@floristcloud/api-lib 1.2.119 → 1.2.120

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.
@@ -19,7 +19,15 @@ const GetOrderListRequestSchema = zod_1.z
19
19
  clientUUID: zod_1.z.string().optional(),
20
20
  searchQuery: zod_1.z.string().optional(),
21
21
  consignmentDeliveryDate: zod_1.z.coerce.date().optional(),
22
+ /**
23
+ * @deprecated Используйте `deliveryDateFrom` / `deliveryDateTo`. Оставлен ради сохранённых
24
+ * ссылок и MCP-клиентов: трактуется как период из одного дня (from = to = deliveryDate).
25
+ */
22
26
  deliveryDate: zod_1.z.coerce.date().optional(),
27
+ // Календарные даты, а не моменты: сутки разворачиваются на бэке по таймзоне компании
28
+ // (`resolveLocalDayPeriod`), поэтому здесь достаточно дня, закодированного полночью UTC.
29
+ deliveryDateFrom: zod_1.z.coerce.date().optional(),
30
+ deliveryDateTo: zod_1.z.coerce.date().optional(),
23
31
  byProductSearchQuery: zod_1.z.string().optional(),
24
32
  statuses: zod_1.z.nativeEnum(enum_1.OrderStatusEnum).array().optional(),
25
33
  type: zod_1.z.nativeEnum(enum_1.OrderTypeEnum).optional(),
@@ -43,6 +51,16 @@ const GetOrderListRequestSchema = zod_1.z
43
51
  }, {
44
52
  message: 'validation.dateRange',
45
53
  path: ['endDate', 'startDate'],
54
+ })
55
+ .refine(value => {
56
+ const { deliveryDateFrom, deliveryDateTo } = value;
57
+ if (deliveryDateFrom && deliveryDateTo) {
58
+ return (0, date_helper_1.dateRangeCheck)(deliveryDateFrom, deliveryDateTo);
59
+ }
60
+ return true;
61
+ }, {
62
+ message: 'validation.dateRange',
63
+ path: ['deliveryDateTo', 'deliveryDateFrom'],
46
64
  });
47
65
  const GetOrderListResponseSchema = zod_1.z.object({
48
66
  message: zod_1.z.string().optional(),
@@ -17,7 +17,15 @@ const GetOrderListRequestSchema = z
17
17
  clientUUID: z.string().optional(),
18
18
  searchQuery: z.string().optional(),
19
19
  consignmentDeliveryDate: z.coerce.date().optional(),
20
+ /**
21
+ * @deprecated Используйте `deliveryDateFrom` / `deliveryDateTo`. Оставлен ради сохранённых
22
+ * ссылок и MCP-клиентов: трактуется как период из одного дня (from = to = deliveryDate).
23
+ */
20
24
  deliveryDate: z.coerce.date().optional(),
25
+ // Календарные даты, а не моменты: сутки разворачиваются на бэке по таймзоне компании
26
+ // (`resolveLocalDayPeriod`), поэтому здесь достаточно дня, закодированного полночью UTC.
27
+ deliveryDateFrom: z.coerce.date().optional(),
28
+ deliveryDateTo: z.coerce.date().optional(),
21
29
  byProductSearchQuery: z.string().optional(),
22
30
  statuses: z.nativeEnum(OrderStatusEnum).array().optional(),
23
31
  type: z.nativeEnum(OrderTypeEnum).optional(),
@@ -44,6 +52,19 @@ const GetOrderListRequestSchema = z
44
52
  message: 'validation.dateRange',
45
53
  path: ['endDate', 'startDate'],
46
54
  },
55
+ )
56
+ .refine(
57
+ value => {
58
+ const { deliveryDateFrom, deliveryDateTo } = value;
59
+ if (deliveryDateFrom && deliveryDateTo) {
60
+ return dateRangeCheck(deliveryDateFrom, deliveryDateTo);
61
+ }
62
+ return true;
63
+ },
64
+ {
65
+ message: 'validation.dateRange',
66
+ path: ['deliveryDateTo', 'deliveryDateFrom'],
67
+ },
47
68
  );
48
69
 
49
70
  const GetOrderListResponseSchema = z.object({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floristcloud/api-lib",
3
- "version": "1.2.119",
3
+ "version": "1.2.120",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {