libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit 1f5e14e210d1f68ec7f73454506869e020c55d3e
parent 532b705fa31848c7118fefe9a10bbe0d32d9327f
Author: MS <ms@taler.net>
Date:   Thu,  5 Oct 2023 09:41:19 +0200

Stats table.

No exchange balance, and comment on the number of 'days' row.

Future versions may express the exchange balance as the average
in the timeframe, where the 'hour' timeframe gets the balance at
the point when the row gets inserted in the database.

Diffstat:
Mdatabase-versioning/libeufin-bank-0001.sql | 6++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/database-versioning/libeufin-bank-0001.sql b/database-versioning/libeufin-bank-0001.sql @@ -48,7 +48,7 @@ CREATE TYPE subscriber_state_enum AS ENUM ('new', 'confirmed'); CREATE TYPE stat_timeframe_enum - AS ENUM ('hour', 'day', 'month', 'year', '10years'); + AS ENUM ('hour', 'day', 'month', 'year', 'decade'); -- FIXME: comments on types (see exchange for example)! @@ -404,19 +404,17 @@ CREATE TABLE IF NOT EXISTS regional_stats ( ,cashout_volume_in_fiat taler_amount NOT NULL ,internal_taler_payments_count BIGINT NOT NULL ,internal_taler_payments_volume taler_amount NOT NULL - ,taler_exchange_balance taler_amount NOT NULL -- FIXME: this can't be accurate, as balance changes continuously. ,timeframe stat_timeframe_enum NOT NULL ); COMMENT ON TABLE regional_stats IS - 'Stores statistics about the regional currency usage. At any given time, this table stores at most: 23 hour rows, 29 day rows, 11 month rows, 9 year rows, and any number of 10year rows'; + 'Stores statistics about the regional currency usage. At any given time, this table stores at most: 24 hour rows, N day rows (with N being the highest day number of the current month), 12 month rows, 9 year rows, and any number of decade rows'; COMMENT ON COLUMN regional_stats.cashin_count IS 'how many cashin operations took place in the timeframe'; COMMENT ON COLUMN regional_stats.cashin_volume_in_fiat IS 'how much fiat currency was cashed in in the timeframe'; COMMENT ON COLUMN regional_stats.cashout_count IS 'how many cashout operations took place in the timeframe'; COMMENT ON COLUMN regional_stats.cashout_volume_in_fiat IS 'how much fiat currency was payed by the bank to customers in the timeframe'; COMMENT ON COLUMN regional_stats.internal_taler_payments_count IS 'how many internal payments were made by a Taler exchange'; COMMENT ON COLUMN regional_stats.internal_taler_payments_volume IS 'how much internal currency was paid by a Taler exchange'; -COMMENT ON COLUMN regional_stats.taler_exchange_balance IS 'balance of the Taler exchange at the given timeframe'; -- FIXME: see FIXME above. COMMENT ON COLUMN regional_stats.timeframe IS 'particular timeframe that this row accounts for'; COMMIT;