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

| | 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

| -**fund\_blocks** +### **fund\_blocks** | Attribute | Description | | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -39,7 +39,7 @@ Persistent Objects - Design | 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

| | amount\_released |

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.

| -initiate\_payment\_batch\_requests +### initiate\_payment\_batch\_requests | Attribute | Description | | ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -47,7 +47,7 @@ initiate\_payment\_batch\_requests | accounting\_log\_attempts |

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.

| | accounting\_status |

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"

| -initiate\_payment\_requests +### initiate\_payment\_requests | Attribute | Description | | ------------------------------------- | ----------- | @@ -75,3 +75,32 @@ initiate\_payment\_requests | narrative\_5 | | | narrative\_6 | | +### accounting\_logs + +| Attribute | Description | +| ----------------------------------- | ----------- | +| reference\_no | | +| corresponding\_block\_reference\_no | | +| customer\_reference\_no | | +| debit\_credit | | +| account\_number | | +| transaction\_amount | | +| transaction\_date | | +| transaction\_currency | | +| transaction\_code | | +| narrative\_1 | | +| narrative\_2 | | +| narrative\_3 | | +| narrative\_4 | | +| narrative\_5 | | +| narrative\_6 | | + +### account\_statements + +| Attribute | Description | +| ------------------------ | ----------- | +| id | | +| account\_number | | +| account\_statement\_lob | | +| account\_statement\_date | | +