@floristcloud/api-lib 1.2.158 → 1.2.160
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/move-pre-order-collection-items-analyze.command.js +3 -0
- package/build/commands/product/export-stock-products.query.js +11 -0
- package/build/commands/product/get-product-list.query.js +4 -25
- package/build/commands/product/index.js +1 -0
- package/build/constant/error-i18n-key.js +3 -0
- package/build/constant/error.js +25 -0
- package/build/enum/index.js +1 -0
- package/build/enum/move-pre-order-source-outcome.enum.js +13 -0
- package/build/schemas/index.js +4 -0
- package/build/schemas/product/export-stock-products-request.schema.js +14 -0
- package/build/schemas/product/export-stock-products-response.schema.js +7 -0
- package/build/schemas/product/get-product-list-request.schema.js +21 -0
- package/build/schemas/product/get-product-list-response.schema.js +9 -0
- package/commands/pre-order-collection-item/move-pre-order-collection-items-analyze.command.ts +3 -0
- package/commands/product/export-stock-products.query.ts +13 -0
- package/commands/product/get-product-list.query.ts +3 -25
- package/commands/product/index.ts +1 -0
- package/constant/error-i18n-key.ts +3 -0
- package/constant/error.ts +25 -0
- package/enum/index.ts +1 -0
- package/enum/move-pre-order-source-outcome.enum.ts +9 -0
- package/package.json +1 -1
- package/schemas/index.ts +4 -0
- package/schemas/product/export-stock-products-request.schema.ts +12 -0
- package/schemas/product/export-stock-products-response.schema.ts +5 -0
- package/schemas/product/get-product-list-request.schema.ts +19 -0
- package/schemas/product/get-product-list-response.schema.ts +7 -0
package/build/commands/pre-order-collection-item/move-pre-order-collection-items-analyze.command.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.MovePreOrderCollectionItemsAnalyzeContractCommand = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const schemas_1 = require("../../schemas");
|
|
6
|
+
const enum_1 = require("../../enum");
|
|
6
7
|
const MovePreOrderCollectionItemsAnalyzeRequestSchema = zod_1.z.object({
|
|
7
8
|
targetPreOrderCollectionUUID: zod_1.z.string().uuid(),
|
|
8
9
|
preOrderCollectionItemUUIDs: zod_1.z.array(zod_1.z.string().uuid()).min(1),
|
|
@@ -19,8 +20,10 @@ const AffectedPreOrderSchema = zod_1.z.object({
|
|
|
19
20
|
clientName: zod_1.z.string(),
|
|
20
21
|
clientCode: zod_1.z.string().nullable().optional(),
|
|
21
22
|
branchName: zod_1.z.string().nullable().optional(),
|
|
23
|
+
// true — у клиента в целевой коллекции нет предзаказа: строки попадут в новый либо предзаказ переедет целиком (MOVED).
|
|
22
24
|
willCreateNewPreOrder: zod_1.z.boolean(),
|
|
23
25
|
targetPreOrderUUID: zod_1.z.string().uuid().nullable().optional(),
|
|
26
|
+
sourcePreOrderOutcome: zod_1.z.nativeEnum(enum_1.MovePreOrderSourceOutcomeEnum),
|
|
24
27
|
});
|
|
25
28
|
const MoveItemDetailSchema = zod_1.z.object({
|
|
26
29
|
preOrderCollectionItemUUID: zod_1.z.string().uuid(),
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExportStockProductsContractQuery = void 0;
|
|
4
|
+
const export_stock_products_request_schema_1 = require("../../schemas/product/export-stock-products-request.schema");
|
|
5
|
+
const export_stock_products_response_schema_1 = require("../../schemas/product/export-stock-products-response.schema");
|
|
6
|
+
var ExportStockProductsContractQuery;
|
|
7
|
+
(function (ExportStockProductsContractQuery) {
|
|
8
|
+
ExportStockProductsContractQuery.MAX_PRODUCTS = 10000;
|
|
9
|
+
ExportStockProductsContractQuery.RequestSchema = export_stock_products_request_schema_1.ExportStockProductsRequestSchema;
|
|
10
|
+
ExportStockProductsContractQuery.ResponseSchema = export_stock_products_response_schema_1.ExportStockProductsResponseSchema;
|
|
11
|
+
})(ExportStockProductsContractQuery || (exports.ExportStockProductsContractQuery = ExportStockProductsContractQuery = {}));
|
|
@@ -1,31 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GetProductListContractQuery = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const schemas_1 = require("../../schemas");
|
|
7
|
-
const GetProductListRequestSchema = zod_1.z.object({
|
|
8
|
-
page: zod_1.z.coerce.number().optional().default(1),
|
|
9
|
-
count: zod_1.z.coerce.number().optional().default(10),
|
|
10
|
-
stock: zod_1.z.coerce.boolean().optional(),
|
|
11
|
-
consignmentUUID: zod_1.z.string().optional(),
|
|
12
|
-
searchQuery: zod_1.z.string().optional(),
|
|
13
|
-
onlyAvailable: zod_1.z.coerce.boolean().optional(),
|
|
14
|
-
categoryUUID: zod_1.z.string().optional(),
|
|
15
|
-
typeUUID: zod_1.z.string().optional(),
|
|
16
|
-
grower: zod_1.z.string().optional(),
|
|
17
|
-
country: zod_1.z.string().optional(),
|
|
18
|
-
color: zod_1.z.string().optional(),
|
|
19
|
-
size: zod_1.z.string().optional(),
|
|
20
|
-
deliveryDates: zod_1.z.array(zod_1.z.coerce.date()).optional(),
|
|
21
|
-
marks: zod_1.z.enum(enum_1.ProductMarkEnum).array().optional(),
|
|
22
|
-
});
|
|
23
|
-
const GetProductListResponseSchema = zod_1.z.object({
|
|
24
|
-
message: zod_1.z.string().optional(),
|
|
25
|
-
data: schemas_1.ProductListSchema,
|
|
26
|
-
});
|
|
4
|
+
const get_product_list_request_schema_1 = require("../../schemas/product/get-product-list-request.schema");
|
|
5
|
+
const get_product_list_response_schema_1 = require("../../schemas/product/get-product-list-response.schema");
|
|
27
6
|
var GetProductListContractQuery;
|
|
28
7
|
(function (GetProductListContractQuery) {
|
|
29
|
-
GetProductListContractQuery.RequestSchema = GetProductListRequestSchema;
|
|
30
|
-
GetProductListContractQuery.ResponseSchema = GetProductListResponseSchema;
|
|
8
|
+
GetProductListContractQuery.RequestSchema = get_product_list_request_schema_1.GetProductListRequestSchema;
|
|
9
|
+
GetProductListContractQuery.ResponseSchema = get_product_list_response_schema_1.GetProductListResponseSchema;
|
|
31
10
|
})(GetProductListContractQuery || (exports.GetProductListContractQuery = GetProductListContractQuery = {}));
|
|
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./get-product.query"), exports);
|
|
18
18
|
__exportStar(require("./get-product-list.query"), exports);
|
|
19
|
+
__exportStar(require("./export-stock-products.query"), exports);
|
|
19
20
|
__exportStar(require("./create-product.command"), exports);
|
|
20
21
|
__exportStar(require("./update-product.command"), exports);
|
|
21
22
|
__exportStar(require("./delete-product.command"), exports);
|
|
@@ -21,6 +21,9 @@ exports.ErrorI18nKey = {
|
|
|
21
21
|
moveItemsBatchLimitExceeded: 'moveItems.batchLimitExceeded',
|
|
22
22
|
moveItemsItemsNotFound: 'moveItems.itemsNotFound',
|
|
23
23
|
moveItemsInPreOrdersWarning: 'moveItems.inPreOrdersWarning',
|
|
24
|
+
moveItemsStandingOrderCatalog: 'moveItems.standingOrderCatalog',
|
|
25
|
+
moveItemsInCompletedPreOrders: 'moveItems.inCompletedPreOrders',
|
|
26
|
+
moveItemsSourceNotFound: 'moveItems.sourceNotFound',
|
|
24
27
|
consignmentImportTooManyRows: 'consignmentImport.tooManyRows',
|
|
25
28
|
clientImportTooManyRows: 'clientImport.tooManyRows',
|
|
26
29
|
clientImportInvalidFileFormat: 'clientImport.invalidFileFormat',
|
package/build/constant/error.js
CHANGED
|
@@ -236,6 +236,11 @@ exports.ERRORS = {
|
|
|
236
236
|
PRODUCT_MULTIPLICITY_OPTION_USED_IN_ORDER: { code: 'P018', message: 'Product multiplicity option used in order', httpCode: 400 },
|
|
237
237
|
PRODUCT_MULTIPLICITY_OPTION_NOT_DELETED: { code: 'P019', message: 'Failed to delete product multiplicity option', httpCode: 500 },
|
|
238
238
|
PRODUCT_IMAGE_MATCHING_FAILED: { code: 'P020', message: 'Failed to match images for products', httpCode: 500 },
|
|
239
|
+
PRODUCT_STOCK_EXPORT_LIMIT_EXCEEDED: {
|
|
240
|
+
code: 'P021',
|
|
241
|
+
message: 'Too many products to export. Narrow the filters and try again',
|
|
242
|
+
httpCode: 400,
|
|
243
|
+
},
|
|
239
244
|
// PRODUCT CONFIGURATION
|
|
240
245
|
PRODUCT_CONFIGURATION_NOT_CREATED: { code: 'PCFG001', message: 'Failed to create product configuration', httpCode: 500 },
|
|
241
246
|
PRODUCT_CONFIGURATION_NOT_DELETED: { code: 'PCFG002', message: 'Failed to delete product configuration', httpCode: 500 },
|
|
@@ -1174,6 +1179,26 @@ exports.ERRORS = {
|
|
|
1174
1179
|
message: 'Batch size too large',
|
|
1175
1180
|
httpCode: 400,
|
|
1176
1181
|
},
|
|
1182
|
+
PRE_ORDER_COLLECTION_ITEM_MOVE_STANDING_ORDER_CATALOG: {
|
|
1183
|
+
code: 'POCI029',
|
|
1184
|
+
message: 'Items cannot be moved to or from the standing order catalog',
|
|
1185
|
+
httpCode: 400,
|
|
1186
|
+
},
|
|
1187
|
+
PRE_ORDER_COLLECTION_ITEM_MOVE_IN_COMPLETED_PRE_ORDERS: {
|
|
1188
|
+
code: 'POCI030',
|
|
1189
|
+
message: 'Some items are in completed pre-orders',
|
|
1190
|
+
httpCode: 400,
|
|
1191
|
+
},
|
|
1192
|
+
PRE_ORDER_COLLECTION_ITEM_MOVE_SOURCE_NOT_FOUND: {
|
|
1193
|
+
code: 'POCI031',
|
|
1194
|
+
message: 'Source pre order collection not found',
|
|
1195
|
+
httpCode: 404,
|
|
1196
|
+
},
|
|
1197
|
+
PRE_ORDER_COLLECTION_ITEM_MOVE_CONFLICT: {
|
|
1198
|
+
code: 'POCI032',
|
|
1199
|
+
message: 'Pre-orders changed during the move, retry the operation',
|
|
1200
|
+
httpCode: 409,
|
|
1201
|
+
},
|
|
1177
1202
|
// EMPLOYEE SCHEDULE
|
|
1178
1203
|
EMPLOYEE_SCHEDULE_NOT_CREATED: { code: 'ES001', message: 'Failed to create employee schedule', httpCode: 500 },
|
|
1179
1204
|
EMPLOYEE_SCHEDULE_NOT_DELETED: { code: 'ES002', message: 'Failed to delete employee schedule', httpCode: 500 },
|
package/build/enum/index.js
CHANGED
|
@@ -42,6 +42,7 @@ __exportStar(require("./package-type.enum"), exports);
|
|
|
42
42
|
__exportStar(require("./product-in-package-status.enum"), exports);
|
|
43
43
|
__exportStar(require("./pre-order-collection-status.enum"), exports);
|
|
44
44
|
__exportStar(require("./pre-order-collection-type.enum"), exports);
|
|
45
|
+
__exportStar(require("./move-pre-order-source-outcome.enum"), exports);
|
|
45
46
|
__exportStar(require("./pre-order-status.enum"), exports);
|
|
46
47
|
__exportStar(require("./userRole.enum"), exports);
|
|
47
48
|
__exportStar(require("./parse-status.enum"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MovePreOrderSourceOutcomeEnum = void 0;
|
|
4
|
+
/** Что станет с предзаказом клиента в исходной коллекции после переноса позиций. */
|
|
5
|
+
var MovePreOrderSourceOutcomeEnum;
|
|
6
|
+
(function (MovePreOrderSourceOutcomeEnum) {
|
|
7
|
+
// В предзаказе остаются другие позиции: перенесённые строки уходят в предзаказ целевой коллекции.
|
|
8
|
+
MovePreOrderSourceOutcomeEnum["KEPT"] = "KEPT";
|
|
9
|
+
// Переносятся все строки, а в целевой коллекции у клиента предзаказа нет: предзаказ переезжает целиком со своим номером.
|
|
10
|
+
MovePreOrderSourceOutcomeEnum["MOVED"] = "MOVED";
|
|
11
|
+
// Переносятся все строки в уже существующий предзаказ целевой коллекции: опустевший исходный удаляется.
|
|
12
|
+
MovePreOrderSourceOutcomeEnum["DELETED"] = "DELETED";
|
|
13
|
+
})(MovePreOrderSourceOutcomeEnum || (exports.MovePreOrderSourceOutcomeEnum = MovePreOrderSourceOutcomeEnum = {}));
|
package/build/schemas/index.js
CHANGED
|
@@ -28,6 +28,10 @@ __exportStar(require("./client/client.schema"), exports);
|
|
|
28
28
|
__exportStar(require("./user/user.schema"), exports);
|
|
29
29
|
__exportStar(require("./product/product.schema"), exports);
|
|
30
30
|
__exportStar(require("./product/product-list.schema"), exports);
|
|
31
|
+
__exportStar(require("./product/get-product-list-request.schema"), exports);
|
|
32
|
+
__exportStar(require("./product/get-product-list-response.schema"), exports);
|
|
33
|
+
__exportStar(require("./product/export-stock-products-request.schema"), exports);
|
|
34
|
+
__exportStar(require("./product/export-stock-products-response.schema"), exports);
|
|
31
35
|
__exportStar(require("./write-off/write-off.schema"), exports);
|
|
32
36
|
__exportStar(require("./write-off/write-off-list.schema"), exports);
|
|
33
37
|
__exportStar(require("./write-off/write-off-archive-file.schema"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExportStockProductsRequestSchema = void 0;
|
|
4
|
+
const get_product_list_request_schema_1 = require("./get-product-list-request.schema");
|
|
5
|
+
exports.ExportStockProductsRequestSchema = get_product_list_request_schema_1.GetProductListRequestSchema.pick({
|
|
6
|
+
searchQuery: true,
|
|
7
|
+
categoryUUID: true,
|
|
8
|
+
typeUUID: true,
|
|
9
|
+
grower: true,
|
|
10
|
+
country: true,
|
|
11
|
+
color: true,
|
|
12
|
+
size: true,
|
|
13
|
+
marks: true,
|
|
14
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExportStockProductsResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.ExportStockProductsResponseSchema = zod_1.z.object({
|
|
6
|
+
data: zod_1.z.object({ fileUrl: zod_1.z.string() }),
|
|
7
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetProductListRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const enum_1 = require("../../enum");
|
|
6
|
+
exports.GetProductListRequestSchema = zod_1.z.object({
|
|
7
|
+
page: zod_1.z.coerce.number().optional().default(1),
|
|
8
|
+
count: zod_1.z.coerce.number().optional().default(10),
|
|
9
|
+
stock: zod_1.z.coerce.boolean().optional(),
|
|
10
|
+
consignmentUUID: zod_1.z.string().optional(),
|
|
11
|
+
searchQuery: zod_1.z.string().optional(),
|
|
12
|
+
onlyAvailable: zod_1.z.coerce.boolean().optional(),
|
|
13
|
+
categoryUUID: zod_1.z.string().optional(),
|
|
14
|
+
typeUUID: zod_1.z.string().optional(),
|
|
15
|
+
grower: zod_1.z.string().optional(),
|
|
16
|
+
country: zod_1.z.string().optional(),
|
|
17
|
+
color: zod_1.z.string().optional(),
|
|
18
|
+
size: zod_1.z.string().optional(),
|
|
19
|
+
deliveryDates: zod_1.z.array(zod_1.z.coerce.date()).optional(),
|
|
20
|
+
marks: zod_1.z.enum(enum_1.ProductMarkEnum).array().optional(),
|
|
21
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetProductListResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const product_list_schema_1 = require("./product-list.schema");
|
|
6
|
+
exports.GetProductListResponseSchema = zod_1.z.object({
|
|
7
|
+
message: zod_1.z.string().optional(),
|
|
8
|
+
data: product_list_schema_1.ProductListSchema,
|
|
9
|
+
});
|
package/commands/pre-order-collection-item/move-pre-order-collection-items-analyze.command.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ErrorMessageSchema } from '../../schemas';
|
|
3
|
+
import { MovePreOrderSourceOutcomeEnum } from '../../enum';
|
|
3
4
|
|
|
4
5
|
const MovePreOrderCollectionItemsAnalyzeRequestSchema = z.object({
|
|
5
6
|
targetPreOrderCollectionUUID: z.string().uuid(),
|
|
@@ -19,8 +20,10 @@ const AffectedPreOrderSchema = z.object({
|
|
|
19
20
|
clientName: z.string(),
|
|
20
21
|
clientCode: z.string().nullable().optional(),
|
|
21
22
|
branchName: z.string().nullable().optional(),
|
|
23
|
+
// true — у клиента в целевой коллекции нет предзаказа: строки попадут в новый либо предзаказ переедет целиком (MOVED).
|
|
22
24
|
willCreateNewPreOrder: z.boolean(),
|
|
23
25
|
targetPreOrderUUID: z.string().uuid().nullable().optional(),
|
|
26
|
+
sourcePreOrderOutcome: z.nativeEnum(MovePreOrderSourceOutcomeEnum),
|
|
24
27
|
});
|
|
25
28
|
|
|
26
29
|
const MoveItemDetailSchema = z.object({
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { ExportStockProductsRequestSchema } from '../../schemas/product/export-stock-products-request.schema';
|
|
3
|
+
import { ExportStockProductsResponseSchema } from '../../schemas/product/export-stock-products-response.schema';
|
|
4
|
+
|
|
5
|
+
export namespace ExportStockProductsContractQuery {
|
|
6
|
+
export const MAX_PRODUCTS = 10_000;
|
|
7
|
+
|
|
8
|
+
export const RequestSchema = ExportStockProductsRequestSchema;
|
|
9
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
10
|
+
|
|
11
|
+
export const ResponseSchema = ExportStockProductsResponseSchema;
|
|
12
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
13
|
+
}
|
|
@@ -1,28 +1,6 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const GetProductListRequestSchema = z.object({
|
|
6
|
-
page: z.coerce.number().optional().default(1),
|
|
7
|
-
count: z.coerce.number().optional().default(10),
|
|
8
|
-
stock: z.coerce.boolean().optional(),
|
|
9
|
-
consignmentUUID: z.string().optional(),
|
|
10
|
-
searchQuery: z.string().optional(),
|
|
11
|
-
onlyAvailable: z.coerce.boolean().optional(),
|
|
12
|
-
categoryUUID: z.string().optional(),
|
|
13
|
-
typeUUID: z.string().optional(),
|
|
14
|
-
grower: z.string().optional(),
|
|
15
|
-
country: z.string().optional(),
|
|
16
|
-
color: z.string().optional(),
|
|
17
|
-
size: z.string().optional(),
|
|
18
|
-
deliveryDates: z.array(z.coerce.date()).optional(),
|
|
19
|
-
marks: z.enum(ProductMarkEnum).array().optional(),
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
const GetProductListResponseSchema = z.object({
|
|
23
|
-
message: z.string().optional(),
|
|
24
|
-
data: ProductListSchema,
|
|
25
|
-
});
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { GetProductListRequestSchema } from '../../schemas/product/get-product-list-request.schema';
|
|
3
|
+
import { GetProductListResponseSchema } from '../../schemas/product/get-product-list-response.schema';
|
|
26
4
|
|
|
27
5
|
export namespace GetProductListContractQuery {
|
|
28
6
|
export const RequestSchema = GetProductListRequestSchema;
|
|
@@ -18,6 +18,9 @@ export const ErrorI18nKey = {
|
|
|
18
18
|
moveItemsBatchLimitExceeded: 'moveItems.batchLimitExceeded',
|
|
19
19
|
moveItemsItemsNotFound: 'moveItems.itemsNotFound',
|
|
20
20
|
moveItemsInPreOrdersWarning: 'moveItems.inPreOrdersWarning',
|
|
21
|
+
moveItemsStandingOrderCatalog: 'moveItems.standingOrderCatalog',
|
|
22
|
+
moveItemsInCompletedPreOrders: 'moveItems.inCompletedPreOrders',
|
|
23
|
+
moveItemsSourceNotFound: 'moveItems.sourceNotFound',
|
|
21
24
|
consignmentImportTooManyRows: 'consignmentImport.tooManyRows',
|
|
22
25
|
clientImportTooManyRows: 'clientImport.tooManyRows',
|
|
23
26
|
clientImportInvalidFileFormat: 'clientImport.invalidFileFormat',
|
package/constant/error.ts
CHANGED
|
@@ -243,6 +243,11 @@ export const ERRORS = {
|
|
|
243
243
|
PRODUCT_MULTIPLICITY_OPTION_USED_IN_ORDER: { code: 'P018', message: 'Product multiplicity option used in order', httpCode: 400 },
|
|
244
244
|
PRODUCT_MULTIPLICITY_OPTION_NOT_DELETED: { code: 'P019', message: 'Failed to delete product multiplicity option', httpCode: 500 },
|
|
245
245
|
PRODUCT_IMAGE_MATCHING_FAILED: { code: 'P020', message: 'Failed to match images for products', httpCode: 500 },
|
|
246
|
+
PRODUCT_STOCK_EXPORT_LIMIT_EXCEEDED: {
|
|
247
|
+
code: 'P021',
|
|
248
|
+
message: 'Too many products to export. Narrow the filters and try again',
|
|
249
|
+
httpCode: 400,
|
|
250
|
+
},
|
|
246
251
|
|
|
247
252
|
// PRODUCT CONFIGURATION
|
|
248
253
|
PRODUCT_CONFIGURATION_NOT_CREATED: { code: 'PCFG001', message: 'Failed to create product configuration', httpCode: 500 },
|
|
@@ -1215,6 +1220,26 @@ export const ERRORS = {
|
|
|
1215
1220
|
message: 'Batch size too large',
|
|
1216
1221
|
httpCode: 400,
|
|
1217
1222
|
},
|
|
1223
|
+
PRE_ORDER_COLLECTION_ITEM_MOVE_STANDING_ORDER_CATALOG: {
|
|
1224
|
+
code: 'POCI029',
|
|
1225
|
+
message: 'Items cannot be moved to or from the standing order catalog',
|
|
1226
|
+
httpCode: 400,
|
|
1227
|
+
},
|
|
1228
|
+
PRE_ORDER_COLLECTION_ITEM_MOVE_IN_COMPLETED_PRE_ORDERS: {
|
|
1229
|
+
code: 'POCI030',
|
|
1230
|
+
message: 'Some items are in completed pre-orders',
|
|
1231
|
+
httpCode: 400,
|
|
1232
|
+
},
|
|
1233
|
+
PRE_ORDER_COLLECTION_ITEM_MOVE_SOURCE_NOT_FOUND: {
|
|
1234
|
+
code: 'POCI031',
|
|
1235
|
+
message: 'Source pre order collection not found',
|
|
1236
|
+
httpCode: 404,
|
|
1237
|
+
},
|
|
1238
|
+
PRE_ORDER_COLLECTION_ITEM_MOVE_CONFLICT: {
|
|
1239
|
+
code: 'POCI032',
|
|
1240
|
+
message: 'Pre-orders changed during the move, retry the operation',
|
|
1241
|
+
httpCode: 409,
|
|
1242
|
+
},
|
|
1218
1243
|
|
|
1219
1244
|
// EMPLOYEE SCHEDULE
|
|
1220
1245
|
EMPLOYEE_SCHEDULE_NOT_CREATED: { code: 'ES001', message: 'Failed to create employee schedule', httpCode: 500 },
|
package/enum/index.ts
CHANGED
|
@@ -26,6 +26,7 @@ export * from './package-type.enum';
|
|
|
26
26
|
export * from './product-in-package-status.enum';
|
|
27
27
|
export * from './pre-order-collection-status.enum';
|
|
28
28
|
export * from './pre-order-collection-type.enum';
|
|
29
|
+
export * from './move-pre-order-source-outcome.enum';
|
|
29
30
|
export * from './pre-order-status.enum';
|
|
30
31
|
export * from './userRole.enum';
|
|
31
32
|
export * from './parse-status.enum';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Что станет с предзаказом клиента в исходной коллекции после переноса позиций. */
|
|
2
|
+
export enum MovePreOrderSourceOutcomeEnum {
|
|
3
|
+
// В предзаказе остаются другие позиции: перенесённые строки уходят в предзаказ целевой коллекции.
|
|
4
|
+
KEPT = 'KEPT',
|
|
5
|
+
// Переносятся все строки, а в целевой коллекции у клиента предзаказа нет: предзаказ переезжает целиком со своим номером.
|
|
6
|
+
MOVED = 'MOVED',
|
|
7
|
+
// Переносятся все строки в уже существующий предзаказ целевой коллекции: опустевший исходный удаляется.
|
|
8
|
+
DELETED = 'DELETED',
|
|
9
|
+
}
|
package/package.json
CHANGED
package/schemas/index.ts
CHANGED
|
@@ -12,6 +12,10 @@ export * from './client/client.schema';
|
|
|
12
12
|
export * from './user/user.schema';
|
|
13
13
|
export * from './product/product.schema';
|
|
14
14
|
export * from './product/product-list.schema';
|
|
15
|
+
export * from './product/get-product-list-request.schema';
|
|
16
|
+
export * from './product/get-product-list-response.schema';
|
|
17
|
+
export * from './product/export-stock-products-request.schema';
|
|
18
|
+
export * from './product/export-stock-products-response.schema';
|
|
15
19
|
export * from './write-off/write-off.schema';
|
|
16
20
|
export * from './write-off/write-off-list.schema';
|
|
17
21
|
export * from './write-off/write-off-archive-file.schema';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { GetProductListRequestSchema } from './get-product-list-request.schema';
|
|
2
|
+
|
|
3
|
+
export const ExportStockProductsRequestSchema = GetProductListRequestSchema.pick({
|
|
4
|
+
searchQuery: true,
|
|
5
|
+
categoryUUID: true,
|
|
6
|
+
typeUUID: true,
|
|
7
|
+
grower: true,
|
|
8
|
+
country: true,
|
|
9
|
+
color: true,
|
|
10
|
+
size: true,
|
|
11
|
+
marks: true,
|
|
12
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ProductMarkEnum } from '../../enum';
|
|
3
|
+
|
|
4
|
+
export const GetProductListRequestSchema = z.object({
|
|
5
|
+
page: z.coerce.number().optional().default(1),
|
|
6
|
+
count: z.coerce.number().optional().default(10),
|
|
7
|
+
stock: z.coerce.boolean().optional(),
|
|
8
|
+
consignmentUUID: z.string().optional(),
|
|
9
|
+
searchQuery: z.string().optional(),
|
|
10
|
+
onlyAvailable: z.coerce.boolean().optional(),
|
|
11
|
+
categoryUUID: z.string().optional(),
|
|
12
|
+
typeUUID: z.string().optional(),
|
|
13
|
+
grower: z.string().optional(),
|
|
14
|
+
country: z.string().optional(),
|
|
15
|
+
color: z.string().optional(),
|
|
16
|
+
size: z.string().optional(),
|
|
17
|
+
deliveryDates: z.array(z.coerce.date()).optional(),
|
|
18
|
+
marks: z.enum(ProductMarkEnum).array().optional(),
|
|
19
|
+
});
|