exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit 22fc947093199808c81a6635d404ff178ade3fcd
parent e6bcbd60618b65a05d8436d8be56090e7babc5d9
Author: Florian Dold <dold@taler.net>
Date:   Mon,  7 Sep 2026 12:36:38 +0200

exchange statistics: return cumulative totals for every configured range

Return an interval even when it has no stored events of its own.
Its cumulative total still includes events from the shorter ranges.

Issue: https://bugs.taler.net/n/9639

Diffstat:
Msrc/exchangedb/sql-schema/exchange_statistics_helpers.sql | 12++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/exchangedb/sql-schema/exchange_statistics_helpers.sql b/src/exchangedb/sql-schema/exchange_statistics_helpers.sql @@ -547,9 +547,11 @@ BEGIN END IF; END IF; - my_rval.range = my_range; - RETURN NEXT my_rval; END IF; + -- Smaller ranges contribute to this interval even when this range has + -- no stored events of its own (for example the 52-week TOPS total). + my_rval.range = my_range; + RETURN NEXT my_rval; END LOOP; END $$; @@ -730,9 +732,11 @@ BEGIN END IF; END IF; - my_rval.range = my_range; - RETURN NEXT my_rval; END IF; + -- Smaller ranges contribute to this interval even when this range has + -- no stored events of its own (for example the 52-week TOPS total). + my_rval.range = my_range; + RETURN NEXT my_rval; END LOOP; -- over my_ranges END $$;