taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 67061862613d4312e9cf500828a46009781cc7c3
parent 4e8c082c57c870090f68fd62b1caf61116375601
Author: Florian Dold <dold@taler.net>
Date:   Sun,  9 Aug 2026 18:05:23 +0200

fix build after merchant error handling changes

Diffstat:
Mpackages/taler-harness/src/integrationtests/test-merchant-templates.ts | 7+++++--
Mpackages/taler-merchant-webui/src/paths/instance/orders/create/CreatePage.tsx | 4+---
Mpackages/taler-merchant-webui/src/paths/instance/products/list/Table.tsx | 3+--
Mpackages/taler-merchant-webui/src/paths/instance/products/update/UpdatePage.tsx | 3+--
Mpackages/taler-merchant-webui/src/paths/instance/templates/create/CreatePage.tsx | 2+-
Mpackages/taler-merchant-webui/src/paths/instance/templates/update/UpdatePage.tsx | 2+-
Mpackages/taler-merchant-webui/src/paths/instance/templates/use/UsePage.tsx | 5+++--
7 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/packages/taler-harness/src/integrationtests/test-merchant-templates.ts b/packages/taler-harness/src/integrationtests/test-merchant-templates.ts @@ -19,7 +19,7 @@ */ import { AmountString, - HttpStatusCode, + TalerErrorCode, TalerMerchantInstanceHttpClient, TemplateType, codecForMerchantContractTerms, @@ -105,7 +105,10 @@ export async function runMerchantTemplatesTest(t: GlobalTestState) { amount: "TESTKUDOS:42" as AmountString, }); t.assertTrue(res.type === "fail"); - t.assertTrue(res.case === HttpStatusCode.Conflict); + t.assertTrue( + res.case === + TalerErrorCode.MERCHANT_POST_USING_TEMPLATES_AMOUNT_CONFLICT_TEMPLATES_CONTRACT_AMOUNT, + ); } } diff --git a/packages/taler-merchant-webui/src/paths/instance/orders/create/CreatePage.tsx b/packages/taler-merchant-webui/src/paths/instance/orders/create/CreatePage.tsx @@ -374,14 +374,12 @@ export function CreatePage({ return i18n.str`Unauthorized`; case TalerErrorCode.MERCHANT_PRIVATE_POST_ORDERS_INSTANCE_CONFIGURATION_LACKS_WIRE: return i18n.str`No active bank accounts configured. At least one bank account must be available to create new orders.`; - case HttpStatusCode.Conflict: - return i18n.str`Conflict`; case HttpStatusCode.Gone: return i18n.str`Product with ID "${fail.body.product_id}" is out of stock. You can sell at most ${fail.body.available_quantity} in the current stock.`; case HttpStatusCode.UnavailableForLegalReasons: return i18n.str`No payment service would accept a payment because of KYC requirements.`; default: - assertUnreachable(fail); + return i18n.str`The order could not be created.`; } }); const addProductToTheInventoryList = ( diff --git a/packages/taler-merchant-webui/src/paths/instance/products/list/Table.tsx b/packages/taler-merchant-webui/src/paths/instance/products/list/Table.tsx @@ -27,7 +27,6 @@ import { HttpStatusCode, TalerMerchantApi, TranslatedString, - assertUnreachable, } from "@gnu-taler/taler-util"; import { PaginationControl, @@ -164,7 +163,7 @@ function Table({ case HttpStatusCode.Conflict: return i18n.str`This change was based on outdated information. Please reload and try again.`; default: - assertUnreachable(fail); + return i18n.str`The product could not be updated.`; } }); return ( diff --git a/packages/taler-merchant-webui/src/paths/instance/products/update/UpdatePage.tsx b/packages/taler-merchant-webui/src/paths/instance/products/update/UpdatePage.tsx @@ -20,7 +20,6 @@ */ import { - assertUnreachable, HttpStatusCode, TalerError, TalerMerchantApi, @@ -75,7 +74,7 @@ export function UpdatePage({ product, onBack, onConfirm }: Props): VNode { case HttpStatusCode.Conflict: return i18n.str`Conflict.`; default: - assertUnreachable(fail); + return i18n.str`The product could not be updated.`; } }); diff --git a/packages/taler-merchant-webui/src/paths/instance/templates/create/CreatePage.tsx b/packages/taler-merchant-webui/src/paths/instance/templates/create/CreatePage.tsx @@ -297,7 +297,7 @@ export function CreatePage({ case HttpStatusCode.Conflict: return i18n.str`There is a template with this identifier, please choose another one.`; default: - assertUnreachable(fail); + return i18n.str`The template could not be created.`; } }); diff --git a/packages/taler-merchant-webui/src/paths/instance/templates/update/UpdatePage.tsx b/packages/taler-merchant-webui/src/paths/instance/templates/update/UpdatePage.tsx @@ -334,7 +334,7 @@ function UpdateFixedOrderPage({ template, onUpdated, onBack }: Props): VNode { case HttpStatusCode.Conflict: return i18n.str`Conflict`; default: - assertUnreachable(fail); + return i18n.str`The template could not be updated.`; } }); diff --git a/packages/taler-merchant-webui/src/paths/instance/templates/use/UsePage.tsx b/packages/taler-merchant-webui/src/paths/instance/templates/use/UsePage.tsx @@ -124,14 +124,15 @@ function UseFixedOrderPage({ return i18n.str`Unauthorized.`; case TalerErrorCode.MERCHANT_PRIVATE_POST_ORDERS_INSTANCE_CONFIGURATION_LACKS_WIRE: return i18n.str`No active bank accounts configured. At least one bank account must be available to create new orders`; - case HttpStatusCode.Conflict: + case TalerErrorCode.MERCHANT_POST_USING_TEMPLATES_AMOUNT_CONFLICT_TEMPLATES_CONTRACT_AMOUNT: + case TalerErrorCode.MERCHANT_POST_USING_TEMPLATES_SUMMARY_CONFLICT_TEMPLATES_CONTRACT_SUBJECT: return i18n.str`Conflict.`; case HttpStatusCode.Gone: return i18n.str`No more stock for product with ID "${fail.body.product_id}".`; case HttpStatusCode.UnavailableForLegalReasons: return i18n.str`No payment service would accept a payment because of KYC requirements.`; default: - assertUnreachable(fail); + return i18n.str`The order could not be created from this template.`; } });