diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-01-18 16:26:33 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-01-18 16:26:33 +0100 |
commit | 9a86e1f1e10338bf869944b2fb215a53aa1fcc54 (patch) | |
tree | cdba1d99a1186e1c720811c775a14dd6a1315f6c /src/backend | |
parent | 6ee72ea210a93327ee36fa360e5264c393ffa224 (diff) | |
download | merchant-9a86e1f1e10338bf869944b2fb215a53aa1fcc54.tar.gz merchant-9a86e1f1e10338bf869944b2fb215a53aa1fcc54.tar.bz2 merchant-9a86e1f1e10338bf869944b2fb215a53aa1fcc54.zip |
add minimum age to products
Diffstat (limited to 'src/backend')
3 files changed, 11 insertions, 2 deletions
diff --git a/src/backend/taler-merchant-httpd_private-get-products-ID.c b/src/backend/taler-merchant-httpd_private-get-products-ID.c index 1cff0deb..1406349f 100644 --- a/src/backend/taler-merchant-httpd_private-get-products-ID.c +++ b/src/backend/taler-merchant-httpd_private-get-products-ID.c @@ -90,7 +90,9 @@ TMH_private_get_products_ID (const struct TMH_RequestHandler *rh, pd.address), GNUNET_JSON_pack_allow_null ( GNUNET_JSON_pack_timestamp ("next_restock", - (pd.next_restock)))); + (pd.next_restock))), + GNUNET_JSON_pack_uint64 ("minimum_age", + pd.minimum_age)); GNUNET_free (pd.description); GNUNET_free (pd.image); GNUNET_free (pd.unit); diff --git a/src/backend/taler-merchant-httpd_private-patch-products-ID.c b/src/backend/taler-merchant-httpd_private-patch-products-ID.c index 13a5c664..06e9e7be 100644 --- a/src/backend/taler-merchant-httpd_private-patch-products-ID.c +++ b/src/backend/taler-merchant-httpd_private-patch-products-ID.c @@ -143,7 +143,10 @@ TMH_private_patch_products_ID (const struct TMH_RequestHandler *rh, &pd.address)), GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_timestamp ("next_restock", - &pd.next_restock)), + &pd.next_restock)), + GNUNET_JSON_spec_mark_optional ( + GNUNET_JSON_spec_uint32 ("minimum_age", + &pd.minimum_age)), GNUNET_JSON_spec_end () }; diff --git a/src/backend/taler-merchant-httpd_private-post-products.c b/src/backend/taler-merchant-httpd_private-post-products.c index b8256a80..18a38d83 100644 --- a/src/backend/taler-merchant-httpd_private-post-products.c +++ b/src/backend/taler-merchant-httpd_private-post-products.c @@ -61,6 +61,7 @@ products_equal (const struct TALER_MERCHANTDB_ProductDetails *p1, (p1->total_stock == p2->total_stock) && (p1->total_sold == p2->total_sold) && (p1->total_lost == p2->total_lost) && + (p1->minimum_age == p2->minimum_age) && (0 == strcmp (p1->image, p2->image)) && (1 == json_equal (p1->address, @@ -108,6 +109,9 @@ TMH_private_post_products (const struct TMH_RequestHandler *rh, GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_timestamp ("next_restock", &pd.next_restock)), + GNUNET_JSON_spec_mark_optional ( + GNUNET_JSON_spec_uint32 ("minimum_age", + &pd.minimum_age)), GNUNET_JSON_spec_end () }; |