@floristcloud/api-lib 1.2.5 → 1.2.7

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.
Files changed (25) hide show
  1. package/build/commands/auth/get-available-channels.command.js +1 -0
  2. package/build/commands/order-product/group/price-correction-analyze.command.js +25 -0
  3. package/build/commands/order-product/group/price-correction-execute.command.js +24 -0
  4. package/build/commands/order-product/index.js +2 -0
  5. package/build/constant/error.js +18 -0
  6. package/build/enum/index.js +2 -0
  7. package/build/enum/notification-type.enum.js +1 -0
  8. package/build/enum/order-price-correction-skipped-status-list.js +10 -0
  9. package/build/enum/security-code-blocked-reason.enum.js +8 -0
  10. package/build/schemas/index.js +2 -0
  11. package/build/schemas/order-product/price-correction-analyze-item.schema.js +34 -0
  12. package/build/schemas/order-product/price-correction-execute-result-item.schema.js +13 -0
  13. package/commands/auth/get-available-channels.command.ts +2 -1
  14. package/commands/order-product/group/price-correction-analyze.command.ts +29 -0
  15. package/commands/order-product/group/price-correction-execute.command.ts +28 -0
  16. package/commands/order-product/index.ts +2 -0
  17. package/constant/error.ts +18 -0
  18. package/enum/index.ts +2 -0
  19. package/enum/notification-type.enum.ts +1 -0
  20. package/enum/order-price-correction-skipped-status-list.ts +8 -0
  21. package/enum/security-code-blocked-reason.enum.ts +4 -0
  22. package/package.json +1 -1
  23. package/schemas/index.ts +2 -0
  24. package/schemas/order-product/price-correction-analyze-item.schema.ts +37 -0
  25. package/schemas/order-product/price-correction-execute-result-item.schema.ts +11 -0
@@ -9,6 +9,7 @@ exports.GetAvailableChannelsRequestSchema = zod_1.z.object({
9
9
  });
10
10
  exports.GetAvailableChannelsResponseSchema = zod_1.z.object({
11
11
  channels: zod_1.z.array(zod_1.z.nativeEnum(enum_1.NotificationChannelEnum)),
12
+ blockedReason: zod_1.z.nativeEnum(enum_1.SecurityCodeBlockedReasonEnum).optional(),
12
13
  });
13
14
  var GetAvailableChannelsContractCommand;
14
15
  (function (GetAvailableChannelsContractCommand) {
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PriceCorrectionAnalyzeContractCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const schemas_1 = require("../../../schemas");
6
+ const PriceCorrectionAnalyzeRequestSchema = zod_1.z
7
+ .object({
8
+ productUUIDList: zod_1.z.array(zod_1.z.string().uuid()).optional(),
9
+ consignmentUUID: zod_1.z.string().uuid().optional(),
10
+ })
11
+ .refine(data => { var _a; return ((_a = data.productUUIDList) === null || _a === void 0 ? void 0 : _a.length) || data.consignmentUUID; }, {
12
+ message: 'Either productUUIDList or consignmentUUID must be provided',
13
+ });
14
+ const PriceCorrectionAnalyzeResponseSchema = zod_1.z.object({
15
+ message: zod_1.z.string().optional(),
16
+ data: zod_1.z.object({
17
+ items: zod_1.z.array(schemas_1.PriceCorrectionAnalyzeItemSchema),
18
+ }),
19
+ });
20
+ var PriceCorrectionAnalyzeContractCommand;
21
+ (function (PriceCorrectionAnalyzeContractCommand) {
22
+ PriceCorrectionAnalyzeContractCommand.RequestSchema = PriceCorrectionAnalyzeRequestSchema;
23
+ PriceCorrectionAnalyzeContractCommand.ItemSchema = schemas_1.PriceCorrectionAnalyzeItemSchema;
24
+ PriceCorrectionAnalyzeContractCommand.ResponseSchema = PriceCorrectionAnalyzeResponseSchema;
25
+ })(PriceCorrectionAnalyzeContractCommand || (exports.PriceCorrectionAnalyzeContractCommand = PriceCorrectionAnalyzeContractCommand = {}));
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PriceCorrectionExecuteContractCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const schemas_1 = require("../../../schemas");
6
+ const PRICE_CORRECTION_BATCH_LIMIT = 50;
7
+ const PriceCorrectionExecuteRequestSchema = zod_1.z.object({
8
+ orderProductUUIDList: zod_1.z.array(zod_1.z.string().uuid()).min(1).max(PRICE_CORRECTION_BATCH_LIMIT),
9
+ withDiscount: zod_1.z.boolean(),
10
+ });
11
+ const PriceCorrectionExecuteResponseSchema = zod_1.z.object({
12
+ message: zod_1.z.string().optional(),
13
+ data: zod_1.z.object({
14
+ results: zod_1.z.array(schemas_1.PriceCorrectionExecuteResultItemSchema),
15
+ successCount: zod_1.z.number(),
16
+ skippedCount: zod_1.z.number(),
17
+ }),
18
+ });
19
+ var PriceCorrectionExecuteContractCommand;
20
+ (function (PriceCorrectionExecuteContractCommand) {
21
+ PriceCorrectionExecuteContractCommand.RequestSchema = PriceCorrectionExecuteRequestSchema;
22
+ PriceCorrectionExecuteContractCommand.BATCH_LIMIT = PRICE_CORRECTION_BATCH_LIMIT;
23
+ PriceCorrectionExecuteContractCommand.ResponseSchema = PriceCorrectionExecuteResponseSchema;
24
+ })(PriceCorrectionExecuteContractCommand || (exports.PriceCorrectionExecuteContractCommand = PriceCorrectionExecuteContractCommand = {}));
@@ -27,6 +27,8 @@ __exportStar(require("./group/update-group-order-product-tag.command"), exports)
27
27
  __exportStar(require("./group/delete-group-order-product.command"), exports);
28
28
  __exportStar(require("./group/update-group-order-product-order.command"), exports);
29
29
  __exportStar(require("./group/zeroing-receipt-order-product.command"), exports);
30
+ __exportStar(require("./group/price-correction-analyze.command"), exports);
31
+ __exportStar(require("./group/price-correction-execute.command"), exports);
30
32
  //webshop
31
33
  __exportStar(require("./webshop/update-order-product-for-client.command"), exports);
32
34
  __exportStar(require("./webshop/create-order-product-for-client.command"), exports);
@@ -400,6 +400,21 @@ exports.ERRORS = {
400
400
  message: 'The product is not deleted, because it has write-off',
401
401
  httpCode: 500,
402
402
  },
403
+ ORDER_PRODUCT_PRICE_CORRECTION_BATCH_LIMIT_EXCEEDED: {
404
+ code: 'OP015',
405
+ message: 'Price correction batch limit exceeded',
406
+ httpCode: 400,
407
+ },
408
+ ORDER_PRODUCT_PRICE_CORRECTION_FAILED: {
409
+ code: 'OP016',
410
+ message: 'Failed to correct price for order product',
411
+ httpCode: 500,
412
+ },
413
+ ORDER_PRODUCT_PRICE_CORRECTION_ORDER_STATUS_NOT_ALLOWED: {
414
+ code: 'OP017',
415
+ message: 'Order status does not allow price correction',
416
+ httpCode: 400,
417
+ },
403
418
  //TRANSACTION
404
419
  TRANSACTION_NOT_CREATED: { code: 'TR001', message: 'Failed to transaction product', httpCode: 500 },
405
420
  TRANSACTION_FETCH_FAILED: { code: 'TR002', message: 'Error when retrieving a transaction', httpCode: 500 },
@@ -879,6 +894,9 @@ exports.ERRORS = {
879
894
  SECURITY_CODE_NOT_FOUND: { code: 'SC002', message: 'Security code not found', httpCode: 404 },
880
895
  SECURITY_CODE_INVALID: { code: 'SC003', message: 'Security code is invalid', httpCode: 400 },
881
896
  SECURITY_CODE_THROTTLED: { code: 'SC004', message: 'Security code creation too frequent', httpCode: 429 },
897
+ SECURITY_CODE_FRAUD: { code: 'SC005', message: 'Security code attempts exceeded. Contact administrator', httpCode: 403 },
898
+ SECURITY_CODE_DAILY_LIMIT: { code: 'SC006', message: 'Daily security code limit reached. Contact administrator', httpCode: 429 },
899
+ SECURITY_CODE_FRAUD_BLOCK: { code: 'SC007', message: 'Security code temporarily blocked after fraud detection', httpCode: 429 },
882
900
  // MESSENGER PROFILE
883
901
  MESSENGER_VERIFICATION_CODE_NOT_FOUND: { code: 'MP001', message: 'Verification code not found', httpCode: 404 },
884
902
  MESSENGER_VERIFICATION_CODE_EXPIRED: { code: 'MP002', message: 'Verification code expired', httpCode: 400 },
@@ -43,6 +43,7 @@ __exportStar(require("./discount-rules-type.enum"), exports);
43
43
  __exportStar(require("./discount-rules-mode-type.enum"), exports);
44
44
  __exportStar(require("./order-distribute-status-list"), exports);
45
45
  __exportStar(require("./order-active-status-list"), exports);
46
+ __exportStar(require("./order-price-correction-skipped-status-list"), exports);
46
47
  __exportStar(require("./client-status.enum"), exports);
47
48
  __exportStar(require("./client-type.enum"), exports);
48
49
  __exportStar(require("./consignment-distribution-validation-status.enum"), exports);
@@ -81,3 +82,4 @@ __exportStar(require("./chat-no-manager-mode.enum"), exports);
81
82
  __exportStar(require("./match-confidence.enum"), exports);
82
83
  __exportStar(require("./session-platform.enum"), exports);
83
84
  __exportStar(require("./device-platform.enum"), exports);
85
+ __exportStar(require("./security-code-blocked-reason.enum"), exports);
@@ -9,4 +9,5 @@ var NotificationTypeEnum;
9
9
  NotificationTypeEnum["CART_EXPIRATION"] = "CART_EXPIRATION";
10
10
  NotificationTypeEnum["WRITE_OFF_REJECTED"] = "WRITE_OFF_REJECTED";
11
11
  NotificationTypeEnum["CLIENT_MESSAGE_TO_EMPLOYEE"] = "CLIENT_MESSAGE_TO_EMPLOYEE";
12
+ NotificationTypeEnum["PASSWORD_CHANGED"] = "PASSWORD_CHANGED";
12
13
  })(NotificationTypeEnum || (exports.NotificationTypeEnum = NotificationTypeEnum = {}));
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OrderPriceCorrectionSkippedStatusList = void 0;
4
+ const order_status_enum_1 = require("./order-status.enum");
5
+ exports.OrderPriceCorrectionSkippedStatusList = [
6
+ order_status_enum_1.OrderStatusEnum.ASSEMBLED,
7
+ order_status_enum_1.OrderStatusEnum.VERIFIED,
8
+ order_status_enum_1.OrderStatusEnum.SHIPPED,
9
+ order_status_enum_1.OrderStatusEnum.COMPLETED,
10
+ ];
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SecurityCodeBlockedReasonEnum = void 0;
4
+ var SecurityCodeBlockedReasonEnum;
5
+ (function (SecurityCodeBlockedReasonEnum) {
6
+ SecurityCodeBlockedReasonEnum["FRAUD_BLOCK"] = "fraud_block";
7
+ SecurityCodeBlockedReasonEnum["DAILY_LIMIT"] = "daily_limit";
8
+ })(SecurityCodeBlockedReasonEnum || (exports.SecurityCodeBlockedReasonEnum = SecurityCodeBlockedReasonEnum = {}));
@@ -26,6 +26,8 @@ __exportStar(require("./order-delivery/order-delivery.schema"), exports);
26
26
  __exportStar(require("./order-product/order-product.schema"), exports);
27
27
  __exportStar(require("./order-product/order-product-list.schema"), exports);
28
28
  __exportStar(require("./order-product/order-product-multiplicity-optiom.schema"), exports);
29
+ __exportStar(require("./order-product/price-correction-analyze-item.schema"), exports);
30
+ __exportStar(require("./order-product/price-correction-execute-result-item.schema"), exports);
29
31
  __exportStar(require("./transaction/transaction.schema"), exports);
30
32
  __exportStar(require("./transaction/transaction-list.schema"), exports);
31
33
  __exportStar(require("./file"), exports);
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PriceCorrectionAnalyzeItemSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const enum_1 = require("../../enum");
6
+ const error_message_schema_1 = require("../error-message.schema");
7
+ exports.PriceCorrectionAnalyzeItemSchema = zod_1.z.object({
8
+ orderProductUUID: zod_1.z.string(),
9
+ orderUUID: zod_1.z.string(),
10
+ orderNumber: zod_1.z.number(),
11
+ orderStatus: zod_1.z.nativeEnum(enum_1.OrderStatusEnum),
12
+ clientName: zod_1.z.string(),
13
+ clientUUID: zod_1.z.string(),
14
+ productUUID: zod_1.z.string(),
15
+ productName: zod_1.z.string(),
16
+ categoryName: zod_1.z.string().nullable(),
17
+ grower: zod_1.z.string().nullable(),
18
+ size: zod_1.z.string().nullable(),
19
+ size2: zod_1.z.string().nullable(),
20
+ size3: zod_1.z.string().nullable(),
21
+ article: zod_1.z.string().nullable(),
22
+ color: zod_1.z.string().nullable(),
23
+ currentPrice: zod_1.z.number(),
24
+ currentAmount: zod_1.z.number(),
25
+ quantity: zod_1.z.number(),
26
+ newPriceWithoutDiscount: zod_1.z.number(),
27
+ newPriceWithDiscount: zod_1.z.number(),
28
+ newAmountWithoutDiscount: zod_1.z.number(),
29
+ newAmountWithDiscount: zod_1.z.number(),
30
+ priceDifferenceWithoutDiscount: zod_1.z.number(),
31
+ priceDifferenceWithDiscount: zod_1.z.number(),
32
+ isSkipped: zod_1.z.boolean(),
33
+ skipReason: error_message_schema_1.ErrorMessageSchema.optional(),
34
+ });
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PriceCorrectionExecuteResultItemSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const error_message_schema_1 = require("../error-message.schema");
6
+ exports.PriceCorrectionExecuteResultItemSchema = zod_1.z.object({
7
+ orderProductUUID: zod_1.z.string(),
8
+ orderUUID: zod_1.z.string(),
9
+ isSuccess: zod_1.z.boolean(),
10
+ error: error_message_schema_1.ErrorMessageSchema.optional(),
11
+ oldPrice: zod_1.z.number().optional(),
12
+ newPrice: zod_1.z.number().optional(),
13
+ });
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { NotificationChannelEnum } from '../../enum';
2
+ import { NotificationChannelEnum, SecurityCodeBlockedReasonEnum } from '../../enum';
3
3
 
4
4
  export const GetAvailableChannelsRequestSchema = z.object({
5
5
  email: z.email().toLowerCase().optional(),
@@ -8,6 +8,7 @@ export const GetAvailableChannelsRequestSchema = z.object({
8
8
 
9
9
  export const GetAvailableChannelsResponseSchema = z.object({
10
10
  channels: z.array(z.nativeEnum(NotificationChannelEnum)),
11
+ blockedReason: z.nativeEnum(SecurityCodeBlockedReasonEnum).optional(),
11
12
  });
12
13
 
13
14
  export namespace GetAvailableChannelsContractCommand {
@@ -0,0 +1,29 @@
1
+ import { z } from 'zod';
2
+ import { PriceCorrectionAnalyzeItemSchema } from '../../../schemas';
3
+
4
+ const PriceCorrectionAnalyzeRequestSchema = z
5
+ .object({
6
+ productUUIDList: z.array(z.string().uuid()).optional(),
7
+ consignmentUUID: z.string().uuid().optional(),
8
+ })
9
+ .refine(data => data.productUUIDList?.length || data.consignmentUUID, {
10
+ message: 'Either productUUIDList or consignmentUUID must be provided',
11
+ });
12
+
13
+ const PriceCorrectionAnalyzeResponseSchema = z.object({
14
+ message: z.string().optional(),
15
+ data: z.object({
16
+ items: z.array(PriceCorrectionAnalyzeItemSchema),
17
+ }),
18
+ });
19
+
20
+ export namespace PriceCorrectionAnalyzeContractCommand {
21
+ export const RequestSchema = PriceCorrectionAnalyzeRequestSchema;
22
+ export type Request = z.infer<typeof RequestSchema>;
23
+
24
+ export const ItemSchema = PriceCorrectionAnalyzeItemSchema;
25
+ export type Item = z.infer<typeof ItemSchema>;
26
+
27
+ export const ResponseSchema = PriceCorrectionAnalyzeResponseSchema;
28
+ export type Response = z.infer<typeof ResponseSchema>;
29
+ }
@@ -0,0 +1,28 @@
1
+ import { z } from 'zod';
2
+ import { PriceCorrectionExecuteResultItemSchema } from '../../../schemas';
3
+
4
+ const PRICE_CORRECTION_BATCH_LIMIT = 50;
5
+
6
+ const PriceCorrectionExecuteRequestSchema = z.object({
7
+ orderProductUUIDList: z.array(z.string().uuid()).min(1).max(PRICE_CORRECTION_BATCH_LIMIT),
8
+ withDiscount: z.boolean(),
9
+ });
10
+
11
+ const PriceCorrectionExecuteResponseSchema = z.object({
12
+ message: z.string().optional(),
13
+ data: z.object({
14
+ results: z.array(PriceCorrectionExecuteResultItemSchema),
15
+ successCount: z.number(),
16
+ skippedCount: z.number(),
17
+ }),
18
+ });
19
+
20
+ export namespace PriceCorrectionExecuteContractCommand {
21
+ export const RequestSchema = PriceCorrectionExecuteRequestSchema;
22
+ export type Request = z.infer<typeof RequestSchema>;
23
+
24
+ export const BATCH_LIMIT = PRICE_CORRECTION_BATCH_LIMIT;
25
+
26
+ export const ResponseSchema = PriceCorrectionExecuteResponseSchema;
27
+ export type Response = z.infer<typeof ResponseSchema>;
28
+ }
@@ -11,6 +11,8 @@ export * from './group/update-group-order-product-tag.command';
11
11
  export * from './group/delete-group-order-product.command';
12
12
  export * from './group/update-group-order-product-order.command';
13
13
  export * from './group/zeroing-receipt-order-product.command';
14
+ export * from './group/price-correction-analyze.command';
15
+ export * from './group/price-correction-execute.command';
14
16
  //webshop
15
17
  export * from './webshop/update-order-product-for-client.command';
16
18
  export * from './webshop/create-order-product-for-client.command';
package/constant/error.ts CHANGED
@@ -416,6 +416,21 @@ export const ERRORS = {
416
416
  message: 'The product is not deleted, because it has write-off',
417
417
  httpCode: 500,
418
418
  },
419
+ ORDER_PRODUCT_PRICE_CORRECTION_BATCH_LIMIT_EXCEEDED: {
420
+ code: 'OP015',
421
+ message: 'Price correction batch limit exceeded',
422
+ httpCode: 400,
423
+ },
424
+ ORDER_PRODUCT_PRICE_CORRECTION_FAILED: {
425
+ code: 'OP016',
426
+ message: 'Failed to correct price for order product',
427
+ httpCode: 500,
428
+ },
429
+ ORDER_PRODUCT_PRICE_CORRECTION_ORDER_STATUS_NOT_ALLOWED: {
430
+ code: 'OP017',
431
+ message: 'Order status does not allow price correction',
432
+ httpCode: 400,
433
+ },
419
434
 
420
435
  //TRANSACTION
421
436
  TRANSACTION_NOT_CREATED: { code: 'TR001', message: 'Failed to transaction product', httpCode: 500 },
@@ -928,6 +943,9 @@ export const ERRORS = {
928
943
  SECURITY_CODE_NOT_FOUND: { code: 'SC002', message: 'Security code not found', httpCode: 404 },
929
944
  SECURITY_CODE_INVALID: { code: 'SC003', message: 'Security code is invalid', httpCode: 400 },
930
945
  SECURITY_CODE_THROTTLED: { code: 'SC004', message: 'Security code creation too frequent', httpCode: 429 },
946
+ SECURITY_CODE_FRAUD: { code: 'SC005', message: 'Security code attempts exceeded. Contact administrator', httpCode: 403 },
947
+ SECURITY_CODE_DAILY_LIMIT: { code: 'SC006', message: 'Daily security code limit reached. Contact administrator', httpCode: 429 },
948
+ SECURITY_CODE_FRAUD_BLOCK: { code: 'SC007', message: 'Security code temporarily blocked after fraud detection', httpCode: 429 },
931
949
 
932
950
  // MESSENGER PROFILE
933
951
  MESSENGER_VERIFICATION_CODE_NOT_FOUND: { code: 'MP001', message: 'Verification code not found', httpCode: 404 },
package/enum/index.ts CHANGED
@@ -27,6 +27,7 @@ export * from './discount-rules-type.enum';
27
27
  export * from './discount-rules-mode-type.enum';
28
28
  export * from './order-distribute-status-list';
29
29
  export * from './order-active-status-list';
30
+ export * from './order-price-correction-skipped-status-list';
30
31
  export * from './client-status.enum';
31
32
  export * from './client-type.enum';
32
33
  export * from './consignment-distribution-validation-status.enum';
@@ -65,3 +66,4 @@ export * from './chat-no-manager-mode.enum';
65
66
  export * from './match-confidence.enum';
66
67
  export * from './session-platform.enum';
67
68
  export * from './device-platform.enum';
69
+ export * from './security-code-blocked-reason.enum';
@@ -5,4 +5,5 @@ export enum NotificationTypeEnum {
5
5
  CART_EXPIRATION = 'CART_EXPIRATION',
6
6
  WRITE_OFF_REJECTED = 'WRITE_OFF_REJECTED',
7
7
  CLIENT_MESSAGE_TO_EMPLOYEE = 'CLIENT_MESSAGE_TO_EMPLOYEE',
8
+ PASSWORD_CHANGED = 'PASSWORD_CHANGED',
8
9
  }
@@ -0,0 +1,8 @@
1
+ import { OrderStatusEnum } from './order-status.enum';
2
+
3
+ export const OrderPriceCorrectionSkippedStatusList: OrderStatusEnum[] = [
4
+ OrderStatusEnum.ASSEMBLED,
5
+ OrderStatusEnum.VERIFIED,
6
+ OrderStatusEnum.SHIPPED,
7
+ OrderStatusEnum.COMPLETED,
8
+ ];
@@ -0,0 +1,4 @@
1
+ export enum SecurityCodeBlockedReasonEnum {
2
+ FRAUD_BLOCK = 'fraud_block',
3
+ DAILY_LIMIT = 'daily_limit',
4
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floristcloud/api-lib",
3
- "version": "1.2.5",
3
+ "version": "1.2.7",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {
package/schemas/index.ts CHANGED
@@ -10,6 +10,8 @@ export * from './order-delivery/order-delivery.schema';
10
10
  export * from './order-product/order-product.schema';
11
11
  export * from './order-product/order-product-list.schema';
12
12
  export * from './order-product/order-product-multiplicity-optiom.schema';
13
+ export * from './order-product/price-correction-analyze-item.schema';
14
+ export * from './order-product/price-correction-execute-result-item.schema';
13
15
  export * from './transaction/transaction.schema';
14
16
  export * from './transaction/transaction-list.schema';
15
17
  export * from './file';
@@ -0,0 +1,37 @@
1
+ import { z } from 'zod';
2
+ import { OrderStatusEnum } from '../../enum';
3
+ import { ErrorMessageSchema } from '../error-message.schema';
4
+
5
+ export const PriceCorrectionAnalyzeItemSchema = z.object({
6
+ orderProductUUID: z.string(),
7
+ orderUUID: z.string(),
8
+ orderNumber: z.number(),
9
+ orderStatus: z.nativeEnum(OrderStatusEnum),
10
+ clientName: z.string(),
11
+ clientUUID: z.string(),
12
+
13
+ productUUID: z.string(),
14
+ productName: z.string(),
15
+ categoryName: z.string().nullable(),
16
+ grower: z.string().nullable(),
17
+ size: z.string().nullable(),
18
+ size2: z.string().nullable(),
19
+ size3: z.string().nullable(),
20
+ article: z.string().nullable(),
21
+ color: z.string().nullable(),
22
+
23
+ currentPrice: z.number(),
24
+ currentAmount: z.number(),
25
+ quantity: z.number(),
26
+
27
+ newPriceWithoutDiscount: z.number(),
28
+ newPriceWithDiscount: z.number(),
29
+ newAmountWithoutDiscount: z.number(),
30
+ newAmountWithDiscount: z.number(),
31
+
32
+ priceDifferenceWithoutDiscount: z.number(),
33
+ priceDifferenceWithDiscount: z.number(),
34
+
35
+ isSkipped: z.boolean(),
36
+ skipReason: ErrorMessageSchema.optional(),
37
+ });
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+ import { ErrorMessageSchema } from '../error-message.schema';
3
+
4
+ export const PriceCorrectionExecuteResultItemSchema = z.object({
5
+ orderProductUUID: z.string(),
6
+ orderUUID: z.string(),
7
+ isSuccess: z.boolean(),
8
+ error: ErrorMessageSchema.optional(),
9
+ oldPrice: z.number().optional(),
10
+ newPrice: z.number().optional(),
11
+ });