This document describes the technical implementation of platform admin functionality, including access controls, scope-aware operations, billing/reconciliation tooling, and operational safeguards.
Scope
This document focuses on platform admin implementation in:
- Views, forms, and templates used by superusers.
- Account provisioning and account-management operations.
- Promotion and billing actions exposed through platform admin.
- Security, rate limiting, and auditability requirements.
Entry Points and Structure
Primary implementation files:
checktick_app/core/views_platform_admin.pychecktick_app/core/urls.pychecktick_app/core/templates/core/platform_admin/*.html
Primary navigation surfaces include:
- Dashboard
- Organisations
- Statistics
- Logs
- Pricing
- Billing
- Promotions
Access Control Model
Platform admin endpoints are superuser-only and protected by explicit controls:
superuser_requireddecorator for route protection.require_http_methodsfor endpoint method constraints.django-ratelimiton sensitive actions.- CSRF protection for state-changing form posts.
Design intent: administrative workflows are explicit, auditable, and fail-closed when authorization fails.
Account and Billing Operations
Platform admin supports operational workflows across account types and tiers:
- Organization administration and status management.
- Pricing override management for supported tiers.
- Billing timeline/reconciliation views.
- Controlled refund actions linked to payment records.
Refund action constraints (hosted reference flow):
- Full refund automation only.
- Mandatory reason code.
- Required free-text explanation for
otherreason. - Idempotent handling for repeated operator attempts.
Promotions Operations
Platform admin promotions implementation supports:
- Promotion creation and edit workflows.
- Activate/deactivate/toggle operations.
- Duplicate/revoke workflows for reuse and controlled shutdown.
- Post-start immutability of billing-impacting terms.
- Lifecycle processing and reconciliation alignment.
Audit and Observability
Administrative actions and lifecycle outcomes are auditable using structured metadata.
Coverage includes:
- Promotion lifecycle events.
- Refund request and webhook-reconciled state transitions.
- Operator attribution and references required for finance/audit traceability.
See also: Audit Logging and Notifications.
Security and Abuse Controls
Relevant protections include:
- Role-constrained admin actions.
- Endpoint rate limiting on refund/billing operations.
- Strict webhook signature verification and required webhook secret.
- Defensive validation on refund amount/policy paths.
See also: Security Overview.
Testing Strategy (Platform Admin Slice)
Primary coverage areas:
- Permissions and authorization boundaries.
- Method restrictions and malformed request handling.
- Promotion operation regressions.
- Billing/refund policy enforcement and idempotency.
- Webhook-reconciled billing state transitions.
Representative suites:
tests/test_platform_admin_permissions.pytests/test_platform_admin_regressions.pytests/test_billing.pytests/test_organisation_checkout.py
Self-Hosted Considerations
For SELF_HOSTED=true environments:
- Billing is disabled by default.
- Platform admin billing/refund flows depend on optional external provider integration.
- Operators must configure webhook signing and provider-specific credentials before enabling billing actions.