gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libeufin] branch master updated: Defining stats table.


From: gnunet
Subject: [libeufin] branch master updated: Defining stats table.
Date: Wed, 04 Oct 2023 16:35:42 +0200

This is an automated email from the git hooks/post-receive script.

ms pushed a commit to branch master
in repository libeufin.

The following commit(s) were added to refs/heads/master by this push:
     new 8f237b69 Defining stats table.
8f237b69 is described below

commit 8f237b69fc4f4054e8f2697858f2af589b2da2dc
Author: MS <ms@taler.net>
AuthorDate: Wed Oct 4 16:34:54 2023 +0200

    Defining stats table.
---
 database-versioning/libeufin-bank-0001.sql | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/database-versioning/libeufin-bank-0001.sql 
b/database-versioning/libeufin-bank-0001.sql
index 94475c99..7fbf6e4e 100644
--- a/database-versioning/libeufin-bank-0001.sql
+++ b/database-versioning/libeufin-bank-0001.sql
@@ -47,6 +47,9 @@ CREATE TYPE subscriber_key_state_enum
 CREATE TYPE subscriber_state_enum
   AS ENUM ('new', 'confirmed');
 
+CREATE TYPE stat_timeframe_enum
+  AS ENUM ('hour', 'day', 'month', 'year', '10years');
+
 -- FIXME: comments on types (see exchange for example)!
 
 -- start of: bank accounts
@@ -392,4 +395,28 @@ COMMENT ON COLUMN 
taler_withdrawal_operations.confirmation_done
   IS 'Signals whether the payment to the exchange took place';
 
 -- end of: Taler integration
+
+CREATE TABLE IF NOT EXISTS regional_stats (
+  regional_stats_id BIGINT GENERATED BY DEFAULT AS IDENTITY
+  ,cashin_count BIGINT NOT NULL
+  ,cashin_volume_in_fiat taler_amount NOT NULL
+  ,cashout_count BIGINT NOT NULL
+  ,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';
+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;

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]