Skip to content

Commit

Permalink
fix(business-report): correct fallback for merchant name
Browse files Browse the repository at this point in the history
- 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)
  • Loading branch information
alonp99 committed Dec 16, 2024
1 parent 1f5830e commit a82ff89
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion services/workflows-service/prisma/data-migrations
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ export class BusinessReportControllerExternal {
await this.businessReportService.checkBusinessReportsLimit(maxBusinessReports, customerId);

let business: Pick<Business, 'id' | 'correlationId'> | undefined;
const merchantNameWithDefault = merchantName || 'Not detected';

if (businessCorrelationId) {
business =
Expand All @@ -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,
Expand All @@ -148,7 +147,7 @@ export class BusinessReportControllerExternal {
business,
websiteUrl,
countryCode,
merchantName: merchantNameWithDefault,
merchantName,
workflowVersion,
withQualityControl,
customerId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<typeof CustomerConfigSchema>;

0 comments on commit a82ff89

Please sign in to comment.