@floristcloud/api-lib 1.2.77 → 1.2.78
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/order-product/group/price-valuation-execute.command.js +28 -0
- package/build/commands/order-product/index.js +1 -0
- package/build/constant/error.js +15 -0
- package/commands/order-product/group/price-valuation-execute.command.ts +33 -0
- package/commands/order-product/index.ts +1 -0
- package/constant/error.ts +15 -0
- package/package.json +1 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PriceValuationExecuteContractCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const schemas_1 = require("../../../schemas");
|
|
6
|
+
const PRICE_VALUATION_BATCH_LIMIT = 50;
|
|
7
|
+
const PriceValuationExecuteItemSchema = zod_1.z.object({
|
|
8
|
+
orderProductUUID: zod_1.z.string().uuid(),
|
|
9
|
+
price: zod_1.z.number().nonnegative(),
|
|
10
|
+
});
|
|
11
|
+
const PriceValuationExecuteRequestSchema = zod_1.z.object({
|
|
12
|
+
orderUUID: zod_1.z.string().uuid(),
|
|
13
|
+
items: zod_1.z.array(PriceValuationExecuteItemSchema).min(1).max(PRICE_VALUATION_BATCH_LIMIT),
|
|
14
|
+
});
|
|
15
|
+
const PriceValuationExecuteResponseSchema = zod_1.z.object({
|
|
16
|
+
message: zod_1.z.string().optional(),
|
|
17
|
+
data: zod_1.z.object({
|
|
18
|
+
results: zod_1.z.array(schemas_1.PriceCorrectionExecuteResultItemSchema),
|
|
19
|
+
successCount: zod_1.z.number(),
|
|
20
|
+
skippedCount: zod_1.z.number(),
|
|
21
|
+
}),
|
|
22
|
+
});
|
|
23
|
+
var PriceValuationExecuteContractCommand;
|
|
24
|
+
(function (PriceValuationExecuteContractCommand) {
|
|
25
|
+
PriceValuationExecuteContractCommand.RequestSchema = PriceValuationExecuteRequestSchema;
|
|
26
|
+
PriceValuationExecuteContractCommand.BATCH_LIMIT = PRICE_VALUATION_BATCH_LIMIT;
|
|
27
|
+
PriceValuationExecuteContractCommand.ResponseSchema = PriceValuationExecuteResponseSchema;
|
|
28
|
+
})(PriceValuationExecuteContractCommand || (exports.PriceValuationExecuteContractCommand = PriceValuationExecuteContractCommand = {}));
|
|
@@ -30,6 +30,7 @@ __exportStar(require("./group/update-group-order-product-order.command"), export
|
|
|
30
30
|
__exportStar(require("./group/zeroing-receipt-order-product.command"), exports);
|
|
31
31
|
__exportStar(require("./group/price-correction-analyze.command"), exports);
|
|
32
32
|
__exportStar(require("./group/price-correction-execute.command"), exports);
|
|
33
|
+
__exportStar(require("./group/price-valuation-execute.command"), exports);
|
|
33
34
|
//webshop
|
|
34
35
|
__exportStar(require("./webshop/update-order-product-for-client.command"), exports);
|
|
35
36
|
__exportStar(require("./webshop/create-order-product-for-client.command"), exports);
|
package/build/constant/error.js
CHANGED
|
@@ -480,6 +480,21 @@ exports.ERRORS = {
|
|
|
480
480
|
message: 'Product consignment is in draft and not available for orders',
|
|
481
481
|
httpCode: 409,
|
|
482
482
|
},
|
|
483
|
+
ORDER_PRODUCT_PRICE_VALUATION_FAILED: {
|
|
484
|
+
code: 'OP022',
|
|
485
|
+
message: 'Failed to change price for order product',
|
|
486
|
+
httpCode: 500,
|
|
487
|
+
},
|
|
488
|
+
ORDER_PRODUCT_PRICE_VALUATION_ORDER_STATUS_NOT_ALLOWED: {
|
|
489
|
+
code: 'OP023',
|
|
490
|
+
message: 'Order status does not allow price change',
|
|
491
|
+
httpCode: 400,
|
|
492
|
+
},
|
|
493
|
+
ORDER_PRODUCT_PRICE_VALUATION_NOT_FOUND: {
|
|
494
|
+
code: 'OP024',
|
|
495
|
+
message: 'Order product not found in the order',
|
|
496
|
+
httpCode: 404,
|
|
497
|
+
},
|
|
483
498
|
//TRANSACTION
|
|
484
499
|
TRANSACTION_NOT_CREATED: { code: 'TR001', message: 'Failed to transaction product', httpCode: 500 },
|
|
485
500
|
TRANSACTION_FETCH_FAILED: { code: 'TR002', message: 'Error when retrieving a transaction', httpCode: 500 },
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PriceCorrectionExecuteResultItemSchema } from '../../../schemas';
|
|
3
|
+
|
|
4
|
+
const PRICE_VALUATION_BATCH_LIMIT = 50;
|
|
5
|
+
|
|
6
|
+
const PriceValuationExecuteItemSchema = z.object({
|
|
7
|
+
orderProductUUID: z.string().uuid(),
|
|
8
|
+
price: z.number().nonnegative(),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
const PriceValuationExecuteRequestSchema = z.object({
|
|
12
|
+
orderUUID: z.string().uuid(),
|
|
13
|
+
items: z.array(PriceValuationExecuteItemSchema).min(1).max(PRICE_VALUATION_BATCH_LIMIT),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const PriceValuationExecuteResponseSchema = z.object({
|
|
17
|
+
message: z.string().optional(),
|
|
18
|
+
data: z.object({
|
|
19
|
+
results: z.array(PriceCorrectionExecuteResultItemSchema),
|
|
20
|
+
successCount: z.number(),
|
|
21
|
+
skippedCount: z.number(),
|
|
22
|
+
}),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export namespace PriceValuationExecuteContractCommand {
|
|
26
|
+
export const RequestSchema = PriceValuationExecuteRequestSchema;
|
|
27
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
28
|
+
|
|
29
|
+
export const BATCH_LIMIT = PRICE_VALUATION_BATCH_LIMIT;
|
|
30
|
+
|
|
31
|
+
export const ResponseSchema = PriceValuationExecuteResponseSchema;
|
|
32
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
33
|
+
}
|
|
@@ -14,6 +14,7 @@ export * from './group/update-group-order-product-order.command';
|
|
|
14
14
|
export * from './group/zeroing-receipt-order-product.command';
|
|
15
15
|
export * from './group/price-correction-analyze.command';
|
|
16
16
|
export * from './group/price-correction-execute.command';
|
|
17
|
+
export * from './group/price-valuation-execute.command';
|
|
17
18
|
//webshop
|
|
18
19
|
export * from './webshop/update-order-product-for-client.command';
|
|
19
20
|
export * from './webshop/create-order-product-for-client.command';
|
package/constant/error.ts
CHANGED
|
@@ -498,6 +498,21 @@ export const ERRORS = {
|
|
|
498
498
|
message: 'Product consignment is in draft and not available for orders',
|
|
499
499
|
httpCode: 409,
|
|
500
500
|
},
|
|
501
|
+
ORDER_PRODUCT_PRICE_VALUATION_FAILED: {
|
|
502
|
+
code: 'OP022',
|
|
503
|
+
message: 'Failed to change price for order product',
|
|
504
|
+
httpCode: 500,
|
|
505
|
+
},
|
|
506
|
+
ORDER_PRODUCT_PRICE_VALUATION_ORDER_STATUS_NOT_ALLOWED: {
|
|
507
|
+
code: 'OP023',
|
|
508
|
+
message: 'Order status does not allow price change',
|
|
509
|
+
httpCode: 400,
|
|
510
|
+
},
|
|
511
|
+
ORDER_PRODUCT_PRICE_VALUATION_NOT_FOUND: {
|
|
512
|
+
code: 'OP024',
|
|
513
|
+
message: 'Order product not found in the order',
|
|
514
|
+
httpCode: 404,
|
|
515
|
+
},
|
|
501
516
|
|
|
502
517
|
//TRANSACTION
|
|
503
518
|
TRANSACTION_NOT_CREATED: { code: 'TR001', message: 'Failed to transaction product', httpCode: 500 },
|