diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-09-14 17:37:53 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-09-14 17:37:53 +0200 |
commit | 6e5092d83473dc1b0200d82744cf0f0056b0c110 (patch) | |
tree | 3a402d87e500fd4e85efb2ec19dfae6d942d9265 /src/include/taler_auditordb_plugin.h | |
parent | 1d088120a5c378ec5fe2d9cfd86353f9b75220c4 (diff) | |
download | exchange-6e5092d83473dc1b0200d82744cf0f0056b0c110.tar.gz exchange-6e5092d83473dc1b0200d82744cf0f0056b0c110.tar.bz2 exchange-6e5092d83473dc1b0200d82744cf0f0056b0c110.zip |
more work towards auditor support for AML/KYC
Diffstat (limited to 'src/include/taler_auditordb_plugin.h')
-rw-r--r-- | src/include/taler_auditordb_plugin.h | 92 |
1 files changed, 86 insertions, 6 deletions
diff --git a/src/include/taler_auditordb_plugin.h b/src/include/taler_auditordb_plugin.h index 99b5e7f3f..eebb31e06 100644 --- a/src/include/taler_auditordb_plugin.h +++ b/src/include/taler_auditordb_plugin.h @@ -98,16 +98,22 @@ struct TALER_AUDITORDB_WireProgressPoint { /** - * Time until which we have confirmed that all wire transactions - * that the exchange should do, have indeed been done. - */ - struct GNUNET_TIME_Timestamp last_timestamp; - - /** * reserves_close uuid until which we have checked * reserve closures. */ uint64_t last_reserve_close_uuid; + + /** + * batch_deposits serial until which we have imported + * batch deposits into the auditor_pending_deposits table. + */ + uint64_t last_batch_deposit_uuid; + + /** + * Maximum number in the aggregations table that + * we have processed so far. + */ + uint64_t last_aggregation_serial; }; @@ -606,6 +612,25 @@ typedef enum GNUNET_GenericReturnValue /** + * Function called on deposits that are past their due date + * and have not yet seen a wire transfer. + * + * @param cls closure + * @param batch_deposit_serial_id where in the table are we + * @param total_amount value of all missing deposits, including fees + * @param wire_target_h_payto hash of the recipient account's payto URI + * @param earliest_deadline what was the earliest requested wire transfer deadline + */ +typedef void +(*TALER_AUDITORDB_WireMissingCallback)( + void *cls, + uint64_t batch_deposit_serial_id, + const struct TALER_Amount *total_amount, + const struct TALER_PaytoHashP *wire_target_h_payto, + struct GNUNET_TIME_Timestamp deadline); + + +/** * Function called on expired purses. * * @param cls closure @@ -1704,6 +1729,61 @@ struct TALER_AUDITORDB_Plugin struct TALER_Amount *balance, struct TALER_Amount *drained_profits); + /** + * Insert new row into the pending deposits table. + * + * @param cls the @e cls of this struct with the plugin-specific state + * @param master_pub master key of the exchange + * @param batch_deposit_serial_id where in the table are we + * @param total_amount value of all missing deposits, including fees + * @param wire_target_h_payto hash of the recipient account's payto URI + * @param deadline what was the requested wire transfer deadline + * @return transaction status code + */ + enum GNUNET_DB_QueryStatus + (*insert_pending_deposit)( + void *cls, + const struct TALER_MasterPublicKeyP *master_pub, + uint64_t batch_deposit_serial_id, + const struct TALER_PaytoHashP *wire_target_h_payto, + const struct TALER_Amount *total_amount, + struct GNUNET_TIME_Timestamp deadline); + + + /** + * Delete a row from the pending deposit table. + * Usually done when the respective wire transfer + * was finally detected. + * + * @param cls the @e cls of this struct with the plugin-specific state + * @param master_pub master key of the exchange + * @param batch_deposit_serial_id which entry to delete + * @return transaction status code + */ + enum GNUNET_DB_QueryStatus + (*delete_pending_deposit)( + void *cls, + const struct TALER_MasterPublicKeyP *master_pub, + uint64_t batch_deposit_serial_id); + + + /** + * Return (batch) deposits for which we have not yet + * seen the required wire transfer. + * + * @param deadline only return up to this deadline + * @param cb function to call on each entry + * @param cb_cls closure for @a cb + * @return transaction status code + */ + enum GNUNET_DB_QueryStatus + (*select_pending_deposits)( + void *cls, + const struct TALER_MasterPublicKeyP *master_pub, + struct GNUNET_TIME_Absolute deadline, + TALER_AUDITORDB_WireMissingCallback cb, + void *cb_cls); + }; |