From bfa58638a0fa7b66ba2bebbb925c9e6b0215a5c6 Mon Sep 17 00:00:00 2001 From: david Date: Thu, 20 Aug 2026 12:10:44 +0200 Subject: [PATCH] feat: add validation and logging for payment method resolution --- .../catalog-resolver/factuges-payment-resolver.ts | 12 ++++++++++++ .../factuges-payment-method-reference.json | 7 +++++++ 2 files changed, 19 insertions(+) diff --git a/modules/factuges/src/api/application/services/catalog-resolver/factuges-payment-resolver.ts b/modules/factuges/src/api/application/services/catalog-resolver/factuges-payment-resolver.ts index d9aa8f68..1b7fb399 100644 --- a/modules/factuges/src/api/application/services/catalog-resolver/factuges-payment-resolver.ts +++ b/modules/factuges/src/api/application/services/catalog-resolver/factuges-payment-resolver.ts @@ -37,6 +37,18 @@ export class FactuGESPaymentResolver { companyId: UniqueID; factugesId: string; }): Promise> { + console.debug( + `Resolving payment method for company ${params.companyId} and FactuGES ID ${params.factugesId}` + ); + + if (!params.factugesId) { + return Result.fail(new Error("FactuGES ID is required to resolve payment method.")); + } + + if (!params.companyId) { + return Result.fail(new Error("Company ID is required to resolve payment method.")); + } + const reference = this.deps.paymentReferenceProvider.findByFactuGESId(params.factugesId); if (reference.isNone()) { diff --git a/modules/factuges/src/api/application/services/json-data/factuges-payment-method/factuges-payment-method-reference.json b/modules/factuges/src/api/application/services/json-data/factuges-payment-method/factuges-payment-method-reference.json index 23bc0c43..3ee64122 100644 --- a/modules/factuges/src/api/application/services/json-data/factuges-payment-method/factuges-payment-method-reference.json +++ b/modules/factuges/src/api/application/services/json-data/factuges-payment-method/factuges-payment-method-reference.json @@ -1,4 +1,11 @@ [ + { + "id": "01a01e78-622e-769b-8980-b987850dad8e", + "company_id": "5e4dc5b3-96b9-4968-9490-14bd032fec5f", + "factuges_id": "10", + "description": "CONTADO", + "group": "General" + }, { "id": "019c2834-a766-7787-a626-fa89cac3a8a1", "company_id": "5e4dc5b3-96b9-4968-9490-14bd032fec5f",