diff options
author | Christian Blättler <blatc2@bfh.ch> | 2024-06-13 17:46:44 +0200 |
---|---|---|
committer | Christian Blättler <blatc2@bfh.ch> | 2024-06-13 17:46:44 +0200 |
commit | cf4679e7b21cafa878903cf679167a7e90c8ac61 (patch) | |
tree | 89ca26a94facb5c8275ea1c68a98b75fe500169c /src | |
parent | d72b878a0e33aa1f312547c56c75fcd6f7cd6cc1 (diff) |
“redeemed” —> “used"
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/taler-merchant-httpd_private-get-token-families-SLUG.c | 5 | ||||
-rw-r--r-- | src/backenddb/merchant-0008.sql | 2 | ||||
-rw-r--r-- | src/backenddb/pg_lookup_token_family.c | 6 | ||||
-rw-r--r-- | src/backenddb/pg_lookup_token_family_key.c | 6 | ||||
-rw-r--r-- | src/include/taler_merchant_service.h | 4 | ||||
-rw-r--r-- | src/include/taler_merchantdb_plugin.h | 4 | ||||
-rw-r--r-- | src/lib/merchant_api_get_tokenfamily.c | 4 |
7 files changed, 16 insertions, 15 deletions
diff --git a/src/backend/taler-merchant-httpd_private-get-token-families-SLUG.c b/src/backend/taler-merchant-httpd_private-get-token-families-SLUG.c index 12e57a99..92e1bb82 100644 --- a/src/backend/taler-merchant-httpd_private-get-token-families-SLUG.c +++ b/src/backend/taler-merchant-httpd_private-get-token-families-SLUG.c @@ -94,9 +94,8 @@ TMH_private_get_tokenfamilies_SLUG (const struct TMH_RequestHandler *rh, GNUNET_JSON_pack_timestamp ("valid_before", details.valid_before), GNUNET_JSON_pack_time_rel ("duration", details.duration), GNUNET_JSON_pack_string ("kind", kind), - // TODO: Implement - GNUNET_JSON_pack_int64 ("issued", 0), - GNUNET_JSON_pack_int64 ("redeemed", 0) + GNUNET_JSON_pack_int64 ("issued", details.issued), + GNUNET_JSON_pack_int64 ("used", details.used) ); GNUNET_free (details.name); diff --git a/src/backenddb/merchant-0008.sql b/src/backenddb/merchant-0008.sql index bb8beb73..4dec99d5 100644 --- a/src/backenddb/merchant-0008.sql +++ b/src/backenddb/merchant-0008.sql @@ -48,5 +48,7 @@ ALTER TABLE merchant_token_families ADD COLUMN rounding BIGINT NOT NULL; COMMENT ON COLUMN merchant_token_families.rounding IS 'Token start date rounding granularity.'; +ALTER TABLE merchant_token_families RENAME COLUMN redeemed TO used; + -- Complete transaction COMMIT; diff --git a/src/backenddb/pg_lookup_token_family.c b/src/backenddb/pg_lookup_token_family.c index d2c651c9..e5c9d518 100644 --- a/src/backenddb/pg_lookup_token_family.c +++ b/src/backenddb/pg_lookup_token_family.c @@ -73,8 +73,8 @@ TMH_PG_lookup_token_family (void *cls, &kind), GNUNET_PQ_result_spec_uint64 ("issued", &details->issued), - GNUNET_PQ_result_spec_uint64 ("redeemed", - &details->redeemed), + GNUNET_PQ_result_spec_uint64 ("used", + &details->used), GNUNET_PQ_result_spec_end }; @@ -91,7 +91,7 @@ TMH_PG_lookup_token_family (void *cls, ",duration" ",kind" ",issued" - ",redeemed" + ",used" " FROM merchant_token_families" " JOIN merchant_instances" " USING (merchant_serial)" diff --git a/src/backenddb/pg_lookup_token_family_key.c b/src/backenddb/pg_lookup_token_family_key.c index a0a5fab1..7883339b 100644 --- a/src/backenddb/pg_lookup_token_family_key.c +++ b/src/backenddb/pg_lookup_token_family_key.c @@ -98,8 +98,8 @@ TMH_PG_lookup_token_family_key (void *cls, &kind), GNUNET_PQ_result_spec_uint64 ("issued", &details->token_family.issued), - GNUNET_PQ_result_spec_uint64 ("redeemed", - &details->token_family.redeemed), + GNUNET_PQ_result_spec_uint64 ("used", + &details->token_family.used), GNUNET_PQ_result_spec_end }; @@ -126,7 +126,7 @@ TMH_PG_lookup_token_family_key (void *cls, ",duration" ",kind" ",issued" - ",redeemed" + ",used" " FROM merchant_token_families" " LEFT JOIN merchant_token_family_keys" " ON merchant_token_families.token_family_serial = merchant_token_family_keys.token_family_serial" diff --git a/src/include/taler_merchant_service.h b/src/include/taler_merchant_service.h index 52034f63..3c660742 100644 --- a/src/include/taler_merchant_service.h +++ b/src/include/taler_merchant_service.h @@ -2008,9 +2008,9 @@ struct TALER_MERCHANT_TokenFamilyGetResponse uint64_t issued; /** - * How many tokens have been redeemed for this family. + * How many tokens have been used for this family. */ - uint64_t redeemed; + uint64_t used; } ok; } details; diff --git a/src/include/taler_merchantdb_plugin.h b/src/include/taler_merchantdb_plugin.h index e7f3090a..2474c1d0 100644 --- a/src/include/taler_merchantdb_plugin.h +++ b/src/include/taler_merchantdb_plugin.h @@ -1163,9 +1163,9 @@ struct TALER_MERCHANTDB_TokenFamilyDetails uint64_t issued; /** - * Counter for each redeemed token of this family. + * Counter for each used token of this family. */ - uint64_t redeemed; + uint64_t used; }; diff --git a/src/lib/merchant_api_get_tokenfamily.c b/src/lib/merchant_api_get_tokenfamily.c index d7e6b06e..232d30d6 100644 --- a/src/lib/merchant_api_get_tokenfamily.c +++ b/src/lib/merchant_api_get_tokenfamily.c @@ -114,8 +114,8 @@ handle_get_token_family_finished (void *cls, &res.details.ok.kind), GNUNET_JSON_spec_uint64 ("issued", &res.details.ok.issued), - GNUNET_JSON_spec_uint64 ("redeemed", - &res.details.ok.redeemed), + GNUNET_JSON_spec_uint64 ("used", + &res.details.ok.used), GNUNET_JSON_spec_end () }; |