@floristcloud/api-lib 1.2.165 → 1.2.167

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/build/commands/category/create-category.command.js +3 -9
  2. package/build/commands/category/get-category-by-uuid.query.js +4 -11
  3. package/build/commands/category/get-category-list.query.js +3 -9
  4. package/build/commands/category/update-category-command.js +3 -9
  5. package/build/commands/integration/ozexport/get-ozexport-catalog-filters.query.js +10 -0
  6. package/build/commands/integration/ozexport/index.js +1 -0
  7. package/build/enum/permission-key.enum.js +6 -0
  8. package/build/schemas/category/category-create.schema.js +4 -0
  9. package/build/schemas/category/category-extended-with-box-settings.schema.js +8 -0
  10. package/build/schemas/category/category-extended.schema.js +8 -0
  11. package/build/schemas/category/category-list.schema.js +2 -2
  12. package/build/schemas/category/category-pieces-per-box-by-length.schema.js +9 -0
  13. package/build/schemas/category/category-pieces-per-box-overrides.schema.js +8 -0
  14. package/build/schemas/category/category-update.schema.js +4 -0
  15. package/build/schemas/category/category-with-box-settings.schema.js +11 -0
  16. package/build/schemas/category/category.schema.js +1 -5
  17. package/build/schemas/category/create-category-response.schema.js +9 -0
  18. package/build/schemas/category/get-category-by-uuid-request.schema.js +7 -0
  19. package/build/schemas/category/get-category-by-uuid-response.schema.js +9 -0
  20. package/build/schemas/category/get-category-list-response.schema.js +9 -0
  21. package/build/schemas/category/index.js +10 -0
  22. package/build/schemas/category/update-category-response.schema.js +9 -0
  23. package/build/schemas/integration/ozexport/get-ozexport-catalog-filters-request.schema.js +5 -0
  24. package/build/schemas/integration/ozexport/get-ozexport-catalog-filters-response-data.schema.js +9 -0
  25. package/build/schemas/integration/ozexport/get-ozexport-catalog-filters-response.schema.js +8 -0
  26. package/build/schemas/integration/ozexport/get-ozexport-catalog-offers-request.schema.js +2 -0
  27. package/build/schemas/integration/ozexport/get-ozexport-catalog-request.schema.js +3 -0
  28. package/build/schemas/integration/ozexport/index.js +4 -0
  29. package/build/schemas/integration/ozexport/ozexport-catalog-category.schema.js +8 -0
  30. package/build/schemas/pre-order-collection-item/index.js +1 -0
  31. package/build/schemas/pre-order-collection-item/pre-order-collection-item-extended-for-admin.schema.js +2 -1
  32. package/build/schemas/pre-order-collection-item/pre-order-collection-item-extended-with-clients-pre-order-product.schema.js +2 -0
  33. package/build/schemas/pre-order-collection-item/pre-order-collection-item-for-admin.schema.js +2 -1
  34. package/build/schemas/pre-order-collection-item/supplier-add-analyze-item.schema.js +2 -0
  35. package/build/schemas/pre-order-collection-item/supplier-add-analyze-request.schema.js +1 -0
  36. package/build/schemas/pre-order-collection-item/supplier-add-cost-price.schema.js +6 -0
  37. package/build/schemas/pre-order-collection-item/supplier-add-execute-item.schema.js +2 -0
  38. package/build/schemas/pre-order-collection-item/supplier-add-execute-request.schema.js +1 -0
  39. package/build/schemas/product-image/product-image.schema.js +2 -2
  40. package/commands/category/create-category.command.ts +3 -10
  41. package/commands/category/get-category-by-uuid.query.ts +3 -11
  42. package/commands/category/get-category-list.query.ts +4 -11
  43. package/commands/category/update-category-command.ts +3 -10
  44. package/commands/integration/ozexport/get-ozexport-catalog-filters.query.ts +11 -0
  45. package/commands/integration/ozexport/index.ts +1 -0
  46. package/enum/permission-key.enum.ts +6 -0
  47. package/package.json +1 -1
  48. package/schemas/category/category-create.schema.ts +5 -0
  49. package/schemas/category/category-extended-with-box-settings.schema.ts +6 -0
  50. package/schemas/category/category-extended.schema.ts +6 -0
  51. package/schemas/category/category-list.schema.ts +2 -2
  52. package/schemas/category/category-pieces-per-box-by-length.schema.ts +8 -0
  53. package/schemas/category/category-pieces-per-box-overrides.schema.ts +6 -0
  54. package/schemas/category/category-update.schema.ts +5 -0
  55. package/schemas/category/category-with-box-settings.schema.ts +10 -0
  56. package/schemas/category/category.schema.ts +0 -5
  57. package/schemas/category/create-category-response.schema.ts +7 -0
  58. package/schemas/category/get-category-by-uuid-request.schema.ts +5 -0
  59. package/schemas/category/get-category-by-uuid-response.schema.ts +7 -0
  60. package/schemas/category/get-category-list-response.schema.ts +7 -0
  61. package/schemas/category/index.ts +10 -0
  62. package/schemas/category/update-category-response.schema.ts +7 -0
  63. package/schemas/integration/ozexport/get-ozexport-catalog-filters-request.schema.ts +3 -0
  64. package/schemas/integration/ozexport/get-ozexport-catalog-filters-response-data.schema.ts +7 -0
  65. package/schemas/integration/ozexport/get-ozexport-catalog-filters-response.schema.ts +6 -0
  66. package/schemas/integration/ozexport/get-ozexport-catalog-offers-request.schema.ts +2 -0
  67. package/schemas/integration/ozexport/get-ozexport-catalog-request.schema.ts +4 -0
  68. package/schemas/integration/ozexport/index.ts +4 -0
  69. package/schemas/integration/ozexport/ozexport-catalog-category.schema.ts +6 -0
  70. package/schemas/pre-order-collection-item/index.ts +1 -0
  71. package/schemas/pre-order-collection-item/pre-order-collection-item-extended-for-admin.schema.ts +5 -3
  72. package/schemas/pre-order-collection-item/pre-order-collection-item-extended-with-clients-pre-order-product.schema.ts +2 -0
  73. package/schemas/pre-order-collection-item/pre-order-collection-item-for-admin.schema.ts +5 -1
  74. package/schemas/pre-order-collection-item/supplier-add-analyze-item.schema.ts +2 -0
  75. package/schemas/pre-order-collection-item/supplier-add-analyze-request.schema.ts +1 -0
  76. package/schemas/pre-order-collection-item/supplier-add-cost-price.schema.ts +4 -0
  77. package/schemas/pre-order-collection-item/supplier-add-execute-item.schema.ts +2 -0
  78. package/schemas/pre-order-collection-item/supplier-add-execute-request.schema.ts +1 -0
  79. package/schemas/product-image/product-image.schema.ts +1 -1
@@ -1,16 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CreateCategoryContractCommand = void 0;
4
- const zod_1 = require("zod");
5
- const schemas_1 = require("../../schemas");
6
4
  const category_create_schema_1 = require("../../schemas/category/category-create.schema");
7
- const CreateCategoryRequestSchema = category_create_schema_1.CategoryCreateSchema;
8
- const CreateCategoryResponseSchema = zod_1.z.object({
9
- message: zod_1.z.string().optional(),
10
- data: schemas_1.CategorySchema,
11
- });
5
+ const create_category_response_schema_1 = require("../../schemas/category/create-category-response.schema");
12
6
  var CreateCategoryContractCommand;
13
7
  (function (CreateCategoryContractCommand) {
14
- CreateCategoryContractCommand.RequestSchema = CreateCategoryRequestSchema;
15
- CreateCategoryContractCommand.ResponseSchema = CreateCategoryResponseSchema;
8
+ CreateCategoryContractCommand.RequestSchema = category_create_schema_1.CategoryCreateSchema;
9
+ CreateCategoryContractCommand.ResponseSchema = create_category_response_schema_1.CreateCategoryResponseSchema;
16
10
  })(CreateCategoryContractCommand || (exports.CreateCategoryContractCommand = CreateCategoryContractCommand = {}));
@@ -1,17 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GetCategoryByUUIDhContractQuery = void 0;
4
- const zod_1 = require("zod");
5
- const category_schema_1 = require("../../schemas/category/category.schema");
6
- const GetCategoryByUUIDRequestSchema = zod_1.z.object({
7
- uuid: zod_1.z.uuid(),
8
- });
9
- const GetCategoryByUUIDResponseSchema = zod_1.z.object({
10
- message: zod_1.z.string().optional(),
11
- data: category_schema_1.CategoryExtendedSchema,
12
- });
4
+ const get_category_by_uuid_request_schema_1 = require("../../schemas/category/get-category-by-uuid-request.schema");
5
+ const get_category_by_uuid_response_schema_1 = require("../../schemas/category/get-category-by-uuid-response.schema");
13
6
  var GetCategoryByUUIDhContractQuery;
14
7
  (function (GetCategoryByUUIDhContractQuery) {
15
- GetCategoryByUUIDhContractQuery.RequestSchema = GetCategoryByUUIDRequestSchema;
16
- GetCategoryByUUIDhContractQuery.ResponseSchema = GetCategoryByUUIDResponseSchema;
8
+ GetCategoryByUUIDhContractQuery.RequestSchema = get_category_by_uuid_request_schema_1.GetCategoryByUUIDRequestSchema;
9
+ GetCategoryByUUIDhContractQuery.ResponseSchema = get_category_by_uuid_response_schema_1.GetCategoryByUUIDResponseSchema;
17
10
  })(GetCategoryByUUIDhContractQuery || (exports.GetCategoryByUUIDhContractQuery = GetCategoryByUUIDhContractQuery = {}));
@@ -1,16 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GetCategoryListContractQuery = void 0;
4
- const zod_1 = require("zod");
5
4
  const category_list_filter_schema_1 = require("../../schemas/category/category-list-filter.schema");
6
- const category_list_schema_1 = require("../../schemas/category/category-list.schema");
7
- const GetCategoryListRequestSchema = category_list_filter_schema_1.CategoryListFilterSchema;
8
- const GetCategoryResponseSchema = zod_1.z.object({
9
- message: zod_1.z.string().optional(),
10
- data: category_list_schema_1.CategoryListSchema,
11
- });
5
+ const get_category_list_response_schema_1 = require("../../schemas/category/get-category-list-response.schema");
12
6
  var GetCategoryListContractQuery;
13
7
  (function (GetCategoryListContractQuery) {
14
- GetCategoryListContractQuery.RequestSchema = GetCategoryListRequestSchema;
15
- GetCategoryListContractQuery.ResponseSchema = GetCategoryResponseSchema;
8
+ GetCategoryListContractQuery.RequestSchema = category_list_filter_schema_1.CategoryListFilterSchema;
9
+ GetCategoryListContractQuery.ResponseSchema = get_category_list_response_schema_1.GetCategoryListResponseSchema;
16
10
  })(GetCategoryListContractQuery || (exports.GetCategoryListContractQuery = GetCategoryListContractQuery = {}));
@@ -1,16 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UpdateCategoryContractCommand = void 0;
4
- const zod_1 = require("zod");
5
- const schemas_1 = require("../../schemas");
6
4
  const category_update_schema_1 = require("../../schemas/category/category-update.schema");
7
- const UpdateCategoryRequestSchema = category_update_schema_1.CategoryUpdateSchema;
8
- const UpdateCategoryResponseSchema = zod_1.z.object({
9
- message: zod_1.z.string().optional(),
10
- data: schemas_1.CategorySchema.nullable(),
11
- });
5
+ const update_category_response_schema_1 = require("../../schemas/category/update-category-response.schema");
12
6
  var UpdateCategoryContractCommand;
13
7
  (function (UpdateCategoryContractCommand) {
14
- UpdateCategoryContractCommand.RequestSchema = UpdateCategoryRequestSchema;
15
- UpdateCategoryContractCommand.ResponseSchema = UpdateCategoryResponseSchema;
8
+ UpdateCategoryContractCommand.RequestSchema = category_update_schema_1.CategoryUpdateSchema;
9
+ UpdateCategoryContractCommand.ResponseSchema = update_category_response_schema_1.UpdateCategoryResponseSchema;
16
10
  })(UpdateCategoryContractCommand || (exports.UpdateCategoryContractCommand = UpdateCategoryContractCommand = {}));
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetOzexportCatalogFiltersContractQuery = void 0;
4
+ const get_ozexport_catalog_filters_request_schema_1 = require("../../../schemas/integration/ozexport/get-ozexport-catalog-filters-request.schema");
5
+ const get_ozexport_catalog_filters_response_schema_1 = require("../../../schemas/integration/ozexport/get-ozexport-catalog-filters-response.schema");
6
+ var GetOzexportCatalogFiltersContractQuery;
7
+ (function (GetOzexportCatalogFiltersContractQuery) {
8
+ GetOzexportCatalogFiltersContractQuery.RequestSchema = get_ozexport_catalog_filters_request_schema_1.GetOzexportCatalogFiltersRequestSchema;
9
+ GetOzexportCatalogFiltersContractQuery.ResponseSchema = get_ozexport_catalog_filters_response_schema_1.GetOzexportCatalogFiltersResponseSchema;
10
+ })(GetOzexportCatalogFiltersContractQuery || (exports.GetOzexportCatalogFiltersContractQuery = GetOzexportCatalogFiltersContractQuery = {}));
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./connect-ozexport.command"), exports);
18
18
  __exportStar(require("./disconnect-ozexport.command"), exports);
19
19
  __exportStar(require("./get-ozexport-catalog.query"), exports);
20
+ __exportStar(require("./get-ozexport-catalog-filters.query"), exports);
20
21
  __exportStar(require("./get-ozexport-status.query"), exports);
21
22
  __exportStar(require("./select-ozexport-unit.command"), exports);
22
23
  __exportStar(require("./get-ozexport-catalog-offers.query"), exports);
@@ -31,6 +31,10 @@ var PermissionKeyEnum;
31
31
  PermissionKeyEnum["WRITE_OFF_DELETE"] = "write_off.delete";
32
32
  // Moving a write-off out of PENDING (принятие / отклонение списания).
33
33
  PermissionKeyEnum["WRITE_OFF_APPROVE"] = "write_off.approve";
34
+ // Outgoing transfer: create a request and cancel it while PENDING (создание и отмена переноса).
35
+ PermissionKeyEnum["CONSIGNMENT_TRANSFER_CREATE"] = "consignment_transfer.create";
36
+ // Incoming transfer: accept or reject a PENDING request (приёмка и отклонение переноса).
37
+ PermissionKeyEnum["CONSIGNMENT_TRANSFER_PROCESS"] = "consignment_transfer.process";
34
38
  })(PermissionKeyEnum || (exports.PermissionKeyEnum = PermissionKeyEnum = {}));
35
39
  exports.PERMISSION_KEY_LIST = [
36
40
  PermissionKeyEnum.PRODUCT_VIEW,
@@ -57,4 +61,6 @@ exports.PERMISSION_KEY_LIST = [
57
61
  PermissionKeyEnum.WRITE_OFF_CREATE,
58
62
  PermissionKeyEnum.WRITE_OFF_DELETE,
59
63
  PermissionKeyEnum.WRITE_OFF_APPROVE,
64
+ PermissionKeyEnum.CONSIGNMENT_TRANSFER_CREATE,
65
+ PermissionKeyEnum.CONSIGNMENT_TRANSFER_PROCESS,
60
66
  ];
@@ -2,13 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CategoryCreateSchema = void 0;
4
4
  const zod_1 = require("zod");
5
+ const category_pieces_per_box_overrides_schema_1 = require("./category-pieces-per-box-overrides.schema");
5
6
  const localized_name_schema_1 = require("../i18n/localized-name.schema");
7
+ const INT4_MAX = 2147483647;
6
8
  // Поля новой категории. Название на дополнительных языках необязательно: без переводов
7
9
  // категория живёт на каноническом имени.
8
10
  exports.CategoryCreateSchema = zod_1.z.object({
9
11
  name: zod_1.z.string(),
10
12
  nameTranslations: localized_name_schema_1.LocalizedNameSchema.nullish(),
11
13
  multiplicity: zod_1.z.number(),
14
+ basePiecesPerBox: zod_1.z.number().int().positive().max(INT4_MAX).nullable().optional(),
15
+ piecesPerBoxByLength: category_pieces_per_box_overrides_schema_1.CategoryPiecesPerBoxOverridesSchema.optional(),
12
16
  isSizeSeparate: zod_1.z.coerce.boolean(),
13
17
  typeUUID: zod_1.z.string(),
14
18
  isSaveCategoryName: zod_1.z.coerce.boolean(),
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CategoryExtendedWithBoxSettingsSchema = void 0;
4
+ const type_schema_1 = require("../type/type.schema");
5
+ const category_with_box_settings_schema_1 = require("./category-with-box-settings.schema");
6
+ exports.CategoryExtendedWithBoxSettingsSchema = category_with_box_settings_schema_1.CategoryWithBoxSettingsSchema.extend({
7
+ type: type_schema_1.TypeSchema.nullable(),
8
+ });
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CategoryExtendedSchema = void 0;
4
+ const category_schema_1 = require("./category.schema");
5
+ const type_schema_1 = require("../type/type.schema");
6
+ exports.CategoryExtendedSchema = category_schema_1.CategorySchema.extend({
7
+ type: type_schema_1.TypeSchema.nullable(),
8
+ });
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CategoryListSchema = void 0;
4
4
  const zod_1 = require("zod");
5
- const category_schema_1 = require("./category.schema");
5
+ const category_extended_with_box_settings_schema_1 = require("./category-extended-with-box-settings.schema");
6
6
  // Страница справочника категорий вместе с общим числом строк по фильтру.
7
7
  exports.CategoryListSchema = zod_1.z.object({
8
- categoryList: category_schema_1.CategoryExtendedSchema.array(),
8
+ categoryList: category_extended_with_box_settings_schema_1.CategoryExtendedWithBoxSettingsSchema.array(),
9
9
  total: zod_1.z.number(),
10
10
  });
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CategoryPiecesPerBoxByLengthSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const INT4_MAX = 2147483647;
6
+ exports.CategoryPiecesPerBoxByLengthSchema = zod_1.z.object({
7
+ lengthCm: zod_1.z.number().int().positive().max(INT4_MAX),
8
+ pieces: zod_1.z.number().int().positive().max(INT4_MAX),
9
+ });
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CategoryPiecesPerBoxOverridesSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const category_pieces_per_box_by_length_schema_1 = require("./category-pieces-per-box-by-length.schema");
6
+ exports.CategoryPiecesPerBoxOverridesSchema = zod_1.z
7
+ .array(category_pieces_per_box_by_length_schema_1.CategoryPiecesPerBoxByLengthSchema)
8
+ .refine(values => new Set(values.map(value => value.lengthCm)).size === values.length, { message: 'Each length must occur only once' });
@@ -2,8 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CategoryUpdateSchema = void 0;
4
4
  const zod_1 = require("zod");
5
+ const category_pieces_per_box_overrides_schema_1 = require("./category-pieces-per-box-overrides.schema");
5
6
  const enum_1 = require("../../enum");
6
7
  const localized_name_schema_1 = require("../i18n/localized-name.schema");
8
+ const INT4_MAX = 2147483647;
7
9
  // Поля редактируемой категории. Переводы отсутствуют в теле — остаются прежними;
8
10
  // `null` и пустой объект их очищают.
9
11
  exports.CategoryUpdateSchema = zod_1.z.object({
@@ -11,6 +13,8 @@ exports.CategoryUpdateSchema = zod_1.z.object({
11
13
  nameTranslations: localized_name_schema_1.LocalizedNameSchema.nullish(),
12
14
  typeUUID: zod_1.z.string(),
13
15
  multiplicity: zod_1.z.number(),
16
+ basePiecesPerBox: zod_1.z.number().int().positive().max(INT4_MAX).nullable().optional(),
17
+ piecesPerBoxByLength: category_pieces_per_box_overrides_schema_1.CategoryPiecesPerBoxOverridesSchema.optional(),
14
18
  isSizeSeparate: zod_1.z.coerce.boolean(),
15
19
  isSaveCategoryName: zod_1.z.coerce.boolean(),
16
20
  status: zod_1.z.nativeEnum(enum_1.CategoryStatusEnum),
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CategoryWithBoxSettingsSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const category_schema_1 = require("./category.schema");
6
+ const category_pieces_per_box_overrides_schema_1 = require("./category-pieces-per-box-overrides.schema");
7
+ const INT4_MAX = 2147483647;
8
+ exports.CategoryWithBoxSettingsSchema = category_schema_1.CategorySchema.extend({
9
+ basePiecesPerBox: zod_1.z.number().int().positive().max(INT4_MAX).nullable(),
10
+ piecesPerBoxByLength: category_pieces_per_box_overrides_schema_1.CategoryPiecesPerBoxOverridesSchema,
11
+ });
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CategoryExtendedSchema = exports.CategorySchema = void 0;
3
+ exports.CategorySchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const category_status_enum_1 = require("../../enum/category-status.enum");
6
6
  const localized_name_schema_1 = require("../i18n/localized-name.schema");
7
- const type_schema_1 = require("../type/type.schema");
8
7
  exports.CategorySchema = zod_1.z.object({
9
8
  uuid: zod_1.z.uuid(),
10
9
  // Канон, по нему сходятся импорт, отчёты и выгрузки.
@@ -19,6 +18,3 @@ exports.CategorySchema = zod_1.z.object({
19
18
  updatedAt: zod_1.z.date(),
20
19
  deletedAt: zod_1.z.date().nullable(),
21
20
  });
22
- exports.CategoryExtendedSchema = exports.CategorySchema.extend({
23
- type: type_schema_1.TypeSchema.nullable(),
24
- });
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateCategoryResponseSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const category_with_box_settings_schema_1 = require("./category-with-box-settings.schema");
6
+ exports.CreateCategoryResponseSchema = zod_1.z.object({
7
+ message: zod_1.z.string().optional(),
8
+ data: category_with_box_settings_schema_1.CategoryWithBoxSettingsSchema,
9
+ });
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetCategoryByUUIDRequestSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.GetCategoryByUUIDRequestSchema = zod_1.z.object({
6
+ uuid: zod_1.z.uuid(),
7
+ });
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetCategoryByUUIDResponseSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const category_extended_with_box_settings_schema_1 = require("./category-extended-with-box-settings.schema");
6
+ exports.GetCategoryByUUIDResponseSchema = zod_1.z.object({
7
+ message: zod_1.z.string().optional(),
8
+ data: category_extended_with_box_settings_schema_1.CategoryExtendedWithBoxSettingsSchema,
9
+ });
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetCategoryListResponseSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const category_list_schema_1 = require("./category-list.schema");
6
+ exports.GetCategoryListResponseSchema = zod_1.z.object({
7
+ message: zod_1.z.string().optional(),
8
+ data: category_list_schema_1.CategoryListSchema,
9
+ });
@@ -21,3 +21,13 @@ __exportStar(require("./category-list-filter.schema"), exports);
21
21
  __exportStar(require("./category-list.schema"), exports);
22
22
  __exportStar(require("./category.schema"), exports);
23
23
  __exportStar(require("./category-name.schema"), exports);
24
+ __exportStar(require("./category-pieces-per-box-by-length.schema"), exports);
25
+ __exportStar(require("./category-pieces-per-box-overrides.schema"), exports);
26
+ __exportStar(require("./category-extended.schema"), exports);
27
+ __exportStar(require("./create-category-response.schema"), exports);
28
+ __exportStar(require("./update-category-response.schema"), exports);
29
+ __exportStar(require("./get-category-by-uuid-request.schema"), exports);
30
+ __exportStar(require("./get-category-by-uuid-response.schema"), exports);
31
+ __exportStar(require("./get-category-list-response.schema"), exports);
32
+ __exportStar(require("./category-with-box-settings.schema"), exports);
33
+ __exportStar(require("./category-extended-with-box-settings.schema"), exports);
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateCategoryResponseSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const category_with_box_settings_schema_1 = require("./category-with-box-settings.schema");
6
+ exports.UpdateCategoryResponseSchema = zod_1.z.object({
7
+ message: zod_1.z.string().optional(),
8
+ data: category_with_box_settings_schema_1.CategoryWithBoxSettingsSchema.nullable(),
9
+ });
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetOzexportCatalogFiltersRequestSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.GetOzexportCatalogFiltersRequestSchema = zod_1.z.object({});
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetOzexportCatalogFiltersResponseDataSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const ozexport_catalog_category_schema_1 = require("./ozexport-catalog-category.schema");
6
+ exports.GetOzexportCatalogFiltersResponseDataSchema = zod_1.z.object({
7
+ categories: zod_1.z.array(ozexport_catalog_category_schema_1.OzexportCatalogCategorySchema),
8
+ lengths: zod_1.z.array(zod_1.z.number().int().positive()),
9
+ });
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetOzexportCatalogFiltersResponseSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const get_ozexport_catalog_filters_response_data_schema_1 = require("./get-ozexport-catalog-filters-response-data.schema");
6
+ exports.GetOzexportCatalogFiltersResponseSchema = zod_1.z.object({
7
+ data: get_ozexport_catalog_filters_response_data_schema_1.GetOzexportCatalogFiltersResponseDataSchema,
8
+ });
@@ -8,6 +8,8 @@ exports.GetOzexportCatalogOffersRequestSchema = get_ozexport_catalog_request_sch
8
8
  count: true,
9
9
  search: true,
10
10
  color: true,
11
+ categoryTemplateUUID: true,
12
+ lengthCm: true,
11
13
  stockType: true,
12
14
  status: true,
13
15
  }).extend({ templateUUID: zod_1.z.string().uuid() });
@@ -6,6 +6,7 @@ const supplier_catalog_nomenclature_filter_enum_1 = require("../../../enum/suppl
6
6
  const supplier_offer_status_enum_1 = require("../../../enum/supplier-offer-status.enum");
7
7
  const OZEXPORT_CATALOG_SEARCH_MAX_LENGTH = 100;
8
8
  const OZEXPORT_CATALOG_FILTER_MAX_LENGTH = 100;
9
+ const OZEXPORT_CATALOG_LENGTH_CM_MAX = 2147483647;
9
10
  // qs отдаёт одиночное значение строкой (`status=AVAILABLE`), а повторённое — массивом.
10
11
  const toArray = (value) => (typeof value === 'string' ? [value] : value);
11
12
  // Дальше этой страницы не листаем: OFFSET до 1 млн строк сортов — заведомо больше каталога поставщика.
@@ -15,6 +16,8 @@ const OZEXPORT_CATALOG_PAGE_SIZE_DEFAULT = 20;
15
16
  exports.GetOzexportCatalogRequestSchema = zod_1.z.object({
16
17
  search: zod_1.z.string().trim().max(OZEXPORT_CATALOG_SEARCH_MAX_LENGTH).optional(),
17
18
  color: zod_1.z.string().trim().max(OZEXPORT_CATALOG_FILTER_MAX_LENGTH).optional(),
19
+ categoryTemplateUUID: zod_1.z.string().uuid().optional(),
20
+ lengthCm: zod_1.z.coerce.number().int().positive().max(OZEXPORT_CATALOG_LENGTH_CM_MAX).optional(),
18
21
  stockType: zod_1.z.string().trim().max(OZEXPORT_CATALOG_FILTER_MAX_LENGTH).optional(),
19
22
  inNomenclature: zod_1.z.nativeEnum(supplier_catalog_nomenclature_filter_enum_1.SupplierCatalogNomenclatureFilterEnum).optional().default(supplier_catalog_nomenclature_filter_enum_1.SupplierCatalogNomenclatureFilterEnum.ALL),
20
23
  // Без фильтра сервер отдаёт живые предложения (AVAILABLE, NO_PRICE и OUT_OF_STOCK); NOT_FOUND запрашивается явно.
@@ -18,6 +18,10 @@ __exportStar(require("./connect-ozexport-request.schema"), exports);
18
18
  __exportStar(require("./disconnect-ozexport-response-true.schema"), exports);
19
19
  __exportStar(require("./disconnect-ozexport-response.schema"), exports);
20
20
  __exportStar(require("./get-ozexport-catalog-request.schema"), exports);
21
+ __exportStar(require("./get-ozexport-catalog-filters-request.schema"), exports);
22
+ __exportStar(require("./get-ozexport-catalog-filters-response.schema"), exports);
23
+ __exportStar(require("./get-ozexport-catalog-filters-response-data.schema"), exports);
24
+ __exportStar(require("./ozexport-catalog-category.schema"), exports);
21
25
  __exportStar(require("./get-ozexport-catalog-response-data.schema"), exports);
22
26
  __exportStar(require("./get-ozexport-catalog-response.schema"), exports);
23
27
  __exportStar(require("./ozexport-account-unit.schema"), exports);
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OzexportCatalogCategorySchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.OzexportCatalogCategorySchema = zod_1.z.object({
6
+ uuid: zod_1.z.string().uuid(),
7
+ name: zod_1.z.string(),
8
+ });
@@ -68,6 +68,7 @@ __exportStar(require("./supplier-add-execute-skipped-item.schema"), exports);
68
68
  __exportStar(require("./supplier-add-items-limit.constant"), exports);
69
69
  __exportStar(require("./supplier-add-offer-key.schema"), exports);
70
70
  __exportStar(require("./supplier-add-sale-price.schema"), exports);
71
+ __exportStar(require("./supplier-add-cost-price.schema"), exports);
71
72
  __exportStar(require("./supplier-sync-analyze-item.schema"), exports);
72
73
  __exportStar(require("./supplier-sync-analyze-request.schema"), exports);
73
74
  __exportStar(require("./supplier-sync-analyze-response-data.schema"), exports);
@@ -3,4 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PreOrderCollectionItemExtendedForAdminSchema = void 0;
4
4
  const pre_order_collection_item_extended_schema_1 = require("./pre-order-collection-item-extended.schema");
5
5
  const pre_order_collection_item_supplier_admin_shape_1 = require("./pre-order-collection-item-supplier-admin.shape");
6
- exports.PreOrderCollectionItemExtendedForAdminSchema = pre_order_collection_item_extended_schema_1.PreOrderCollectionItemExtendedSchema.extend(pre_order_collection_item_supplier_admin_shape_1.PreOrderCollectionItemSupplierAdminShape);
6
+ const supplier_add_cost_price_schema_1 = require("./supplier-add-cost-price.schema");
7
+ exports.PreOrderCollectionItemExtendedForAdminSchema = pre_order_collection_item_extended_schema_1.PreOrderCollectionItemExtendedSchema.extend(Object.assign(Object.assign({}, pre_order_collection_item_supplier_admin_shape_1.PreOrderCollectionItemSupplierAdminShape), { costPrice: supplier_add_cost_price_schema_1.SupplierAddCostPriceSchema.nullable() }));
@@ -4,6 +4,8 @@ exports.PreOrderCollectionItemExtendedWithClientsPreOrderProductSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const pre_order_collection_item_client_pre_order_product_schema_1 = require("./pre-order-collection-item-client-pre-order-product.schema");
6
6
  const pre_order_collection_item_extended_schema_1 = require("./pre-order-collection-item-extended.schema");
7
+ const supplier_add_cost_price_schema_1 = require("./supplier-add-cost-price.schema");
7
8
  exports.PreOrderCollectionItemExtendedWithClientsPreOrderProductSchema = pre_order_collection_item_extended_schema_1.PreOrderCollectionItemExtendedSchema.extend({
9
+ costPrice: supplier_add_cost_price_schema_1.SupplierAddCostPriceSchema.nullable(),
8
10
  clientsWithPreOrderProduct: zod_1.z.array(pre_order_collection_item_client_pre_order_product_schema_1.PreOrderCollectionItemClientPreOrderProductSchema),
9
11
  });
@@ -3,4 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PreOrderCollectionItemForAdminSchema = void 0;
4
4
  const pre_order_collection_item_supplier_admin_shape_1 = require("./pre-order-collection-item-supplier-admin.shape");
5
5
  const pre_order_collection_item_base_schema_1 = require("./pre-order-collection-item-base.schema");
6
- exports.PreOrderCollectionItemForAdminSchema = pre_order_collection_item_base_schema_1.PreOrderCollectionItemSchema.extend(pre_order_collection_item_supplier_admin_shape_1.PreOrderCollectionItemSupplierAdminShape);
6
+ const supplier_add_cost_price_schema_1 = require("./supplier-add-cost-price.schema");
7
+ exports.PreOrderCollectionItemForAdminSchema = pre_order_collection_item_base_schema_1.PreOrderCollectionItemSchema.extend(Object.assign(Object.assign({}, pre_order_collection_item_supplier_admin_shape_1.PreOrderCollectionItemSupplierAdminShape), { costPrice: supplier_add_cost_price_schema_1.SupplierAddCostPriceSchema.nullable() }));
@@ -15,6 +15,8 @@ exports.SupplierAddAnalyzeItemSchema = zod_1.z.object({
15
15
  productImageUUID: zod_1.z.string().nullable(),
16
16
  willImportCard: zod_1.z.boolean(),
17
17
  categoryName: zod_1.z.string().nullable(),
18
+ categoryMultiplicity: zod_1.z.number().nullable(),
19
+ piecesPerBox: zod_1.z.number().int().positive().nullable(),
18
20
  offer: supplier_add_analyze_offer_schema_1.SupplierAddAnalyzeOfferSchema.nullable(),
19
21
  existingItemUUID: zod_1.z.string().nullable(),
20
22
  isSkipped: zod_1.z.boolean(),
@@ -13,4 +13,5 @@ exports.SupplierAddAnalyzeRequestSchema = zod_1.z.object({
13
13
  .min(1)
14
14
  .max(supplier_add_items_limit_constant_1.SUPPLIER_ADD_ITEMS_LIMIT)
15
15
  .refine(has_unique_supplier_add_keys_helper_1.hasUniqueSupplierAddKeys, { message: 'validation.supplierAdd.duplicateKeys' }),
16
+ allowDuplicates: zod_1.z.boolean().optional().default(false),
16
17
  });
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SupplierAddCostPriceSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ // Себестоимость передаётся точной десятичной строкой без округления до денежного масштаба.
6
+ exports.SupplierAddCostPriceSchema = zod_1.z.string().regex(/^\d+(\.\d+)?$/);
@@ -4,10 +4,12 @@ exports.SupplierAddExecuteItemSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const supplier_add_offer_key_schema_1 = require("./supplier-add-offer-key.schema");
6
6
  const supplier_add_sale_price_schema_1 = require("./supplier-add-sale-price.schema");
7
+ const supplier_add_cost_price_schema_1 = require("./supplier-add-cost-price.schema");
7
8
  // Кратность — Int колонки позиции (int4).
8
9
  const MULTIPLICITY_MAX = 2147483647;
9
10
  exports.SupplierAddExecuteItemSchema = supplier_add_offer_key_schema_1.SupplierAddOfferKeySchema.extend({
10
11
  price: supplier_add_sale_price_schema_1.SupplierAddSalePriceSchema,
12
+ costPrice: supplier_add_cost_price_schema_1.SupplierAddCostPriceSchema.nullable().optional(),
11
13
  multiplicity: zod_1.z.number().int().min(1).max(MULTIPLICITY_MAX).optional(),
12
14
  isOpen: zod_1.z.boolean().optional(),
13
15
  });
@@ -15,4 +15,5 @@ exports.SupplierAddExecuteRequestSchema = zod_1.z.object({
15
15
  .refine(has_unique_supplier_add_keys_helper_1.hasUniqueSupplierAddKeys, { message: 'validation.supplierAdd.duplicateKeys' }),
16
16
  // true — добавить и те предложения, которые в коллекции уже есть (ALREADY_IN_COLLECTION не пропускается).
17
17
  allowDuplicates: zod_1.z.boolean().optional().default(false),
18
+ transferGrower: zod_1.z.boolean().optional().default(true),
18
19
  });
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UpdateProductImageSchema = exports.ProductImageExtendedSchema = exports.ProductImageSchema = void 0;
4
4
  const zod_1 = require("zod");
5
- const category_schema_1 = require("../category/category.schema");
5
+ const category_extended_schema_1 = require("../category/category-extended.schema");
6
6
  const product_image_alias_schema_1 = require("./product-image-alias.schema");
7
7
  exports.ProductImageSchema = zod_1.z.object({
8
8
  uuid: zod_1.z.string(),
@@ -20,7 +20,7 @@ exports.ProductImageSchema = zod_1.z.object({
20
20
  deletedAt: zod_1.z.date().nullable(),
21
21
  });
22
22
  exports.ProductImageExtendedSchema = exports.ProductImageSchema.extend({
23
- category: category_schema_1.CategoryExtendedSchema.nullable(),
23
+ category: category_extended_schema_1.CategoryExtendedSchema.nullable(),
24
24
  aliasList: zod_1.z.array(product_image_alias_schema_1.ProductImageAliasSchema).optional(),
25
25
  });
26
26
  exports.UpdateProductImageSchema = exports.ProductImageSchema.omit({
@@ -1,16 +1,9 @@
1
- import { z } from 'zod';
2
- import { CategorySchema } from '../../schemas';
1
+ import type { z } from 'zod';
3
2
  import { CategoryCreateSchema } from '../../schemas/category/category-create.schema';
4
-
5
- const CreateCategoryRequestSchema = CategoryCreateSchema;
6
-
7
- const CreateCategoryResponseSchema = z.object({
8
- message: z.string().optional(),
9
- data: CategorySchema,
10
- });
3
+ import { CreateCategoryResponseSchema } from '../../schemas/category/create-category-response.schema';
11
4
 
12
5
  export namespace CreateCategoryContractCommand {
13
- export const RequestSchema = CreateCategoryRequestSchema;
6
+ export const RequestSchema = CategoryCreateSchema;
14
7
  export type Request = z.infer<typeof RequestSchema>;
15
8
 
16
9
  export const ResponseSchema = CreateCategoryResponseSchema;
@@ -1,14 +1,6 @@
1
- import { z } from 'zod';
2
- import { CategoryExtendedSchema } from '../../schemas/category/category.schema';
3
-
4
- const GetCategoryByUUIDRequestSchema = z.object({
5
- uuid: z.uuid(),
6
- });
7
-
8
- const GetCategoryByUUIDResponseSchema = z.object({
9
- message: z.string().optional(),
10
- data: CategoryExtendedSchema,
11
- });
1
+ import type { z } from 'zod';
2
+ import { GetCategoryByUUIDRequestSchema } from '../../schemas/category/get-category-by-uuid-request.schema';
3
+ import { GetCategoryByUUIDResponseSchema } from '../../schemas/category/get-category-by-uuid-response.schema';
12
4
 
13
5
  export namespace GetCategoryByUUIDhContractQuery {
14
6
  export const RequestSchema = GetCategoryByUUIDRequestSchema;
@@ -1,18 +1,11 @@
1
- import { z } from 'zod';
1
+ import type { z } from 'zod';
2
2
  import { CategoryListFilterSchema } from '../../schemas/category/category-list-filter.schema';
3
- import { CategoryListSchema } from '../../schemas/category/category-list.schema';
4
-
5
- const GetCategoryListRequestSchema = CategoryListFilterSchema;
6
-
7
- const GetCategoryResponseSchema = z.object({
8
- message: z.string().optional(),
9
- data: CategoryListSchema,
10
- });
3
+ import { GetCategoryListResponseSchema } from '../../schemas/category/get-category-list-response.schema';
11
4
 
12
5
  export namespace GetCategoryListContractQuery {
13
- export const RequestSchema = GetCategoryListRequestSchema;
6
+ export const RequestSchema = CategoryListFilterSchema;
14
7
  export type Request = z.infer<typeof RequestSchema>;
15
8
 
16
- export const ResponseSchema = GetCategoryResponseSchema;
9
+ export const ResponseSchema = GetCategoryListResponseSchema;
17
10
  export type Response = z.infer<typeof ResponseSchema>;
18
11
  }
@@ -1,16 +1,9 @@
1
- import { z } from 'zod';
2
- import { CategorySchema } from '../../schemas';
1
+ import type { z } from 'zod';
3
2
  import { CategoryUpdateSchema } from '../../schemas/category/category-update.schema';
4
-
5
- const UpdateCategoryRequestSchema = CategoryUpdateSchema;
6
-
7
- const UpdateCategoryResponseSchema = z.object({
8
- message: z.string().optional(),
9
- data: CategorySchema.nullable(),
10
- });
3
+ import { UpdateCategoryResponseSchema } from '../../schemas/category/update-category-response.schema';
11
4
 
12
5
  export namespace UpdateCategoryContractCommand {
13
- export const RequestSchema = UpdateCategoryRequestSchema;
6
+ export const RequestSchema = CategoryUpdateSchema;
14
7
  export type Request = z.infer<typeof RequestSchema>;
15
8
 
16
9
  export const ResponseSchema = UpdateCategoryResponseSchema;
@@ -0,0 +1,11 @@
1
+ import type { z } from 'zod';
2
+ import { GetOzexportCatalogFiltersRequestSchema } from '../../../schemas/integration/ozexport/get-ozexport-catalog-filters-request.schema';
3
+ import { GetOzexportCatalogFiltersResponseSchema } from '../../../schemas/integration/ozexport/get-ozexport-catalog-filters-response.schema';
4
+
5
+ export namespace GetOzexportCatalogFiltersContractQuery {
6
+ export const RequestSchema = GetOzexportCatalogFiltersRequestSchema;
7
+ export type Request = z.infer<typeof RequestSchema>;
8
+
9
+ export const ResponseSchema = GetOzexportCatalogFiltersResponseSchema;
10
+ export type Response = z.infer<typeof ResponseSchema>;
11
+ }
@@ -1,6 +1,7 @@
1
1
  export * from './connect-ozexport.command';
2
2
  export * from './disconnect-ozexport.command';
3
3
  export * from './get-ozexport-catalog.query';
4
+ export * from './get-ozexport-catalog-filters.query';
4
5
  export * from './get-ozexport-status.query';
5
6
  export * from './select-ozexport-unit.command';
6
7
 
@@ -27,6 +27,10 @@ export enum PermissionKeyEnum {
27
27
  WRITE_OFF_DELETE = 'write_off.delete',
28
28
  // Moving a write-off out of PENDING (принятие / отклонение списания).
29
29
  WRITE_OFF_APPROVE = 'write_off.approve',
30
+ // Outgoing transfer: create a request and cancel it while PENDING (создание и отмена переноса).
31
+ CONSIGNMENT_TRANSFER_CREATE = 'consignment_transfer.create',
32
+ // Incoming transfer: accept or reject a PENDING request (приёмка и отклонение переноса).
33
+ CONSIGNMENT_TRANSFER_PROCESS = 'consignment_transfer.process',
30
34
  }
31
35
 
32
36
  export const PERMISSION_KEY_LIST: PermissionKeyEnum[] = [
@@ -54,4 +58,6 @@ export const PERMISSION_KEY_LIST: PermissionKeyEnum[] = [
54
58
  PermissionKeyEnum.WRITE_OFF_CREATE,
55
59
  PermissionKeyEnum.WRITE_OFF_DELETE,
56
60
  PermissionKeyEnum.WRITE_OFF_APPROVE,
61
+ PermissionKeyEnum.CONSIGNMENT_TRANSFER_CREATE,
62
+ PermissionKeyEnum.CONSIGNMENT_TRANSFER_PROCESS,
57
63
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floristcloud/api-lib",
3
- "version": "1.2.165",
3
+ "version": "1.2.167",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {
@@ -1,12 +1,17 @@
1
1
  import { z } from 'zod';
2
+ import { CategoryPiecesPerBoxOverridesSchema } from './category-pieces-per-box-overrides.schema';
2
3
  import { LocalizedNameSchema } from '../i18n/localized-name.schema';
3
4
 
5
+ const INT4_MAX = 2147483647;
6
+
4
7
  // Поля новой категории. Название на дополнительных языках необязательно: без переводов
5
8
  // категория живёт на каноническом имени.
6
9
  export const CategoryCreateSchema = z.object({
7
10
  name: z.string(),
8
11
  nameTranslations: LocalizedNameSchema.nullish(),
9
12
  multiplicity: z.number(),
13
+ basePiecesPerBox: z.number().int().positive().max(INT4_MAX).nullable().optional(),
14
+ piecesPerBoxByLength: CategoryPiecesPerBoxOverridesSchema.optional(),
10
15
  isSizeSeparate: z.coerce.boolean(),
11
16
  typeUUID: z.string(),
12
17
  isSaveCategoryName: z.coerce.boolean(),
@@ -0,0 +1,6 @@
1
+ import { TypeSchema } from '../type/type.schema';
2
+ import { CategoryWithBoxSettingsSchema } from './category-with-box-settings.schema';
3
+
4
+ export const CategoryExtendedWithBoxSettingsSchema = CategoryWithBoxSettingsSchema.extend({
5
+ type: TypeSchema.nullable(),
6
+ });
@@ -0,0 +1,6 @@
1
+ import { CategorySchema } from './category.schema';
2
+ import { TypeSchema } from '../type/type.schema';
3
+
4
+ export const CategoryExtendedSchema = CategorySchema.extend({
5
+ type: TypeSchema.nullable(),
6
+ });
@@ -1,8 +1,8 @@
1
1
  import { z } from 'zod';
2
- import { CategoryExtendedSchema } from './category.schema';
2
+ import { CategoryExtendedWithBoxSettingsSchema } from './category-extended-with-box-settings.schema';
3
3
 
4
4
  // Страница справочника категорий вместе с общим числом строк по фильтру.
5
5
  export const CategoryListSchema = z.object({
6
- categoryList: CategoryExtendedSchema.array(),
6
+ categoryList: CategoryExtendedWithBoxSettingsSchema.array(),
7
7
  total: z.number(),
8
8
  });
@@ -0,0 +1,8 @@
1
+ import { z } from 'zod';
2
+
3
+ const INT4_MAX = 2147483647;
4
+
5
+ export const CategoryPiecesPerBoxByLengthSchema = z.object({
6
+ lengthCm: z.number().int().positive().max(INT4_MAX),
7
+ pieces: z.number().int().positive().max(INT4_MAX),
8
+ });
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+ import { CategoryPiecesPerBoxByLengthSchema } from './category-pieces-per-box-by-length.schema';
3
+
4
+ export const CategoryPiecesPerBoxOverridesSchema = z
5
+ .array(CategoryPiecesPerBoxByLengthSchema)
6
+ .refine(values => new Set(values.map(value => value.lengthCm)).size === values.length, { message: 'Each length must occur only once' });
@@ -1,7 +1,10 @@
1
1
  import { z } from 'zod';
2
+ import { CategoryPiecesPerBoxOverridesSchema } from './category-pieces-per-box-overrides.schema';
2
3
  import { CategoryStatusEnum } from '../../enum';
3
4
  import { LocalizedNameSchema } from '../i18n/localized-name.schema';
4
5
 
6
+ const INT4_MAX = 2147483647;
7
+
5
8
  // Поля редактируемой категории. Переводы отсутствуют в теле — остаются прежними;
6
9
  // `null` и пустой объект их очищают.
7
10
  export const CategoryUpdateSchema = z.object({
@@ -9,6 +12,8 @@ export const CategoryUpdateSchema = z.object({
9
12
  nameTranslations: LocalizedNameSchema.nullish(),
10
13
  typeUUID: z.string(),
11
14
  multiplicity: z.number(),
15
+ basePiecesPerBox: z.number().int().positive().max(INT4_MAX).nullable().optional(),
16
+ piecesPerBoxByLength: CategoryPiecesPerBoxOverridesSchema.optional(),
12
17
  isSizeSeparate: z.coerce.boolean(),
13
18
  isSaveCategoryName: z.coerce.boolean(),
14
19
  status: z.nativeEnum(CategoryStatusEnum),
@@ -0,0 +1,10 @@
1
+ import { z } from 'zod';
2
+ import { CategorySchema } from './category.schema';
3
+ import { CategoryPiecesPerBoxOverridesSchema } from './category-pieces-per-box-overrides.schema';
4
+
5
+ const INT4_MAX = 2147483647;
6
+
7
+ export const CategoryWithBoxSettingsSchema = CategorySchema.extend({
8
+ basePiecesPerBox: z.number().int().positive().max(INT4_MAX).nullable(),
9
+ piecesPerBoxByLength: CategoryPiecesPerBoxOverridesSchema,
10
+ });
@@ -1,7 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { CategoryStatusEnum } from '../../enum/category-status.enum';
3
3
  import { LocalizedNameSchema } from '../i18n/localized-name.schema';
4
- import { TypeSchema } from '../type/type.schema';
5
4
 
6
5
  export const CategorySchema = z.object({
7
6
  uuid: z.uuid(),
@@ -17,7 +16,3 @@ export const CategorySchema = z.object({
17
16
  updatedAt: z.date(),
18
17
  deletedAt: z.date().nullable(),
19
18
  });
20
-
21
- export const CategoryExtendedSchema = CategorySchema.extend({
22
- type: TypeSchema.nullable(),
23
- });
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ import { CategoryWithBoxSettingsSchema } from './category-with-box-settings.schema';
3
+
4
+ export const CreateCategoryResponseSchema = z.object({
5
+ message: z.string().optional(),
6
+ data: CategoryWithBoxSettingsSchema,
7
+ });
@@ -0,0 +1,5 @@
1
+ import { z } from 'zod';
2
+
3
+ export const GetCategoryByUUIDRequestSchema = z.object({
4
+ uuid: z.uuid(),
5
+ });
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ import { CategoryExtendedWithBoxSettingsSchema } from './category-extended-with-box-settings.schema';
3
+
4
+ export const GetCategoryByUUIDResponseSchema = z.object({
5
+ message: z.string().optional(),
6
+ data: CategoryExtendedWithBoxSettingsSchema,
7
+ });
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ import { CategoryListSchema } from './category-list.schema';
3
+
4
+ export const GetCategoryListResponseSchema = z.object({
5
+ message: z.string().optional(),
6
+ data: CategoryListSchema,
7
+ });
@@ -5,3 +5,13 @@ export * from './category-list-filter.schema';
5
5
  export * from './category-list.schema';
6
6
  export * from './category.schema';
7
7
  export * from './category-name.schema';
8
+ export * from './category-pieces-per-box-by-length.schema';
9
+ export * from './category-pieces-per-box-overrides.schema';
10
+ export * from './category-extended.schema';
11
+ export * from './create-category-response.schema';
12
+ export * from './update-category-response.schema';
13
+ export * from './get-category-by-uuid-request.schema';
14
+ export * from './get-category-by-uuid-response.schema';
15
+ export * from './get-category-list-response.schema';
16
+ export * from './category-with-box-settings.schema';
17
+ export * from './category-extended-with-box-settings.schema';
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ import { CategoryWithBoxSettingsSchema } from './category-with-box-settings.schema';
3
+
4
+ export const UpdateCategoryResponseSchema = z.object({
5
+ message: z.string().optional(),
6
+ data: CategoryWithBoxSettingsSchema.nullable(),
7
+ });
@@ -0,0 +1,3 @@
1
+ import { z } from 'zod';
2
+
3
+ export const GetOzexportCatalogFiltersRequestSchema = z.object({});
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ import { OzexportCatalogCategorySchema } from './ozexport-catalog-category.schema';
3
+
4
+ export const GetOzexportCatalogFiltersResponseDataSchema = z.object({
5
+ categories: z.array(OzexportCatalogCategorySchema),
6
+ lengths: z.array(z.number().int().positive()),
7
+ });
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+ import { GetOzexportCatalogFiltersResponseDataSchema } from './get-ozexport-catalog-filters-response-data.schema';
3
+
4
+ export const GetOzexportCatalogFiltersResponseSchema = z.object({
5
+ data: GetOzexportCatalogFiltersResponseDataSchema,
6
+ });
@@ -6,6 +6,8 @@ export const GetOzexportCatalogOffersRequestSchema = GetOzexportCatalogRequestSc
6
6
  count: true,
7
7
  search: true,
8
8
  color: true,
9
+ categoryTemplateUUID: true,
10
+ lengthCm: true,
9
11
  stockType: true,
10
12
  status: true,
11
13
  }).extend({ templateUUID: z.string().uuid() });
@@ -6,6 +6,8 @@ const OZEXPORT_CATALOG_SEARCH_MAX_LENGTH = 100;
6
6
 
7
7
  const OZEXPORT_CATALOG_FILTER_MAX_LENGTH = 100;
8
8
 
9
+ const OZEXPORT_CATALOG_LENGTH_CM_MAX = 2147483647;
10
+
9
11
  // qs отдаёт одиночное значение строкой (`status=AVAILABLE`), а повторённое — массивом.
10
12
  const toArray = (value: unknown): unknown => (typeof value === 'string' ? [value] : value);
11
13
 
@@ -19,6 +21,8 @@ const OZEXPORT_CATALOG_PAGE_SIZE_DEFAULT = 20;
19
21
  export const GetOzexportCatalogRequestSchema = z.object({
20
22
  search: z.string().trim().max(OZEXPORT_CATALOG_SEARCH_MAX_LENGTH).optional(),
21
23
  color: z.string().trim().max(OZEXPORT_CATALOG_FILTER_MAX_LENGTH).optional(),
24
+ categoryTemplateUUID: z.string().uuid().optional(),
25
+ lengthCm: z.coerce.number().int().positive().max(OZEXPORT_CATALOG_LENGTH_CM_MAX).optional(),
22
26
  stockType: z.string().trim().max(OZEXPORT_CATALOG_FILTER_MAX_LENGTH).optional(),
23
27
  inNomenclature: z.nativeEnum(SupplierCatalogNomenclatureFilterEnum).optional().default(SupplierCatalogNomenclatureFilterEnum.ALL),
24
28
  // Без фильтра сервер отдаёт живые предложения (AVAILABLE, NO_PRICE и OUT_OF_STOCK); NOT_FOUND запрашивается явно.
@@ -2,6 +2,10 @@ export * from './connect-ozexport-request.schema';
2
2
  export * from './disconnect-ozexport-response-true.schema';
3
3
  export * from './disconnect-ozexport-response.schema';
4
4
  export * from './get-ozexport-catalog-request.schema';
5
+ export * from './get-ozexport-catalog-filters-request.schema';
6
+ export * from './get-ozexport-catalog-filters-response.schema';
7
+ export * from './get-ozexport-catalog-filters-response-data.schema';
8
+ export * from './ozexport-catalog-category.schema';
5
9
  export * from './get-ozexport-catalog-response-data.schema';
6
10
  export * from './get-ozexport-catalog-response.schema';
7
11
  export * from './ozexport-account-unit.schema';
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+
3
+ export const OzexportCatalogCategorySchema = z.object({
4
+ uuid: z.string().uuid(),
5
+ name: z.string(),
6
+ });
@@ -52,6 +52,7 @@ export * from './supplier-add-execute-skipped-item.schema';
52
52
  export * from './supplier-add-items-limit.constant';
53
53
  export * from './supplier-add-offer-key.schema';
54
54
  export * from './supplier-add-sale-price.schema';
55
+ export * from './supplier-add-cost-price.schema';
55
56
  export * from './supplier-sync-analyze-item.schema';
56
57
  export * from './supplier-sync-analyze-request.schema';
57
58
  export * from './supplier-sync-analyze-response-data.schema';
@@ -1,6 +1,8 @@
1
1
  import { PreOrderCollectionItemExtendedSchema } from './pre-order-collection-item-extended.schema';
2
2
  import { PreOrderCollectionItemSupplierAdminShape } from './pre-order-collection-item-supplier-admin.shape';
3
+ import { SupplierAddCostPriceSchema } from './supplier-add-cost-price.schema';
3
4
 
4
- export const PreOrderCollectionItemExtendedForAdminSchema = PreOrderCollectionItemExtendedSchema.extend(
5
- PreOrderCollectionItemSupplierAdminShape,
6
- );
5
+ export const PreOrderCollectionItemExtendedForAdminSchema = PreOrderCollectionItemExtendedSchema.extend({
6
+ ...PreOrderCollectionItemSupplierAdminShape,
7
+ costPrice: SupplierAddCostPriceSchema.nullable(),
8
+ });
@@ -1,7 +1,9 @@
1
1
  import { z } from 'zod';
2
2
  import { PreOrderCollectionItemClientPreOrderProductSchema } from './pre-order-collection-item-client-pre-order-product.schema';
3
3
  import { PreOrderCollectionItemExtendedSchema } from './pre-order-collection-item-extended.schema';
4
+ import { SupplierAddCostPriceSchema } from './supplier-add-cost-price.schema';
4
5
 
5
6
  export const PreOrderCollectionItemExtendedWithClientsPreOrderProductSchema = PreOrderCollectionItemExtendedSchema.extend({
7
+ costPrice: SupplierAddCostPriceSchema.nullable(),
6
8
  clientsWithPreOrderProduct: z.array(PreOrderCollectionItemClientPreOrderProductSchema),
7
9
  });
@@ -1,4 +1,8 @@
1
1
  import { PreOrderCollectionItemSupplierAdminShape } from './pre-order-collection-item-supplier-admin.shape';
2
2
  import { PreOrderCollectionItemSchema } from './pre-order-collection-item-base.schema';
3
+ import { SupplierAddCostPriceSchema } from './supplier-add-cost-price.schema';
3
4
 
4
- export const PreOrderCollectionItemForAdminSchema = PreOrderCollectionItemSchema.extend(PreOrderCollectionItemSupplierAdminShape);
5
+ export const PreOrderCollectionItemForAdminSchema = PreOrderCollectionItemSchema.extend({
6
+ ...PreOrderCollectionItemSupplierAdminShape,
7
+ costPrice: SupplierAddCostPriceSchema.nullable(),
8
+ });
@@ -13,6 +13,8 @@ export const SupplierAddAnalyzeItemSchema = z.object({
13
13
  productImageUUID: z.string().nullable(),
14
14
  willImportCard: z.boolean(),
15
15
  categoryName: z.string().nullable(),
16
+ categoryMultiplicity: z.number().nullable(),
17
+ piecesPerBox: z.number().int().positive().nullable(),
16
18
  offer: SupplierAddAnalyzeOfferSchema.nullable(),
17
19
  existingItemUUID: z.string().nullable(),
18
20
  isSkipped: z.boolean(),
@@ -11,4 +11,5 @@ export const SupplierAddAnalyzeRequestSchema = z.object({
11
11
  .min(1)
12
12
  .max(SUPPLIER_ADD_ITEMS_LIMIT)
13
13
  .refine(hasUniqueSupplierAddKeys, { message: 'validation.supplierAdd.duplicateKeys' }),
14
+ allowDuplicates: z.boolean().optional().default(false),
14
15
  });
@@ -0,0 +1,4 @@
1
+ import { z } from 'zod';
2
+
3
+ // Себестоимость передаётся точной десятичной строкой без округления до денежного масштаба.
4
+ export const SupplierAddCostPriceSchema = z.string().regex(/^\d+(\.\d+)?$/);
@@ -1,12 +1,14 @@
1
1
  import { z } from 'zod';
2
2
  import { SupplierAddOfferKeySchema } from './supplier-add-offer-key.schema';
3
3
  import { SupplierAddSalePriceSchema } from './supplier-add-sale-price.schema';
4
+ import { SupplierAddCostPriceSchema } from './supplier-add-cost-price.schema';
4
5
 
5
6
  // Кратность — Int колонки позиции (int4).
6
7
  const MULTIPLICITY_MAX = 2147483647;
7
8
 
8
9
  export const SupplierAddExecuteItemSchema = SupplierAddOfferKeySchema.extend({
9
10
  price: SupplierAddSalePriceSchema,
11
+ costPrice: SupplierAddCostPriceSchema.nullable().optional(),
10
12
  multiplicity: z.number().int().min(1).max(MULTIPLICITY_MAX).optional(),
11
13
  isOpen: z.boolean().optional(),
12
14
  });
@@ -13,4 +13,5 @@ export const SupplierAddExecuteRequestSchema = z.object({
13
13
  .refine(hasUniqueSupplierAddKeys, { message: 'validation.supplierAdd.duplicateKeys' }),
14
14
  // true — добавить и те предложения, которые в коллекции уже есть (ALREADY_IN_COLLECTION не пропускается).
15
15
  allowDuplicates: z.boolean().optional().default(false),
16
+ transferGrower: z.boolean().optional().default(true),
16
17
  });
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { CategoryExtendedSchema } from '../category/category.schema';
2
+ import { CategoryExtendedSchema } from '../category/category-extended.schema';
3
3
  import { ProductImageAliasSchema } from './product-image-alias.schema';
4
4
 
5
5
  export const ProductImageSchema = z.object({