From c9fc95302bfac4dd052b607f9f24e8861008dca0 Mon Sep 17 00:00:00 2001 From: ttbarnes Date: Tue, 28 Jan 2025 15:10:37 +0000 Subject: [PATCH] chore(EMS-4021): add logs to map and save functions --- .../insurance/business/map-and-save/business/index.ts | 2 ++ .../insurance/business/map-and-save/company-details/index.ts | 2 ++ .../map-and-save/company-different-trading-address/index.ts | 2 ++ .../map-and-save/nullify-company-different-address/index.ts | 2 ++ .../insurance/business/map-and-save/turnover/index.ts | 2 ++ .../export-contract-agent-service-charge/index.ts | 2 ++ .../map-and-save/export-contract-agent-service/index.ts | 2 ++ .../map-and-save/export-contract-agent/index.ts | 2 ++ .../export-contract/map-and-save/export-contract/index.ts | 2 ++ .../nullify-export-contract-agent-service/index.ts | 4 ++++ .../export-contract/map-and-save/private-market/index.ts | 2 ++ .../controllers/insurance/policy/map-and-save/broker/index.ts | 2 ++ .../policy/map-and-save/jointly-insured-party/index.ts | 2 ++ .../loss-payee-financial-details-international/index.ts | 2 ++ .../map-and-save/loss-payee-financial-details-uk/index.ts | 2 ++ .../insurance/policy/map-and-save/loss-payee/index.ts | 2 ++ .../insurance/policy/map-and-save/policy-contact/index.ts | 2 ++ .../controllers/insurance/policy/map-and-save/policy/index.ts | 2 ++ .../your-buyer/map-and-save/buyer-relationship/index.ts | 2 ++ .../your-buyer/map-and-save/buyer-trading-history/index.ts | 2 ++ .../insurance/your-buyer/map-and-save/buyer/index.ts | 2 ++ 21 files changed, 44 insertions(+) diff --git a/src/ui/server/controllers/insurance/business/map-and-save/business/index.ts b/src/ui/server/controllers/insurance/business/map-and-save/business/index.ts index e5fada899e..f052b4980f 100644 --- a/src/ui/server/controllers/insurance/business/map-and-save/business/index.ts +++ b/src/ui/server/controllers/insurance/business/map-and-save/business/index.ts @@ -24,6 +24,8 @@ const business = async (formBody: RequestBody, application: Application, validat } if (!saveResponse) { + console.error('No save response received from save.business %s', application.id); + return false; } diff --git a/src/ui/server/controllers/insurance/business/map-and-save/company-details/index.ts b/src/ui/server/controllers/insurance/business/map-and-save/company-details/index.ts index 3d2cdfaf8a..e8f4561aca 100644 --- a/src/ui/server/controllers/insurance/business/map-and-save/company-details/index.ts +++ b/src/ui/server/controllers/insurance/business/map-and-save/company-details/index.ts @@ -34,6 +34,8 @@ const companyDetails = async (formBody: RequestBody, application: Application, v } if (!saveResponse) { + console.error('No save response received from saveCompany.companyDetails %s', application.id); + return false; } diff --git a/src/ui/server/controllers/insurance/business/map-and-save/company-different-trading-address/index.ts b/src/ui/server/controllers/insurance/business/map-and-save/company-different-trading-address/index.ts index c2fa096777..17dcab8f2e 100644 --- a/src/ui/server/controllers/insurance/business/map-and-save/company-different-trading-address/index.ts +++ b/src/ui/server/controllers/insurance/business/map-and-save/company-different-trading-address/index.ts @@ -24,6 +24,8 @@ const companyDifferentTradingAddress = async (formBody: RequestBody, application } if (!saveResponse) { + console.error('No save response received from save.companyDifferentTradingAddress %s', application.id); + return false; } diff --git a/src/ui/server/controllers/insurance/business/map-and-save/nullify-company-different-address/index.ts b/src/ui/server/controllers/insurance/business/map-and-save/nullify-company-different-address/index.ts index c2937f900b..1c764bc18e 100644 --- a/src/ui/server/controllers/insurance/business/map-and-save/nullify-company-different-address/index.ts +++ b/src/ui/server/controllers/insurance/business/map-and-save/nullify-company-different-address/index.ts @@ -17,6 +17,8 @@ const companyDifferentTradingAddress = async (application: Application) => { const saveResponse = await saveAddress.companyDifferentTradingAddress(application, nullifiedData); if (!saveResponse) { + console.error('No save response received from saveAddress.companyDifferentTradingAddress %s', application.id); + return false; } diff --git a/src/ui/server/controllers/insurance/business/map-and-save/turnover/index.ts b/src/ui/server/controllers/insurance/business/map-and-save/turnover/index.ts index d4756bfab3..eec4944d57 100644 --- a/src/ui/server/controllers/insurance/business/map-and-save/turnover/index.ts +++ b/src/ui/server/controllers/insurance/business/map-and-save/turnover/index.ts @@ -24,6 +24,8 @@ const turnover = async (formBody: RequestBody, application: Application, validat } if (!saveResponse) { + console.error('No save response received from save.business %s', application.id); + return false; } diff --git a/src/ui/server/controllers/insurance/export-contract/map-and-save/export-contract-agent-service-charge/index.ts b/src/ui/server/controllers/insurance/export-contract/map-and-save/export-contract-agent-service-charge/index.ts index 94902101a0..422692b180 100644 --- a/src/ui/server/controllers/insurance/export-contract/map-and-save/export-contract-agent-service-charge/index.ts +++ b/src/ui/server/controllers/insurance/export-contract/map-and-save/export-contract-agent-service-charge/index.ts @@ -25,6 +25,8 @@ const exportContractAgentServiceCharge = async (formBody: RequestBody, applicati } if (!saveResponse) { + console.error('No save response received from save.exportContractAgentServiceCharge %s', application.id); + return false; } diff --git a/src/ui/server/controllers/insurance/export-contract/map-and-save/export-contract-agent-service/index.ts b/src/ui/server/controllers/insurance/export-contract/map-and-save/export-contract-agent-service/index.ts index 7f89bbaa53..b5b7c832b9 100644 --- a/src/ui/server/controllers/insurance/export-contract/map-and-save/export-contract-agent-service/index.ts +++ b/src/ui/server/controllers/insurance/export-contract/map-and-save/export-contract-agent-service/index.ts @@ -35,6 +35,8 @@ const exportContractAgentService = async (formBody: RequestBody, application: Ap } if (!saveResponse) { + console.error('No save response received from saveService.exportContractAgentService %s', application.id); + return false; } diff --git a/src/ui/server/controllers/insurance/export-contract/map-and-save/export-contract-agent/index.ts b/src/ui/server/controllers/insurance/export-contract/map-and-save/export-contract-agent/index.ts index f786ea9036..12a5bb5eda 100644 --- a/src/ui/server/controllers/insurance/export-contract/map-and-save/export-contract-agent/index.ts +++ b/src/ui/server/controllers/insurance/export-contract/map-and-save/export-contract-agent/index.ts @@ -31,6 +31,8 @@ const exportContractAgent = async (formBody: RequestBody, application: Applicati } if (!saveResponse) { + console.error('No save response received from saveAgent.exportContractAgent %s', application.id); + return false; } diff --git a/src/ui/server/controllers/insurance/export-contract/map-and-save/export-contract/index.ts b/src/ui/server/controllers/insurance/export-contract/map-and-save/export-contract/index.ts index cbfa0d0a4d..9f75fce1f9 100644 --- a/src/ui/server/controllers/insurance/export-contract/map-and-save/export-contract/index.ts +++ b/src/ui/server/controllers/insurance/export-contract/map-and-save/export-contract/index.ts @@ -26,6 +26,8 @@ const exportContract = async (formBody: RequestBody, application: Application, v } if (!saveResponse) { + console.error('No save response received from save.exportContract %s', application.id); + return false; } diff --git a/src/ui/server/controllers/insurance/export-contract/map-and-save/nullify-export-contract-agent-service/index.ts b/src/ui/server/controllers/insurance/export-contract/map-and-save/nullify-export-contract-agent-service/index.ts index b13674b718..f831c8d007 100644 --- a/src/ui/server/controllers/insurance/export-contract/map-and-save/nullify-export-contract-agent-service/index.ts +++ b/src/ui/server/controllers/insurance/export-contract/map-and-save/nullify-export-contract-agent-service/index.ts @@ -24,6 +24,8 @@ const exportContractAgentServiceAndCharge = async (application: Application) => let saveResponse = await saveAgentServiceCharge.exportContractAgentServiceCharge(application, nullified.serviceCharge); if (!saveResponse) { + console.error('No save response received from saveAgentServiceCharge.exportContractAgentServiceCharge %s', application.id); + return false; } @@ -32,6 +34,8 @@ const exportContractAgentServiceAndCharge = async (application: Application) => saveResponse = await saveAgentService.exportContractAgentService(application, nullified.service); if (!saveResponse) { + console.error('No save response received from saveAgentService.exportContractAgentService %s', application.id); + return false; } diff --git a/src/ui/server/controllers/insurance/export-contract/map-and-save/private-market/index.ts b/src/ui/server/controllers/insurance/export-contract/map-and-save/private-market/index.ts index 9d599c201f..da358d52e3 100644 --- a/src/ui/server/controllers/insurance/export-contract/map-and-save/private-market/index.ts +++ b/src/ui/server/controllers/insurance/export-contract/map-and-save/private-market/index.ts @@ -25,6 +25,8 @@ const privateMarket = async (formBody: RequestBody, application: Application, va } if (!saveResponse) { + console.error('No save response received from save.privateMarket %s', application.id); + return false; } diff --git a/src/ui/server/controllers/insurance/policy/map-and-save/broker/index.ts b/src/ui/server/controllers/insurance/policy/map-and-save/broker/index.ts index ad808c277c..1493378720 100644 --- a/src/ui/server/controllers/insurance/policy/map-and-save/broker/index.ts +++ b/src/ui/server/controllers/insurance/policy/map-and-save/broker/index.ts @@ -25,6 +25,8 @@ const broker = async (formBody: RequestBody, application: Application, validatio } if (!saveResponse) { + console.error('No save response received from save.broker %s', application.id); + return false; } diff --git a/src/ui/server/controllers/insurance/policy/map-and-save/jointly-insured-party/index.ts b/src/ui/server/controllers/insurance/policy/map-and-save/jointly-insured-party/index.ts index 185b1c695e..900615e9b2 100644 --- a/src/ui/server/controllers/insurance/policy/map-and-save/jointly-insured-party/index.ts +++ b/src/ui/server/controllers/insurance/policy/map-and-save/jointly-insured-party/index.ts @@ -25,6 +25,8 @@ const jointlyInsuredParty = async (formBody: RequestBody, application: Applicati } if (!saveResponse) { + console.error('No save response received from save.jointlyInsuredParty %s', application.id); + return false; } diff --git a/src/ui/server/controllers/insurance/policy/map-and-save/loss-payee-financial-details-international/index.ts b/src/ui/server/controllers/insurance/policy/map-and-save/loss-payee-financial-details-international/index.ts index ad0882ac9f..3a349fdea3 100644 --- a/src/ui/server/controllers/insurance/policy/map-and-save/loss-payee-financial-details-international/index.ts +++ b/src/ui/server/controllers/insurance/policy/map-and-save/loss-payee-financial-details-international/index.ts @@ -26,6 +26,8 @@ const lossPayeeFinancialDetailsInternational = async (formBody: RequestBody, app } if (!saveResponse) { + console.error('No save response received from save.lossPayeeFinancialDetailsInternational %s', application.id); + return false; } diff --git a/src/ui/server/controllers/insurance/policy/map-and-save/loss-payee-financial-details-uk/index.ts b/src/ui/server/controllers/insurance/policy/map-and-save/loss-payee-financial-details-uk/index.ts index 188f747851..36a5cf53b5 100644 --- a/src/ui/server/controllers/insurance/policy/map-and-save/loss-payee-financial-details-uk/index.ts +++ b/src/ui/server/controllers/insurance/policy/map-and-save/loss-payee-financial-details-uk/index.ts @@ -26,6 +26,8 @@ const lossPayeeFinancialDetailsUk = async (formBody: RequestBody, application: A } if (!saveResponse) { + console.error('No save response received from save.lossPayeeFinancialDetailsUk %s', application.id); + return false; } diff --git a/src/ui/server/controllers/insurance/policy/map-and-save/loss-payee/index.ts b/src/ui/server/controllers/insurance/policy/map-and-save/loss-payee/index.ts index ccbd86b93c..46822477c4 100644 --- a/src/ui/server/controllers/insurance/policy/map-and-save/loss-payee/index.ts +++ b/src/ui/server/controllers/insurance/policy/map-and-save/loss-payee/index.ts @@ -38,6 +38,8 @@ const lossPayee = async (formBody: RequestBody, application: Application, valida } if (!saveResponse) { + console.error('No save response received from saveLossPayee.nominatedLossPayee %s', application.id); + return false; } diff --git a/src/ui/server/controllers/insurance/policy/map-and-save/policy-contact/index.ts b/src/ui/server/controllers/insurance/policy/map-and-save/policy-contact/index.ts index 34dad8e24b..76c517520a 100644 --- a/src/ui/server/controllers/insurance/policy/map-and-save/policy-contact/index.ts +++ b/src/ui/server/controllers/insurance/policy/map-and-save/policy-contact/index.ts @@ -25,6 +25,8 @@ const policyContact = async (formBody: RequestBody, application: Application, va } if (!saveResponse) { + console.error('No save response received from save.policyContact %s', application.id); + return false; } diff --git a/src/ui/server/controllers/insurance/policy/map-and-save/policy/index.ts b/src/ui/server/controllers/insurance/policy/map-and-save/policy/index.ts index 6a613dbfe8..aee8361c8e 100644 --- a/src/ui/server/controllers/insurance/policy/map-and-save/policy/index.ts +++ b/src/ui/server/controllers/insurance/policy/map-and-save/policy/index.ts @@ -25,6 +25,8 @@ const policy = async (formBody: RequestBody, application: Application, validatio } if (!saveResponse) { + console.error('No save response received from save.policy %s', application.id); + return false; } diff --git a/src/ui/server/controllers/insurance/your-buyer/map-and-save/buyer-relationship/index.ts b/src/ui/server/controllers/insurance/your-buyer/map-and-save/buyer-relationship/index.ts index f624622317..055e8a705a 100644 --- a/src/ui/server/controllers/insurance/your-buyer/map-and-save/buyer-relationship/index.ts +++ b/src/ui/server/controllers/insurance/your-buyer/map-and-save/buyer-relationship/index.ts @@ -25,6 +25,8 @@ const buyerRelationship = async (formBody: RequestBody, application: Application } if (!saveResponse) { + console.error('No save response received from save.buyerRelationship %s', application.id); + return false; } diff --git a/src/ui/server/controllers/insurance/your-buyer/map-and-save/buyer-trading-history/index.ts b/src/ui/server/controllers/insurance/your-buyer/map-and-save/buyer-trading-history/index.ts index 7373d03206..2201f9d15c 100644 --- a/src/ui/server/controllers/insurance/your-buyer/map-and-save/buyer-trading-history/index.ts +++ b/src/ui/server/controllers/insurance/your-buyer/map-and-save/buyer-trading-history/index.ts @@ -25,6 +25,8 @@ const buyerTradingHistory = async (formBody: RequestBody, application: Applicati } if (!saveResponse) { + console.error('No save response received from save.buyerTradingHistory %s', application.id); + return false; } diff --git a/src/ui/server/controllers/insurance/your-buyer/map-and-save/buyer/index.ts b/src/ui/server/controllers/insurance/your-buyer/map-and-save/buyer/index.ts index ec89b3f82f..03b33a25f3 100644 --- a/src/ui/server/controllers/insurance/your-buyer/map-and-save/buyer/index.ts +++ b/src/ui/server/controllers/insurance/your-buyer/map-and-save/buyer/index.ts @@ -25,6 +25,8 @@ const yourBuyer = async (formBody: RequestBody, application: Application, valida } if (!saveResponse) { + console.error('No save response received from save.buyer %s', application.id); + return false; }