@floristcloud/api-lib 1.0.79 → 1.0.81
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/pre-order-collection-item/index.js +2 -0
- package/build/commands/pre-order-collection-item/move-pre-order-collection-items-analyze.command.js +51 -0
- package/build/commands/pre-order-collection-item/move-pre-order-collection-items-execute.command.js +16 -0
- package/build/constant/error-i18n-key.js +5 -0
- package/build/constant/error.js +25 -0
- package/build/schemas/order/order.schema.js +1 -0
- package/commands/pre-order-collection-item/index.ts +2 -0
- package/commands/pre-order-collection-item/move-pre-order-collection-items-analyze.command.ts +60 -0
- package/commands/pre-order-collection-item/move-pre-order-collection-items-execute.command.ts +18 -0
- package/constant/error-i18n-key.ts +5 -0
- package/constant/error.ts +25 -0
- package/package.json +1 -1
- package/schemas/order/order.schema.ts +1 -0
|
@@ -38,3 +38,5 @@ __exportStar(require("./multiplicity-option/update-pre-order-collection-item-mul
|
|
|
38
38
|
__exportStar(require("./multiplicity-option/delete-pre-order-collection-item-multiplicity-option.command"), exports);
|
|
39
39
|
__exportStar(require("./multiplicity-option/reorder-pre-order-collection-item-multiplicity-options.command"), exports);
|
|
40
40
|
__exportStar(require("./execute-pre-order-collection-item-update.command"), exports);
|
|
41
|
+
__exportStar(require("./move-pre-order-collection-items-analyze.command"), exports);
|
|
42
|
+
__exportStar(require("./move-pre-order-collection-items-execute.command"), exports);
|
package/build/commands/pre-order-collection-item/move-pre-order-collection-items-analyze.command.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MovePreOrderCollectionItemsAnalyzeContractCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const schemas_1 = require("../../schemas");
|
|
6
|
+
const MovePreOrderCollectionItemsAnalyzeRequestSchema = zod_1.z.object({
|
|
7
|
+
targetPreOrderCollectionUUID: zod_1.z.string().uuid(),
|
|
8
|
+
preOrderCollectionItemUUIDs: zod_1.z.array(zod_1.z.string().uuid()).min(1),
|
|
9
|
+
});
|
|
10
|
+
const CollectionInfoSchema = zod_1.z.object({
|
|
11
|
+
uuid: zod_1.z.string().uuid(),
|
|
12
|
+
label: zod_1.z.string().nullable(),
|
|
13
|
+
description: zod_1.z.string().optional(),
|
|
14
|
+
deliveryDate: zod_1.z.string().optional(),
|
|
15
|
+
});
|
|
16
|
+
const AffectedPreOrderSchema = zod_1.z.object({
|
|
17
|
+
preOrderUUID: zod_1.z.string().uuid(),
|
|
18
|
+
preOrderNum: zod_1.z.number(),
|
|
19
|
+
clientName: zod_1.z.string(),
|
|
20
|
+
clientCode: zod_1.z.string().nullable().optional(),
|
|
21
|
+
branchName: zod_1.z.string().nullable().optional(),
|
|
22
|
+
willCreateNewPreOrder: zod_1.z.boolean(),
|
|
23
|
+
targetPreOrderUUID: zod_1.z.string().uuid().nullable().optional(),
|
|
24
|
+
});
|
|
25
|
+
const MoveItemDetailSchema = zod_1.z.object({
|
|
26
|
+
preOrderCollectionItemUUID: zod_1.z.string().uuid(),
|
|
27
|
+
name: zod_1.z.string(),
|
|
28
|
+
inPreOrders: zod_1.z.boolean(),
|
|
29
|
+
affectedPreOrders: zod_1.z.array(AffectedPreOrderSchema).optional(),
|
|
30
|
+
});
|
|
31
|
+
const MovePreOrderCollectionItemsAnalyzeDataSchema = zod_1.z.object({
|
|
32
|
+
isPossible: zod_1.z.boolean(),
|
|
33
|
+
errors: zod_1.z.array(schemas_1.ErrorMessageSchema),
|
|
34
|
+
warnings: zod_1.z.array(schemas_1.ErrorMessageSchema),
|
|
35
|
+
sourceCollection: CollectionInfoSchema.nullable(),
|
|
36
|
+
targetCollection: CollectionInfoSchema.nullable(),
|
|
37
|
+
itemsTotal: zod_1.z.number(),
|
|
38
|
+
itemsInPreOrdersCount: zod_1.z.number(),
|
|
39
|
+
itemDetails: zod_1.z.array(MoveItemDetailSchema),
|
|
40
|
+
});
|
|
41
|
+
const MovePreOrderCollectionItemsAnalyzeResponseSchema = zod_1.z.object({
|
|
42
|
+
message: zod_1.z.string().optional(),
|
|
43
|
+
data: MovePreOrderCollectionItemsAnalyzeDataSchema,
|
|
44
|
+
});
|
|
45
|
+
var MovePreOrderCollectionItemsAnalyzeContractCommand;
|
|
46
|
+
(function (MovePreOrderCollectionItemsAnalyzeContractCommand) {
|
|
47
|
+
MovePreOrderCollectionItemsAnalyzeContractCommand.RequestSchema = MovePreOrderCollectionItemsAnalyzeRequestSchema;
|
|
48
|
+
MovePreOrderCollectionItemsAnalyzeContractCommand.ResponseSchema = MovePreOrderCollectionItemsAnalyzeResponseSchema;
|
|
49
|
+
MovePreOrderCollectionItemsAnalyzeContractCommand.ItemDetailSchema = MoveItemDetailSchema;
|
|
50
|
+
MovePreOrderCollectionItemsAnalyzeContractCommand.AffectedPreOrderDetailSchema = AffectedPreOrderSchema;
|
|
51
|
+
})(MovePreOrderCollectionItemsAnalyzeContractCommand || (exports.MovePreOrderCollectionItemsAnalyzeContractCommand = MovePreOrderCollectionItemsAnalyzeContractCommand = {}));
|
package/build/commands/pre-order-collection-item/move-pre-order-collection-items-execute.command.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MovePreOrderCollectionItemsExecuteContractCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const MovePreOrderCollectionItemsExecuteRequestSchema = zod_1.z.object({
|
|
6
|
+
targetPreOrderCollectionUUID: zod_1.z.string().uuid(),
|
|
7
|
+
preOrderCollectionItemUUIDs: zod_1.z.array(zod_1.z.string().uuid()).min(1),
|
|
8
|
+
});
|
|
9
|
+
const MovePreOrderCollectionItemsExecuteResponseSchema = zod_1.z.object({
|
|
10
|
+
data: zod_1.z.object({ success: zod_1.z.boolean() }),
|
|
11
|
+
});
|
|
12
|
+
var MovePreOrderCollectionItemsExecuteContractCommand;
|
|
13
|
+
(function (MovePreOrderCollectionItemsExecuteContractCommand) {
|
|
14
|
+
MovePreOrderCollectionItemsExecuteContractCommand.RequestSchema = MovePreOrderCollectionItemsExecuteRequestSchema;
|
|
15
|
+
MovePreOrderCollectionItemsExecuteContractCommand.ResponseSchema = MovePreOrderCollectionItemsExecuteResponseSchema;
|
|
16
|
+
})(MovePreOrderCollectionItemsExecuteContractCommand || (exports.MovePreOrderCollectionItemsExecuteContractCommand = MovePreOrderCollectionItemsExecuteContractCommand = {}));
|
|
@@ -13,4 +13,9 @@ exports.ErrorI18nKey = {
|
|
|
13
13
|
mergeOrderPaymentsTransfer: 'mergeOrder.paymentsTransfer',
|
|
14
14
|
mergeOrderDeliveryMerge: 'mergeOrder.deliveryMerge',
|
|
15
15
|
mergeOrderDeliveryTransfer: 'mergeOrder.deliveryTransfer',
|
|
16
|
+
moveItemsTargetNotFound: 'moveItems.targetNotFound',
|
|
17
|
+
moveItemsSameCollection: 'moveItems.sameCollection',
|
|
18
|
+
moveItemsBatchLimitExceeded: 'moveItems.batchLimitExceeded',
|
|
19
|
+
moveItemsItemsNotFound: 'moveItems.itemsNotFound',
|
|
20
|
+
moveItemsInPreOrdersWarning: 'moveItems.inPreOrdersWarning',
|
|
16
21
|
};
|
package/build/constant/error.js
CHANGED
|
@@ -791,6 +791,31 @@ exports.ERRORS = {
|
|
|
791
791
|
message: 'Failed to delete multiplicity option',
|
|
792
792
|
httpCode: 500,
|
|
793
793
|
},
|
|
794
|
+
PRE_ORDER_COLLECTION_ITEM_MOVE_TARGET_NOT_FOUND: {
|
|
795
|
+
code: 'POCI020',
|
|
796
|
+
message: 'Target pre order collection not found',
|
|
797
|
+
httpCode: 404,
|
|
798
|
+
},
|
|
799
|
+
PRE_ORDER_COLLECTION_ITEM_MOVE_SAME_COLLECTION: {
|
|
800
|
+
code: 'POCI021',
|
|
801
|
+
message: 'Target collection must differ from source collection',
|
|
802
|
+
httpCode: 400,
|
|
803
|
+
},
|
|
804
|
+
PRE_ORDER_COLLECTION_ITEM_MOVE_BATCH_LIMIT_EXCEEDED: {
|
|
805
|
+
code: 'POCI022',
|
|
806
|
+
message: 'Move batch size limit exceeded',
|
|
807
|
+
httpCode: 400,
|
|
808
|
+
},
|
|
809
|
+
PRE_ORDER_COLLECTION_ITEM_MOVE_ITEMS_NOT_FOUND: {
|
|
810
|
+
code: 'POCI023',
|
|
811
|
+
message: 'Some items not found or not in source collection',
|
|
812
|
+
httpCode: 400,
|
|
813
|
+
},
|
|
814
|
+
PRE_ORDER_COLLECTION_ITEM_MOVE_FAILED: {
|
|
815
|
+
code: 'POCI024',
|
|
816
|
+
message: 'Failed to move pre order collection items',
|
|
817
|
+
httpCode: 500,
|
|
818
|
+
},
|
|
794
819
|
// EMPLOYEE SCHEDULE
|
|
795
820
|
EMPLOYEE_SCHEDULE_NOT_CREATED: { code: 'ES001', message: 'Failed to create employee schedule', httpCode: 500 },
|
|
796
821
|
EMPLOYEE_SCHEDULE_NOT_DELETED: { code: 'ES002', message: 'Failed to delete employee schedule', httpCode: 500 },
|
|
@@ -51,6 +51,7 @@ exports.OrderExtendedSchema = exports.OrderSchema.extend({
|
|
|
51
51
|
deliveryRoute: delivery_route_schema_1.DeliveryRouteSchema.nullable().optional(),
|
|
52
52
|
canReceiveTelegramNotifications: zod_1.z.boolean(),
|
|
53
53
|
clientHasOverdueDebt: zod_1.z.boolean().nullable(),
|
|
54
|
+
responsibleUserName: zod_1.z.string().nullable().optional(),
|
|
54
55
|
});
|
|
55
56
|
exports.OrderExtendedForClientSchema = exports.OrderForClientSchema.extend({
|
|
56
57
|
client: client_1.ClientSchema,
|
|
@@ -22,3 +22,5 @@ export * from './multiplicity-option/update-pre-order-collection-item-multiplici
|
|
|
22
22
|
export * from './multiplicity-option/delete-pre-order-collection-item-multiplicity-option.command';
|
|
23
23
|
export * from './multiplicity-option/reorder-pre-order-collection-item-multiplicity-options.command';
|
|
24
24
|
export * from './execute-pre-order-collection-item-update.command';
|
|
25
|
+
export * from './move-pre-order-collection-items-analyze.command';
|
|
26
|
+
export * from './move-pre-order-collection-items-execute.command';
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ErrorMessageSchema } from '../../schemas';
|
|
3
|
+
|
|
4
|
+
const MovePreOrderCollectionItemsAnalyzeRequestSchema = z.object({
|
|
5
|
+
targetPreOrderCollectionUUID: z.string().uuid(),
|
|
6
|
+
preOrderCollectionItemUUIDs: z.array(z.string().uuid()).min(1),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
const CollectionInfoSchema = z.object({
|
|
10
|
+
uuid: z.string().uuid(),
|
|
11
|
+
label: z.string().nullable(),
|
|
12
|
+
description: z.string().optional(),
|
|
13
|
+
deliveryDate: z.string().optional(),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const AffectedPreOrderSchema = z.object({
|
|
17
|
+
preOrderUUID: z.string().uuid(),
|
|
18
|
+
preOrderNum: z.number(),
|
|
19
|
+
clientName: z.string(),
|
|
20
|
+
clientCode: z.string().nullable().optional(),
|
|
21
|
+
branchName: z.string().nullable().optional(),
|
|
22
|
+
willCreateNewPreOrder: z.boolean(),
|
|
23
|
+
targetPreOrderUUID: z.string().uuid().nullable().optional(),
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const MoveItemDetailSchema = z.object({
|
|
27
|
+
preOrderCollectionItemUUID: z.string().uuid(),
|
|
28
|
+
name: z.string(),
|
|
29
|
+
inPreOrders: z.boolean(),
|
|
30
|
+
affectedPreOrders: z.array(AffectedPreOrderSchema).optional(),
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const MovePreOrderCollectionItemsAnalyzeDataSchema = z.object({
|
|
34
|
+
isPossible: z.boolean(),
|
|
35
|
+
errors: z.array(ErrorMessageSchema),
|
|
36
|
+
warnings: z.array(ErrorMessageSchema),
|
|
37
|
+
sourceCollection: CollectionInfoSchema.nullable(),
|
|
38
|
+
targetCollection: CollectionInfoSchema.nullable(),
|
|
39
|
+
itemsTotal: z.number(),
|
|
40
|
+
itemsInPreOrdersCount: z.number(),
|
|
41
|
+
itemDetails: z.array(MoveItemDetailSchema),
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
const MovePreOrderCollectionItemsAnalyzeResponseSchema = z.object({
|
|
45
|
+
message: z.string().optional(),
|
|
46
|
+
data: MovePreOrderCollectionItemsAnalyzeDataSchema,
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export namespace MovePreOrderCollectionItemsAnalyzeContractCommand {
|
|
50
|
+
export const RequestSchema = MovePreOrderCollectionItemsAnalyzeRequestSchema;
|
|
51
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
52
|
+
|
|
53
|
+
export const ResponseSchema = MovePreOrderCollectionItemsAnalyzeResponseSchema;
|
|
54
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
55
|
+
|
|
56
|
+
export const ItemDetailSchema = MoveItemDetailSchema;
|
|
57
|
+
export type ItemDetail = z.infer<typeof ItemDetailSchema>;
|
|
58
|
+
export const AffectedPreOrderDetailSchema = AffectedPreOrderSchema;
|
|
59
|
+
export type AffectedPreOrderDetail = z.infer<typeof AffectedPreOrderSchema>;
|
|
60
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
const MovePreOrderCollectionItemsExecuteRequestSchema = z.object({
|
|
4
|
+
targetPreOrderCollectionUUID: z.string().uuid(),
|
|
5
|
+
preOrderCollectionItemUUIDs: z.array(z.string().uuid()).min(1),
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
const MovePreOrderCollectionItemsExecuteResponseSchema = z.object({
|
|
9
|
+
data: z.object({ success: z.boolean() }),
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export namespace MovePreOrderCollectionItemsExecuteContractCommand {
|
|
13
|
+
export const RequestSchema = MovePreOrderCollectionItemsExecuteRequestSchema;
|
|
14
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
15
|
+
|
|
16
|
+
export const ResponseSchema = MovePreOrderCollectionItemsExecuteResponseSchema;
|
|
17
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
18
|
+
}
|
|
@@ -10,6 +10,11 @@ export const ErrorI18nKey = {
|
|
|
10
10
|
mergeOrderPaymentsTransfer: 'mergeOrder.paymentsTransfer',
|
|
11
11
|
mergeOrderDeliveryMerge: 'mergeOrder.deliveryMerge',
|
|
12
12
|
mergeOrderDeliveryTransfer: 'mergeOrder.deliveryTransfer',
|
|
13
|
+
moveItemsTargetNotFound: 'moveItems.targetNotFound',
|
|
14
|
+
moveItemsSameCollection: 'moveItems.sameCollection',
|
|
15
|
+
moveItemsBatchLimitExceeded: 'moveItems.batchLimitExceeded',
|
|
16
|
+
moveItemsItemsNotFound: 'moveItems.itemsNotFound',
|
|
17
|
+
moveItemsInPreOrdersWarning: 'moveItems.inPreOrdersWarning',
|
|
13
18
|
} as const;
|
|
14
19
|
|
|
15
20
|
export type ErrorI18nKeyType = (typeof ErrorI18nKey)[keyof typeof ErrorI18nKey];
|
package/constant/error.ts
CHANGED
|
@@ -828,6 +828,31 @@ export const ERRORS = {
|
|
|
828
828
|
message: 'Failed to delete multiplicity option',
|
|
829
829
|
httpCode: 500,
|
|
830
830
|
},
|
|
831
|
+
PRE_ORDER_COLLECTION_ITEM_MOVE_TARGET_NOT_FOUND: {
|
|
832
|
+
code: 'POCI020',
|
|
833
|
+
message: 'Target pre order collection not found',
|
|
834
|
+
httpCode: 404,
|
|
835
|
+
},
|
|
836
|
+
PRE_ORDER_COLLECTION_ITEM_MOVE_SAME_COLLECTION: {
|
|
837
|
+
code: 'POCI021',
|
|
838
|
+
message: 'Target collection must differ from source collection',
|
|
839
|
+
httpCode: 400,
|
|
840
|
+
},
|
|
841
|
+
PRE_ORDER_COLLECTION_ITEM_MOVE_BATCH_LIMIT_EXCEEDED: {
|
|
842
|
+
code: 'POCI022',
|
|
843
|
+
message: 'Move batch size limit exceeded',
|
|
844
|
+
httpCode: 400,
|
|
845
|
+
},
|
|
846
|
+
PRE_ORDER_COLLECTION_ITEM_MOVE_ITEMS_NOT_FOUND: {
|
|
847
|
+
code: 'POCI023',
|
|
848
|
+
message: 'Some items not found or not in source collection',
|
|
849
|
+
httpCode: 400,
|
|
850
|
+
},
|
|
851
|
+
PRE_ORDER_COLLECTION_ITEM_MOVE_FAILED: {
|
|
852
|
+
code: 'POCI024',
|
|
853
|
+
message: 'Failed to move pre order collection items',
|
|
854
|
+
httpCode: 500,
|
|
855
|
+
},
|
|
831
856
|
|
|
832
857
|
// EMPLOYEE SCHEDULE
|
|
833
858
|
EMPLOYEE_SCHEDULE_NOT_CREATED: { code: 'ES001', message: 'Failed to create employee schedule', httpCode: 500 },
|
package/package.json
CHANGED
|
@@ -57,6 +57,7 @@ export const OrderExtendedSchema = OrderSchema.extend({
|
|
|
57
57
|
deliveryRoute: DeliveryRouteSchema.nullable().optional(),
|
|
58
58
|
canReceiveTelegramNotifications: z.boolean(),
|
|
59
59
|
clientHasOverdueDebt: z.boolean().nullable(),
|
|
60
|
+
responsibleUserName: z.string().nullable().optional(),
|
|
60
61
|
});
|
|
61
62
|
|
|
62
63
|
export const OrderExtendedForClientSchema = OrderForClientSchema.extend({
|