@floristcloud/api-lib 1.2.84 → 1.2.86
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/build/schemas/action-log/consignment-items-delete-action-log.schema.js +6 -0
- package/build/schemas/order/order.schema.js +3 -0
- package/build/schemas/settings/settings.schema.js +11 -1
- package/package.json +1 -1
- package/schemas/action-log/consignment-items-delete-action-log.schema.ts +7 -0
- package/schemas/order/order.schema.ts +3 -0
- package/schemas/settings/settings.schema.ts +11 -0
|
@@ -2,7 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ConsignmentItemsDeleteActionLogSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const ConsignmentItemBriefSchema = zod_1.z.object({
|
|
6
|
+
productUUID: zod_1.z.string(),
|
|
7
|
+
productName: zod_1.z.string(),
|
|
8
|
+
});
|
|
5
9
|
exports.ConsignmentItemsDeleteActionLogSchema = zod_1.z.object({
|
|
6
10
|
consignmentUUID: zod_1.z.string(),
|
|
7
11
|
count: zod_1.z.coerce.number(),
|
|
12
|
+
// Optional snapshot of deleted items; absent on legacy records and on the consignment-cascade delete (count only).
|
|
13
|
+
products: zod_1.z.array(ConsignmentItemBriefSchema).optional(),
|
|
8
14
|
});
|
|
@@ -58,4 +58,7 @@ exports.OrderExtendedForClientSchema = exports.OrderForClientSchema.extend({
|
|
|
58
58
|
delivery: order_delivery_schema_1.OrderDeliverySchema.nullable(),
|
|
59
59
|
writeOffSum: zod_1.z.number().nullable(),
|
|
60
60
|
consignmentDeliveryDates: zod_1.z.union([zod_1.z.date(), zod_1.z.literal('in-stock')]).array(),
|
|
61
|
+
// Server-computed delivery cost for the current subtotal when the tier rule is on (null when off).
|
|
62
|
+
// Convenience preview for the cart page; the storefront still recomputes locally on the delivery/pickup toggle.
|
|
63
|
+
deliveryCostPreview: zod_1.z.number().nullable(),
|
|
61
64
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UpdateSettingsRequestSchema = exports.CreateSettingsSchema = exports.SettingsForAdminSchema = exports.SettingsSchema = exports.ImportantMessageSchema = exports.SettingsWorkingHoursSchema = void 0;
|
|
3
|
+
exports.UpdateSettingsRequestSchema = exports.CreateSettingsSchema = exports.SettingsForAdminSchema = exports.SettingsSchema = exports.DeliveryPricingTierSchema = exports.ImportantMessageSchema = exports.SettingsWorkingHoursSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const enum_1 = require("../../enum");
|
|
6
6
|
const webshop_main_display_mode_enum_1 = require("../../enum/webshop-main-display-mode.enum");
|
|
@@ -20,6 +20,10 @@ exports.ImportantMessageSchema = zod_1.z.object({
|
|
|
20
20
|
description: zod_1.z.string(),
|
|
21
21
|
isActive: zod_1.z.boolean(),
|
|
22
22
|
});
|
|
23
|
+
exports.DeliveryPricingTierSchema = zod_1.z.object({
|
|
24
|
+
minSubtotal: zod_1.z.number().nonnegative(),
|
|
25
|
+
cost: zod_1.z.number().nonnegative(),
|
|
26
|
+
});
|
|
23
27
|
exports.SettingsSchema = zod_1.z.object({
|
|
24
28
|
uuid: zod_1.z.string(),
|
|
25
29
|
language: zod_1.z.nativeEnum(enum_1.LanguageEnum),
|
|
@@ -84,6 +88,8 @@ exports.SettingsSchema = zod_1.z.object({
|
|
|
84
88
|
isInvoiceDownloadEnabled: zod_1.z.boolean(),
|
|
85
89
|
isBalanceVisible: zod_1.z.boolean(),
|
|
86
90
|
importantMessage: exports.ImportantMessageSchema.nullable(),
|
|
91
|
+
deliveryPricingEnabled: zod_1.z.boolean(),
|
|
92
|
+
deliveryPricingTiers: zod_1.z.array(exports.DeliveryPricingTierSchema).nullable(),
|
|
87
93
|
telegramStaffBotName: zod_1.z.string().nullable().optional(),
|
|
88
94
|
});
|
|
89
95
|
exports.SettingsForAdminSchema = exports.SettingsSchema.extend({
|
|
@@ -165,6 +171,8 @@ exports.CreateSettingsSchema = zod_1.z.object({
|
|
|
165
171
|
chatHasManagerMode: zod_1.z.nativeEnum(enum_1.ChatHasManagerModeEnum).default(enum_1.ChatHasManagerModeEnum.ALL_RW),
|
|
166
172
|
chatNoManagerMode: zod_1.z.nativeEnum(enum_1.ChatNoManagerModeEnum).default(enum_1.ChatNoManagerModeEnum.ANY_MANAGER),
|
|
167
173
|
importantMessage: exports.ImportantMessageSchema.nullable().optional(),
|
|
174
|
+
deliveryPricingEnabled: zod_1.z.coerce.boolean().optional(),
|
|
175
|
+
deliveryPricingTiers: zod_1.z.array(exports.DeliveryPricingTierSchema).nullable().optional(),
|
|
168
176
|
});
|
|
169
177
|
exports.UpdateSettingsRequestSchema = zod_1.z.object({
|
|
170
178
|
language: zod_1.z.nativeEnum(enum_1.LanguageEnum),
|
|
@@ -226,6 +234,8 @@ exports.UpdateSettingsRequestSchema = zod_1.z.object({
|
|
|
226
234
|
chatHasManagerMode: zod_1.z.nativeEnum(enum_1.ChatHasManagerModeEnum).default(enum_1.ChatHasManagerModeEnum.ALL_RW).optional(),
|
|
227
235
|
chatNoManagerMode: zod_1.z.nativeEnum(enum_1.ChatNoManagerModeEnum).default(enum_1.ChatNoManagerModeEnum.ANY_MANAGER).optional(),
|
|
228
236
|
importantMessage: exports.ImportantMessageSchema.nullable().optional(),
|
|
237
|
+
deliveryPricingEnabled: zod_1.z.coerce.boolean().optional(),
|
|
238
|
+
deliveryPricingTiers: zod_1.z.array(exports.DeliveryPricingTierSchema).nullable().optional(),
|
|
229
239
|
// post terminal settings
|
|
230
240
|
vatTag: zod_1.z.string().nullable().optional(),
|
|
231
241
|
taxMode: zod_1.z.string().nullable().optional(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
|
+
const ConsignmentItemBriefSchema = z.object({
|
|
4
|
+
productUUID: z.string(),
|
|
5
|
+
productName: z.string(),
|
|
6
|
+
});
|
|
7
|
+
|
|
3
8
|
export const ConsignmentItemsDeleteActionLogSchema = z.object({
|
|
4
9
|
consignmentUUID: z.string(),
|
|
5
10
|
count: z.coerce.number(),
|
|
11
|
+
// Optional snapshot of deleted items; absent on legacy records and on the consignment-cascade delete (count only).
|
|
12
|
+
products: z.array(ConsignmentItemBriefSchema).optional(),
|
|
6
13
|
});
|
|
@@ -65,4 +65,7 @@ export const OrderExtendedForClientSchema = OrderForClientSchema.extend({
|
|
|
65
65
|
delivery: OrderDeliverySchema.nullable(),
|
|
66
66
|
writeOffSum: z.number().nullable(),
|
|
67
67
|
consignmentDeliveryDates: z.union([z.date(), z.literal('in-stock')]).array(),
|
|
68
|
+
// Server-computed delivery cost for the current subtotal when the tier rule is on (null when off).
|
|
69
|
+
// Convenience preview for the cart page; the storefront still recomputes locally on the delivery/pickup toggle.
|
|
70
|
+
deliveryCostPreview: z.number().nullable(),
|
|
68
71
|
});
|
|
@@ -20,6 +20,11 @@ export const ImportantMessageSchema = z.object({
|
|
|
20
20
|
isActive: z.boolean(),
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
+
export const DeliveryPricingTierSchema = z.object({
|
|
24
|
+
minSubtotal: z.number().nonnegative(),
|
|
25
|
+
cost: z.number().nonnegative(),
|
|
26
|
+
});
|
|
27
|
+
|
|
23
28
|
export const SettingsSchema = z.object({
|
|
24
29
|
uuid: z.string(),
|
|
25
30
|
language: z.nativeEnum(LanguageEnum),
|
|
@@ -84,6 +89,8 @@ export const SettingsSchema = z.object({
|
|
|
84
89
|
isInvoiceDownloadEnabled: z.boolean(),
|
|
85
90
|
isBalanceVisible: z.boolean(),
|
|
86
91
|
importantMessage: ImportantMessageSchema.nullable(),
|
|
92
|
+
deliveryPricingEnabled: z.boolean(),
|
|
93
|
+
deliveryPricingTiers: z.array(DeliveryPricingTierSchema).nullable(),
|
|
87
94
|
telegramStaffBotName: z.string().nullable().optional(),
|
|
88
95
|
});
|
|
89
96
|
|
|
@@ -169,6 +176,8 @@ export const CreateSettingsSchema = z.object({
|
|
|
169
176
|
chatHasManagerMode: z.nativeEnum(ChatHasManagerModeEnum).default(ChatHasManagerModeEnum.ALL_RW),
|
|
170
177
|
chatNoManagerMode: z.nativeEnum(ChatNoManagerModeEnum).default(ChatNoManagerModeEnum.ANY_MANAGER),
|
|
171
178
|
importantMessage: ImportantMessageSchema.nullable().optional(),
|
|
179
|
+
deliveryPricingEnabled: z.coerce.boolean().optional(),
|
|
180
|
+
deliveryPricingTiers: z.array(DeliveryPricingTierSchema).nullable().optional(),
|
|
172
181
|
});
|
|
173
182
|
|
|
174
183
|
export const UpdateSettingsRequestSchema = z.object({
|
|
@@ -233,6 +242,8 @@ export const UpdateSettingsRequestSchema = z.object({
|
|
|
233
242
|
chatHasManagerMode: z.nativeEnum(ChatHasManagerModeEnum).default(ChatHasManagerModeEnum.ALL_RW).optional(),
|
|
234
243
|
chatNoManagerMode: z.nativeEnum(ChatNoManagerModeEnum).default(ChatNoManagerModeEnum.ANY_MANAGER).optional(),
|
|
235
244
|
importantMessage: ImportantMessageSchema.nullable().optional(),
|
|
245
|
+
deliveryPricingEnabled: z.coerce.boolean().optional(),
|
|
246
|
+
deliveryPricingTiers: z.array(DeliveryPricingTierSchema).nullable().optional(),
|
|
236
247
|
// post terminal settings
|
|
237
248
|
vatTag: z.string().nullable().optional(),
|
|
238
249
|
taxMode: z.string().nullable().optional(),
|