Skip to content

Commit acd2915

Browse files
fix(workflows): update ongoing merchant report scheduling options (#3419)
- Change scheduling type from 'interval' to 'specific' - Add new fields for 'dayInMonth' and 'monthInterval' - Update relevant schemas and types for consistency
1 parent 662cb8d commit acd2915

File tree

4 files changed

+13
-18
lines changed

4 files changed

+13
-18
lines changed

services/workflows-service/scripts/seed.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,9 @@ async function createCustomer(
112112
options: {
113113
reportType: 'ONGOING_MERCHANT_REPORT_T1',
114114
runByDefault: true,
115-
scheduleType: 'interval',
116-
intervalInDays: 30,
115+
scheduleType: 'specific',
116+
dayInMonth: 1,
117+
monthInterval: 1,
117118
proxyViaCountry: 'GB',
118119
workflowVersion: '2',
119120
},

services/workflows-service/src/customer/schemas/zod-schemas.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ export const CustomerFeaturesSchema = z.object({
6969
reportType: z.string().optional(),
7070
runByDefault: z.boolean().optional(),
7171
scheduleType: z.string().optional(),
72-
intervalInDays: z.number().optional(),
72+
dayInMonth: z.number().optional(),
73+
monthInterval: z.number().optional(),
7374
proxyViaCountry: z.string().optional(),
7475
workflowVersion: z.string().optional(),
7576
})

services/workflows-service/src/customer/types.ts

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,10 @@ export type TOngoingMerchantReportOptions = {
2222
proxyViaCountry: string;
2323
workflowVersion: MerchantReportVersion;
2424
reportType: 'ONGOING_MERCHANT_REPORT_T1';
25-
} & (
26-
| {
27-
scheduleType: 'specific';
28-
specificDates: {
29-
dayInMonth: number;
30-
};
31-
}
32-
| {
33-
scheduleType: 'interval';
34-
intervalInDays: number;
35-
}
36-
);
25+
scheduleType: 'specific';
26+
dayInMonth: number;
27+
monthInterval: number;
28+
};
3729

3830
type FeaturesOptions = TOngoingMerchantReportOptions;
3931

@@ -49,8 +41,9 @@ export const CUSTOMER_FEATURES = {
4941
name: FEATURE_LIST.ONGOING_MERCHANT_REPORT,
5042
enabled: true,
5143
options: {
52-
scheduleType: 'interval',
53-
intervalInDays: 30,
44+
scheduleType: 'specific',
45+
dayInMonth: 1,
46+
monthInterval: 1,
5447
runByDefault: true,
5548
workflowVersion: '2',
5649
proxyViaCountry: 'GB',

0 commit comments

Comments
 (0)