Note: You are viewing an old version of this page. View the current version.

Prototype

Buckets

Consume
Sink for consumed service; source for refunds
Service
Current allocation for service (can go negative if customer desires, or act as access cutoff)
Balance
Current customer balance not allocated for service (can go negative as consumed, or positive if prepaid)
Invoice
Amount owed on current invoice

Ticks

Automatic Ticks

  • Service tick

    • Service -> Consume

      • Consumes a bit of service

        • once a day for daily consumption (disk, etc)
        • once a month for granular service (hosting)
        • once a year for registration (domain)
  • Billing tick

    • Balance -> Service

      • Replenishes Service with enough to cover the next billing period
  • Invoice tick

    • Invoice -> Balance

      • Bring Balance from negative to zero to account for currently owed outstanding
      • Bring Invoice from positive to zero to account for overpayment
  • Payment tick

    • Outside -> Invoice

      • Incoming payments are placed here until they're accounted for by an invoice run

Manual Ticks

  • Prepay tick

    • Invoice -> Balance

      • Preemptively move money to indicate a customer's desire to prepay by owing more on next invoice than is actually outstanding
  • Service Refund tick

    • Consume -> Service

      • Refund for consumed but unprovided service (outage, etc)
  • Balance Refund tick

    • Service -> Balance

      • Refund for unused service, in case of overprovisioning or unconfigured service

Invoice Generation

  1. Generate Balance Refund tick to refund unused service
  2. Generate Billing tick to fund next billing period
  3. Generate Invoice tick to account for payments and refunds
  4. Compute invoice values and lines from all ticks between current and previous Invoice tick

Example flows