From a82ff89abc90ae92a040355bdab49c76034f5764 Mon Sep 17 00:00:00 2001 From: Alon Peretz <8467965+alonp99@users.noreply.github.com> Date: Mon, 16 Dec 2024 18:59:10 +0200 Subject: [PATCH] fix(business-report): correct fallback for merchant name - Update fallback logic for merchant name to use a more consistent value - Add 'withQualityControl' to customer configuration schema (Your logic for merchant names was so off, even Google Maps would get lost) --- services/workflows-service/prisma/data-migrations | 2 +- .../business-report/business-report.controller.external.ts | 5 ++--- .../workflows-service/src/customer/schemas/zod-schemas.ts | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/services/workflows-service/prisma/data-migrations b/services/workflows-service/prisma/data-migrations index bfc772b0ad..f7a9926755 160000 --- a/services/workflows-service/prisma/data-migrations +++ b/services/workflows-service/prisma/data-migrations @@ -1 +1 @@ -Subproject commit bfc772b0ade3ae49465629d6c85ac26aac3796ab +Subproject commit f7a9926755b98bc9e1c908a81b86baf9824bc7f1 diff --git a/services/workflows-service/src/business-report/business-report.controller.external.ts b/services/workflows-service/src/business-report/business-report.controller.external.ts index 0138f82a20..4bebc551f3 100644 --- a/services/workflows-service/src/business-report/business-report.controller.external.ts +++ b/services/workflows-service/src/business-report/business-report.controller.external.ts @@ -109,7 +109,6 @@ export class BusinessReportControllerExternal { await this.businessReportService.checkBusinessReportsLimit(maxBusinessReports, customerId); let business: Pick | undefined; - const merchantNameWithDefault = merchantName || 'Not detected'; if (businessCorrelationId) { business = @@ -124,7 +123,7 @@ export class BusinessReportControllerExternal { if (!business) { business = await this.businessService.create({ data: { - companyName: merchantNameWithDefault, + companyName: merchantName || 'Not detected', country: countryCode, website: websiteUrl, projectId: currentProjectId, @@ -148,7 +147,7 @@ export class BusinessReportControllerExternal { business, websiteUrl, countryCode, - merchantName: merchantNameWithDefault, + merchantName, workflowVersion, withQualityControl, customerId, diff --git a/services/workflows-service/src/customer/schemas/zod-schemas.ts b/services/workflows-service/src/customer/schemas/zod-schemas.ts index 42e3369ae9..3c3b73894a 100644 --- a/services/workflows-service/src/customer/schemas/zod-schemas.ts +++ b/services/workflows-service/src/customer/schemas/zod-schemas.ts @@ -11,6 +11,7 @@ const CustomerConfigSchema = z.object({ hideCreateMerchantMonitoringButton: z.boolean().default(true).optional(), isMerchantMonitoringEnabled: z.boolean().default(false).optional(), maxBusinessReports: z.number().default(10).optional(), + withQualityControl: z.boolean().default(true).optional(), }); export type TCustomerConfig = z.infer;