The motive behind the update of current structure is because of poorly defined relationship between tables which requires a lot of compromise on business flow.
Original Structure
New Structure
transaction, claim, debt
transaction
The original idea is to segregate unrealised from realised transaction:
Capture whatever income/expense in the form of debt/claim first
When the debt/claim is realised, it will then be recorded into the transaction table
However, the original idea has scattered and redundant columns across 3 tables, thus resulting in the idea of redesigning the table structures
The new proposal is to solve scattered columns by putting them together and distinguishes realised/unrealised transaction with the combination of transaction_type + transaction_status, where:
real-world representation
transaction_status
transaction_type
realised income
COMPLETED
INCOME
realised expense
COMPLETED
INCOME
unrealised income
PENDING
EXPENSE
unrealised expense
PENDING
EXPENSE
bad debt
INVALID
INCOME
anonymous income
INVALID
EXPENSE
The documentation of updating Transaction table and motive behind it is in this google doc
Update of database structure
Why tho?
The motive behind the update of current structure is because of poorly defined relationship between tables which requires a lot of compromise on business flow.
The original idea is to segregate unrealised from realised transaction:
However, the original idea has scattered and redundant columns across 3 tables, thus resulting in the idea of redesigning the table structures
The new proposal is to solve scattered columns by putting them together and distinguishes realised/unrealised transaction with the combination of transaction_type + transaction_status, where:
The documentation of updating Transaction table and motive behind it is in this google doc