Modeling Banks Financial Institution

Asked

Viewed 287 times

0

I am starting a personal project for my learning, an application simulating a financial institution system, first using the following products: current account, credit agreement (loans). I came across the following difficulty, which would be the best way to model the daily current account balances and the same goes for the credit product?

Currently this would be the current account table:

id_cliente - inteiro, fk
num_conta - inteiro
tipo_conta - inteiro, fk
situacao_conta - inteiro, fk
data_abertura - data
data_encerramento - data

I thought to create a table saldo_cc and store the account number balance and date, this would be a good idea?

  • 1

    Think that for the balance to change there must be an event, a "move". Could create a table "Move" with FK for "current account", which had the date, description and value of the movement (draw, transfer, etc.) beyond the balance. Just a personal suggestion

  • makes the moving table and records saldo_anterior, valor and saldo_atual of the account... each time the value is updated. Remember that in this table, there can be no update, only Insert. This way you have previous balance and current balance of any period. If it can have retroactive movements, there is no way, the balance has to be calculated on top of the reported period.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.