@floristcloud/api-lib 1.2.83 → 1.2.85
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/commands/consignment-import-schema/get-consignment-import-schema-template-file.query.js +8 -0
- package/build/commands/consignment-import-schema/index.js +1 -0
- package/build/constant/error.js +5 -0
- package/build/schemas/consignment-import-schema/get-consignment-import-schema-template-file.schema.js +9 -0
- package/build/schemas/consignment-import-schema/index.js +1 -0
- package/build/schemas/order/order.schema.js +3 -0
- package/build/schemas/settings/settings.schema.js +11 -1
- package/commands/consignment-import-schema/get-consignment-import-schema-template-file.query.ts +7 -0
- package/commands/consignment-import-schema/index.ts +1 -0
- package/constant/error.ts +5 -0
- package/package.json +1 -1
- package/schemas/consignment-import-schema/get-consignment-import-schema-template-file.schema.ts +7 -0
- package/schemas/consignment-import-schema/index.ts +1 -0
- package/schemas/order/order.schema.ts +3 -0
- package/schemas/settings/settings.schema.ts +11 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetConsignmentImportSchemaTemplateFileContractQuery = void 0;
|
|
4
|
+
const consignment_import_schema_1 = require("../../schemas/consignment-import-schema");
|
|
5
|
+
var GetConsignmentImportSchemaTemplateFileContractQuery;
|
|
6
|
+
(function (GetConsignmentImportSchemaTemplateFileContractQuery) {
|
|
7
|
+
GetConsignmentImportSchemaTemplateFileContractQuery.ResponseSchema = consignment_import_schema_1.GetConsignmentImportSchemaTemplateFileResponseSchema;
|
|
8
|
+
})(GetConsignmentImportSchemaTemplateFileContractQuery || (exports.GetConsignmentImportSchemaTemplateFileContractQuery = GetConsignmentImportSchemaTemplateFileContractQuery = {}));
|
|
@@ -17,3 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./create-consignment-import-scheme.command"), exports);
|
|
18
18
|
__exportStar(require("./update-consignment-import-schema.command"), exports);
|
|
19
19
|
__exportStar(require("./get-consignment-import-schema-template.query"), exports);
|
|
20
|
+
__exportStar(require("./get-consignment-import-schema-template-file.query"), exports);
|
package/build/constant/error.js
CHANGED
|
@@ -270,6 +270,11 @@ exports.ERRORS = {
|
|
|
270
270
|
message: 'Default consignment import scheme cannot be deleted',
|
|
271
271
|
httpCode: 400,
|
|
272
272
|
},
|
|
273
|
+
CONSIGNMENT_IMPORT_SCHEME_TEMPLATE_FILE_FAILED: {
|
|
274
|
+
code: 'CS008',
|
|
275
|
+
message: 'Failed to build consignment import scheme template file',
|
|
276
|
+
httpCode: 500,
|
|
277
|
+
},
|
|
273
278
|
// CONSIGNMENT-IMPORT-SCHEMA-RELATION
|
|
274
279
|
CONSIGNMENT_IMPORT_SCHEMA_RELATION_NOT_CREATED: {
|
|
275
280
|
code: 'CSR001',
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetConsignmentImportSchemaTemplateFileResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.GetConsignmentImportSchemaTemplateFileResponseSchema = zod_1.z.object({
|
|
6
|
+
data: zod_1.z.object({
|
|
7
|
+
url: zod_1.z.string().url(),
|
|
8
|
+
}),
|
|
9
|
+
});
|
|
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./consignment-import-schema.scheme"), exports);
|
|
18
|
+
__exportStar(require("./get-consignment-import-schema-template-file.schema"), exports);
|
|
@@ -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/commands/consignment-import-schema/get-consignment-import-schema-template-file.query.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { GetConsignmentImportSchemaTemplateFileResponseSchema } from '../../schemas/consignment-import-schema';
|
|
3
|
+
|
|
4
|
+
export namespace GetConsignmentImportSchemaTemplateFileContractQuery {
|
|
5
|
+
export const ResponseSchema = GetConsignmentImportSchemaTemplateFileResponseSchema;
|
|
6
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
7
|
+
}
|
package/constant/error.ts
CHANGED
|
@@ -280,6 +280,11 @@ export const ERRORS = {
|
|
|
280
280
|
message: 'Default consignment import scheme cannot be deleted',
|
|
281
281
|
httpCode: 400,
|
|
282
282
|
},
|
|
283
|
+
CONSIGNMENT_IMPORT_SCHEME_TEMPLATE_FILE_FAILED: {
|
|
284
|
+
code: 'CS008',
|
|
285
|
+
message: 'Failed to build consignment import scheme template file',
|
|
286
|
+
httpCode: 500,
|
|
287
|
+
},
|
|
283
288
|
|
|
284
289
|
// CONSIGNMENT-IMPORT-SCHEMA-RELATION
|
|
285
290
|
CONSIGNMENT_IMPORT_SCHEMA_RELATION_NOT_CREATED: {
|
package/package.json
CHANGED
|
@@ -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(),
|