@tmlmobilidade/types 20260324.1728.13 → 20260324.1820.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dates/event.d.ts +15 -0
- package/dist/offer/pattern.d.ts +45 -19
- package/dist/offer/rules.d.ts +192 -14
- package/dist/offer/rules.js +31 -4
- package/package.json +1 -1
package/dist/dates/event.d.ts
CHANGED
|
@@ -85,6 +85,7 @@ export declare const EventSchema: z.ZodObject<{
|
|
|
85
85
|
id: string;
|
|
86
86
|
}>;
|
|
87
87
|
kind: z.ZodLiteral<"event_replacement">;
|
|
88
|
+
same_weekday: z.ZodOptional<z.ZodBoolean>;
|
|
88
89
|
weekdays: z.ZodArray<z.ZodNativeEnum<{
|
|
89
90
|
readonly Fri: 5;
|
|
90
91
|
readonly Mon: 1;
|
|
@@ -110,6 +111,7 @@ export declare const EventSchema: z.ZodObject<{
|
|
|
110
111
|
timepoints?: (string & z.BRAND<"HHMM">)[] | undefined;
|
|
111
112
|
lines_to_exclude?: string[] | undefined;
|
|
112
113
|
lines_to_include?: string[] | undefined;
|
|
114
|
+
same_weekday?: boolean | undefined;
|
|
113
115
|
}, {
|
|
114
116
|
event: {
|
|
115
117
|
title: string;
|
|
@@ -125,6 +127,7 @@ export declare const EventSchema: z.ZodObject<{
|
|
|
125
127
|
timepoints?: string[] | undefined;
|
|
126
128
|
lines_to_exclude?: string[] | undefined;
|
|
127
129
|
lines_to_include?: string[] | undefined;
|
|
130
|
+
same_weekday?: boolean | undefined;
|
|
128
131
|
}>]>, "many">>;
|
|
129
132
|
title: z.ZodDefault<z.ZodString>;
|
|
130
133
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -172,6 +175,7 @@ export declare const EventSchema: z.ZodObject<{
|
|
|
172
175
|
timepoints?: (string & z.BRAND<"HHMM">)[] | undefined;
|
|
173
176
|
lines_to_exclude?: string[] | undefined;
|
|
174
177
|
lines_to_include?: string[] | undefined;
|
|
178
|
+
same_weekday?: boolean | undefined;
|
|
175
179
|
})[];
|
|
176
180
|
updated_by?: string | undefined;
|
|
177
181
|
}, {
|
|
@@ -216,6 +220,7 @@ export declare const EventSchema: z.ZodObject<{
|
|
|
216
220
|
timepoints?: string[] | undefined;
|
|
217
221
|
lines_to_exclude?: string[] | undefined;
|
|
218
222
|
lines_to_include?: string[] | undefined;
|
|
223
|
+
same_weekday?: boolean | undefined;
|
|
219
224
|
})[] | undefined;
|
|
220
225
|
}>;
|
|
221
226
|
export declare const CreateEventSchema: z.ZodObject<Omit<{
|
|
@@ -304,6 +309,7 @@ export declare const CreateEventSchema: z.ZodObject<Omit<{
|
|
|
304
309
|
id: string;
|
|
305
310
|
}>;
|
|
306
311
|
kind: z.ZodLiteral<"event_replacement">;
|
|
312
|
+
same_weekday: z.ZodOptional<z.ZodBoolean>;
|
|
307
313
|
weekdays: z.ZodArray<z.ZodNativeEnum<{
|
|
308
314
|
readonly Fri: 5;
|
|
309
315
|
readonly Mon: 1;
|
|
@@ -329,6 +335,7 @@ export declare const CreateEventSchema: z.ZodObject<Omit<{
|
|
|
329
335
|
timepoints?: (string & z.BRAND<"HHMM">)[] | undefined;
|
|
330
336
|
lines_to_exclude?: string[] | undefined;
|
|
331
337
|
lines_to_include?: string[] | undefined;
|
|
338
|
+
same_weekday?: boolean | undefined;
|
|
332
339
|
}, {
|
|
333
340
|
event: {
|
|
334
341
|
title: string;
|
|
@@ -344,6 +351,7 @@ export declare const CreateEventSchema: z.ZodObject<Omit<{
|
|
|
344
351
|
timepoints?: string[] | undefined;
|
|
345
352
|
lines_to_exclude?: string[] | undefined;
|
|
346
353
|
lines_to_include?: string[] | undefined;
|
|
354
|
+
same_weekday?: boolean | undefined;
|
|
347
355
|
}>]>, "many">>;
|
|
348
356
|
title: z.ZodDefault<z.ZodString>;
|
|
349
357
|
}, "_id" | "created_at" | "updated_at">, "strip", z.ZodTypeAny, {
|
|
@@ -384,6 +392,7 @@ export declare const CreateEventSchema: z.ZodObject<Omit<{
|
|
|
384
392
|
timepoints?: (string & z.BRAND<"HHMM">)[] | undefined;
|
|
385
393
|
lines_to_exclude?: string[] | undefined;
|
|
386
394
|
lines_to_include?: string[] | undefined;
|
|
395
|
+
same_weekday?: boolean | undefined;
|
|
387
396
|
})[];
|
|
388
397
|
updated_by?: string | undefined;
|
|
389
398
|
}, {
|
|
@@ -425,6 +434,7 @@ export declare const CreateEventSchema: z.ZodObject<Omit<{
|
|
|
425
434
|
timepoints?: string[] | undefined;
|
|
426
435
|
lines_to_exclude?: string[] | undefined;
|
|
427
436
|
lines_to_include?: string[] | undefined;
|
|
437
|
+
same_weekday?: boolean | undefined;
|
|
428
438
|
})[] | undefined;
|
|
429
439
|
}>;
|
|
430
440
|
export declare const UpdateEventSchema: z.ZodObject<{
|
|
@@ -509,6 +519,7 @@ export declare const UpdateEventSchema: z.ZodObject<{
|
|
|
509
519
|
id: string;
|
|
510
520
|
}>;
|
|
511
521
|
kind: z.ZodLiteral<"event_replacement">;
|
|
522
|
+
same_weekday: z.ZodOptional<z.ZodBoolean>;
|
|
512
523
|
weekdays: z.ZodArray<z.ZodNativeEnum<{
|
|
513
524
|
readonly Fri: 5;
|
|
514
525
|
readonly Mon: 1;
|
|
@@ -534,6 +545,7 @@ export declare const UpdateEventSchema: z.ZodObject<{
|
|
|
534
545
|
timepoints?: (string & z.BRAND<"HHMM">)[] | undefined;
|
|
535
546
|
lines_to_exclude?: string[] | undefined;
|
|
536
547
|
lines_to_include?: string[] | undefined;
|
|
548
|
+
same_weekday?: boolean | undefined;
|
|
537
549
|
}, {
|
|
538
550
|
event: {
|
|
539
551
|
title: string;
|
|
@@ -549,6 +561,7 @@ export declare const UpdateEventSchema: z.ZodObject<{
|
|
|
549
561
|
timepoints?: string[] | undefined;
|
|
550
562
|
lines_to_exclude?: string[] | undefined;
|
|
551
563
|
lines_to_include?: string[] | undefined;
|
|
564
|
+
same_weekday?: boolean | undefined;
|
|
552
565
|
}>]>, "many">>>;
|
|
553
566
|
}, "strip", z.ZodTypeAny, {
|
|
554
567
|
is_locked?: boolean | undefined;
|
|
@@ -588,6 +601,7 @@ export declare const UpdateEventSchema: z.ZodObject<{
|
|
|
588
601
|
timepoints?: (string & z.BRAND<"HHMM">)[] | undefined;
|
|
589
602
|
lines_to_exclude?: string[] | undefined;
|
|
590
603
|
lines_to_include?: string[] | undefined;
|
|
604
|
+
same_weekday?: boolean | undefined;
|
|
591
605
|
})[] | undefined;
|
|
592
606
|
}, {
|
|
593
607
|
is_locked?: boolean | undefined;
|
|
@@ -627,6 +641,7 @@ export declare const UpdateEventSchema: z.ZodObject<{
|
|
|
627
641
|
timepoints?: string[] | undefined;
|
|
628
642
|
lines_to_exclude?: string[] | undefined;
|
|
629
643
|
lines_to_include?: string[] | undefined;
|
|
644
|
+
same_weekday?: boolean | undefined;
|
|
630
645
|
})[] | undefined;
|
|
631
646
|
}>;
|
|
632
647
|
export type Event = z.infer<typeof EventSchema>;
|
package/dist/offer/pattern.d.ts
CHANGED
|
@@ -1729,7 +1729,7 @@ export declare const PatternSchema: z.ZodObject<{
|
|
|
1729
1729
|
name: z.ZodOptional<z.ZodString>;
|
|
1730
1730
|
operating_mode: z.ZodEnum<["exclude", "include"]>;
|
|
1731
1731
|
timepoints: z.ZodArray<z.ZodBranded<z.ZodString, "HHMM">, "many">;
|
|
1732
|
-
weekdays: z.ZodArray<z.ZodNativeEnum<{
|
|
1732
|
+
weekdays: z.ZodOptional<z.ZodArray<z.ZodNativeEnum<{
|
|
1733
1733
|
readonly Fri: 5;
|
|
1734
1734
|
readonly Mon: 1;
|
|
1735
1735
|
readonly Sat: 6;
|
|
@@ -1737,26 +1737,26 @@ export declare const PatternSchema: z.ZodObject<{
|
|
|
1737
1737
|
readonly Thu: 4;
|
|
1738
1738
|
readonly Tue: 2;
|
|
1739
1739
|
readonly Wed: 3;
|
|
1740
|
-
}>, "many"
|
|
1740
|
+
}>, "many">>;
|
|
1741
1741
|
year_period_ids: z.ZodArray<z.ZodString, "many">;
|
|
1742
1742
|
}, "strip", z.ZodTypeAny, {
|
|
1743
1743
|
_id: string;
|
|
1744
1744
|
kind: "manual";
|
|
1745
1745
|
operating_mode: "exclude" | "include";
|
|
1746
1746
|
timepoints: (string & z.BRAND<"HHMM">)[];
|
|
1747
|
-
weekdays: (1 | 2 | 4 | 3 | 5 | 6 | 7)[];
|
|
1748
1747
|
year_period_ids: string[];
|
|
1749
1748
|
name?: string | undefined;
|
|
1750
1749
|
event_id?: string | undefined;
|
|
1750
|
+
weekdays?: (1 | 2 | 4 | 3 | 5 | 6 | 7)[] | undefined;
|
|
1751
1751
|
}, {
|
|
1752
1752
|
_id: string;
|
|
1753
1753
|
kind: "manual";
|
|
1754
1754
|
operating_mode: "exclude" | "include";
|
|
1755
1755
|
timepoints: string[];
|
|
1756
|
-
weekdays: (1 | 2 | 4 | 3 | 5 | 6 | 7)[];
|
|
1757
1756
|
year_period_ids: string[];
|
|
1758
1757
|
name?: string | undefined;
|
|
1759
1758
|
event_id?: string | undefined;
|
|
1759
|
+
weekdays?: (1 | 2 | 4 | 3 | 5 | 6 | 7)[] | undefined;
|
|
1760
1760
|
}>, z.ZodObject<{
|
|
1761
1761
|
_id: z.ZodOptional<z.ZodString>;
|
|
1762
1762
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -1832,6 +1832,7 @@ export declare const PatternSchema: z.ZodObject<{
|
|
|
1832
1832
|
id: string;
|
|
1833
1833
|
}>;
|
|
1834
1834
|
kind: z.ZodLiteral<"event_replacement">;
|
|
1835
|
+
same_weekday: z.ZodOptional<z.ZodBoolean>;
|
|
1835
1836
|
weekdays: z.ZodArray<z.ZodNativeEnum<{
|
|
1836
1837
|
readonly Fri: 5;
|
|
1837
1838
|
readonly Mon: 1;
|
|
@@ -1857,6 +1858,7 @@ export declare const PatternSchema: z.ZodObject<{
|
|
|
1857
1858
|
timepoints?: (string & z.BRAND<"HHMM">)[] | undefined;
|
|
1858
1859
|
lines_to_exclude?: string[] | undefined;
|
|
1859
1860
|
lines_to_include?: string[] | undefined;
|
|
1861
|
+
same_weekday?: boolean | undefined;
|
|
1860
1862
|
}, {
|
|
1861
1863
|
event: {
|
|
1862
1864
|
title: string;
|
|
@@ -1872,6 +1874,7 @@ export declare const PatternSchema: z.ZodObject<{
|
|
|
1872
1874
|
timepoints?: string[] | undefined;
|
|
1873
1875
|
lines_to_exclude?: string[] | undefined;
|
|
1874
1876
|
lines_to_include?: string[] | undefined;
|
|
1877
|
+
same_weekday?: boolean | undefined;
|
|
1875
1878
|
}>]>, "many">>>;
|
|
1876
1879
|
shape: z.ZodOptional<z.ZodObject<{
|
|
1877
1880
|
extension: z.ZodNumber;
|
|
@@ -1941,10 +1944,10 @@ export declare const PatternSchema: z.ZodObject<{
|
|
|
1941
1944
|
kind: "manual";
|
|
1942
1945
|
operating_mode: "exclude" | "include";
|
|
1943
1946
|
timepoints: (string & z.BRAND<"HHMM">)[];
|
|
1944
|
-
weekdays: (1 | 2 | 4 | 3 | 5 | 6 | 7)[];
|
|
1945
1947
|
year_period_ids: string[];
|
|
1946
1948
|
name?: string | undefined;
|
|
1947
1949
|
event_id?: string | undefined;
|
|
1950
|
+
weekdays?: (1 | 2 | 4 | 3 | 5 | 6 | 7)[] | undefined;
|
|
1948
1951
|
} | {
|
|
1949
1952
|
event: {
|
|
1950
1953
|
title: string;
|
|
@@ -1976,6 +1979,7 @@ export declare const PatternSchema: z.ZodObject<{
|
|
|
1976
1979
|
timepoints?: (string & z.BRAND<"HHMM">)[] | undefined;
|
|
1977
1980
|
lines_to_exclude?: string[] | undefined;
|
|
1978
1981
|
lines_to_include?: string[] | undefined;
|
|
1982
|
+
same_weekday?: boolean | undefined;
|
|
1979
1983
|
})[];
|
|
1980
1984
|
comments: ({
|
|
1981
1985
|
created_at: number & {
|
|
@@ -2294,10 +2298,10 @@ export declare const PatternSchema: z.ZodObject<{
|
|
|
2294
2298
|
kind: "manual";
|
|
2295
2299
|
operating_mode: "exclude" | "include";
|
|
2296
2300
|
timepoints: string[];
|
|
2297
|
-
weekdays: (1 | 2 | 4 | 3 | 5 | 6 | 7)[];
|
|
2298
2301
|
year_period_ids: string[];
|
|
2299
2302
|
name?: string | undefined;
|
|
2300
2303
|
event_id?: string | undefined;
|
|
2304
|
+
weekdays?: (1 | 2 | 4 | 3 | 5 | 6 | 7)[] | undefined;
|
|
2301
2305
|
} | {
|
|
2302
2306
|
event: {
|
|
2303
2307
|
title: string;
|
|
@@ -2329,6 +2333,7 @@ export declare const PatternSchema: z.ZodObject<{
|
|
|
2329
2333
|
timepoints?: string[] | undefined;
|
|
2330
2334
|
lines_to_exclude?: string[] | undefined;
|
|
2331
2335
|
lines_to_include?: string[] | undefined;
|
|
2336
|
+
same_weekday?: boolean | undefined;
|
|
2332
2337
|
})[] | undefined;
|
|
2333
2338
|
comments?: ({
|
|
2334
2339
|
created_at: number;
|
|
@@ -3429,7 +3434,7 @@ export declare const CreatePatternSchema: z.ZodObject<Omit<{
|
|
|
3429
3434
|
name: z.ZodOptional<z.ZodString>;
|
|
3430
3435
|
operating_mode: z.ZodEnum<["exclude", "include"]>;
|
|
3431
3436
|
timepoints: z.ZodArray<z.ZodBranded<z.ZodString, "HHMM">, "many">;
|
|
3432
|
-
weekdays: z.ZodArray<z.ZodNativeEnum<{
|
|
3437
|
+
weekdays: z.ZodOptional<z.ZodArray<z.ZodNativeEnum<{
|
|
3433
3438
|
readonly Fri: 5;
|
|
3434
3439
|
readonly Mon: 1;
|
|
3435
3440
|
readonly Sat: 6;
|
|
@@ -3437,26 +3442,26 @@ export declare const CreatePatternSchema: z.ZodObject<Omit<{
|
|
|
3437
3442
|
readonly Thu: 4;
|
|
3438
3443
|
readonly Tue: 2;
|
|
3439
3444
|
readonly Wed: 3;
|
|
3440
|
-
}>, "many"
|
|
3445
|
+
}>, "many">>;
|
|
3441
3446
|
year_period_ids: z.ZodArray<z.ZodString, "many">;
|
|
3442
3447
|
}, "strip", z.ZodTypeAny, {
|
|
3443
3448
|
_id: string;
|
|
3444
3449
|
kind: "manual";
|
|
3445
3450
|
operating_mode: "exclude" | "include";
|
|
3446
3451
|
timepoints: (string & z.BRAND<"HHMM">)[];
|
|
3447
|
-
weekdays: (1 | 2 | 4 | 3 | 5 | 6 | 7)[];
|
|
3448
3452
|
year_period_ids: string[];
|
|
3449
3453
|
name?: string | undefined;
|
|
3450
3454
|
event_id?: string | undefined;
|
|
3455
|
+
weekdays?: (1 | 2 | 4 | 3 | 5 | 6 | 7)[] | undefined;
|
|
3451
3456
|
}, {
|
|
3452
3457
|
_id: string;
|
|
3453
3458
|
kind: "manual";
|
|
3454
3459
|
operating_mode: "exclude" | "include";
|
|
3455
3460
|
timepoints: string[];
|
|
3456
|
-
weekdays: (1 | 2 | 4 | 3 | 5 | 6 | 7)[];
|
|
3457
3461
|
year_period_ids: string[];
|
|
3458
3462
|
name?: string | undefined;
|
|
3459
3463
|
event_id?: string | undefined;
|
|
3464
|
+
weekdays?: (1 | 2 | 4 | 3 | 5 | 6 | 7)[] | undefined;
|
|
3460
3465
|
}>, z.ZodObject<{
|
|
3461
3466
|
_id: z.ZodOptional<z.ZodString>;
|
|
3462
3467
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -3532,6 +3537,7 @@ export declare const CreatePatternSchema: z.ZodObject<Omit<{
|
|
|
3532
3537
|
id: string;
|
|
3533
3538
|
}>;
|
|
3534
3539
|
kind: z.ZodLiteral<"event_replacement">;
|
|
3540
|
+
same_weekday: z.ZodOptional<z.ZodBoolean>;
|
|
3535
3541
|
weekdays: z.ZodArray<z.ZodNativeEnum<{
|
|
3536
3542
|
readonly Fri: 5;
|
|
3537
3543
|
readonly Mon: 1;
|
|
@@ -3557,6 +3563,7 @@ export declare const CreatePatternSchema: z.ZodObject<Omit<{
|
|
|
3557
3563
|
timepoints?: (string & z.BRAND<"HHMM">)[] | undefined;
|
|
3558
3564
|
lines_to_exclude?: string[] | undefined;
|
|
3559
3565
|
lines_to_include?: string[] | undefined;
|
|
3566
|
+
same_weekday?: boolean | undefined;
|
|
3560
3567
|
}, {
|
|
3561
3568
|
event: {
|
|
3562
3569
|
title: string;
|
|
@@ -3572,6 +3579,7 @@ export declare const CreatePatternSchema: z.ZodObject<Omit<{
|
|
|
3572
3579
|
timepoints?: string[] | undefined;
|
|
3573
3580
|
lines_to_exclude?: string[] | undefined;
|
|
3574
3581
|
lines_to_include?: string[] | undefined;
|
|
3582
|
+
same_weekday?: boolean | undefined;
|
|
3575
3583
|
}>]>, "many">>>;
|
|
3576
3584
|
shape: z.ZodOptional<z.ZodObject<{
|
|
3577
3585
|
extension: z.ZodNumber;
|
|
@@ -3634,10 +3642,10 @@ export declare const CreatePatternSchema: z.ZodObject<Omit<{
|
|
|
3634
3642
|
kind: "manual";
|
|
3635
3643
|
operating_mode: "exclude" | "include";
|
|
3636
3644
|
timepoints: (string & z.BRAND<"HHMM">)[];
|
|
3637
|
-
weekdays: (1 | 2 | 4 | 3 | 5 | 6 | 7)[];
|
|
3638
3645
|
year_period_ids: string[];
|
|
3639
3646
|
name?: string | undefined;
|
|
3640
3647
|
event_id?: string | undefined;
|
|
3648
|
+
weekdays?: (1 | 2 | 4 | 3 | 5 | 6 | 7)[] | undefined;
|
|
3641
3649
|
} | {
|
|
3642
3650
|
event: {
|
|
3643
3651
|
title: string;
|
|
@@ -3669,6 +3677,7 @@ export declare const CreatePatternSchema: z.ZodObject<Omit<{
|
|
|
3669
3677
|
timepoints?: (string & z.BRAND<"HHMM">)[] | undefined;
|
|
3670
3678
|
lines_to_exclude?: string[] | undefined;
|
|
3671
3679
|
lines_to_include?: string[] | undefined;
|
|
3680
|
+
same_weekday?: boolean | undefined;
|
|
3672
3681
|
})[];
|
|
3673
3682
|
comments: ({
|
|
3674
3683
|
created_at: number & {
|
|
@@ -3984,10 +3993,10 @@ export declare const CreatePatternSchema: z.ZodObject<Omit<{
|
|
|
3984
3993
|
kind: "manual";
|
|
3985
3994
|
operating_mode: "exclude" | "include";
|
|
3986
3995
|
timepoints: string[];
|
|
3987
|
-
weekdays: (1 | 2 | 4 | 3 | 5 | 6 | 7)[];
|
|
3988
3996
|
year_period_ids: string[];
|
|
3989
3997
|
name?: string | undefined;
|
|
3990
3998
|
event_id?: string | undefined;
|
|
3999
|
+
weekdays?: (1 | 2 | 4 | 3 | 5 | 6 | 7)[] | undefined;
|
|
3991
4000
|
} | {
|
|
3992
4001
|
event: {
|
|
3993
4002
|
title: string;
|
|
@@ -4019,6 +4028,7 @@ export declare const CreatePatternSchema: z.ZodObject<Omit<{
|
|
|
4019
4028
|
timepoints?: string[] | undefined;
|
|
4020
4029
|
lines_to_exclude?: string[] | undefined;
|
|
4021
4030
|
lines_to_include?: string[] | undefined;
|
|
4031
|
+
same_weekday?: boolean | undefined;
|
|
4022
4032
|
})[] | undefined;
|
|
4023
4033
|
comments?: ({
|
|
4024
4034
|
created_at: number;
|
|
@@ -5140,14 +5150,14 @@ export declare const UpdatePatternSchema: z.ZodObject<{
|
|
|
5140
5150
|
day_periods?: ("PPM" | "CD" | "PPT" | "N" | "M")[] | undefined;
|
|
5141
5151
|
})[]>>>;
|
|
5142
5152
|
} & {
|
|
5143
|
-
rules: z.ZodOptional<z.ZodArray<z.ZodObject<Omit<{
|
|
5153
|
+
rules: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<Omit<{
|
|
5144
5154
|
_id: z.ZodString;
|
|
5145
5155
|
event_id: z.ZodOptional<z.ZodString>;
|
|
5146
5156
|
kind: z.ZodLiteral<"manual">;
|
|
5147
5157
|
name: z.ZodOptional<z.ZodString>;
|
|
5148
5158
|
operating_mode: z.ZodEnum<["exclude", "include"]>;
|
|
5149
5159
|
timepoints: z.ZodArray<z.ZodBranded<z.ZodString, "HHMM">, "many">;
|
|
5150
|
-
weekdays: z.ZodArray<z.ZodNativeEnum<{
|
|
5160
|
+
weekdays: z.ZodOptional<z.ZodArray<z.ZodNativeEnum<{
|
|
5151
5161
|
readonly Fri: 5;
|
|
5152
5162
|
readonly Mon: 1;
|
|
5153
5163
|
readonly Sat: 6;
|
|
@@ -5155,24 +5165,40 @@ export declare const UpdatePatternSchema: z.ZodObject<{
|
|
|
5155
5165
|
readonly Thu: 4;
|
|
5156
5166
|
readonly Tue: 2;
|
|
5157
5167
|
readonly Wed: 3;
|
|
5158
|
-
}>, "many"
|
|
5168
|
+
}>, "many">>;
|
|
5159
5169
|
year_period_ids: z.ZodArray<z.ZodString, "many">;
|
|
5160
5170
|
}, "name">, "strip", z.ZodTypeAny, {
|
|
5161
5171
|
_id: string;
|
|
5162
5172
|
kind: "manual";
|
|
5163
5173
|
operating_mode: "exclude" | "include";
|
|
5164
5174
|
timepoints: (string & z.BRAND<"HHMM">)[];
|
|
5165
|
-
weekdays: (1 | 2 | 4 | 3 | 5 | 6 | 7)[];
|
|
5166
5175
|
year_period_ids: string[];
|
|
5167
5176
|
event_id?: string | undefined;
|
|
5177
|
+
weekdays?: (1 | 2 | 4 | 3 | 5 | 6 | 7)[] | undefined;
|
|
5168
5178
|
}, {
|
|
5169
5179
|
_id: string;
|
|
5170
5180
|
kind: "manual";
|
|
5171
5181
|
operating_mode: "exclude" | "include";
|
|
5172
5182
|
timepoints: string[];
|
|
5173
|
-
weekdays: (1 | 2 | 4 | 3 | 5 | 6 | 7)[];
|
|
5174
5183
|
year_period_ids: string[];
|
|
5175
5184
|
event_id?: string | undefined;
|
|
5185
|
+
weekdays?: (1 | 2 | 4 | 3 | 5 | 6 | 7)[] | undefined;
|
|
5186
|
+
}>, {
|
|
5187
|
+
_id: string;
|
|
5188
|
+
kind: "manual";
|
|
5189
|
+
operating_mode: "exclude" | "include";
|
|
5190
|
+
timepoints: (string & z.BRAND<"HHMM">)[];
|
|
5191
|
+
year_period_ids: string[];
|
|
5192
|
+
event_id?: string | undefined;
|
|
5193
|
+
weekdays?: (1 | 2 | 4 | 3 | 5 | 6 | 7)[] | undefined;
|
|
5194
|
+
}, {
|
|
5195
|
+
_id: string;
|
|
5196
|
+
kind: "manual";
|
|
5197
|
+
operating_mode: "exclude" | "include";
|
|
5198
|
+
timepoints: string[];
|
|
5199
|
+
year_period_ids: string[];
|
|
5200
|
+
event_id?: string | undefined;
|
|
5201
|
+
weekdays?: (1 | 2 | 4 | 3 | 5 | 6 | 7)[] | undefined;
|
|
5176
5202
|
}>, "many">>;
|
|
5177
5203
|
}, "strip", z.ZodTypeAny, {
|
|
5178
5204
|
is_locked?: boolean | undefined;
|
|
@@ -5303,9 +5329,9 @@ export declare const UpdatePatternSchema: z.ZodObject<{
|
|
|
5303
5329
|
kind: "manual";
|
|
5304
5330
|
operating_mode: "exclude" | "include";
|
|
5305
5331
|
timepoints: (string & z.BRAND<"HHMM">)[];
|
|
5306
|
-
weekdays: (1 | 2 | 4 | 3 | 5 | 6 | 7)[];
|
|
5307
5332
|
year_period_ids: string[];
|
|
5308
5333
|
event_id?: string | undefined;
|
|
5334
|
+
weekdays?: (1 | 2 | 4 | 3 | 5 | 6 | 7)[] | undefined;
|
|
5309
5335
|
}[] | undefined;
|
|
5310
5336
|
comments?: ({
|
|
5311
5337
|
created_at: number & {
|
|
@@ -5495,9 +5521,9 @@ export declare const UpdatePatternSchema: z.ZodObject<{
|
|
|
5495
5521
|
kind: "manual";
|
|
5496
5522
|
operating_mode: "exclude" | "include";
|
|
5497
5523
|
timepoints: string[];
|
|
5498
|
-
weekdays: (1 | 2 | 4 | 3 | 5 | 6 | 7)[];
|
|
5499
5524
|
year_period_ids: string[];
|
|
5500
5525
|
event_id?: string | undefined;
|
|
5526
|
+
weekdays?: (1 | 2 | 4 | 3 | 5 | 6 | 7)[] | undefined;
|
|
5501
5527
|
}[] | undefined;
|
|
5502
5528
|
comments?: ({
|
|
5503
5529
|
created_at: number;
|
package/dist/offer/rules.d.ts
CHANGED
|
@@ -5,14 +5,14 @@ export type OperatingMode = z.infer<typeof OperatingModeSchema>;
|
|
|
5
5
|
export declare const LinesModeValues: readonly ["all", "exclude", "include"];
|
|
6
6
|
export declare const LinesModeSchema: z.ZodEnum<["all", "exclude", "include"]>;
|
|
7
7
|
export type LinesMode = z.infer<typeof LinesModeSchema>;
|
|
8
|
-
export declare const
|
|
8
|
+
export declare const ManualRuleBaseSchema: z.ZodObject<{
|
|
9
9
|
_id: z.ZodString;
|
|
10
10
|
event_id: z.ZodOptional<z.ZodString>;
|
|
11
11
|
kind: z.ZodLiteral<"manual">;
|
|
12
12
|
name: z.ZodOptional<z.ZodString>;
|
|
13
13
|
operating_mode: z.ZodEnum<["exclude", "include"]>;
|
|
14
14
|
timepoints: z.ZodArray<z.ZodBranded<z.ZodString, "HHMM">, "many">;
|
|
15
|
-
weekdays: z.ZodArray<z.ZodNativeEnum<{
|
|
15
|
+
weekdays: z.ZodOptional<z.ZodArray<z.ZodNativeEnum<{
|
|
16
16
|
readonly Fri: 5;
|
|
17
17
|
readonly Mon: 1;
|
|
18
18
|
readonly Sat: 6;
|
|
@@ -20,26 +20,80 @@ export declare const ManualRuleSchema: z.ZodObject<{
|
|
|
20
20
|
readonly Thu: 4;
|
|
21
21
|
readonly Tue: 2;
|
|
22
22
|
readonly Wed: 3;
|
|
23
|
-
}>, "many"
|
|
23
|
+
}>, "many">>;
|
|
24
24
|
year_period_ids: z.ZodArray<z.ZodString, "many">;
|
|
25
25
|
}, "strip", z.ZodTypeAny, {
|
|
26
26
|
_id: string;
|
|
27
27
|
kind: "manual";
|
|
28
28
|
operating_mode: "exclude" | "include";
|
|
29
29
|
timepoints: (string & z.BRAND<"HHMM">)[];
|
|
30
|
-
weekdays: (1 | 2 | 4 | 3 | 5 | 6 | 7)[];
|
|
31
30
|
year_period_ids: string[];
|
|
32
31
|
name?: string | undefined;
|
|
33
32
|
event_id?: string | undefined;
|
|
33
|
+
weekdays?: (1 | 2 | 4 | 3 | 5 | 6 | 7)[] | undefined;
|
|
34
34
|
}, {
|
|
35
35
|
_id: string;
|
|
36
36
|
kind: "manual";
|
|
37
37
|
operating_mode: "exclude" | "include";
|
|
38
38
|
timepoints: string[];
|
|
39
|
-
weekdays: (1 | 2 | 4 | 3 | 5 | 6 | 7)[];
|
|
40
39
|
year_period_ids: string[];
|
|
41
40
|
name?: string | undefined;
|
|
42
41
|
event_id?: string | undefined;
|
|
42
|
+
weekdays?: (1 | 2 | 4 | 3 | 5 | 6 | 7)[] | undefined;
|
|
43
|
+
}>;
|
|
44
|
+
export declare const ManualRuleSchema: z.ZodEffects<z.ZodObject<{
|
|
45
|
+
_id: z.ZodString;
|
|
46
|
+
event_id: z.ZodOptional<z.ZodString>;
|
|
47
|
+
kind: z.ZodLiteral<"manual">;
|
|
48
|
+
name: z.ZodOptional<z.ZodString>;
|
|
49
|
+
operating_mode: z.ZodEnum<["exclude", "include"]>;
|
|
50
|
+
timepoints: z.ZodArray<z.ZodBranded<z.ZodString, "HHMM">, "many">;
|
|
51
|
+
weekdays: z.ZodOptional<z.ZodArray<z.ZodNativeEnum<{
|
|
52
|
+
readonly Fri: 5;
|
|
53
|
+
readonly Mon: 1;
|
|
54
|
+
readonly Sat: 6;
|
|
55
|
+
readonly Sun: 7;
|
|
56
|
+
readonly Thu: 4;
|
|
57
|
+
readonly Tue: 2;
|
|
58
|
+
readonly Wed: 3;
|
|
59
|
+
}>, "many">>;
|
|
60
|
+
year_period_ids: z.ZodArray<z.ZodString, "many">;
|
|
61
|
+
}, "strip", z.ZodTypeAny, {
|
|
62
|
+
_id: string;
|
|
63
|
+
kind: "manual";
|
|
64
|
+
operating_mode: "exclude" | "include";
|
|
65
|
+
timepoints: (string & z.BRAND<"HHMM">)[];
|
|
66
|
+
year_period_ids: string[];
|
|
67
|
+
name?: string | undefined;
|
|
68
|
+
event_id?: string | undefined;
|
|
69
|
+
weekdays?: (1 | 2 | 4 | 3 | 5 | 6 | 7)[] | undefined;
|
|
70
|
+
}, {
|
|
71
|
+
_id: string;
|
|
72
|
+
kind: "manual";
|
|
73
|
+
operating_mode: "exclude" | "include";
|
|
74
|
+
timepoints: string[];
|
|
75
|
+
year_period_ids: string[];
|
|
76
|
+
name?: string | undefined;
|
|
77
|
+
event_id?: string | undefined;
|
|
78
|
+
weekdays?: (1 | 2 | 4 | 3 | 5 | 6 | 7)[] | undefined;
|
|
79
|
+
}>, {
|
|
80
|
+
_id: string;
|
|
81
|
+
kind: "manual";
|
|
82
|
+
operating_mode: "exclude" | "include";
|
|
83
|
+
timepoints: (string & z.BRAND<"HHMM">)[];
|
|
84
|
+
year_period_ids: string[];
|
|
85
|
+
name?: string | undefined;
|
|
86
|
+
event_id?: string | undefined;
|
|
87
|
+
weekdays?: (1 | 2 | 4 | 3 | 5 | 6 | 7)[] | undefined;
|
|
88
|
+
}, {
|
|
89
|
+
_id: string;
|
|
90
|
+
kind: "manual";
|
|
91
|
+
operating_mode: "exclude" | "include";
|
|
92
|
+
timepoints: string[];
|
|
93
|
+
year_period_ids: string[];
|
|
94
|
+
name?: string | undefined;
|
|
95
|
+
event_id?: string | undefined;
|
|
96
|
+
weekdays?: (1 | 2 | 4 | 3 | 5 | 6 | 7)[] | undefined;
|
|
43
97
|
}>;
|
|
44
98
|
export declare const EventDerivedBaseSchema: z.ZodObject<{
|
|
45
99
|
_id: z.ZodOptional<z.ZodString>;
|
|
@@ -142,6 +196,12 @@ export declare const EventReplacementSchema: z.ZodObject<{
|
|
|
142
196
|
id: string;
|
|
143
197
|
}>;
|
|
144
198
|
kind: z.ZodLiteral<"event_replacement">;
|
|
199
|
+
/**
|
|
200
|
+
* When true, each date in the rule will function as its own actual weekday
|
|
201
|
+
* but within the specified year_period_ids, instead of all dates functioning
|
|
202
|
+
* as the same target weekday(s).
|
|
203
|
+
*/
|
|
204
|
+
same_weekday: z.ZodOptional<z.ZodBoolean>;
|
|
145
205
|
weekdays: z.ZodArray<z.ZodNativeEnum<{
|
|
146
206
|
readonly Fri: 5;
|
|
147
207
|
readonly Mon: 1;
|
|
@@ -167,6 +227,7 @@ export declare const EventReplacementSchema: z.ZodObject<{
|
|
|
167
227
|
timepoints?: (string & z.BRAND<"HHMM">)[] | undefined;
|
|
168
228
|
lines_to_exclude?: string[] | undefined;
|
|
169
229
|
lines_to_include?: string[] | undefined;
|
|
230
|
+
same_weekday?: boolean | undefined;
|
|
170
231
|
}, {
|
|
171
232
|
event: {
|
|
172
233
|
title: string;
|
|
@@ -182,6 +243,7 @@ export declare const EventReplacementSchema: z.ZodObject<{
|
|
|
182
243
|
timepoints?: string[] | undefined;
|
|
183
244
|
lines_to_exclude?: string[] | undefined;
|
|
184
245
|
lines_to_include?: string[] | undefined;
|
|
246
|
+
same_weekday?: boolean | undefined;
|
|
185
247
|
}>;
|
|
186
248
|
export declare const EventRuleSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
187
249
|
_id: z.ZodOptional<z.ZodString>;
|
|
@@ -258,6 +320,12 @@ export declare const EventRuleSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObje
|
|
|
258
320
|
id: string;
|
|
259
321
|
}>;
|
|
260
322
|
kind: z.ZodLiteral<"event_replacement">;
|
|
323
|
+
/**
|
|
324
|
+
* When true, each date in the rule will function as its own actual weekday
|
|
325
|
+
* but within the specified year_period_ids, instead of all dates functioning
|
|
326
|
+
* as the same target weekday(s).
|
|
327
|
+
*/
|
|
328
|
+
same_weekday: z.ZodOptional<z.ZodBoolean>;
|
|
261
329
|
weekdays: z.ZodArray<z.ZodNativeEnum<{
|
|
262
330
|
readonly Fri: 5;
|
|
263
331
|
readonly Mon: 1;
|
|
@@ -283,6 +351,7 @@ export declare const EventRuleSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObje
|
|
|
283
351
|
timepoints?: (string & z.BRAND<"HHMM">)[] | undefined;
|
|
284
352
|
lines_to_exclude?: string[] | undefined;
|
|
285
353
|
lines_to_include?: string[] | undefined;
|
|
354
|
+
same_weekday?: boolean | undefined;
|
|
286
355
|
}, {
|
|
287
356
|
event: {
|
|
288
357
|
title: string;
|
|
@@ -298,6 +367,7 @@ export declare const EventRuleSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObje
|
|
|
298
367
|
timepoints?: string[] | undefined;
|
|
299
368
|
lines_to_exclude?: string[] | undefined;
|
|
300
369
|
lines_to_include?: string[] | undefined;
|
|
370
|
+
same_weekday?: boolean | undefined;
|
|
301
371
|
}>]>;
|
|
302
372
|
export declare const ScheduleRuleSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
303
373
|
_id: z.ZodString;
|
|
@@ -306,7 +376,7 @@ export declare const ScheduleRuleSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodO
|
|
|
306
376
|
name: z.ZodOptional<z.ZodString>;
|
|
307
377
|
operating_mode: z.ZodEnum<["exclude", "include"]>;
|
|
308
378
|
timepoints: z.ZodArray<z.ZodBranded<z.ZodString, "HHMM">, "many">;
|
|
309
|
-
weekdays: z.ZodArray<z.ZodNativeEnum<{
|
|
379
|
+
weekdays: z.ZodOptional<z.ZodArray<z.ZodNativeEnum<{
|
|
310
380
|
readonly Fri: 5;
|
|
311
381
|
readonly Mon: 1;
|
|
312
382
|
readonly Sat: 6;
|
|
@@ -314,26 +384,26 @@ export declare const ScheduleRuleSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodO
|
|
|
314
384
|
readonly Thu: 4;
|
|
315
385
|
readonly Tue: 2;
|
|
316
386
|
readonly Wed: 3;
|
|
317
|
-
}>, "many"
|
|
387
|
+
}>, "many">>;
|
|
318
388
|
year_period_ids: z.ZodArray<z.ZodString, "many">;
|
|
319
389
|
}, "strip", z.ZodTypeAny, {
|
|
320
390
|
_id: string;
|
|
321
391
|
kind: "manual";
|
|
322
392
|
operating_mode: "exclude" | "include";
|
|
323
393
|
timepoints: (string & z.BRAND<"HHMM">)[];
|
|
324
|
-
weekdays: (1 | 2 | 4 | 3 | 5 | 6 | 7)[];
|
|
325
394
|
year_period_ids: string[];
|
|
326
395
|
name?: string | undefined;
|
|
327
396
|
event_id?: string | undefined;
|
|
397
|
+
weekdays?: (1 | 2 | 4 | 3 | 5 | 6 | 7)[] | undefined;
|
|
328
398
|
}, {
|
|
329
399
|
_id: string;
|
|
330
400
|
kind: "manual";
|
|
331
401
|
operating_mode: "exclude" | "include";
|
|
332
402
|
timepoints: string[];
|
|
333
|
-
weekdays: (1 | 2 | 4 | 3 | 5 | 6 | 7)[];
|
|
334
403
|
year_period_ids: string[];
|
|
335
404
|
name?: string | undefined;
|
|
336
405
|
event_id?: string | undefined;
|
|
406
|
+
weekdays?: (1 | 2 | 4 | 3 | 5 | 6 | 7)[] | undefined;
|
|
337
407
|
}>, z.ZodObject<{
|
|
338
408
|
_id: z.ZodOptional<z.ZodString>;
|
|
339
409
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -409,6 +479,12 @@ export declare const ScheduleRuleSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodO
|
|
|
409
479
|
id: string;
|
|
410
480
|
}>;
|
|
411
481
|
kind: z.ZodLiteral<"event_replacement">;
|
|
482
|
+
/**
|
|
483
|
+
* When true, each date in the rule will function as its own actual weekday
|
|
484
|
+
* but within the specified year_period_ids, instead of all dates functioning
|
|
485
|
+
* as the same target weekday(s).
|
|
486
|
+
*/
|
|
487
|
+
same_weekday: z.ZodOptional<z.ZodBoolean>;
|
|
412
488
|
weekdays: z.ZodArray<z.ZodNativeEnum<{
|
|
413
489
|
readonly Fri: 5;
|
|
414
490
|
readonly Mon: 1;
|
|
@@ -434,6 +510,7 @@ export declare const ScheduleRuleSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodO
|
|
|
434
510
|
timepoints?: (string & z.BRAND<"HHMM">)[] | undefined;
|
|
435
511
|
lines_to_exclude?: string[] | undefined;
|
|
436
512
|
lines_to_include?: string[] | undefined;
|
|
513
|
+
same_weekday?: boolean | undefined;
|
|
437
514
|
}, {
|
|
438
515
|
event: {
|
|
439
516
|
title: string;
|
|
@@ -449,15 +526,16 @@ export declare const ScheduleRuleSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodO
|
|
|
449
526
|
timepoints?: string[] | undefined;
|
|
450
527
|
lines_to_exclude?: string[] | undefined;
|
|
451
528
|
lines_to_include?: string[] | undefined;
|
|
529
|
+
same_weekday?: boolean | undefined;
|
|
452
530
|
}>]>;
|
|
453
|
-
export declare const
|
|
531
|
+
export declare const PatternUpdateRuleBaseSchema: z.ZodObject<Omit<{
|
|
454
532
|
_id: z.ZodString;
|
|
455
533
|
event_id: z.ZodOptional<z.ZodString>;
|
|
456
534
|
kind: z.ZodLiteral<"manual">;
|
|
457
535
|
name: z.ZodOptional<z.ZodString>;
|
|
458
536
|
operating_mode: z.ZodEnum<["exclude", "include"]>;
|
|
459
537
|
timepoints: z.ZodArray<z.ZodBranded<z.ZodString, "HHMM">, "many">;
|
|
460
|
-
weekdays: z.ZodArray<z.ZodNativeEnum<{
|
|
538
|
+
weekdays: z.ZodOptional<z.ZodArray<z.ZodNativeEnum<{
|
|
461
539
|
readonly Fri: 5;
|
|
462
540
|
readonly Mon: 1;
|
|
463
541
|
readonly Sat: 6;
|
|
@@ -465,24 +543,124 @@ export declare const PatternUpdateRulesSchema: z.ZodOptional<z.ZodArray<z.ZodObj
|
|
|
465
543
|
readonly Thu: 4;
|
|
466
544
|
readonly Tue: 2;
|
|
467
545
|
readonly Wed: 3;
|
|
468
|
-
}>, "many"
|
|
546
|
+
}>, "many">>;
|
|
469
547
|
year_period_ids: z.ZodArray<z.ZodString, "many">;
|
|
470
548
|
}, "name">, "strip", z.ZodTypeAny, {
|
|
471
549
|
_id: string;
|
|
472
550
|
kind: "manual";
|
|
473
551
|
operating_mode: "exclude" | "include";
|
|
474
552
|
timepoints: (string & z.BRAND<"HHMM">)[];
|
|
475
|
-
weekdays: (1 | 2 | 4 | 3 | 5 | 6 | 7)[];
|
|
476
553
|
year_period_ids: string[];
|
|
477
554
|
event_id?: string | undefined;
|
|
555
|
+
weekdays?: (1 | 2 | 4 | 3 | 5 | 6 | 7)[] | undefined;
|
|
556
|
+
}, {
|
|
557
|
+
_id: string;
|
|
558
|
+
kind: "manual";
|
|
559
|
+
operating_mode: "exclude" | "include";
|
|
560
|
+
timepoints: string[];
|
|
561
|
+
year_period_ids: string[];
|
|
562
|
+
event_id?: string | undefined;
|
|
563
|
+
weekdays?: (1 | 2 | 4 | 3 | 5 | 6 | 7)[] | undefined;
|
|
564
|
+
}>;
|
|
565
|
+
export declare const PatternUpdateRuleSchema: z.ZodEffects<z.ZodObject<Omit<{
|
|
566
|
+
_id: z.ZodString;
|
|
567
|
+
event_id: z.ZodOptional<z.ZodString>;
|
|
568
|
+
kind: z.ZodLiteral<"manual">;
|
|
569
|
+
name: z.ZodOptional<z.ZodString>;
|
|
570
|
+
operating_mode: z.ZodEnum<["exclude", "include"]>;
|
|
571
|
+
timepoints: z.ZodArray<z.ZodBranded<z.ZodString, "HHMM">, "many">;
|
|
572
|
+
weekdays: z.ZodOptional<z.ZodArray<z.ZodNativeEnum<{
|
|
573
|
+
readonly Fri: 5;
|
|
574
|
+
readonly Mon: 1;
|
|
575
|
+
readonly Sat: 6;
|
|
576
|
+
readonly Sun: 7;
|
|
577
|
+
readonly Thu: 4;
|
|
578
|
+
readonly Tue: 2;
|
|
579
|
+
readonly Wed: 3;
|
|
580
|
+
}>, "many">>;
|
|
581
|
+
year_period_ids: z.ZodArray<z.ZodString, "many">;
|
|
582
|
+
}, "name">, "strip", z.ZodTypeAny, {
|
|
583
|
+
_id: string;
|
|
584
|
+
kind: "manual";
|
|
585
|
+
operating_mode: "exclude" | "include";
|
|
586
|
+
timepoints: (string & z.BRAND<"HHMM">)[];
|
|
587
|
+
year_period_ids: string[];
|
|
588
|
+
event_id?: string | undefined;
|
|
589
|
+
weekdays?: (1 | 2 | 4 | 3 | 5 | 6 | 7)[] | undefined;
|
|
590
|
+
}, {
|
|
591
|
+
_id: string;
|
|
592
|
+
kind: "manual";
|
|
593
|
+
operating_mode: "exclude" | "include";
|
|
594
|
+
timepoints: string[];
|
|
595
|
+
year_period_ids: string[];
|
|
596
|
+
event_id?: string | undefined;
|
|
597
|
+
weekdays?: (1 | 2 | 4 | 3 | 5 | 6 | 7)[] | undefined;
|
|
598
|
+
}>, {
|
|
599
|
+
_id: string;
|
|
600
|
+
kind: "manual";
|
|
601
|
+
operating_mode: "exclude" | "include";
|
|
602
|
+
timepoints: (string & z.BRAND<"HHMM">)[];
|
|
603
|
+
year_period_ids: string[];
|
|
604
|
+
event_id?: string | undefined;
|
|
605
|
+
weekdays?: (1 | 2 | 4 | 3 | 5 | 6 | 7)[] | undefined;
|
|
606
|
+
}, {
|
|
607
|
+
_id: string;
|
|
608
|
+
kind: "manual";
|
|
609
|
+
operating_mode: "exclude" | "include";
|
|
610
|
+
timepoints: string[];
|
|
611
|
+
year_period_ids: string[];
|
|
612
|
+
event_id?: string | undefined;
|
|
613
|
+
weekdays?: (1 | 2 | 4 | 3 | 5 | 6 | 7)[] | undefined;
|
|
614
|
+
}>;
|
|
615
|
+
export declare const PatternUpdateRulesSchema: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<Omit<{
|
|
616
|
+
_id: z.ZodString;
|
|
617
|
+
event_id: z.ZodOptional<z.ZodString>;
|
|
618
|
+
kind: z.ZodLiteral<"manual">;
|
|
619
|
+
name: z.ZodOptional<z.ZodString>;
|
|
620
|
+
operating_mode: z.ZodEnum<["exclude", "include"]>;
|
|
621
|
+
timepoints: z.ZodArray<z.ZodBranded<z.ZodString, "HHMM">, "many">;
|
|
622
|
+
weekdays: z.ZodOptional<z.ZodArray<z.ZodNativeEnum<{
|
|
623
|
+
readonly Fri: 5;
|
|
624
|
+
readonly Mon: 1;
|
|
625
|
+
readonly Sat: 6;
|
|
626
|
+
readonly Sun: 7;
|
|
627
|
+
readonly Thu: 4;
|
|
628
|
+
readonly Tue: 2;
|
|
629
|
+
readonly Wed: 3;
|
|
630
|
+
}>, "many">>;
|
|
631
|
+
year_period_ids: z.ZodArray<z.ZodString, "many">;
|
|
632
|
+
}, "name">, "strip", z.ZodTypeAny, {
|
|
633
|
+
_id: string;
|
|
634
|
+
kind: "manual";
|
|
635
|
+
operating_mode: "exclude" | "include";
|
|
636
|
+
timepoints: (string & z.BRAND<"HHMM">)[];
|
|
637
|
+
year_period_ids: string[];
|
|
638
|
+
event_id?: string | undefined;
|
|
639
|
+
weekdays?: (1 | 2 | 4 | 3 | 5 | 6 | 7)[] | undefined;
|
|
640
|
+
}, {
|
|
641
|
+
_id: string;
|
|
642
|
+
kind: "manual";
|
|
643
|
+
operating_mode: "exclude" | "include";
|
|
644
|
+
timepoints: string[];
|
|
645
|
+
year_period_ids: string[];
|
|
646
|
+
event_id?: string | undefined;
|
|
647
|
+
weekdays?: (1 | 2 | 4 | 3 | 5 | 6 | 7)[] | undefined;
|
|
648
|
+
}>, {
|
|
649
|
+
_id: string;
|
|
650
|
+
kind: "manual";
|
|
651
|
+
operating_mode: "exclude" | "include";
|
|
652
|
+
timepoints: (string & z.BRAND<"HHMM">)[];
|
|
653
|
+
year_period_ids: string[];
|
|
654
|
+
event_id?: string | undefined;
|
|
655
|
+
weekdays?: (1 | 2 | 4 | 3 | 5 | 6 | 7)[] | undefined;
|
|
478
656
|
}, {
|
|
479
657
|
_id: string;
|
|
480
658
|
kind: "manual";
|
|
481
659
|
operating_mode: "exclude" | "include";
|
|
482
660
|
timepoints: string[];
|
|
483
|
-
weekdays: (1 | 2 | 4 | 3 | 5 | 6 | 7)[];
|
|
484
661
|
year_period_ids: string[];
|
|
485
662
|
event_id?: string | undefined;
|
|
663
|
+
weekdays?: (1 | 2 | 4 | 3 | 5 | 6 | 7)[] | undefined;
|
|
486
664
|
}>, "many">>;
|
|
487
665
|
export type ScheduleRule = z.infer<typeof ScheduleRuleSchema>;
|
|
488
666
|
export type ManualRule = z.infer<typeof ManualRuleSchema>;
|
package/dist/offer/rules.js
CHANGED
|
@@ -15,16 +15,25 @@ export const LinesModeValues = [
|
|
|
15
15
|
];
|
|
16
16
|
export const LinesModeSchema = z.enum(LinesModeValues);
|
|
17
17
|
/* * */
|
|
18
|
-
export const
|
|
18
|
+
export const ManualRuleBaseSchema = z.object({
|
|
19
19
|
_id: z.string(),
|
|
20
20
|
event_id: z.string().optional(),
|
|
21
21
|
kind: z.literal('manual'),
|
|
22
22
|
name: z.string().optional(),
|
|
23
23
|
operating_mode: OperatingModeSchema,
|
|
24
24
|
timepoints: z.array(HHMMSchema),
|
|
25
|
-
weekdays: z.array(z.nativeEnum(WEEKDAYS)),
|
|
25
|
+
weekdays: z.array(z.nativeEnum(WEEKDAYS)).optional(),
|
|
26
26
|
year_period_ids: z.array(z.string()),
|
|
27
27
|
});
|
|
28
|
+
export const ManualRuleSchema = ManualRuleBaseSchema.superRefine((data, ctx) => {
|
|
29
|
+
if (!data.event_id && !data.weekdays?.length) {
|
|
30
|
+
ctx.addIssue({
|
|
31
|
+
code: z.ZodIssueCode.custom,
|
|
32
|
+
message: 'Selecione pelo menos um dia da semana.',
|
|
33
|
+
path: ['weekdays'],
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
});
|
|
28
37
|
/* * */
|
|
29
38
|
export const EventDerivedBaseSchema = z.object({
|
|
30
39
|
// UI fields
|
|
@@ -54,14 +63,32 @@ export const EventReplacementSchema = EventDerivedBaseSchema.extend({
|
|
|
54
63
|
title: z.string(),
|
|
55
64
|
}),
|
|
56
65
|
kind: z.literal('event_replacement'),
|
|
66
|
+
/**
|
|
67
|
+
* When true, each date in the rule will function as its own actual weekday
|
|
68
|
+
* but within the specified year_period_ids, instead of all dates functioning
|
|
69
|
+
* as the same target weekday(s).
|
|
70
|
+
*/
|
|
71
|
+
same_weekday: z.boolean().optional(),
|
|
57
72
|
weekdays: z.array(z.nativeEnum(WEEKDAYS)),
|
|
58
73
|
year_period_ids: z.array(z.string()),
|
|
59
74
|
});
|
|
60
75
|
export const EventRuleSchema = z.discriminatedUnion('kind', [EventRestrictionSchema, EventReplacementSchema]);
|
|
61
76
|
/* * */
|
|
62
77
|
export const ScheduleRuleSchema = z.discriminatedUnion('kind', [
|
|
63
|
-
|
|
78
|
+
ManualRuleBaseSchema,
|
|
64
79
|
EventRestrictionSchema,
|
|
65
80
|
EventReplacementSchema,
|
|
66
81
|
]);
|
|
67
|
-
export const
|
|
82
|
+
export const PatternUpdateRuleBaseSchema = ManualRuleBaseSchema.omit({ name: true });
|
|
83
|
+
export const PatternUpdateRuleSchema = PatternUpdateRuleBaseSchema.superRefine((data, ctx) => {
|
|
84
|
+
const hasEvent = Boolean(data.event_id);
|
|
85
|
+
const hasWeekdays = Boolean(data.weekdays?.length);
|
|
86
|
+
if (!hasEvent && !hasWeekdays) {
|
|
87
|
+
ctx.addIssue({
|
|
88
|
+
code: z.ZodIssueCode.custom,
|
|
89
|
+
message: 'Selecione pelo menos um dia da semana.',
|
|
90
|
+
path: ['weekdays'],
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
export const PatternUpdateRulesSchema = z.array(PatternUpdateRuleSchema).optional();
|