From a04425df340e9bef067cbf64809ced5597576dfc Mon Sep 17 00:00:00 2001
From: Özgür Kesim <oec-taler@kesim.org>
Date: Fri, 12 May 2023 15:10:23 +0200
Subject: [age-withdraw] WIP: change schema to use new support for array types,
 11/n

---
 src/exchangedb/exchange_do_batch_withdraw.sql | 6 ++++++
 1 file changed, 6 insertions(+)

(limited to 'src/exchangedb/exchange_do_batch_withdraw.sql')

diff --git a/src/exchangedb/exchange_do_batch_withdraw.sql b/src/exchangedb/exchange_do_batch_withdraw.sql
index fedb7e91..64777bb3 100644
--- a/src/exchangedb/exchange_do_batch_withdraw.sql
+++ b/src/exchangedb/exchange_do_batch_withdraw.sql
@@ -20,6 +20,7 @@ CREATE OR REPLACE FUNCTION exchange_do_batch_withdraw(
   IN rpub BYTEA,
   IN now INT8,
   IN min_reserve_gc INT8,
+-- TODO[oec]: add [IN] parameter for maximum age and [OUT] parameter for required age
   OUT reserve_found BOOLEAN,
   OUT balance_ok BOOLEAN,
   OUT ruuid INT8)
@@ -38,11 +39,13 @@ BEGIN
 --         reserves_in by reserve_pub (SELECT)
 --         wire_targets by wire_target_h_payto
 
+
 SELECT
    current_balance_val
   ,current_balance_frac
   ,gc_date
   ,reserve_uuid
+-- TODO[oec]: get age requirements
  INTO
    reserve_val
   ,reserve_frac
@@ -60,6 +63,8 @@ THEN
   RETURN;
 END IF;
 
+-- TODO[oec]: check age requirements
+
 -- Check reserve balance is sufficient.
 IF (reserve_val > amount_val)
 THEN
@@ -99,6 +104,7 @@ balance_ok=TRUE;
 
 END $$;
 
+-- TODO[oec]: Update comment re: age requirements are implemented
 COMMENT ON FUNCTION exchange_do_batch_withdraw(INT8, INT4, BYTEA, INT8, INT8)
   IS 'Checks whether the reserve has sufficient balance for a withdraw operation (or the request is repeated and was previously approved) and if so updates the database with the result. Excludes storing the planchets.';
 
-- 
cgit v1.2.3

