@floristcloud/api-lib 1.2.78 → 1.2.80

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.
@@ -18,4 +18,7 @@ var ActionLogTypeEnum;
18
18
  ActionLogTypeEnum["DELETE_PREORDER"] = "DELETE_PREORDER";
19
19
  ActionLogTypeEnum["DELETE_PREORDER_ITEM"] = "DELETE_PREORDER_ITEM";
20
20
  ActionLogTypeEnum["UPDATE_PREORDER_ITEM"] = "UPDATE_PREORDER_ITEM";
21
+ ActionLogTypeEnum["UPDATE_CONSIGNMENT_ITEM"] = "UPDATE_CONSIGNMENT_ITEM";
22
+ ActionLogTypeEnum["CREATE_CONSIGNMENT_ITEMS"] = "CREATE_CONSIGNMENT_ITEMS";
23
+ ActionLogTypeEnum["DELETE_CONSIGNMENT_ITEMS"] = "DELETE_CONSIGNMENT_ITEMS";
21
24
  })(ActionLogTypeEnum || (exports.ActionLogTypeEnum = ActionLogTypeEnum = {}));
@@ -12,4 +12,5 @@ var MenuItemsUrlEnum;
12
12
  MenuItemsUrlEnum["REPORT"] = "/report";
13
13
  MenuItemsUrlEnum["STAFF"] = "/staff";
14
14
  MenuItemsUrlEnum["COMPANY"] = "/company";
15
+ MenuItemsUrlEnum["TEMPLATE"] = "/template";
15
16
  })(MenuItemsUrlEnum || (exports.MenuItemsUrlEnum = MenuItemsUrlEnum = {}));
@@ -15,6 +15,9 @@ const pre_order_create_action_log_schema_1 = require("./pre-order-create-action-
15
15
  const pre_order_delete_action_log_schema_1 = require("./pre-order-delete-action-log.schema");
16
16
  const pre_order_product_update_action_log_schema_1 = require("./pre-order-product-update-action-log.schema");
17
17
  const pre_order_product_delete_action_log_schema_1 = require("./pre-order-product-delete-action-log.schema");
18
+ const consignment_product_update_action_log_schema_1 = require("./consignment-product-update-action-log.schema");
19
+ const consignment_items_create_action_log_schema_1 = require("./consignment-items-create-action-log.schema");
20
+ const consignment_items_delete_action_log_schema_1 = require("./consignment-items-delete-action-log.schema");
18
21
  exports.ActionLogPayloadSchema = zod_1.z.union([
19
22
  order_delete_action_log_payload_schema_1.OrderDeleteActionLogPayloadSchema,
20
23
  order_merge_action_log_schema_1.OrderMergeActionLogSchema,
@@ -29,5 +32,8 @@ exports.ActionLogPayloadSchema = zod_1.z.union([
29
32
  pre_order_delete_action_log_schema_1.PreOrderDeleteActionLogSchema,
30
33
  pre_order_product_update_action_log_schema_1.PreOrderProductUpdateActionLogSchema,
31
34
  pre_order_product_delete_action_log_schema_1.PreOrderProductDeleteActionLogSchema,
35
+ consignment_product_update_action_log_schema_1.ConsignmentProductUpdateActionLogSchema,
36
+ consignment_items_create_action_log_schema_1.ConsignmentItemsCreateActionLogSchema,
37
+ consignment_items_delete_action_log_schema_1.ConsignmentItemsDeleteActionLogSchema,
32
38
  zod_1.z.null(),
33
39
  ]);
@@ -17,6 +17,9 @@ const pre_order_create_action_log_schema_1 = require("./pre-order-create-action-
17
17
  const pre_order_delete_action_log_schema_1 = require("./pre-order-delete-action-log.schema");
18
18
  const pre_order_product_update_action_log_schema_1 = require("./pre-order-product-update-action-log.schema");
19
19
  const pre_order_product_delete_action_log_schema_1 = require("./pre-order-product-delete-action-log.schema");
20
+ const consignment_product_update_action_log_schema_1 = require("./consignment-product-update-action-log.schema");
21
+ const consignment_items_create_action_log_schema_1 = require("./consignment-items-create-action-log.schema");
22
+ const consignment_items_delete_action_log_schema_1 = require("./consignment-items-delete-action-log.schema");
20
23
  const BaseActionFields = zod_1.z.object({
21
24
  uuid: zod_1.z.string(),
22
25
  companyUUID: zod_1.z.string(),
@@ -115,6 +118,24 @@ exports.ActionLogSchema = zod_1.z.discriminatedUnion('actionType', [
115
118
  payload: zod_1.z.null(),
116
119
  })
117
120
  .merge(BaseActionFields),
121
+ zod_1.z
122
+ .object({
123
+ actionType: zod_1.z.literal(enum_1.ActionLogTypeEnum.UPDATE_CONSIGNMENT_ITEM),
124
+ payload: consignment_product_update_action_log_schema_1.ConsignmentProductUpdateActionLogSchema,
125
+ })
126
+ .merge(BaseActionFields),
127
+ zod_1.z
128
+ .object({
129
+ actionType: zod_1.z.literal(enum_1.ActionLogTypeEnum.CREATE_CONSIGNMENT_ITEMS),
130
+ payload: consignment_items_create_action_log_schema_1.ConsignmentItemsCreateActionLogSchema,
131
+ })
132
+ .merge(BaseActionFields),
133
+ zod_1.z
134
+ .object({
135
+ actionType: zod_1.z.literal(enum_1.ActionLogTypeEnum.DELETE_CONSIGNMENT_ITEMS),
136
+ payload: consignment_items_delete_action_log_schema_1.ConsignmentItemsDeleteActionLogSchema,
137
+ })
138
+ .merge(BaseActionFields),
118
139
  ]);
119
140
  exports.CreateActionLogSchema = zod_1.z.object({
120
141
  actionType: zod_1.z.nativeEnum(enum_1.ActionLogTypeEnum),
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConsignmentItemsCreateActionLogSchema = 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.ConsignmentItemsCreateActionLogSchema = zod_1.z.object({
10
+ consignmentUUID: zod_1.z.string(),
11
+ count: zod_1.z.coerce.number(),
12
+ products: zod_1.z.array(ConsignmentItemBriefSchema),
13
+ });
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConsignmentItemsDeleteActionLogSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.ConsignmentItemsDeleteActionLogSchema = zod_1.z.object({
6
+ consignmentUUID: zod_1.z.string(),
7
+ count: zod_1.z.coerce.number(),
8
+ });
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConsignmentProductInfoSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.ConsignmentProductInfoSchema = zod_1.z.object({
6
+ consignmentUUID: zod_1.z.string(),
7
+ productUUID: zod_1.z.string(),
8
+ productName: zod_1.z.string(),
9
+ categoryName: zod_1.z.string().nullable(),
10
+ article: zod_1.z.string().nullable(),
11
+ });
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConsignmentProductUpdateActionLogSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const consignment_product_info_schema_1 = require("./consignment-product-info.schema");
6
+ const ConsignmentProductChangeSchema = zod_1.z.object({
7
+ field: zod_1.z.string(),
8
+ oldValue: zod_1.z.union([zod_1.z.string(), zod_1.z.number(), zod_1.z.null()]),
9
+ newValue: zod_1.z.union([zod_1.z.string(), zod_1.z.number(), zod_1.z.null()]),
10
+ });
11
+ exports.ConsignmentProductUpdateActionLogSchema = zod_1.z.object({
12
+ product: consignment_product_info_schema_1.ConsignmentProductInfoSchema,
13
+ changes: zod_1.z.array(ConsignmentProductChangeSchema),
14
+ });
@@ -31,3 +31,7 @@ __exportStar(require("./pre-order-product-update-action-log.schema"), exports);
31
31
  __exportStar(require("./pre-order-product-delete-action-log.schema"), exports);
32
32
  __exportStar(require("./transaction-add-action-log.schema"), exports);
33
33
  __exportStar(require("./transaction-delete-action-log.schema"), exports);
34
+ __exportStar(require("./consignment-product-info.schema"), exports);
35
+ __exportStar(require("./consignment-product-update-action-log.schema"), exports);
36
+ __exportStar(require("./consignment-items-create-action-log.schema"), exports);
37
+ __exportStar(require("./consignment-items-delete-action-log.schema"), exports);
@@ -14,4 +14,7 @@ export enum ActionLogTypeEnum {
14
14
  DELETE_PREORDER = 'DELETE_PREORDER',
15
15
  DELETE_PREORDER_ITEM = 'DELETE_PREORDER_ITEM',
16
16
  UPDATE_PREORDER_ITEM = 'UPDATE_PREORDER_ITEM',
17
+ UPDATE_CONSIGNMENT_ITEM = 'UPDATE_CONSIGNMENT_ITEM',
18
+ CREATE_CONSIGNMENT_ITEMS = 'CREATE_CONSIGNMENT_ITEMS',
19
+ DELETE_CONSIGNMENT_ITEMS = 'DELETE_CONSIGNMENT_ITEMS',
17
20
  }
@@ -8,4 +8,5 @@ export enum MenuItemsUrlEnum {
8
8
  REPORT = '/report',
9
9
  STAFF = '/staff',
10
10
  COMPANY = '/company',
11
+ TEMPLATE = '/template',
11
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floristcloud/api-lib",
3
- "version": "1.2.78",
3
+ "version": "1.2.80",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {
@@ -12,6 +12,9 @@ import { PreOrderCreateActionLogSchema } from './pre-order-create-action-log.sch
12
12
  import { PreOrderDeleteActionLogSchema } from './pre-order-delete-action-log.schema';
13
13
  import { PreOrderProductUpdateActionLogSchema } from './pre-order-product-update-action-log.schema';
14
14
  import { PreOrderProductDeleteActionLogSchema } from './pre-order-product-delete-action-log.schema';
15
+ import { ConsignmentProductUpdateActionLogSchema } from './consignment-product-update-action-log.schema';
16
+ import { ConsignmentItemsCreateActionLogSchema } from './consignment-items-create-action-log.schema';
17
+ import { ConsignmentItemsDeleteActionLogSchema } from './consignment-items-delete-action-log.schema';
15
18
 
16
19
  export const ActionLogPayloadSchema = z.union([
17
20
  OrderDeleteActionLogPayloadSchema,
@@ -27,5 +30,8 @@ export const ActionLogPayloadSchema = z.union([
27
30
  PreOrderDeleteActionLogSchema,
28
31
  PreOrderProductUpdateActionLogSchema,
29
32
  PreOrderProductDeleteActionLogSchema,
33
+ ConsignmentProductUpdateActionLogSchema,
34
+ ConsignmentItemsCreateActionLogSchema,
35
+ ConsignmentItemsDeleteActionLogSchema,
30
36
  z.null(),
31
37
  ]);
@@ -14,6 +14,9 @@ import { PreOrderCreateActionLogSchema } from './pre-order-create-action-log.sch
14
14
  import { PreOrderDeleteActionLogSchema } from './pre-order-delete-action-log.schema';
15
15
  import { PreOrderProductUpdateActionLogSchema } from './pre-order-product-update-action-log.schema';
16
16
  import { PreOrderProductDeleteActionLogSchema } from './pre-order-product-delete-action-log.schema';
17
+ import { ConsignmentProductUpdateActionLogSchema } from './consignment-product-update-action-log.schema';
18
+ import { ConsignmentItemsCreateActionLogSchema } from './consignment-items-create-action-log.schema';
19
+ import { ConsignmentItemsDeleteActionLogSchema } from './consignment-items-delete-action-log.schema';
17
20
 
18
21
  const BaseActionFields = z.object({
19
22
  uuid: z.string(),
@@ -114,6 +117,24 @@ export const ActionLogSchema = z.discriminatedUnion('actionType', [
114
117
  payload: z.null(),
115
118
  })
116
119
  .merge(BaseActionFields),
120
+ z
121
+ .object({
122
+ actionType: z.literal(ActionLogTypeEnum.UPDATE_CONSIGNMENT_ITEM),
123
+ payload: ConsignmentProductUpdateActionLogSchema,
124
+ })
125
+ .merge(BaseActionFields),
126
+ z
127
+ .object({
128
+ actionType: z.literal(ActionLogTypeEnum.CREATE_CONSIGNMENT_ITEMS),
129
+ payload: ConsignmentItemsCreateActionLogSchema,
130
+ })
131
+ .merge(BaseActionFields),
132
+ z
133
+ .object({
134
+ actionType: z.literal(ActionLogTypeEnum.DELETE_CONSIGNMENT_ITEMS),
135
+ payload: ConsignmentItemsDeleteActionLogSchema,
136
+ })
137
+ .merge(BaseActionFields),
117
138
  ]);
118
139
 
119
140
  export const CreateActionLogSchema = z.object({
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+
3
+ const ConsignmentItemBriefSchema = z.object({
4
+ productUUID: z.string(),
5
+ productName: z.string(),
6
+ });
7
+
8
+ export const ConsignmentItemsCreateActionLogSchema = z.object({
9
+ consignmentUUID: z.string(),
10
+ count: z.coerce.number(),
11
+ products: z.array(ConsignmentItemBriefSchema),
12
+ });
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+
3
+ export const ConsignmentItemsDeleteActionLogSchema = z.object({
4
+ consignmentUUID: z.string(),
5
+ count: z.coerce.number(),
6
+ });
@@ -0,0 +1,9 @@
1
+ import { z } from 'zod';
2
+
3
+ export const ConsignmentProductInfoSchema = z.object({
4
+ consignmentUUID: z.string(),
5
+ productUUID: z.string(),
6
+ productName: z.string(),
7
+ categoryName: z.string().nullable(),
8
+ article: z.string().nullable(),
9
+ });
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ import { ConsignmentProductInfoSchema } from './consignment-product-info.schema';
3
+
4
+ const ConsignmentProductChangeSchema = z.object({
5
+ field: z.string(),
6
+ oldValue: z.union([z.string(), z.number(), z.null()]),
7
+ newValue: z.union([z.string(), z.number(), z.null()]),
8
+ });
9
+
10
+ export const ConsignmentProductUpdateActionLogSchema = z.object({
11
+ product: ConsignmentProductInfoSchema,
12
+ changes: z.array(ConsignmentProductChangeSchema),
13
+ });
@@ -15,3 +15,7 @@ export * from './pre-order-product-update-action-log.schema';
15
15
  export * from './pre-order-product-delete-action-log.schema';
16
16
  export * from './transaction-add-action-log.schema';
17
17
  export * from './transaction-delete-action-log.schema';
18
+ export * from './consignment-product-info.schema';
19
+ export * from './consignment-product-update-action-log.schema';
20
+ export * from './consignment-items-create-action-log.schema';
21
+ export * from './consignment-items-delete-action-log.schema';