@floristcloud/api-lib 1.2.87 → 1.2.89
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/enum/action-log-type.enum.js +2 -0
- package/build/enum/color-code.enum.js +2 -0
- package/build/enum/group-update-consignment-items-operation.enum.js +10 -0
- package/build/enum/index.js +1 -0
- package/build/schemas/action-log/action-log-payload.schema.js +4 -0
- package/build/schemas/action-log/action-log.schema.js +14 -0
- package/build/schemas/action-log/group-update-consignment-items-action-log.schema.js +22 -0
- package/build/schemas/action-log/index.js +2 -0
- package/build/schemas/action-log/transfer-consignment-items-action-log.schema.js +14 -0
- package/enum/action-log-type.enum.ts +2 -0
- package/enum/color-code.enum.ts +2 -0
- package/enum/group-update-consignment-items-operation.enum.ts +6 -0
- package/enum/index.ts +1 -0
- package/package.json +1 -1
- package/schemas/action-log/action-log-payload.schema.ts +4 -0
- package/schemas/action-log/action-log.schema.ts +14 -0
- package/schemas/action-log/group-update-consignment-items-action-log.schema.ts +22 -0
- package/schemas/action-log/index.ts +2 -0
- package/schemas/action-log/transfer-consignment-items-action-log.schema.ts +13 -0
|
@@ -21,4 +21,6 @@ var ActionLogTypeEnum;
|
|
|
21
21
|
ActionLogTypeEnum["UPDATE_CONSIGNMENT_ITEM"] = "UPDATE_CONSIGNMENT_ITEM";
|
|
22
22
|
ActionLogTypeEnum["CREATE_CONSIGNMENT_ITEMS"] = "CREATE_CONSIGNMENT_ITEMS";
|
|
23
23
|
ActionLogTypeEnum["DELETE_CONSIGNMENT_ITEMS"] = "DELETE_CONSIGNMENT_ITEMS";
|
|
24
|
+
ActionLogTypeEnum["GROUP_UPDATE_CONSIGNMENT_ITEMS"] = "GROUP_UPDATE_CONSIGNMENT_ITEMS";
|
|
25
|
+
ActionLogTypeEnum["TRANSFER_CONSIGNMENT_ITEMS"] = "TRANSFER_CONSIGNMENT_ITEMS";
|
|
24
26
|
})(ActionLogTypeEnum || (exports.ActionLogTypeEnum = ActionLogTypeEnum = {}));
|
|
@@ -5,6 +5,8 @@ var ColorCodeEnum;
|
|
|
5
5
|
(function (ColorCodeEnum) {
|
|
6
6
|
ColorCodeEnum["RED"] = "red";
|
|
7
7
|
ColorCodeEnum["PINK"] = "pink";
|
|
8
|
+
ColorCodeEnum["LIGHT_PINK"] = "light-pink";
|
|
9
|
+
ColorCodeEnum["BRIGHT_PINK"] = "bright-pink";
|
|
8
10
|
ColorCodeEnum["WHITE"] = "white";
|
|
9
11
|
ColorCodeEnum["YELLOW"] = "yellow";
|
|
10
12
|
ColorCodeEnum["ORANGE"] = "orange";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GroupUpdateConsignmentItemsOperationEnum = void 0;
|
|
4
|
+
var GroupUpdateConsignmentItemsOperationEnum;
|
|
5
|
+
(function (GroupUpdateConsignmentItemsOperationEnum) {
|
|
6
|
+
GroupUpdateConsignmentItemsOperationEnum["PRICES"] = "prices";
|
|
7
|
+
GroupUpdateConsignmentItemsOperationEnum["UPDATE_BATCH"] = "update-batch";
|
|
8
|
+
GroupUpdateConsignmentItemsOperationEnum["CATEGORY"] = "category";
|
|
9
|
+
GroupUpdateConsignmentItemsOperationEnum["IS_OPEN"] = "is-open";
|
|
10
|
+
})(GroupUpdateConsignmentItemsOperationEnum || (exports.GroupUpdateConsignmentItemsOperationEnum = GroupUpdateConsignmentItemsOperationEnum = {}));
|
package/build/enum/index.js
CHANGED
|
@@ -58,6 +58,7 @@ __exportStar(require("./consignment-distribution-validation-type.enum"), exports
|
|
|
58
58
|
__exportStar(require("./consignment-access-client-status.enum"), exports);
|
|
59
59
|
__exportStar(require("./client-legal-type.enum"), exports);
|
|
60
60
|
__exportStar(require("./action-log-type.enum"), exports);
|
|
61
|
+
__exportStar(require("./group-update-consignment-items-operation.enum"), exports);
|
|
61
62
|
__exportStar(require("./write-off-status.enum"), exports);
|
|
62
63
|
__exportStar(require("./position-report-type.enum"), exports);
|
|
63
64
|
__exportStar(require("./discount-price-routing.enum"), exports);
|
|
@@ -18,6 +18,8 @@ const pre_order_product_delete_action_log_schema_1 = require("./pre-order-produc
|
|
|
18
18
|
const consignment_product_update_action_log_schema_1 = require("./consignment-product-update-action-log.schema");
|
|
19
19
|
const consignment_items_create_action_log_schema_1 = require("./consignment-items-create-action-log.schema");
|
|
20
20
|
const consignment_items_delete_action_log_schema_1 = require("./consignment-items-delete-action-log.schema");
|
|
21
|
+
const group_update_consignment_items_action_log_schema_1 = require("./group-update-consignment-items-action-log.schema");
|
|
22
|
+
const transfer_consignment_items_action_log_schema_1 = require("./transfer-consignment-items-action-log.schema");
|
|
21
23
|
exports.ActionLogPayloadSchema = zod_1.z.union([
|
|
22
24
|
order_delete_action_log_payload_schema_1.OrderDeleteActionLogPayloadSchema,
|
|
23
25
|
order_merge_action_log_schema_1.OrderMergeActionLogSchema,
|
|
@@ -35,5 +37,7 @@ exports.ActionLogPayloadSchema = zod_1.z.union([
|
|
|
35
37
|
consignment_product_update_action_log_schema_1.ConsignmentProductUpdateActionLogSchema,
|
|
36
38
|
consignment_items_create_action_log_schema_1.ConsignmentItemsCreateActionLogSchema,
|
|
37
39
|
consignment_items_delete_action_log_schema_1.ConsignmentItemsDeleteActionLogSchema,
|
|
40
|
+
group_update_consignment_items_action_log_schema_1.GroupUpdateConsignmentItemsActionLogSchema,
|
|
41
|
+
transfer_consignment_items_action_log_schema_1.TransferConsignmentItemsActionLogSchema,
|
|
38
42
|
zod_1.z.null(),
|
|
39
43
|
]);
|
|
@@ -20,6 +20,8 @@ const pre_order_product_delete_action_log_schema_1 = require("./pre-order-produc
|
|
|
20
20
|
const consignment_product_update_action_log_schema_1 = require("./consignment-product-update-action-log.schema");
|
|
21
21
|
const consignment_items_create_action_log_schema_1 = require("./consignment-items-create-action-log.schema");
|
|
22
22
|
const consignment_items_delete_action_log_schema_1 = require("./consignment-items-delete-action-log.schema");
|
|
23
|
+
const group_update_consignment_items_action_log_schema_1 = require("./group-update-consignment-items-action-log.schema");
|
|
24
|
+
const transfer_consignment_items_action_log_schema_1 = require("./transfer-consignment-items-action-log.schema");
|
|
23
25
|
const BaseActionFields = zod_1.z.object({
|
|
24
26
|
uuid: zod_1.z.string(),
|
|
25
27
|
companyUUID: zod_1.z.string(),
|
|
@@ -136,6 +138,18 @@ exports.ActionLogSchema = zod_1.z.discriminatedUnion('actionType', [
|
|
|
136
138
|
payload: consignment_items_delete_action_log_schema_1.ConsignmentItemsDeleteActionLogSchema,
|
|
137
139
|
})
|
|
138
140
|
.merge(BaseActionFields),
|
|
141
|
+
zod_1.z
|
|
142
|
+
.object({
|
|
143
|
+
actionType: zod_1.z.literal(enum_1.ActionLogTypeEnum.GROUP_UPDATE_CONSIGNMENT_ITEMS),
|
|
144
|
+
payload: group_update_consignment_items_action_log_schema_1.GroupUpdateConsignmentItemsActionLogSchema,
|
|
145
|
+
})
|
|
146
|
+
.merge(BaseActionFields),
|
|
147
|
+
zod_1.z
|
|
148
|
+
.object({
|
|
149
|
+
actionType: zod_1.z.literal(enum_1.ActionLogTypeEnum.TRANSFER_CONSIGNMENT_ITEMS),
|
|
150
|
+
payload: transfer_consignment_items_action_log_schema_1.TransferConsignmentItemsActionLogSchema,
|
|
151
|
+
})
|
|
152
|
+
.merge(BaseActionFields),
|
|
139
153
|
]);
|
|
140
154
|
exports.CreateActionLogSchema = zod_1.z.object({
|
|
141
155
|
actionType: zod_1.z.nativeEnum(enum_1.ActionLogTypeEnum),
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GroupUpdateConsignmentItemsActionLogSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const enum_1 = require("../../enum");
|
|
6
|
+
const ConsignmentItemBriefSchema = zod_1.z.object({
|
|
7
|
+
productUUID: zod_1.z.string(),
|
|
8
|
+
productName: zod_1.z.string(),
|
|
9
|
+
});
|
|
10
|
+
const ChangedFieldSchema = zod_1.z.object({
|
|
11
|
+
field: zod_1.z.string(),
|
|
12
|
+
// Absent when the value differs per product (e.g. batch price update with per-item prices).
|
|
13
|
+
newValue: zod_1.z.union([zod_1.z.string(), zod_1.z.number(), zod_1.z.boolean(), zod_1.z.null()]).optional(),
|
|
14
|
+
});
|
|
15
|
+
exports.GroupUpdateConsignmentItemsActionLogSchema = zod_1.z.object({
|
|
16
|
+
consignmentUUID: zod_1.z.string(),
|
|
17
|
+
operation: zod_1.z.nativeEnum(enum_1.GroupUpdateConsignmentItemsOperationEnum),
|
|
18
|
+
count: zod_1.z.coerce.number(),
|
|
19
|
+
changedFields: zod_1.z.array(ChangedFieldSchema),
|
|
20
|
+
// Optional snapshot of affected items; may be omitted for very large edits.
|
|
21
|
+
products: zod_1.z.array(ConsignmentItemBriefSchema).optional(),
|
|
22
|
+
});
|
|
@@ -35,3 +35,5 @@ __exportStar(require("./consignment-product-info.schema"), exports);
|
|
|
35
35
|
__exportStar(require("./consignment-product-update-action-log.schema"), exports);
|
|
36
36
|
__exportStar(require("./consignment-items-create-action-log.schema"), exports);
|
|
37
37
|
__exportStar(require("./consignment-items-delete-action-log.schema"), exports);
|
|
38
|
+
__exportStar(require("./group-update-consignment-items-action-log.schema"), exports);
|
|
39
|
+
__exportStar(require("./transfer-consignment-items-action-log.schema"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TransferConsignmentItemsActionLogSchema = void 0;
|
|
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
|
+
});
|
|
9
|
+
exports.TransferConsignmentItemsActionLogSchema = zod_1.z.object({
|
|
10
|
+
fromConsignmentUUID: zod_1.z.string(),
|
|
11
|
+
toConsignmentUUID: zod_1.z.string(),
|
|
12
|
+
count: zod_1.z.coerce.number(),
|
|
13
|
+
products: zod_1.z.array(ConsignmentItemBriefSchema),
|
|
14
|
+
});
|
|
@@ -17,4 +17,6 @@ export enum ActionLogTypeEnum {
|
|
|
17
17
|
UPDATE_CONSIGNMENT_ITEM = 'UPDATE_CONSIGNMENT_ITEM',
|
|
18
18
|
CREATE_CONSIGNMENT_ITEMS = 'CREATE_CONSIGNMENT_ITEMS',
|
|
19
19
|
DELETE_CONSIGNMENT_ITEMS = 'DELETE_CONSIGNMENT_ITEMS',
|
|
20
|
+
GROUP_UPDATE_CONSIGNMENT_ITEMS = 'GROUP_UPDATE_CONSIGNMENT_ITEMS',
|
|
21
|
+
TRANSFER_CONSIGNMENT_ITEMS = 'TRANSFER_CONSIGNMENT_ITEMS',
|
|
20
22
|
}
|
package/enum/color-code.enum.ts
CHANGED
package/enum/index.ts
CHANGED
|
@@ -42,6 +42,7 @@ export * from './consignment-distribution-validation-type.enum';
|
|
|
42
42
|
export * from './consignment-access-client-status.enum';
|
|
43
43
|
export * from './client-legal-type.enum';
|
|
44
44
|
export * from './action-log-type.enum';
|
|
45
|
+
export * from './group-update-consignment-items-operation.enum';
|
|
45
46
|
export * from './write-off-status.enum';
|
|
46
47
|
export * from './position-report-type.enum';
|
|
47
48
|
export * from './discount-price-routing.enum';
|
package/package.json
CHANGED
|
@@ -15,6 +15,8 @@ import { PreOrderProductDeleteActionLogSchema } from './pre-order-product-delete
|
|
|
15
15
|
import { ConsignmentProductUpdateActionLogSchema } from './consignment-product-update-action-log.schema';
|
|
16
16
|
import { ConsignmentItemsCreateActionLogSchema } from './consignment-items-create-action-log.schema';
|
|
17
17
|
import { ConsignmentItemsDeleteActionLogSchema } from './consignment-items-delete-action-log.schema';
|
|
18
|
+
import { GroupUpdateConsignmentItemsActionLogSchema } from './group-update-consignment-items-action-log.schema';
|
|
19
|
+
import { TransferConsignmentItemsActionLogSchema } from './transfer-consignment-items-action-log.schema';
|
|
18
20
|
|
|
19
21
|
export const ActionLogPayloadSchema = z.union([
|
|
20
22
|
OrderDeleteActionLogPayloadSchema,
|
|
@@ -33,5 +35,7 @@ export const ActionLogPayloadSchema = z.union([
|
|
|
33
35
|
ConsignmentProductUpdateActionLogSchema,
|
|
34
36
|
ConsignmentItemsCreateActionLogSchema,
|
|
35
37
|
ConsignmentItemsDeleteActionLogSchema,
|
|
38
|
+
GroupUpdateConsignmentItemsActionLogSchema,
|
|
39
|
+
TransferConsignmentItemsActionLogSchema,
|
|
36
40
|
z.null(),
|
|
37
41
|
]);
|
|
@@ -17,6 +17,8 @@ import { PreOrderProductDeleteActionLogSchema } from './pre-order-product-delete
|
|
|
17
17
|
import { ConsignmentProductUpdateActionLogSchema } from './consignment-product-update-action-log.schema';
|
|
18
18
|
import { ConsignmentItemsCreateActionLogSchema } from './consignment-items-create-action-log.schema';
|
|
19
19
|
import { ConsignmentItemsDeleteActionLogSchema } from './consignment-items-delete-action-log.schema';
|
|
20
|
+
import { GroupUpdateConsignmentItemsActionLogSchema } from './group-update-consignment-items-action-log.schema';
|
|
21
|
+
import { TransferConsignmentItemsActionLogSchema } from './transfer-consignment-items-action-log.schema';
|
|
20
22
|
|
|
21
23
|
const BaseActionFields = z.object({
|
|
22
24
|
uuid: z.string(),
|
|
@@ -135,6 +137,18 @@ export const ActionLogSchema = z.discriminatedUnion('actionType', [
|
|
|
135
137
|
payload: ConsignmentItemsDeleteActionLogSchema,
|
|
136
138
|
})
|
|
137
139
|
.merge(BaseActionFields),
|
|
140
|
+
z
|
|
141
|
+
.object({
|
|
142
|
+
actionType: z.literal(ActionLogTypeEnum.GROUP_UPDATE_CONSIGNMENT_ITEMS),
|
|
143
|
+
payload: GroupUpdateConsignmentItemsActionLogSchema,
|
|
144
|
+
})
|
|
145
|
+
.merge(BaseActionFields),
|
|
146
|
+
z
|
|
147
|
+
.object({
|
|
148
|
+
actionType: z.literal(ActionLogTypeEnum.TRANSFER_CONSIGNMENT_ITEMS),
|
|
149
|
+
payload: TransferConsignmentItemsActionLogSchema,
|
|
150
|
+
})
|
|
151
|
+
.merge(BaseActionFields),
|
|
138
152
|
]);
|
|
139
153
|
|
|
140
154
|
export const CreateActionLogSchema = z.object({
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { GroupUpdateConsignmentItemsOperationEnum } from '../../enum';
|
|
3
|
+
|
|
4
|
+
const ConsignmentItemBriefSchema = z.object({
|
|
5
|
+
productUUID: z.string(),
|
|
6
|
+
productName: z.string(),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
const ChangedFieldSchema = z.object({
|
|
10
|
+
field: z.string(),
|
|
11
|
+
// Absent when the value differs per product (e.g. batch price update with per-item prices).
|
|
12
|
+
newValue: z.union([z.string(), z.number(), z.boolean(), z.null()]).optional(),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export const GroupUpdateConsignmentItemsActionLogSchema = z.object({
|
|
16
|
+
consignmentUUID: z.string(),
|
|
17
|
+
operation: z.nativeEnum(GroupUpdateConsignmentItemsOperationEnum),
|
|
18
|
+
count: z.coerce.number(),
|
|
19
|
+
changedFields: z.array(ChangedFieldSchema),
|
|
20
|
+
// Optional snapshot of affected items; may be omitted for very large edits.
|
|
21
|
+
products: z.array(ConsignmentItemBriefSchema).optional(),
|
|
22
|
+
});
|
|
@@ -19,3 +19,5 @@ export * from './consignment-product-info.schema';
|
|
|
19
19
|
export * from './consignment-product-update-action-log.schema';
|
|
20
20
|
export * from './consignment-items-create-action-log.schema';
|
|
21
21
|
export * from './consignment-items-delete-action-log.schema';
|
|
22
|
+
export * from './group-update-consignment-items-action-log.schema';
|
|
23
|
+
export * from './transfer-consignment-items-action-log.schema';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
const ConsignmentItemBriefSchema = z.object({
|
|
4
|
+
productUUID: z.string(),
|
|
5
|
+
productName: z.string(),
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export const TransferConsignmentItemsActionLogSchema = z.object({
|
|
9
|
+
fromConsignmentUUID: z.string(),
|
|
10
|
+
toConsignmentUUID: z.string(),
|
|
11
|
+
count: z.coerce.number(),
|
|
12
|
+
products: z.array(ConsignmentItemBriefSchema),
|
|
13
|
+
});
|