S
Sheba ISP ERPDOCS
Business Domains

Customer Lifecycle Workflow

Comprehensive lifecycle state transitions from registration to provisioning, suspension, and termination.

Customer Lifecycle Workflow

IMPLEMENTED

The subscriber lifecycle is the core operational domain in Sheba ISP ERP.


1. Lifecycle State Machine

Rendering diagram...

2. End-to-End Registration Flow

PhaseStepDescription
1. TriggerPOST /api/v1/customers/Staff submits customer registration form via /customers.
2. ValidationDRF SerializerValidates unique pppoe_username, valid package_id, assigned router_id, and valid phone format (01XXXXXXXXX).
3. Business RulesDomain LogicChecks if package bandwidth is supported by router IP pool. Computes initial bill and expiry date.
4. Database ChangesAtomic TransactionCreates Customer record, creates associated BillingAccount, generates initial invoice if applicable.
5. External OperationsMikroTik ProvisioningContacts target MikroTik router via MikroTikService.create_pppoe_user(). Creates secret, password, and profile.
6. Events / TasksCelery TaskDispatches welcome SMS broadcast task via apps.payments.models.SmsLog.
7. AuditAuditLog RecordEmits AuditLog action CUSTOMER_CREATE with actor identity, IP, and assigned package.
8. SuccessHTTP 201 CreatedReturns complete Customer payload with connection credentials.
9. FailureHTTP 400 / 500Rolls back database transaction. If router sync fails, flags customer status as DESYNC for admin attention.

On this page