@floristcloud/api-lib 1.2.16 → 1.2.17

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.
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UpdateGroupOrderStatusContractCommand = void 0;
3
+ exports.UpdateGroupOrderStatusContractCommand = exports.BULK_CHANGE_ORDER_STATUS_LIMIT = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const enum_1 = require("../../../enum");
6
+ exports.BULK_CHANGE_ORDER_STATUS_LIMIT = 500;
6
7
  const UpdateGroupOrderStatusRequestSchema = zod_1.z.object({
7
- orderUUIDList: zod_1.z.array(zod_1.z.string()),
8
+ orderUUIDList: zod_1.z.array(zod_1.z.string()).min(1).max(exports.BULK_CHANGE_ORDER_STATUS_LIMIT),
8
9
  status: zod_1.z.nativeEnum(enum_1.OrderStatusEnum),
9
10
  });
10
11
  const UpdateGroupOrderStatusResponseSchema = zod_1.z.object({
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DeleteGroupOrderProductContractCommand = void 0;
3
+ exports.DeleteGroupOrderProductContractCommand = exports.BULK_DELETE_ORDER_PRODUCT_LIMIT = void 0;
4
4
  const zod_1 = require("zod");
5
+ exports.BULK_DELETE_ORDER_PRODUCT_LIMIT = 500;
5
6
  const DeleteGroupOrderProductRequestSchema = zod_1.z.object({
6
- orderProductUUIDList: zod_1.z.array(zod_1.z.string()),
7
+ orderProductUUIDList: zod_1.z.array(zod_1.z.string()).min(1).max(exports.BULK_DELETE_ORDER_PRODUCT_LIMIT),
7
8
  });
8
9
  const DeleteGroupOrderProductResponseSchema = zod_1.z.object({
9
10
  message: zod_1.z.string().optional(),
@@ -423,6 +423,11 @@ exports.ERRORS = {
423
423
  message: 'Order status does not allow price correction',
424
424
  httpCode: 400,
425
425
  },
426
+ ORDER_PRODUCT_BULK_OPERATION_IN_PROGRESS: {
427
+ code: 'OP018',
428
+ message: 'Another bulk operation on this order is in progress, retry later',
429
+ httpCode: 409,
430
+ },
426
431
  //TRANSACTION
427
432
  TRANSACTION_NOT_CREATED: { code: 'TR001', message: 'Failed to transaction product', httpCode: 500 },
428
433
  TRANSACTION_FETCH_FAILED: { code: 'TR002', message: 'Error when retrieving a transaction', httpCode: 500 },
@@ -1,8 +1,10 @@
1
1
  import { z } from 'zod';
2
2
  import { OrderStatusEnum } from '../../../enum';
3
3
 
4
+ export const BULK_CHANGE_ORDER_STATUS_LIMIT = 500;
5
+
4
6
  const UpdateGroupOrderStatusRequestSchema = z.object({
5
- orderUUIDList: z.array(z.string()),
7
+ orderUUIDList: z.array(z.string()).min(1).max(BULK_CHANGE_ORDER_STATUS_LIMIT),
6
8
  status: z.nativeEnum(OrderStatusEnum),
7
9
  });
8
10
 
@@ -1,7 +1,9 @@
1
1
  import { z } from 'zod';
2
2
 
3
+ export const BULK_DELETE_ORDER_PRODUCT_LIMIT = 500;
4
+
3
5
  const DeleteGroupOrderProductRequestSchema = z.object({
4
- orderProductUUIDList: z.array(z.string()),
6
+ orderProductUUIDList: z.array(z.string()).min(1).max(BULK_DELETE_ORDER_PRODUCT_LIMIT),
5
7
  });
6
8
 
7
9
  const DeleteGroupOrderProductResponseSchema = z.object({
package/constant/error.ts CHANGED
@@ -439,6 +439,11 @@ export const ERRORS = {
439
439
  message: 'Order status does not allow price correction',
440
440
  httpCode: 400,
441
441
  },
442
+ ORDER_PRODUCT_BULK_OPERATION_IN_PROGRESS: {
443
+ code: 'OP018',
444
+ message: 'Another bulk operation on this order is in progress, retry later',
445
+ httpCode: 409,
446
+ },
442
447
 
443
448
  //TRANSACTION
444
449
  TRANSACTION_NOT_CREATED: { code: 'TR001', message: 'Failed to transaction product', httpCode: 500 },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floristcloud/api-lib",
3
- "version": "1.2.16",
3
+ "version": "1.2.17",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {