Add Live Data to Account Page #464
Reference in New Issue
Block a user
Delete Branch "account-page-live-data"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR addresses the following:
account_balancesandvaluationstablesTrendmodel and helpers for time series trend calculationsvaluationsin UINotes
This is a rough sketch of the system. Plenty of refactoring to be done in the future.
What is
Valuationfor?A
Valuationrepresents a "point-in-time" value assignment for anAccount. This is an STI table of two types:Appraisal- most common, and represents an "updated" value of an asset or debtAdjustment- less common, used as a manual adjustment of account value (user overrides for missing txns)What is
AccountBalancefor?This is a "cache table" that stores daily account balances.
It is a function of
ValuationandTransaction(not created yet). By replaying the history ofValuationandTransactionrecords starting at the current balance of an account and working backwards, we can construct daily balances for an account that can be displayed in a time series chart.This table requires a trigger and sync mechanism. Every time a
ValuationorTransactionor bulk update happens on anAccount, a sync is triggered which updatesAccountBalance. Furthermore, a daily sync or client-side locf (last observation carried forward) will be required to keep balances up-to-date with the latest value of the account.