@floristcloud/api-lib 1.2.58 → 1.2.60
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/consignment-transfer/accept-consignment-transfer.command.js +9 -0
- package/build/commands/consignment-transfer/cancel-consignment-transfer.command.js +8 -0
- package/build/commands/consignment-transfer/create-consignment-transfer.command.js +9 -0
- package/build/commands/consignment-transfer/get-consignment-transfer-list.query.js +9 -0
- package/build/commands/consignment-transfer/get-consignment-transfer.query.js +8 -0
- package/build/commands/consignment-transfer/index.js +22 -0
- package/build/commands/consignment-transfer/reject-consignment-transfer.command.js +9 -0
- package/build/commands/index.js +1 -0
- package/build/commands/pre-order-collection-item/import-pre-order-collection-item.command.js +38 -0
- package/build/commands/pre-order-collection-item/index.js +1 -0
- package/build/commands/wrire-off-archive/get-write-off-archive-files.command.js +1 -0
- package/build/constant/error-i18n-key.js +4 -0
- package/build/constant/error.js +29 -0
- package/build/enum/consignment-transfer-direction.enum.js +8 -0
- package/build/enum/consignment-transfer-request-status.enum.js +10 -0
- package/build/enum/index.js +3 -0
- package/build/enum/pre-order-collection-item-import-entity-property.enum.js +7 -0
- package/build/enum/pre-order-collection-item-import-errors.enum.js +15 -0
- package/build/schemas/consignment-transfer/accept-consignment-transfer.schema.js +32 -0
- package/build/schemas/consignment-transfer/cancel-consignment-transfer.schema.js +9 -0
- package/build/schemas/consignment-transfer/consignment-transfer-request-item.schema.js +24 -0
- package/build/schemas/consignment-transfer/consignment-transfer-request.schema.js +21 -0
- package/build/schemas/consignment-transfer/create-consignment-transfer.schema.js +21 -0
- package/build/schemas/consignment-transfer/get-consignment-transfer-list.schema.js +19 -0
- package/build/schemas/consignment-transfer/get-consignment-transfer.schema.js +17 -0
- package/build/schemas/consignment-transfer/index.js +24 -0
- package/build/schemas/consignment-transfer/reject-consignment-transfer.schema.js +12 -0
- package/build/schemas/index.js +1 -0
- package/commands/consignment-transfer/accept-consignment-transfer.command.ts +13 -0
- package/commands/consignment-transfer/cancel-consignment-transfer.command.ts +7 -0
- package/commands/consignment-transfer/create-consignment-transfer.command.ts +13 -0
- package/commands/consignment-transfer/get-consignment-transfer-list.query.ts +13 -0
- package/commands/consignment-transfer/get-consignment-transfer.query.ts +7 -0
- package/commands/consignment-transfer/index.ts +6 -0
- package/commands/consignment-transfer/reject-consignment-transfer.command.ts +13 -0
- package/commands/index.ts +1 -0
- package/commands/pre-order-collection-item/import-pre-order-collection-item.command.ts +48 -0
- package/commands/pre-order-collection-item/index.ts +1 -0
- package/commands/wrire-off-archive/get-write-off-archive-files.command.ts +1 -0
- package/constant/error-i18n-key.ts +4 -0
- package/constant/error.ts +30 -0
- package/enum/consignment-transfer-direction.enum.ts +4 -0
- package/enum/consignment-transfer-request-status.enum.ts +6 -0
- package/enum/index.ts +3 -0
- package/enum/pre-order-collection-item-import-entity-property.enum.ts +8 -0
- package/enum/pre-order-collection-item-import-errors.enum.ts +11 -0
- package/package.json +1 -1
- package/schemas/consignment-transfer/accept-consignment-transfer.schema.ts +33 -0
- package/schemas/consignment-transfer/cancel-consignment-transfer.schema.ts +7 -0
- package/schemas/consignment-transfer/consignment-transfer-request-item.schema.ts +22 -0
- package/schemas/consignment-transfer/consignment-transfer-request.schema.ts +19 -0
- package/schemas/consignment-transfer/create-consignment-transfer.schema.ts +22 -0
- package/schemas/consignment-transfer/get-consignment-transfer-list.schema.ts +18 -0
- package/schemas/consignment-transfer/get-consignment-transfer.schema.ts +15 -0
- package/schemas/consignment-transfer/index.ts +8 -0
- package/schemas/consignment-transfer/reject-consignment-transfer.schema.ts +11 -0
- package/schemas/index.ts +1 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AcceptConsignmentTransferContractCommand = void 0;
|
|
4
|
+
const accept_consignment_transfer_schema_1 = require("../../schemas/consignment-transfer/accept-consignment-transfer.schema");
|
|
5
|
+
var AcceptConsignmentTransferContractCommand;
|
|
6
|
+
(function (AcceptConsignmentTransferContractCommand) {
|
|
7
|
+
AcceptConsignmentTransferContractCommand.RequestSchema = accept_consignment_transfer_schema_1.AcceptConsignmentTransferRequestSchema;
|
|
8
|
+
AcceptConsignmentTransferContractCommand.ResponseSchema = accept_consignment_transfer_schema_1.AcceptConsignmentTransferResponseSchema;
|
|
9
|
+
})(AcceptConsignmentTransferContractCommand || (exports.AcceptConsignmentTransferContractCommand = AcceptConsignmentTransferContractCommand = {}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CancelConsignmentTransferContractCommand = void 0;
|
|
4
|
+
const cancel_consignment_transfer_schema_1 = require("../../schemas/consignment-transfer/cancel-consignment-transfer.schema");
|
|
5
|
+
var CancelConsignmentTransferContractCommand;
|
|
6
|
+
(function (CancelConsignmentTransferContractCommand) {
|
|
7
|
+
CancelConsignmentTransferContractCommand.ResponseSchema = cancel_consignment_transfer_schema_1.CancelConsignmentTransferResponseSchema;
|
|
8
|
+
})(CancelConsignmentTransferContractCommand || (exports.CancelConsignmentTransferContractCommand = CancelConsignmentTransferContractCommand = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateConsignmentTransferContractCommand = void 0;
|
|
4
|
+
const create_consignment_transfer_schema_1 = require("../../schemas/consignment-transfer/create-consignment-transfer.schema");
|
|
5
|
+
var CreateConsignmentTransferContractCommand;
|
|
6
|
+
(function (CreateConsignmentTransferContractCommand) {
|
|
7
|
+
CreateConsignmentTransferContractCommand.RequestSchema = create_consignment_transfer_schema_1.CreateConsignmentTransferRequestSchema;
|
|
8
|
+
CreateConsignmentTransferContractCommand.ResponseSchema = create_consignment_transfer_schema_1.CreateConsignmentTransferResponseSchema;
|
|
9
|
+
})(CreateConsignmentTransferContractCommand || (exports.CreateConsignmentTransferContractCommand = CreateConsignmentTransferContractCommand = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetConsignmentTransferListContractQuery = void 0;
|
|
4
|
+
const get_consignment_transfer_list_schema_1 = require("../../schemas/consignment-transfer/get-consignment-transfer-list.schema");
|
|
5
|
+
var GetConsignmentTransferListContractQuery;
|
|
6
|
+
(function (GetConsignmentTransferListContractQuery) {
|
|
7
|
+
GetConsignmentTransferListContractQuery.RequestSchema = get_consignment_transfer_list_schema_1.GetConsignmentTransferListRequestSchema;
|
|
8
|
+
GetConsignmentTransferListContractQuery.ResponseSchema = get_consignment_transfer_list_schema_1.GetConsignmentTransferListResponseSchema;
|
|
9
|
+
})(GetConsignmentTransferListContractQuery || (exports.GetConsignmentTransferListContractQuery = GetConsignmentTransferListContractQuery = {}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetConsignmentTransferContractQuery = void 0;
|
|
4
|
+
const get_consignment_transfer_schema_1 = require("../../schemas/consignment-transfer/get-consignment-transfer.schema");
|
|
5
|
+
var GetConsignmentTransferContractQuery;
|
|
6
|
+
(function (GetConsignmentTransferContractQuery) {
|
|
7
|
+
GetConsignmentTransferContractQuery.ResponseSchema = get_consignment_transfer_schema_1.GetConsignmentTransferResponseSchema;
|
|
8
|
+
})(GetConsignmentTransferContractQuery || (exports.GetConsignmentTransferContractQuery = GetConsignmentTransferContractQuery = {}));
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./create-consignment-transfer.command"), exports);
|
|
18
|
+
__exportStar(require("./get-consignment-transfer-list.query"), exports);
|
|
19
|
+
__exportStar(require("./get-consignment-transfer.query"), exports);
|
|
20
|
+
__exportStar(require("./cancel-consignment-transfer.command"), exports);
|
|
21
|
+
__exportStar(require("./reject-consignment-transfer.command"), exports);
|
|
22
|
+
__exportStar(require("./accept-consignment-transfer.command"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RejectConsignmentTransferContractCommand = void 0;
|
|
4
|
+
const reject_consignment_transfer_schema_1 = require("../../schemas/consignment-transfer/reject-consignment-transfer.schema");
|
|
5
|
+
var RejectConsignmentTransferContractCommand;
|
|
6
|
+
(function (RejectConsignmentTransferContractCommand) {
|
|
7
|
+
RejectConsignmentTransferContractCommand.RequestSchema = reject_consignment_transfer_schema_1.RejectConsignmentTransferRequestSchema;
|
|
8
|
+
RejectConsignmentTransferContractCommand.ResponseSchema = reject_consignment_transfer_schema_1.RejectConsignmentTransferResponseSchema;
|
|
9
|
+
})(RejectConsignmentTransferContractCommand || (exports.RejectConsignmentTransferContractCommand = RejectConsignmentTransferContractCommand = {}));
|
package/build/commands/index.js
CHANGED
|
@@ -78,3 +78,4 @@ var create_ws_ticket_command_1 = require("./session/create-ws-ticket.command");
|
|
|
78
78
|
Object.defineProperty(exports, "CreateWsTicketContractCommand", { enumerable: true, get: function () { return create_ws_ticket_command_1.CreateWsTicketContractCommand; } });
|
|
79
79
|
var validate_ws_ticket_s2s_query_1 = require("./session/validate-ws-ticket-s2s.query");
|
|
80
80
|
Object.defineProperty(exports, "ValidateWsTicketS2SContractQuery", { enumerable: true, get: function () { return validate_ws_ticket_s2s_query_1.ValidateWsTicketS2SContractQuery; } });
|
|
81
|
+
__exportStar(require("./consignment-transfer"), exports);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ImportPreOrderCollectionItemContractCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const enum_1 = require("../../enum");
|
|
6
|
+
const ImportPreOrderCollectionItemRequestSchema = zod_1.z.object({});
|
|
7
|
+
const PreOrderCollectionItemImportIssueParamsSchema = zod_1.z.record(zod_1.z.string(), zod_1.z.union([zod_1.z.string(), zod_1.z.number(), zod_1.z.null(), zod_1.z.array(zod_1.z.string())]));
|
|
8
|
+
const PreOrderCollectionItemImportIssueSchema = zod_1.z.object({
|
|
9
|
+
path: zod_1.z.nativeEnum(enum_1.PreOrderCollectionItemImportEntityPropertyEnum).optional(),
|
|
10
|
+
type: zod_1.z.nativeEnum(enum_1.PreOrderCollectionItemImportErrorsEnum),
|
|
11
|
+
params: PreOrderCollectionItemImportIssueParamsSchema.optional(),
|
|
12
|
+
});
|
|
13
|
+
const PreOrderCollectionItemImportRowErrorSchema = zod_1.z.object({
|
|
14
|
+
row: zod_1.z.number(),
|
|
15
|
+
errors: zod_1.z.array(PreOrderCollectionItemImportIssueSchema),
|
|
16
|
+
});
|
|
17
|
+
const PreOrderCollectionItemImportGlobalErrorSchema = zod_1.z.object({
|
|
18
|
+
errors: zod_1.z.array(PreOrderCollectionItemImportIssueSchema),
|
|
19
|
+
});
|
|
20
|
+
const PreOrderCollectionItemImportCreatedRowSchema = zod_1.z.object({
|
|
21
|
+
row: zod_1.z.number(),
|
|
22
|
+
uuid: zod_1.z.string(),
|
|
23
|
+
});
|
|
24
|
+
const ImportPreOrderCollectionItemResponseSchema = zod_1.z.object({
|
|
25
|
+
message: zod_1.z.string().optional(),
|
|
26
|
+
data: zod_1.z.object({
|
|
27
|
+
rows: zod_1.z.number(),
|
|
28
|
+
created: zod_1.z.array(PreOrderCollectionItemImportCreatedRowSchema),
|
|
29
|
+
errors: zod_1.z.array(PreOrderCollectionItemImportRowErrorSchema),
|
|
30
|
+
warnings: zod_1.z.array(PreOrderCollectionItemImportRowErrorSchema),
|
|
31
|
+
globalErrors: zod_1.z.array(PreOrderCollectionItemImportGlobalErrorSchema).optional(),
|
|
32
|
+
}),
|
|
33
|
+
});
|
|
34
|
+
var ImportPreOrderCollectionItemContractCommand;
|
|
35
|
+
(function (ImportPreOrderCollectionItemContractCommand) {
|
|
36
|
+
ImportPreOrderCollectionItemContractCommand.RequestSchema = ImportPreOrderCollectionItemRequestSchema;
|
|
37
|
+
ImportPreOrderCollectionItemContractCommand.ResponseSchema = ImportPreOrderCollectionItemResponseSchema;
|
|
38
|
+
})(ImportPreOrderCollectionItemContractCommand || (exports.ImportPreOrderCollectionItemContractCommand = ImportPreOrderCollectionItemContractCommand = {}));
|
|
@@ -41,3 +41,4 @@ __exportStar(require("./multiplicity-option/reorder-pre-order-collection-item-mu
|
|
|
41
41
|
__exportStar(require("./execute-pre-order-collection-item-update.command"), exports);
|
|
42
42
|
__exportStar(require("./move-pre-order-collection-items-analyze.command"), exports);
|
|
43
43
|
__exportStar(require("./move-pre-order-collection-items-execute.command"), exports);
|
|
44
|
+
__exportStar(require("./import-pre-order-collection-item.command"), exports);
|
|
@@ -7,6 +7,7 @@ const ArchiveFileItemSchema = zod_1.z.object({
|
|
|
7
7
|
grower: zod_1.z.string(),
|
|
8
8
|
name: zod_1.z.string(),
|
|
9
9
|
size: zod_1.z.string(),
|
|
10
|
+
categoryName: zod_1.z.string(),
|
|
10
11
|
});
|
|
11
12
|
const GetWriteOffArchiveFilesResponseSchema = zod_1.z.object({
|
|
12
13
|
message: zod_1.z.string().optional(),
|
|
@@ -25,4 +25,8 @@ exports.ErrorI18nKey = {
|
|
|
25
25
|
transactionImportTooManyRows: 'transactionImport.tooManyRows',
|
|
26
26
|
transactionImportInvalidFileFormat: 'transactionImport.invalidFileFormat',
|
|
27
27
|
transactionImportMissingRequiredColumns: 'transactionImport.missingRequiredColumns',
|
|
28
|
+
preOrderCollectionItemImportTooManyRows: 'preOrderCollectionItemImport.tooManyRows',
|
|
29
|
+
preOrderCollectionItemImportInvalidFileFormat: 'preOrderCollectionItemImport.invalidFileFormat',
|
|
30
|
+
preOrderCollectionItemImportMissingRequiredColumns: 'preOrderCollectionItemImport.missingRequiredColumns',
|
|
31
|
+
preOrderCollectionItemImportFailed: 'preOrderCollectionItemImport.failed',
|
|
28
32
|
};
|
package/build/constant/error.js
CHANGED
|
@@ -879,6 +879,21 @@ exports.ERRORS = {
|
|
|
879
879
|
message: 'Failed to move pre order collection items',
|
|
880
880
|
httpCode: 500,
|
|
881
881
|
},
|
|
882
|
+
PRE_ORDER_COLLECTION_ITEM_IMPORT_TOO_MANY_ROWS: {
|
|
883
|
+
code: 'POCI025',
|
|
884
|
+
message: 'Too many rows for pre order collection item import',
|
|
885
|
+
httpCode: 400,
|
|
886
|
+
},
|
|
887
|
+
PRE_ORDER_COLLECTION_ITEM_IMPORT_INVALID_FILE_FORMAT: {
|
|
888
|
+
code: 'POCI026',
|
|
889
|
+
message: 'Invalid file format for pre order collection item import',
|
|
890
|
+
httpCode: 400,
|
|
891
|
+
},
|
|
892
|
+
PRE_ORDER_COLLECTION_ITEM_IMPORT_MISSING_REQUIRED_COLUMNS: {
|
|
893
|
+
code: 'POCI027',
|
|
894
|
+
message: 'Missing required columns in pre order collection item import file',
|
|
895
|
+
httpCode: 400,
|
|
896
|
+
},
|
|
882
897
|
// EMPLOYEE SCHEDULE
|
|
883
898
|
EMPLOYEE_SCHEDULE_NOT_CREATED: { code: 'ES001', message: 'Failed to create employee schedule', httpCode: 500 },
|
|
884
899
|
EMPLOYEE_SCHEDULE_NOT_DELETED: { code: 'ES002', message: 'Failed to delete employee schedule', httpCode: 500 },
|
|
@@ -1115,4 +1130,18 @@ exports.ERRORS = {
|
|
|
1115
1130
|
ONE_C_INVALID_CREDENTIALS: { code: 'OC003', message: '1C credentials are invalid', httpCode: 401 },
|
|
1116
1131
|
ONE_C_INTEGRATION_DISABLED: { code: 'OC004', message: '1C integration is disabled for this company', httpCode: 409 },
|
|
1117
1132
|
ONE_C_SESSION_INVALID: { code: 'OC005', message: '1C session is missing or expired', httpCode: 401 },
|
|
1133
|
+
// CONSIGNMENT TRANSFER (FC-227)
|
|
1134
|
+
CONSIGNMENT_TRANSFER_NOT_CREATED: { code: 'CTR001', message: 'Failed to create consignment transfer request', httpCode: 500 },
|
|
1135
|
+
CONSIGNMENT_TRANSFER_NOT_FOUND: { code: 'CTR002', message: 'Consignment transfer request not found', httpCode: 404 },
|
|
1136
|
+
CONSIGNMENT_TRANSFER_FETCH_FAILED: { code: 'CTR003', message: 'Failed to fetch consignment transfer requests', httpCode: 500 },
|
|
1137
|
+
CONSIGNMENT_TRANSFER_RECEIVER_NOT_FOUND: { code: 'CTR004', message: 'Receiver company not found or inactive', httpCode: 404 },
|
|
1138
|
+
CONSIGNMENT_TRANSFER_RECEIVER_IS_SENDER: { code: 'CTR005', message: 'Cannot transfer a consignment to your own company', httpCode: 400 },
|
|
1139
|
+
CONSIGNMENT_TRANSFER_PRODUCT_NOT_FOUND: { code: 'CTR006', message: 'Transfer position not found in the source consignment', httpCode: 404 },
|
|
1140
|
+
CONSIGNMENT_TRANSFER_QUANTITY_EXCEEDS_BALANCE: { code: 'CTR007', message: 'Requested quantity exceeds the available product balance', httpCode: 400 },
|
|
1141
|
+
CONSIGNMENT_TRANSFER_NOT_PENDING: { code: 'CTR008', message: 'Consignment transfer request is not pending', httpCode: 409 },
|
|
1142
|
+
CONSIGNMENT_TRANSFER_NOT_UPDATED: { code: 'CTR009', message: 'Failed to update consignment transfer request', httpCode: 500 },
|
|
1143
|
+
CONSIGNMENT_TRANSFER_ITEMS_MISMATCH: { code: 'CTR010', message: 'Accept payload must map every transfer position exactly once', httpCode: 400 },
|
|
1144
|
+
CONSIGNMENT_TRANSFER_CATEGORY_NOT_FOUND: { code: 'CTR011', message: 'Mapped category not found in the receiver company', httpCode: 404 },
|
|
1145
|
+
CONSIGNMENT_TRANSFER_TARGET_CONSIGNMENT_NOT_FOUND: { code: 'CTR012', message: 'Target consignment not found in the receiver company', httpCode: 404 },
|
|
1146
|
+
CONSIGNMENT_TRANSFER_ACCEPT_FAILED: { code: 'CTR013', message: 'Failed to accept consignment transfer request', httpCode: 500 },
|
|
1118
1147
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConsignmentTransferDirectionEnum = void 0;
|
|
4
|
+
var ConsignmentTransferDirectionEnum;
|
|
5
|
+
(function (ConsignmentTransferDirectionEnum) {
|
|
6
|
+
ConsignmentTransferDirectionEnum["INCOMING"] = "incoming";
|
|
7
|
+
ConsignmentTransferDirectionEnum["OUTGOING"] = "outgoing";
|
|
8
|
+
})(ConsignmentTransferDirectionEnum || (exports.ConsignmentTransferDirectionEnum = ConsignmentTransferDirectionEnum = {}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConsignmentTransferRequestStatusEnum = void 0;
|
|
4
|
+
var ConsignmentTransferRequestStatusEnum;
|
|
5
|
+
(function (ConsignmentTransferRequestStatusEnum) {
|
|
6
|
+
ConsignmentTransferRequestStatusEnum["PENDING"] = "PENDING";
|
|
7
|
+
ConsignmentTransferRequestStatusEnum["ACCEPTED"] = "ACCEPTED";
|
|
8
|
+
ConsignmentTransferRequestStatusEnum["REJECTED"] = "REJECTED";
|
|
9
|
+
ConsignmentTransferRequestStatusEnum["CANCELLED"] = "CANCELLED";
|
|
10
|
+
})(ConsignmentTransferRequestStatusEnum || (exports.ConsignmentTransferRequestStatusEnum = ConsignmentTransferRequestStatusEnum = {}));
|
package/build/enum/index.js
CHANGED
|
@@ -67,6 +67,7 @@ __exportStar(require("./client-import-errors.enum"), exports);
|
|
|
67
67
|
__exportStar(require("./transaction-import-entity-property.enum"), exports);
|
|
68
68
|
__exportStar(require("./transaction-import-errors.enum"), exports);
|
|
69
69
|
__exportStar(require("./pre-order-collection-item-import-entity-property.enum"), exports);
|
|
70
|
+
__exportStar(require("./pre-order-collection-item-import-errors.enum"), exports);
|
|
70
71
|
__exportStar(require("./report-period-type.enum"), exports);
|
|
71
72
|
__exportStar(require("./inventory-movement-type.enum"), exports);
|
|
72
73
|
__exportStar(require("./client-statement-type.enum"), exports);
|
|
@@ -99,4 +100,6 @@ __exportStar(require("./account-deletion-request-source.enum"), exports);
|
|
|
99
100
|
__exportStar(require("./bulk-create-product-image-alias-skip-reason.enum"), exports);
|
|
100
101
|
__exportStar(require("./bulk-create-product-image-alias-from-pre-order-collection-item-skip-reason.enum"), exports);
|
|
101
102
|
__exportStar(require("./moysklad-sync-status.enum"), exports);
|
|
103
|
+
__exportStar(require("./consignment-transfer-request-status.enum"), exports);
|
|
104
|
+
__exportStar(require("./consignment-transfer-direction.enum"), exports);
|
|
102
105
|
__exportStar(require("./legal-identifier-field.enum"), exports);
|
|
@@ -26,4 +26,11 @@ var PreOrderCollectionItemImportEntityPropertyEnum;
|
|
|
26
26
|
PreOrderCollectionItemImportEntityPropertyEnum["MULTIPLICITY_DESCRIPTION"] = "MULTIPLICITY_DESCRIPTION";
|
|
27
27
|
// Специальные поля
|
|
28
28
|
PreOrderCollectionItemImportEntityPropertyEnum["SALES_UNIT"] = "SALES_UNIT";
|
|
29
|
+
// Опции кратности
|
|
30
|
+
PreOrderCollectionItemImportEntityPropertyEnum["OPTION1_TITLE"] = "OPTION1_TITLE";
|
|
31
|
+
PreOrderCollectionItemImportEntityPropertyEnum["OPTION1_MULTIPLICITY"] = "OPTION1_MULTIPLICITY";
|
|
32
|
+
PreOrderCollectionItemImportEntityPropertyEnum["OPTION1_PRICE"] = "OPTION1_PRICE";
|
|
33
|
+
PreOrderCollectionItemImportEntityPropertyEnum["OPTION2_TITLE"] = "OPTION2_TITLE";
|
|
34
|
+
PreOrderCollectionItemImportEntityPropertyEnum["OPTION2_MULTIPLICITY"] = "OPTION2_MULTIPLICITY";
|
|
35
|
+
PreOrderCollectionItemImportEntityPropertyEnum["OPTION2_PRICE"] = "OPTION2_PRICE";
|
|
29
36
|
})(PreOrderCollectionItemImportEntityPropertyEnum || (exports.PreOrderCollectionItemImportEntityPropertyEnum = PreOrderCollectionItemImportEntityPropertyEnum = {}));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PreOrderCollectionItemImportErrorsEnum = void 0;
|
|
4
|
+
var PreOrderCollectionItemImportErrorsEnum;
|
|
5
|
+
(function (PreOrderCollectionItemImportErrorsEnum) {
|
|
6
|
+
PreOrderCollectionItemImportErrorsEnum["INVALID_FILE_FORMAT"] = "INVALID_FILE_FORMAT";
|
|
7
|
+
PreOrderCollectionItemImportErrorsEnum["TOO_MANY_ROWS"] = "TOO_MANY_ROWS";
|
|
8
|
+
PreOrderCollectionItemImportErrorsEnum["MISSING_REQUIRED_COLUMNS"] = "MISSING_REQUIRED_COLUMNS";
|
|
9
|
+
PreOrderCollectionItemImportErrorsEnum["IMPORT_FAILED"] = "IMPORT_FAILED";
|
|
10
|
+
PreOrderCollectionItemImportErrorsEnum["REQUIRED"] = "REQUIRED";
|
|
11
|
+
PreOrderCollectionItemImportErrorsEnum["INVALID_VALUE"] = "INVALID_VALUE";
|
|
12
|
+
PreOrderCollectionItemImportErrorsEnum["CATEGORY_NOT_FOUND"] = "CATEGORY_NOT_FOUND";
|
|
13
|
+
PreOrderCollectionItemImportErrorsEnum["NOT_CREATED"] = "NOT_CREATED";
|
|
14
|
+
PreOrderCollectionItemImportErrorsEnum["UNKNOWN"] = "UNKNOWN";
|
|
15
|
+
})(PreOrderCollectionItemImportErrorsEnum || (exports.PreOrderCollectionItemImportErrorsEnum = PreOrderCollectionItemImportErrorsEnum = {}));
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AcceptConsignmentTransferResponseSchema = exports.AcceptConsignmentTransferRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const consignment_transfer_request_schema_1 = require("./consignment-transfer-request.schema");
|
|
6
|
+
exports.AcceptConsignmentTransferRequestSchema = zod_1.z
|
|
7
|
+
.object({
|
|
8
|
+
// Accept into an existing consignment of the receiver OR create a new one — exactly one of the two.
|
|
9
|
+
targetConsignmentUUID: zod_1.z.uuid().optional(),
|
|
10
|
+
newConsignment: zod_1.z
|
|
11
|
+
.object({
|
|
12
|
+
deliveryDate: zod_1.z.coerce.date().min(new Date('2000-01-01')).max(new Date('2100-01-01')),
|
|
13
|
+
description: zod_1.z.string().max(2000).nullable().optional(),
|
|
14
|
+
label: zod_1.z.string().max(255).nullable().optional(),
|
|
15
|
+
})
|
|
16
|
+
.optional(),
|
|
17
|
+
items: zod_1.z
|
|
18
|
+
.array(zod_1.z.object({
|
|
19
|
+
itemUUID: zod_1.z.uuid(),
|
|
20
|
+
categoryUUID: zod_1.z.uuid(),
|
|
21
|
+
price: zod_1.z.number().min(0).optional(),
|
|
22
|
+
}))
|
|
23
|
+
.min(1),
|
|
24
|
+
})
|
|
25
|
+
.refine(data => Boolean(data.targetConsignmentUUID) !== Boolean(data.newConsignment), {
|
|
26
|
+
message: 'Provide either targetConsignmentUUID or newConsignment, not both',
|
|
27
|
+
path: ['targetConsignmentUUID'],
|
|
28
|
+
});
|
|
29
|
+
exports.AcceptConsignmentTransferResponseSchema = zod_1.z.object({
|
|
30
|
+
message: zod_1.z.string().optional(),
|
|
31
|
+
data: consignment_transfer_request_schema_1.ConsignmentTransferRequestSchema,
|
|
32
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CancelConsignmentTransferResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const consignment_transfer_request_schema_1 = require("./consignment-transfer-request.schema");
|
|
6
|
+
exports.CancelConsignmentTransferResponseSchema = zod_1.z.object({
|
|
7
|
+
message: zod_1.z.string().optional(),
|
|
8
|
+
data: consignment_transfer_request_schema_1.ConsignmentTransferRequestSchema,
|
|
9
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConsignmentTransferRequestItemSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.ConsignmentTransferRequestItemSchema = zod_1.z.object({
|
|
6
|
+
uuid: zod_1.z.uuid(),
|
|
7
|
+
sourceProductUUID: zod_1.z.uuid(),
|
|
8
|
+
targetProductUUID: zod_1.z.uuid().nullable(),
|
|
9
|
+
name: zod_1.z.string(),
|
|
10
|
+
quantity: zod_1.z.number().int(),
|
|
11
|
+
transferPrice: zod_1.z.number(),
|
|
12
|
+
categoryName: zod_1.z.string().nullable(),
|
|
13
|
+
multiplicity: zod_1.z.number().int(),
|
|
14
|
+
grower: zod_1.z.string().nullable(),
|
|
15
|
+
size: zod_1.z.string().nullable(),
|
|
16
|
+
size2: zod_1.z.string().nullable(),
|
|
17
|
+
size3: zod_1.z.string().nullable(),
|
|
18
|
+
color: zod_1.z.string().nullable(),
|
|
19
|
+
country: zod_1.z.string().nullable(),
|
|
20
|
+
article: zod_1.z.string().nullable(),
|
|
21
|
+
barcode: zod_1.z.string().nullable(),
|
|
22
|
+
description: zod_1.z.string().nullable(),
|
|
23
|
+
quality: zod_1.z.string().nullable(),
|
|
24
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConsignmentTransferRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const enum_1 = require("../../enum");
|
|
6
|
+
exports.ConsignmentTransferRequestSchema = zod_1.z.object({
|
|
7
|
+
uuid: zod_1.z.uuid(),
|
|
8
|
+
senderCompanyUUID: zod_1.z.uuid(),
|
|
9
|
+
senderCompanyName: zod_1.z.string().optional(),
|
|
10
|
+
receiverCompanyUUID: zod_1.z.uuid(),
|
|
11
|
+
receiverCompanyName: zod_1.z.string().optional(),
|
|
12
|
+
sourceConsignmentUUID: zod_1.z.uuid(),
|
|
13
|
+
targetConsignmentUUID: zod_1.z.uuid().nullable(),
|
|
14
|
+
status: zod_1.z.nativeEnum(enum_1.ConsignmentTransferRequestStatusEnum),
|
|
15
|
+
comment: zod_1.z.string().nullable(),
|
|
16
|
+
processedComment: zod_1.z.string().nullable(),
|
|
17
|
+
processedAt: zod_1.z.date().nullable(),
|
|
18
|
+
itemsCount: zod_1.z.number().int().optional(),
|
|
19
|
+
createdAt: zod_1.z.date(),
|
|
20
|
+
updatedAt: zod_1.z.date(),
|
|
21
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateConsignmentTransferResponseSchema = exports.CreateConsignmentTransferRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const consignment_transfer_request_schema_1 = require("./consignment-transfer-request.schema");
|
|
6
|
+
exports.CreateConsignmentTransferRequestSchema = zod_1.z.object({
|
|
7
|
+
receiverCompanyUUID: zod_1.z.uuid(),
|
|
8
|
+
sourceConsignmentUUID: zod_1.z.uuid(),
|
|
9
|
+
comment: zod_1.z.string().max(2000).nullable().optional(),
|
|
10
|
+
items: zod_1.z
|
|
11
|
+
.array(zod_1.z.object({
|
|
12
|
+
productUUID: zod_1.z.uuid(),
|
|
13
|
+
quantity: zod_1.z.number().int().min(1),
|
|
14
|
+
}))
|
|
15
|
+
.min(1)
|
|
16
|
+
.max(500),
|
|
17
|
+
});
|
|
18
|
+
exports.CreateConsignmentTransferResponseSchema = zod_1.z.object({
|
|
19
|
+
message: zod_1.z.string().optional(),
|
|
20
|
+
data: consignment_transfer_request_schema_1.ConsignmentTransferRequestSchema,
|
|
21
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetConsignmentTransferListResponseSchema = exports.GetConsignmentTransferListRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const enum_1 = require("../../enum");
|
|
6
|
+
const consignment_transfer_request_schema_1 = require("./consignment-transfer-request.schema");
|
|
7
|
+
exports.GetConsignmentTransferListRequestSchema = zod_1.z.object({
|
|
8
|
+
direction: zod_1.z.nativeEnum(enum_1.ConsignmentTransferDirectionEnum),
|
|
9
|
+
status: zod_1.z.nativeEnum(enum_1.ConsignmentTransferRequestStatusEnum).optional(),
|
|
10
|
+
page: zod_1.z.coerce.number().int().min(1).optional().default(1),
|
|
11
|
+
count: zod_1.z.coerce.number().int().min(1).max(100).optional().default(10),
|
|
12
|
+
});
|
|
13
|
+
exports.GetConsignmentTransferListResponseSchema = zod_1.z.object({
|
|
14
|
+
message: zod_1.z.string().optional(),
|
|
15
|
+
data: zod_1.z.object({
|
|
16
|
+
transferList: consignment_transfer_request_schema_1.ConsignmentTransferRequestSchema.array(),
|
|
17
|
+
total: zod_1.z.number(),
|
|
18
|
+
}),
|
|
19
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetConsignmentTransferResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const consignment_transfer_request_schema_1 = require("./consignment-transfer-request.schema");
|
|
6
|
+
const consignment_transfer_request_item_schema_1 = require("./consignment-transfer-request-item.schema");
|
|
7
|
+
exports.GetConsignmentTransferResponseSchema = zod_1.z.object({
|
|
8
|
+
message: zod_1.z.string().optional(),
|
|
9
|
+
data: zod_1.z.object({
|
|
10
|
+
request: consignment_transfer_request_schema_1.ConsignmentTransferRequestSchema,
|
|
11
|
+
items: consignment_transfer_request_item_schema_1.ConsignmentTransferRequestItemSchema.extend({
|
|
12
|
+
// Receiver-side convenience: suggested local category resolved by name (null when no match).
|
|
13
|
+
suggestedCategoryUUID: zod_1.z.uuid().nullable().optional(),
|
|
14
|
+
suggestedCategoryName: zod_1.z.string().nullable().optional(),
|
|
15
|
+
}).array(),
|
|
16
|
+
}),
|
|
17
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./consignment-transfer-request.schema"), exports);
|
|
18
|
+
__exportStar(require("./consignment-transfer-request-item.schema"), exports);
|
|
19
|
+
__exportStar(require("./create-consignment-transfer.schema"), exports);
|
|
20
|
+
__exportStar(require("./get-consignment-transfer-list.schema"), exports);
|
|
21
|
+
__exportStar(require("./get-consignment-transfer.schema"), exports);
|
|
22
|
+
__exportStar(require("./cancel-consignment-transfer.schema"), exports);
|
|
23
|
+
__exportStar(require("./reject-consignment-transfer.schema"), exports);
|
|
24
|
+
__exportStar(require("./accept-consignment-transfer.schema"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RejectConsignmentTransferResponseSchema = exports.RejectConsignmentTransferRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const consignment_transfer_request_schema_1 = require("./consignment-transfer-request.schema");
|
|
6
|
+
exports.RejectConsignmentTransferRequestSchema = zod_1.z.object({
|
|
7
|
+
comment: zod_1.z.string().max(2000).nullable().optional(),
|
|
8
|
+
});
|
|
9
|
+
exports.RejectConsignmentTransferResponseSchema = zod_1.z.object({
|
|
10
|
+
message: zod_1.z.string().optional(),
|
|
11
|
+
data: consignment_transfer_request_schema_1.ConsignmentTransferRequestSchema,
|
|
12
|
+
});
|
package/build/schemas/index.js
CHANGED
|
@@ -78,3 +78,4 @@ __exportStar(require("./bank-payment/get-bank-payment-match-suggestions.schema")
|
|
|
78
78
|
__exportStar(require("./messenger-profile"), exports);
|
|
79
79
|
__exportStar(require("./error-message.schema"), exports);
|
|
80
80
|
__exportStar(require("./account-deletion-request/account-deletion-request.schema"), exports);
|
|
81
|
+
__exportStar(require("./consignment-transfer"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import {
|
|
3
|
+
AcceptConsignmentTransferRequestSchema,
|
|
4
|
+
AcceptConsignmentTransferResponseSchema,
|
|
5
|
+
} from '../../schemas/consignment-transfer/accept-consignment-transfer.schema';
|
|
6
|
+
|
|
7
|
+
export namespace AcceptConsignmentTransferContractCommand {
|
|
8
|
+
export const RequestSchema = AcceptConsignmentTransferRequestSchema;
|
|
9
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
10
|
+
|
|
11
|
+
export const ResponseSchema = AcceptConsignmentTransferResponseSchema;
|
|
12
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { CancelConsignmentTransferResponseSchema } from '../../schemas/consignment-transfer/cancel-consignment-transfer.schema';
|
|
3
|
+
|
|
4
|
+
export namespace CancelConsignmentTransferContractCommand {
|
|
5
|
+
export const ResponseSchema = CancelConsignmentTransferResponseSchema;
|
|
6
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import {
|
|
3
|
+
CreateConsignmentTransferRequestSchema,
|
|
4
|
+
CreateConsignmentTransferResponseSchema,
|
|
5
|
+
} from '../../schemas/consignment-transfer/create-consignment-transfer.schema';
|
|
6
|
+
|
|
7
|
+
export namespace CreateConsignmentTransferContractCommand {
|
|
8
|
+
export const RequestSchema = CreateConsignmentTransferRequestSchema;
|
|
9
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
10
|
+
|
|
11
|
+
export const ResponseSchema = CreateConsignmentTransferResponseSchema;
|
|
12
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import {
|
|
3
|
+
GetConsignmentTransferListRequestSchema,
|
|
4
|
+
GetConsignmentTransferListResponseSchema,
|
|
5
|
+
} from '../../schemas/consignment-transfer/get-consignment-transfer-list.schema';
|
|
6
|
+
|
|
7
|
+
export namespace GetConsignmentTransferListContractQuery {
|
|
8
|
+
export const RequestSchema = GetConsignmentTransferListRequestSchema;
|
|
9
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
10
|
+
|
|
11
|
+
export const ResponseSchema = GetConsignmentTransferListResponseSchema;
|
|
12
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { GetConsignmentTransferResponseSchema } from '../../schemas/consignment-transfer/get-consignment-transfer.schema';
|
|
3
|
+
|
|
4
|
+
export namespace GetConsignmentTransferContractQuery {
|
|
5
|
+
export const ResponseSchema = GetConsignmentTransferResponseSchema;
|
|
6
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './create-consignment-transfer.command';
|
|
2
|
+
export * from './get-consignment-transfer-list.query';
|
|
3
|
+
export * from './get-consignment-transfer.query';
|
|
4
|
+
export * from './cancel-consignment-transfer.command';
|
|
5
|
+
export * from './reject-consignment-transfer.command';
|
|
6
|
+
export * from './accept-consignment-transfer.command';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import {
|
|
3
|
+
RejectConsignmentTransferRequestSchema,
|
|
4
|
+
RejectConsignmentTransferResponseSchema,
|
|
5
|
+
} from '../../schemas/consignment-transfer/reject-consignment-transfer.schema';
|
|
6
|
+
|
|
7
|
+
export namespace RejectConsignmentTransferContractCommand {
|
|
8
|
+
export const RequestSchema = RejectConsignmentTransferRequestSchema;
|
|
9
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
10
|
+
|
|
11
|
+
export const ResponseSchema = RejectConsignmentTransferResponseSchema;
|
|
12
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
13
|
+
}
|
package/commands/index.ts
CHANGED
|
@@ -55,3 +55,4 @@ export { GetActiveSessionsContractQuery } from './session/get-active-sessions.qu
|
|
|
55
55
|
export { ValidateSessionS2SContractQuery } from './session/validate-session-s2s.query';
|
|
56
56
|
export { CreateWsTicketContractCommand } from './session/create-ws-ticket.command';
|
|
57
57
|
export { ValidateWsTicketS2SContractQuery } from './session/validate-ws-ticket-s2s.query';
|
|
58
|
+
export * from './consignment-transfer';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PreOrderCollectionItemImportEntityPropertyEnum, PreOrderCollectionItemImportErrorsEnum } from '../../enum';
|
|
3
|
+
|
|
4
|
+
const ImportPreOrderCollectionItemRequestSchema = z.object({});
|
|
5
|
+
|
|
6
|
+
const PreOrderCollectionItemImportIssueParamsSchema = z.record(
|
|
7
|
+
z.string(),
|
|
8
|
+
z.union([z.string(), z.number(), z.null(), z.array(z.string())]),
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
const PreOrderCollectionItemImportIssueSchema = z.object({
|
|
12
|
+
path: z.nativeEnum(PreOrderCollectionItemImportEntityPropertyEnum).optional(),
|
|
13
|
+
type: z.nativeEnum(PreOrderCollectionItemImportErrorsEnum),
|
|
14
|
+
params: PreOrderCollectionItemImportIssueParamsSchema.optional(),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const PreOrderCollectionItemImportRowErrorSchema = z.object({
|
|
18
|
+
row: z.number(),
|
|
19
|
+
errors: z.array(PreOrderCollectionItemImportIssueSchema),
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const PreOrderCollectionItemImportGlobalErrorSchema = z.object({
|
|
23
|
+
errors: z.array(PreOrderCollectionItemImportIssueSchema),
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const PreOrderCollectionItemImportCreatedRowSchema = z.object({
|
|
27
|
+
row: z.number(),
|
|
28
|
+
uuid: z.string(),
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const ImportPreOrderCollectionItemResponseSchema = z.object({
|
|
32
|
+
message: z.string().optional(),
|
|
33
|
+
data: z.object({
|
|
34
|
+
rows: z.number(),
|
|
35
|
+
created: z.array(PreOrderCollectionItemImportCreatedRowSchema),
|
|
36
|
+
errors: z.array(PreOrderCollectionItemImportRowErrorSchema),
|
|
37
|
+
warnings: z.array(PreOrderCollectionItemImportRowErrorSchema),
|
|
38
|
+
globalErrors: z.array(PreOrderCollectionItemImportGlobalErrorSchema).optional(),
|
|
39
|
+
}),
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export namespace ImportPreOrderCollectionItemContractCommand {
|
|
43
|
+
export const RequestSchema = ImportPreOrderCollectionItemRequestSchema;
|
|
44
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
45
|
+
|
|
46
|
+
export const ResponseSchema = ImportPreOrderCollectionItemResponseSchema;
|
|
47
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
48
|
+
}
|
|
@@ -25,3 +25,4 @@ export * from './multiplicity-option/reorder-pre-order-collection-item-multiplic
|
|
|
25
25
|
export * from './execute-pre-order-collection-item-update.command';
|
|
26
26
|
export * from './move-pre-order-collection-items-analyze.command';
|
|
27
27
|
export * from './move-pre-order-collection-items-execute.command';
|
|
28
|
+
export * from './import-pre-order-collection-item.command';
|
|
@@ -22,6 +22,10 @@ export const ErrorI18nKey = {
|
|
|
22
22
|
transactionImportTooManyRows: 'transactionImport.tooManyRows',
|
|
23
23
|
transactionImportInvalidFileFormat: 'transactionImport.invalidFileFormat',
|
|
24
24
|
transactionImportMissingRequiredColumns: 'transactionImport.missingRequiredColumns',
|
|
25
|
+
preOrderCollectionItemImportTooManyRows: 'preOrderCollectionItemImport.tooManyRows',
|
|
26
|
+
preOrderCollectionItemImportInvalidFileFormat: 'preOrderCollectionItemImport.invalidFileFormat',
|
|
27
|
+
preOrderCollectionItemImportMissingRequiredColumns: 'preOrderCollectionItemImport.missingRequiredColumns',
|
|
28
|
+
preOrderCollectionItemImportFailed: 'preOrderCollectionItemImport.failed',
|
|
25
29
|
} as const;
|
|
26
30
|
|
|
27
31
|
export type ErrorI18nKeyType = (typeof ErrorI18nKey)[keyof typeof ErrorI18nKey];
|
package/constant/error.ts
CHANGED
|
@@ -916,6 +916,21 @@ export const ERRORS = {
|
|
|
916
916
|
message: 'Failed to move pre order collection items',
|
|
917
917
|
httpCode: 500,
|
|
918
918
|
},
|
|
919
|
+
PRE_ORDER_COLLECTION_ITEM_IMPORT_TOO_MANY_ROWS: {
|
|
920
|
+
code: 'POCI025',
|
|
921
|
+
message: 'Too many rows for pre order collection item import',
|
|
922
|
+
httpCode: 400,
|
|
923
|
+
},
|
|
924
|
+
PRE_ORDER_COLLECTION_ITEM_IMPORT_INVALID_FILE_FORMAT: {
|
|
925
|
+
code: 'POCI026',
|
|
926
|
+
message: 'Invalid file format for pre order collection item import',
|
|
927
|
+
httpCode: 400,
|
|
928
|
+
},
|
|
929
|
+
PRE_ORDER_COLLECTION_ITEM_IMPORT_MISSING_REQUIRED_COLUMNS: {
|
|
930
|
+
code: 'POCI027',
|
|
931
|
+
message: 'Missing required columns in pre order collection item import file',
|
|
932
|
+
httpCode: 400,
|
|
933
|
+
},
|
|
919
934
|
|
|
920
935
|
// EMPLOYEE SCHEDULE
|
|
921
936
|
EMPLOYEE_SCHEDULE_NOT_CREATED: { code: 'ES001', message: 'Failed to create employee schedule', httpCode: 500 },
|
|
@@ -1177,4 +1192,19 @@ export const ERRORS = {
|
|
|
1177
1192
|
ONE_C_INVALID_CREDENTIALS: { code: 'OC003', message: '1C credentials are invalid', httpCode: 401 },
|
|
1178
1193
|
ONE_C_INTEGRATION_DISABLED: { code: 'OC004', message: '1C integration is disabled for this company', httpCode: 409 },
|
|
1179
1194
|
ONE_C_SESSION_INVALID: { code: 'OC005', message: '1C session is missing or expired', httpCode: 401 },
|
|
1195
|
+
|
|
1196
|
+
// CONSIGNMENT TRANSFER (FC-227)
|
|
1197
|
+
CONSIGNMENT_TRANSFER_NOT_CREATED: { code: 'CTR001', message: 'Failed to create consignment transfer request', httpCode: 500 },
|
|
1198
|
+
CONSIGNMENT_TRANSFER_NOT_FOUND: { code: 'CTR002', message: 'Consignment transfer request not found', httpCode: 404 },
|
|
1199
|
+
CONSIGNMENT_TRANSFER_FETCH_FAILED: { code: 'CTR003', message: 'Failed to fetch consignment transfer requests', httpCode: 500 },
|
|
1200
|
+
CONSIGNMENT_TRANSFER_RECEIVER_NOT_FOUND: { code: 'CTR004', message: 'Receiver company not found or inactive', httpCode: 404 },
|
|
1201
|
+
CONSIGNMENT_TRANSFER_RECEIVER_IS_SENDER: { code: 'CTR005', message: 'Cannot transfer a consignment to your own company', httpCode: 400 },
|
|
1202
|
+
CONSIGNMENT_TRANSFER_PRODUCT_NOT_FOUND: { code: 'CTR006', message: 'Transfer position not found in the source consignment', httpCode: 404 },
|
|
1203
|
+
CONSIGNMENT_TRANSFER_QUANTITY_EXCEEDS_BALANCE: { code: 'CTR007', message: 'Requested quantity exceeds the available product balance', httpCode: 400 },
|
|
1204
|
+
CONSIGNMENT_TRANSFER_NOT_PENDING: { code: 'CTR008', message: 'Consignment transfer request is not pending', httpCode: 409 },
|
|
1205
|
+
CONSIGNMENT_TRANSFER_NOT_UPDATED: { code: 'CTR009', message: 'Failed to update consignment transfer request', httpCode: 500 },
|
|
1206
|
+
CONSIGNMENT_TRANSFER_ITEMS_MISMATCH: { code: 'CTR010', message: 'Accept payload must map every transfer position exactly once', httpCode: 400 },
|
|
1207
|
+
CONSIGNMENT_TRANSFER_CATEGORY_NOT_FOUND: { code: 'CTR011', message: 'Mapped category not found in the receiver company', httpCode: 404 },
|
|
1208
|
+
CONSIGNMENT_TRANSFER_TARGET_CONSIGNMENT_NOT_FOUND: { code: 'CTR012', message: 'Target consignment not found in the receiver company', httpCode: 404 },
|
|
1209
|
+
CONSIGNMENT_TRANSFER_ACCEPT_FAILED: { code: 'CTR013', message: 'Failed to accept consignment transfer request', httpCode: 500 },
|
|
1180
1210
|
} as const;
|
package/enum/index.ts
CHANGED
|
@@ -51,6 +51,7 @@ export * from './client-import-errors.enum';
|
|
|
51
51
|
export * from './transaction-import-entity-property.enum';
|
|
52
52
|
export * from './transaction-import-errors.enum';
|
|
53
53
|
export * from './pre-order-collection-item-import-entity-property.enum';
|
|
54
|
+
export * from './pre-order-collection-item-import-errors.enum';
|
|
54
55
|
export * from './report-period-type.enum';
|
|
55
56
|
export * from './inventory-movement-type.enum';
|
|
56
57
|
export * from './client-statement-type.enum';
|
|
@@ -83,4 +84,6 @@ export * from './account-deletion-request-source.enum';
|
|
|
83
84
|
export * from './bulk-create-product-image-alias-skip-reason.enum';
|
|
84
85
|
export * from './bulk-create-product-image-alias-from-pre-order-collection-item-skip-reason.enum';
|
|
85
86
|
export * from './moysklad-sync-status.enum';
|
|
87
|
+
export * from './consignment-transfer-request-status.enum';
|
|
88
|
+
export * from './consignment-transfer-direction.enum';
|
|
86
89
|
export * from './legal-identifier-field.enum';
|
|
@@ -24,4 +24,12 @@ export enum PreOrderCollectionItemImportEntityPropertyEnum {
|
|
|
24
24
|
MULTIPLICITY_DESCRIPTION = 'MULTIPLICITY_DESCRIPTION',
|
|
25
25
|
// Специальные поля
|
|
26
26
|
SALES_UNIT = 'SALES_UNIT',
|
|
27
|
+
|
|
28
|
+
// Опции кратности
|
|
29
|
+
OPTION1_TITLE = 'OPTION1_TITLE',
|
|
30
|
+
OPTION1_MULTIPLICITY = 'OPTION1_MULTIPLICITY',
|
|
31
|
+
OPTION1_PRICE = 'OPTION1_PRICE',
|
|
32
|
+
OPTION2_TITLE = 'OPTION2_TITLE',
|
|
33
|
+
OPTION2_MULTIPLICITY = 'OPTION2_MULTIPLICITY',
|
|
34
|
+
OPTION2_PRICE = 'OPTION2_PRICE',
|
|
27
35
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export enum PreOrderCollectionItemImportErrorsEnum {
|
|
2
|
+
INVALID_FILE_FORMAT = 'INVALID_FILE_FORMAT',
|
|
3
|
+
TOO_MANY_ROWS = 'TOO_MANY_ROWS',
|
|
4
|
+
MISSING_REQUIRED_COLUMNS = 'MISSING_REQUIRED_COLUMNS',
|
|
5
|
+
IMPORT_FAILED = 'IMPORT_FAILED',
|
|
6
|
+
REQUIRED = 'REQUIRED',
|
|
7
|
+
INVALID_VALUE = 'INVALID_VALUE',
|
|
8
|
+
CATEGORY_NOT_FOUND = 'CATEGORY_NOT_FOUND',
|
|
9
|
+
NOT_CREATED = 'NOT_CREATED',
|
|
10
|
+
UNKNOWN = 'UNKNOWN',
|
|
11
|
+
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ConsignmentTransferRequestSchema } from './consignment-transfer-request.schema';
|
|
3
|
+
|
|
4
|
+
export const AcceptConsignmentTransferRequestSchema = z
|
|
5
|
+
.object({
|
|
6
|
+
// Accept into an existing consignment of the receiver OR create a new one — exactly one of the two.
|
|
7
|
+
targetConsignmentUUID: z.uuid().optional(),
|
|
8
|
+
newConsignment: z
|
|
9
|
+
.object({
|
|
10
|
+
deliveryDate: z.coerce.date().min(new Date('2000-01-01')).max(new Date('2100-01-01')),
|
|
11
|
+
description: z.string().max(2000).nullable().optional(),
|
|
12
|
+
label: z.string().max(255).nullable().optional(),
|
|
13
|
+
})
|
|
14
|
+
.optional(),
|
|
15
|
+
items: z
|
|
16
|
+
.array(
|
|
17
|
+
z.object({
|
|
18
|
+
itemUUID: z.uuid(),
|
|
19
|
+
categoryUUID: z.uuid(),
|
|
20
|
+
price: z.number().min(0).optional(),
|
|
21
|
+
}),
|
|
22
|
+
)
|
|
23
|
+
.min(1),
|
|
24
|
+
})
|
|
25
|
+
.refine(data => Boolean(data.targetConsignmentUUID) !== Boolean(data.newConsignment), {
|
|
26
|
+
message: 'Provide either targetConsignmentUUID or newConsignment, not both',
|
|
27
|
+
path: ['targetConsignmentUUID'],
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export const AcceptConsignmentTransferResponseSchema = z.object({
|
|
31
|
+
message: z.string().optional(),
|
|
32
|
+
data: ConsignmentTransferRequestSchema,
|
|
33
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ConsignmentTransferRequestSchema } from './consignment-transfer-request.schema';
|
|
3
|
+
|
|
4
|
+
export const CancelConsignmentTransferResponseSchema = z.object({
|
|
5
|
+
message: z.string().optional(),
|
|
6
|
+
data: ConsignmentTransferRequestSchema,
|
|
7
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export const ConsignmentTransferRequestItemSchema = z.object({
|
|
4
|
+
uuid: z.uuid(),
|
|
5
|
+
sourceProductUUID: z.uuid(),
|
|
6
|
+
targetProductUUID: z.uuid().nullable(),
|
|
7
|
+
name: z.string(),
|
|
8
|
+
quantity: z.number().int(),
|
|
9
|
+
transferPrice: z.number(),
|
|
10
|
+
categoryName: z.string().nullable(),
|
|
11
|
+
multiplicity: z.number().int(),
|
|
12
|
+
grower: z.string().nullable(),
|
|
13
|
+
size: z.string().nullable(),
|
|
14
|
+
size2: z.string().nullable(),
|
|
15
|
+
size3: z.string().nullable(),
|
|
16
|
+
color: z.string().nullable(),
|
|
17
|
+
country: z.string().nullable(),
|
|
18
|
+
article: z.string().nullable(),
|
|
19
|
+
barcode: z.string().nullable(),
|
|
20
|
+
description: z.string().nullable(),
|
|
21
|
+
quality: z.string().nullable(),
|
|
22
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ConsignmentTransferRequestStatusEnum } from '../../enum';
|
|
3
|
+
|
|
4
|
+
export const ConsignmentTransferRequestSchema = z.object({
|
|
5
|
+
uuid: z.uuid(),
|
|
6
|
+
senderCompanyUUID: z.uuid(),
|
|
7
|
+
senderCompanyName: z.string().optional(),
|
|
8
|
+
receiverCompanyUUID: z.uuid(),
|
|
9
|
+
receiverCompanyName: z.string().optional(),
|
|
10
|
+
sourceConsignmentUUID: z.uuid(),
|
|
11
|
+
targetConsignmentUUID: z.uuid().nullable(),
|
|
12
|
+
status: z.nativeEnum(ConsignmentTransferRequestStatusEnum),
|
|
13
|
+
comment: z.string().nullable(),
|
|
14
|
+
processedComment: z.string().nullable(),
|
|
15
|
+
processedAt: z.date().nullable(),
|
|
16
|
+
itemsCount: z.number().int().optional(),
|
|
17
|
+
createdAt: z.date(),
|
|
18
|
+
updatedAt: z.date(),
|
|
19
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ConsignmentTransferRequestSchema } from './consignment-transfer-request.schema';
|
|
3
|
+
|
|
4
|
+
export const CreateConsignmentTransferRequestSchema = z.object({
|
|
5
|
+
receiverCompanyUUID: z.uuid(),
|
|
6
|
+
sourceConsignmentUUID: z.uuid(),
|
|
7
|
+
comment: z.string().max(2000).nullable().optional(),
|
|
8
|
+
items: z
|
|
9
|
+
.array(
|
|
10
|
+
z.object({
|
|
11
|
+
productUUID: z.uuid(),
|
|
12
|
+
quantity: z.number().int().min(1),
|
|
13
|
+
}),
|
|
14
|
+
)
|
|
15
|
+
.min(1)
|
|
16
|
+
.max(500),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export const CreateConsignmentTransferResponseSchema = z.object({
|
|
20
|
+
message: z.string().optional(),
|
|
21
|
+
data: ConsignmentTransferRequestSchema,
|
|
22
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ConsignmentTransferDirectionEnum, ConsignmentTransferRequestStatusEnum } from '../../enum';
|
|
3
|
+
import { ConsignmentTransferRequestSchema } from './consignment-transfer-request.schema';
|
|
4
|
+
|
|
5
|
+
export const GetConsignmentTransferListRequestSchema = z.object({
|
|
6
|
+
direction: z.nativeEnum(ConsignmentTransferDirectionEnum),
|
|
7
|
+
status: z.nativeEnum(ConsignmentTransferRequestStatusEnum).optional(),
|
|
8
|
+
page: z.coerce.number().int().min(1).optional().default(1),
|
|
9
|
+
count: z.coerce.number().int().min(1).max(100).optional().default(10),
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export const GetConsignmentTransferListResponseSchema = z.object({
|
|
13
|
+
message: z.string().optional(),
|
|
14
|
+
data: z.object({
|
|
15
|
+
transferList: ConsignmentTransferRequestSchema.array(),
|
|
16
|
+
total: z.number(),
|
|
17
|
+
}),
|
|
18
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ConsignmentTransferRequestSchema } from './consignment-transfer-request.schema';
|
|
3
|
+
import { ConsignmentTransferRequestItemSchema } from './consignment-transfer-request-item.schema';
|
|
4
|
+
|
|
5
|
+
export const GetConsignmentTransferResponseSchema = z.object({
|
|
6
|
+
message: z.string().optional(),
|
|
7
|
+
data: z.object({
|
|
8
|
+
request: ConsignmentTransferRequestSchema,
|
|
9
|
+
items: ConsignmentTransferRequestItemSchema.extend({
|
|
10
|
+
// Receiver-side convenience: suggested local category resolved by name (null when no match).
|
|
11
|
+
suggestedCategoryUUID: z.uuid().nullable().optional(),
|
|
12
|
+
suggestedCategoryName: z.string().nullable().optional(),
|
|
13
|
+
}).array(),
|
|
14
|
+
}),
|
|
15
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './consignment-transfer-request.schema';
|
|
2
|
+
export * from './consignment-transfer-request-item.schema';
|
|
3
|
+
export * from './create-consignment-transfer.schema';
|
|
4
|
+
export * from './get-consignment-transfer-list.schema';
|
|
5
|
+
export * from './get-consignment-transfer.schema';
|
|
6
|
+
export * from './cancel-consignment-transfer.schema';
|
|
7
|
+
export * from './reject-consignment-transfer.schema';
|
|
8
|
+
export * from './accept-consignment-transfer.schema';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ConsignmentTransferRequestSchema } from './consignment-transfer-request.schema';
|
|
3
|
+
|
|
4
|
+
export const RejectConsignmentTransferRequestSchema = z.object({
|
|
5
|
+
comment: z.string().max(2000).nullable().optional(),
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export const RejectConsignmentTransferResponseSchema = z.object({
|
|
9
|
+
message: z.string().optional(),
|
|
10
|
+
data: ConsignmentTransferRequestSchema,
|
|
11
|
+
});
|
package/schemas/index.ts
CHANGED
|
@@ -62,3 +62,4 @@ export * from './bank-payment/get-bank-payment-match-suggestions.schema';
|
|
|
62
62
|
export * from './messenger-profile';
|
|
63
63
|
export * from './error-message.schema';
|
|
64
64
|
export * from './account-deletion-request/account-deletion-request.schema';
|
|
65
|
+
export * from './consignment-transfer';
|