From 20a8a569ad334174ca251a4cebc995d14bcbdb11 Mon Sep 17 00:00:00 2001 From: "tg(x)" <*@tg-x.net> Date: Thu, 3 Nov 2016 13:01:36 +0100 Subject: auditordb postgres plugin --- src/include/taler_auditordb_plugin.h | 72 ++++++++++++++++++++++++++++++++++-- 1 file changed, 68 insertions(+), 4 deletions(-) (limited to 'src/include/taler_auditordb_plugin.h') diff --git a/src/include/taler_auditordb_plugin.h b/src/include/taler_auditordb_plugin.h index cc75fb014..a04fedc8b 100644 --- a/src/include/taler_auditordb_plugin.h +++ b/src/include/taler_auditordb_plugin.h @@ -28,6 +28,70 @@ #include "taler_signatures.h" +/** + * Function called with the results of select_denomination_info() + * + * @param cls closure + * @param issue issuing information with value, fees and other info about the denomination. + */ +typedef void +(*TALER_AUDITORDB_DenominationInfoDataCallback)(void *cls, + const struct TALER_DenominationKeyValidityPS *issue); + + +/** + * Function called with the results of select_historic_denom_revenue() + * + * @param cls closure + * @param denom_pub_hash hash of the denomination key + * @param revenue_timestamp when did this profit get realized + * @param revenue_balance what was the total profit made from + * deposit fees, melting fees, refresh fees + * and coins that were never returned? + * @param deposit_fee_balance total profits from deposit fees + * @param melt_fee_balance total profits from melting fees + * @param refund_fee_balance total profits from refund fees + */ +typedef void +(*TALER_AUDITORDB_HistoricDenominationRevenueDataCallback)(void *cls, + const struct GNUNET_HashCode *denom_pub_hash, + struct GNUNET_TIME_Absolute revenue_timestamp, + const struct TALER_Amount *revenue_balance, + const struct TALER_Amount *deposit_fee_balance, + const struct TALER_Amount *melt_fee_balance, + const struct TALER_Amount *refund_fee_balance); + + +/** + * Function called with the results of select_historic_losses() + * + * @param cls closure + * @param denom_pub_hash hash of the denomination key + * @param loss_timestamp when did this profit get realized + * @param loss_balance what was the total loss + */ +typedef void +(*TALER_AUDITORDB_HistoricLossesDataCallback)(void *cls, + const struct GNUNET_HashCode *denom_pub_hash, + struct GNUNET_TIME_Absolute loss_timestamp, + const struct TALER_Amount *loss_balance); + + +/** + * Function called with the results of select_historic_reserve_revenue() + * + * @param cls closure + * @param start_time beginning of aggregated time interval + * @param end_time end of aggregated time interval + * @param reserve_profits total profits made + */ +typedef void +(*TALER_AUDITORDB_HistoricReserveRevenueDataCallback)(void *cls, + struct GNUNET_TIME_Absolute start_time, + struct GNUNET_TIME_Absolute end_time, + const struct TALER_Amount *reserve_profits); + + /** * Handle for one session with the database. */ @@ -164,7 +228,7 @@ struct TALER_AUDITORDB_Plugin (*select_denomination_info)(void *cls, struct TALER_AUDITORDB_Session *session, const struct TALER_MasterPublicKeyP *master_pub, - void *cb, /* FIXME: type! */ + TALER_AUDITORDB_DenominationInfoDataCallback cb, void *cb_cls); @@ -586,7 +650,7 @@ struct TALER_AUDITORDB_Plugin (*select_historic_denom_revenue)(void *cls, struct TALER_AUDITORDB_Session *session, const struct TALER_MasterPublicKeyP *master_pub, - void *cb, /* FIXME: fix type */ + TALER_AUDITORDB_HistoricDenominationRevenueDataCallback cb, void *cb_cls); @@ -628,7 +692,7 @@ struct TALER_AUDITORDB_Plugin (*select_historic_losses)(void *cls, struct TALER_AUDITORDB_Session *session, const struct TALER_MasterPublicKeyP *master_pub, - void *cb, /* FIXME: fix type */ + TALER_AUDITORDB_HistoricLossesDataCallback cb, void *cb_cls); @@ -666,7 +730,7 @@ struct TALER_AUDITORDB_Plugin (*select_historic_reserve_revenue)(void *cls, struct TALER_AUDITORDB_Session *session, const struct TALER_MasterPublicKeyP *master_pub, - void *cb, /* FIXME: type */ + TALER_AUDITORDB_HistoricReserveRevenueDataCallback cb, void *cb_cls); -- cgit v1.2.3