Skip to content

Commit

Permalink
feat: send failed reports to the manual review (#2843)
Browse files Browse the repository at this point in the history
  • Loading branch information
MatanYadaev authored Nov 17, 2024
1 parent c67a596 commit db43887
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ export const useCreateBusinessReportBatchMutation = ({
merchantSheet,
isExample: customer?.config?.isExample ?? false,
});

// Artificial delay to ensure report is created in Unified API's DB
await new Promise(resolve => setTimeout(resolve, 3000));
},
onSuccess: data => {
void queryClient.invalidateQueries();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ export const useCreateBusinessReportMutation = ({
workflowVersion,
isExample: customer?.config?.isExample ?? false,
});

// Artificial delay to ensure report is created in Unified API's DB
await new Promise(resolve => setTimeout(resolve, 3000));
},
onSuccess: data => {
if (customer?.config?.isExample) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,9 @@ export const MerchantMonitoring: FunctionComponent = () => {
</TooltipProvider>
</div>
</div>
{!!businessReports?.length && (
<div className={`flex`}>
<Search value={search} onChange={onSearch} />
</div>
)}
<div className={`flex`}>
<Search value={search} onChange={onSearch} />
</div>
<div className="flex flex-1 flex-col gap-6 overflow-auto">
{isNonEmptyArray(businessReports) && <MerchantMonitoringTable data={businessReports} />}
{Array.isArray(businessReports) && !businessReports.length && !isLoadingBusinessReports && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ export const columns = [
<TextWithNAFallback
className={ctw('font-semibold', {
'text-slate-400': status === MERCHANT_REPORT_STATUSES_MAP.completed,
'text-destructive': status === MERCHANT_REPORT_STATUSES_MAP['failed'],
})}
>
{titleCase(statusToDisplayStatus[status as keyof typeof statusToDisplayStatus] ?? status)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export const useMerchantMonitoringBusinessReportLogic = () => {
variant: 'violet',
text: 'Quality Control',
},
[MERCHANT_REPORT_STATUSES_MAP['failed']]: { variant: 'destructive', text: 'Failed' },
} as const;

const websiteWithNoProtocol = safeUrl(businessReport?.website)?.hostname;
Expand Down
2 changes: 1 addition & 1 deletion services/workflows-service/prisma/data-migrations

0 comments on commit db43887

Please sign in to comment.