diff --git a/g2p-bridge/development/design-specifications/example-bank/openg2p-g2p-bridge-example-bank-models.md b/g2p-bridge/development/design-specifications/example-bank/openg2p-g2p-bridge-example-bank-models.md index cc6dc90d..0d07f8c0 100644 --- a/g2p-bridge/development/design-specifications/example-bank/openg2p-g2p-bridge-example-bank-models.md +++ b/g2p-bridge/development/design-specifications/example-bank/openg2p-g2p-bridge-example-bank-models.md @@ -16,9 +16,9 @@ layout: This is a library project - that contains all the sqlalchemy models and pydantic schemas - that are required to provide the required features of a Sponsor Bank. -Persistent Objects - Design +## Persistent Objects - Design -**account** +### **account** | Attribute | Deesreption | | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -29,7 +29,7 @@ Persistent Objects - Design | available\_balance |
This is the available balance (funds available for use for disbursements)
available_balance = book_balance - blocked_amount
This is the total amount that has been reserved (earmarked) by the program for specific purposes.
The G2P Bridge - blocks the entire envelope amount - for every disbursement_envelope.
The sponsor bank - creates an Amount Block for every block request. These amount blocks are available in the table - fund_blocks. The sum total of all records in fund_blocks equals this blocked_amount
The amount that has been blocked under this block_reference_no.
The g2p-bridge subsystem requests an amount block for the total envelope amount.
This amount reflects that total envelope amount in this scenario
The amount released - (partial) against this amount_block
In the g2p-bridge scenario, every disbursement diminishes (releases) the amount block partially
Once all the disbursements are effected, the amount released will equal to the amount blocked. When this happens, the column - blocked_amount in the account table - will become zero.
The actual payment itself (generating book keeping entries) is handled asynchronously. A celery beat picks up all PENDING batches and delegates the batch_id to a task.
This attribute - keeps a count of these attempts.
PENDING, PROCESSED
A celery beat picks all PENDING records and delegates the batch_id to a celery worker.
The worker picks up the individual payment records for this batch_id and effects book keeping entries for the "remitting_account"