Upload
it-people
View
850
Download
1
Embed Size (px)
Citation preview
Billing transaction processing
Olga SobolevaKirill Ivanov
Problem Statement
• Top up an account• Make calls, send text messages and use internet• Get current balance
Customer can:
Use Case
Customer's account
(0$)
Use Case
Top up: +250$
Customer's account(250$)
Use Case
SMS (1 unit): -2$
Call (5 minutes): -5$
SMS (2 units): -4$
Top up: +250$
Customer's account(239$)
Transaction Processing
Balance service
transaction
Transaction Processing
Balance service
Transactions
transaction
Transaction Processing
Balance service
Transactions
transaction
async
Transaction handling
Transaction Processing
Balance service
Transactions
transaction
async
Transaction handling
Settings
Transaction Processing
Balance service
Transactions Transaction handling Charges
Settings
transaction
async
Transaction ProcessingCF: Transactions
Transaction ProcessingCF: Transactions
…
Row: "transactionId"
Transaction ProcessingCF: Transactions
…
Row: "transactionId"
Col: "transactionId"
Transaction:• transactionId• transactionDate• senderId• recipientId• resourceId• resourceCount
Transaction Processing
Transaction:• transactionId• transactionDate• customerId• customerId• "money"• 250
Top up sampleTransaction:• transactionId• transactionDate• senderId• recipientId• "sms"• 3
Write off sample
Transaction ProcessingCF: Charges
Transaction ProcessingCF: Charges
Row: "customerId"
…
Transaction ProcessingCF: Charges
Row: "customerId"
Col: "yyyy-MM-ddTHH-mm-ss-fffffff:transactionId"
Charge:• Money• Type (WriteOff or TopUp)• TransactionDate• TransactionId
…
…
Transaction Processing
Charge:• +250$• TopUp• TransactionDate• TransactionId
Top up sampleCharge:• -2$• WriteOff• TransactionDate• TransactionId
Write off sample
Problem Statement
• Top up an account• Make calls, send text messages and use internet• Get current balance
Customer can:
Get Current Balance
Charge 1
Charge 2
Charge N
…
+
++
Get Current Balance
Charge 1
Charge 2
Charge N
…
+
++
Balance
Get Current Balance
charges count
time
Get Current Balance
charges count
time
Get Current BalanceSolution — aggregate balance
Σ Char
ge 1
…
Char
ge k
Char
ge k
+1
…
Char
ge N
Get Current BalanceSolution — aggregate balance
time
Char
ge k
+1
…
Char
ge N
nownow - Δtlast aggregation
Σ
Σ Char
ge 1
…
Char
ge k
Char
ge k
+1
…
Char
ge N
balance set up
Get Current BalanceCF: AggregatedBalance
Row: "customerId"
…
Get Current BalanceCF: AggregatedBalance
Row: "customerId"
Col: "customerId"
AggregatedBalance :• Money• AggregationDate
…
Problem StatementCustomer can:• Top up an account• Make calls, send text messages and use internet• Get current balance
Problem StatementCustomer can:• Top up an account• Make calls, send text messages and use internet• Get current balance• Buy package of services
Package of Services
Charge structure
money typeresourcecount
resourceid …
Package of Services
Example
Charge structure
money typeresourcecount
resourceid …
-6$ -3 "sms" WriteOff …
Package of Services
Annul
Charge structure
money typeresourcecount
resourceid …
— — "sms" Annul …
Package of Services
Balance• 10$
Charge (+10$)
Package of Services
Charge (+100 sms)
Balance• 10$• 100 sms
Charge (+10$)
Package of Services
Charge (+100 sms)
Charge (-2 sms)
Charge (+10$)
Balance• 10$• 98 sms
Package of Services
Charge (+100 sms)
Charge (-2 sms)
Charge (-5 sms)
Charge (+10$)
Balance• 10$• 93 sms
Package of Services
Charge (+100 sms)
Charge (-2 sms)
Charge (-5 sms)
Annul
Charge (+10$)
Balance• 10$
Package of Services
Charge (+100 sms)
Charge (-2 sms)
Charge (-5 sms)
Annul
Charge (-3 sms)
Charge (+10$)
Balance• 4$
Problem StatementCustomer can:• Top up an account• Make calls, send text messages and use internet• Get current balance• Buy package of services
Problem StatementCustomer can:• Top up an account• Make calls, send text messages and use internet• Get current balance• Buy package of services• Buy flat rate
Flat Rate
• To all recipients• To fixed recipients
Flat Rate
Transaction handling
Chargestransaction
• To all recipients• To fixed recipients
Not processed
Settings
Problem StatementCustomer can:• Top up an account• Make calls, send text messages and use internet• Get current balance• Buy package of services• Buy flat rate