From 4ba07b54e4ea2ac75c408f795cd806409450bc29 Mon Sep 17 00:00:00 2001 From: Özgür Kesim Date: Sat, 8 Oct 2022 17:13:57 +0200 Subject: WIP: policy_*_fulfiment added and API changes - policy_fulfilment table defined, handlers added - policy_details_fulfilment table defined, handlers added - TALER_extensions_serial_from_policy_details implemened --- src/exchangedb/plugin_exchangedb_postgres.c | 37 ++++++++++++++++++----------- 1 file changed, 23 insertions(+), 14 deletions(-) (limited to 'src/exchangedb/plugin_exchangedb_postgres.c') diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c index e03713c3..ebac70ea 100644 --- a/src/exchangedb/plugin_exchangedb_postgres.c +++ b/src/exchangedb/plugin_exchangedb_postgres.c @@ -3932,19 +3932,28 @@ prepare_statements (struct PostgresClosure *pg) "(policy_details_serial_id" ",serial_id" ",policy_options" - ",fulfilment_serial_id" + ",deadline" + ",fulfilment_state" ") VALUES " - "($1, $2, $3, $4);", - 4), + "($1, $2, $3, $4, $5);", + 5), GNUNET_PQ_make_prepare ( "insert_into_table_policy_fulfilments", "INSERT INTO policy_fulfilments" - "(policy_fulfilments_serial_id" + "(fulfilment_id" ",fulfilment_timestamp" ",fulfilment_proof" ") VALUES " "($1, $2, $3);", 3), + GNUNET_PQ_make_prepare ( + "insert_into_table_policy_details_fulfilments", + "INSERT INTO policy_details_fulfilments" + "(fulfilment_id" + ",serial_id" + ") VALUES " + "($1, $2);", + 2), GNUNET_PQ_make_prepare ( "insert_into_table_purse_requests", "INSERT INTO purse_requests" @@ -6273,16 +6282,16 @@ postgres_do_deposit ( GNUNET_PQ_query_param_auto_from_type (&deposit->coin.coin_pub), GNUNET_PQ_query_param_auto_from_type (&deposit->csig), GNUNET_PQ_query_param_uint64 (&deposit_shard), - GNUNET_PQ_query_param_bool (! deposit->no_policy_details), - (deposit->no_policy_details) - ? GNUNET_PQ_query_param_null () - : TALER_PQ_query_param_json (deposit->policy_details), - (deposit->no_policy_details) - ? GNUNET_PQ_query_param_null () - : GNUNET_PQ_query_param_auto_from_type (&deposit->policy_serial_id), - (deposit->no_policy_details) - ? GNUNET_PQ_query_param_null () - : GNUNET_PQ_query_param_timestamp (&deposit->policy_deadline), + GNUNET_PQ_query_param_bool (deposit->has_policy_details), + (deposit->has_policy_details) + ? TALER_PQ_query_param_json (deposit->policy_details) + : GNUNET_PQ_query_param_null (), + (deposit->has_policy_details) + ? GNUNET_PQ_query_param_auto_from_type (&deposit->policy_serial_id) + : GNUNET_PQ_query_param_null (), + (deposit->has_policy_details) + ? GNUNET_PQ_query_param_timestamp (&deposit->policy_deadline) + : GNUNET_PQ_query_param_null (), GNUNET_PQ_query_param_end }; struct GNUNET_PQ_ResultSpec rs[] = { -- cgit v1.2.3