Five-Fishes / Club-Management-Spring-Server

Server Side for Full Stack Club Management System
0 stars 0 forks source link

Transaction Business Logic Update #134

Closed LUXIANZE closed 3 years ago

LUXIANZE commented 3 years ago

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.

Original Structure New Structure
transaction, claim, debt transaction

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:

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