@floristcloud/api-lib 1.2.166 → 1.2.168
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/category/create-category.command.js +3 -9
- package/build/commands/category/get-category-by-uuid.query.js +4 -11
- package/build/commands/category/get-category-list.query.js +3 -9
- package/build/commands/category/update-category-command.js +3 -9
- package/build/commands/integration/ozexport/get-ozexport-catalog-filters.query.js +10 -0
- package/build/commands/integration/ozexport/index.js +1 -0
- package/build/constant/discount-rules-pricing-type-list.constant.js +14 -0
- package/build/constant/error.js +11 -0
- package/build/constant/index.js +1 -0
- package/build/enum/discount-rules-mode-type.enum.js +2 -4
- package/build/enum/discount-rules-type.enum.js +1 -0
- package/build/schemas/category/category-create.schema.js +4 -0
- package/build/schemas/category/category-extended-with-box-settings.schema.js +8 -0
- package/build/schemas/category/category-extended.schema.js +8 -0
- package/build/schemas/category/category-list.schema.js +2 -2
- package/build/schemas/category/category-pieces-per-box-by-length.schema.js +9 -0
- package/build/schemas/category/category-pieces-per-box-overrides.schema.js +8 -0
- package/build/schemas/category/category-update.schema.js +4 -0
- package/build/schemas/category/category-with-box-settings.schema.js +11 -0
- package/build/schemas/category/category.schema.js +1 -5
- package/build/schemas/category/create-category-response.schema.js +9 -0
- package/build/schemas/category/get-category-by-uuid-request.schema.js +7 -0
- package/build/schemas/category/get-category-by-uuid-response.schema.js +9 -0
- package/build/schemas/category/get-category-list-response.schema.js +9 -0
- package/build/schemas/category/index.js +10 -0
- package/build/schemas/category/update-category-response.schema.js +9 -0
- package/build/schemas/discount-rules/discount-rules.schema.js +25 -11
- package/build/schemas/discount-rules/product-discount-price-data.schema.js +9 -0
- package/build/schemas/discount-rules/product-discount-price-multiplicity-option.schema.js +2 -0
- package/build/schemas/integration/ozexport/get-ozexport-catalog-filters-request.schema.js +5 -0
- package/build/schemas/integration/ozexport/get-ozexport-catalog-filters-response-data.schema.js +9 -0
- package/build/schemas/integration/ozexport/get-ozexport-catalog-filters-response.schema.js +8 -0
- package/build/schemas/integration/ozexport/get-ozexport-catalog-offers-request.schema.js +2 -0
- package/build/schemas/integration/ozexport/get-ozexport-catalog-request.schema.js +3 -0
- package/build/schemas/integration/ozexport/index.js +4 -0
- package/build/schemas/integration/ozexport/ozexport-catalog-category.schema.js +8 -0
- package/build/schemas/order-product/price-correction-analyze-item.schema.js +6 -0
- package/build/schemas/pre-order-collection-item/index.js +1 -0
- package/build/schemas/pre-order-collection-item/pre-order-collection-item-extended-for-admin.schema.js +2 -1
- package/build/schemas/pre-order-collection-item/pre-order-collection-item-extended-with-clients-pre-order-product.schema.js +2 -0
- package/build/schemas/pre-order-collection-item/pre-order-collection-item-for-admin.schema.js +2 -1
- package/build/schemas/pre-order-collection-item/supplier-add-analyze-item.schema.js +2 -0
- package/build/schemas/pre-order-collection-item/supplier-add-analyze-request.schema.js +1 -0
- package/build/schemas/pre-order-collection-item/supplier-add-cost-price.schema.js +6 -0
- package/build/schemas/pre-order-collection-item/supplier-add-execute-item.schema.js +2 -0
- package/build/schemas/pre-order-collection-item/supplier-add-execute-request.schema.js +1 -0
- package/build/schemas/product-image/product-image.schema.js +2 -2
- package/commands/category/create-category.command.ts +3 -10
- package/commands/category/get-category-by-uuid.query.ts +3 -11
- package/commands/category/get-category-list.query.ts +4 -11
- package/commands/category/update-category-command.ts +3 -10
- package/commands/integration/ozexport/get-ozexport-catalog-filters.query.ts +11 -0
- package/commands/integration/ozexport/index.ts +1 -0
- package/constant/discount-rules-pricing-type-list.constant.ts +12 -0
- package/constant/error.ts +11 -0
- package/constant/index.ts +1 -0
- package/enum/discount-rules-mode-type.enum.ts +2 -4
- package/enum/discount-rules-type.enum.ts +1 -0
- package/package.json +1 -1
- package/schemas/category/category-create.schema.ts +5 -0
- package/schemas/category/category-extended-with-box-settings.schema.ts +6 -0
- package/schemas/category/category-extended.schema.ts +6 -0
- package/schemas/category/category-list.schema.ts +2 -2
- package/schemas/category/category-pieces-per-box-by-length.schema.ts +8 -0
- package/schemas/category/category-pieces-per-box-overrides.schema.ts +6 -0
- package/schemas/category/category-update.schema.ts +5 -0
- package/schemas/category/category-with-box-settings.schema.ts +10 -0
- package/schemas/category/category.schema.ts +0 -5
- package/schemas/category/create-category-response.schema.ts +7 -0
- package/schemas/category/get-category-by-uuid-request.schema.ts +5 -0
- package/schemas/category/get-category-by-uuid-response.schema.ts +7 -0
- package/schemas/category/get-category-list-response.schema.ts +7 -0
- package/schemas/category/index.ts +10 -0
- package/schemas/category/update-category-response.schema.ts +7 -0
- package/schemas/discount-rules/discount-rules.schema.ts +28 -11
- package/schemas/discount-rules/product-discount-price-data.schema.ts +9 -0
- package/schemas/discount-rules/product-discount-price-multiplicity-option.schema.ts +2 -0
- package/schemas/integration/ozexport/get-ozexport-catalog-filters-request.schema.ts +3 -0
- package/schemas/integration/ozexport/get-ozexport-catalog-filters-response-data.schema.ts +7 -0
- package/schemas/integration/ozexport/get-ozexport-catalog-filters-response.schema.ts +6 -0
- package/schemas/integration/ozexport/get-ozexport-catalog-offers-request.schema.ts +2 -0
- package/schemas/integration/ozexport/get-ozexport-catalog-request.schema.ts +4 -0
- package/schemas/integration/ozexport/index.ts +4 -0
- package/schemas/integration/ozexport/ozexport-catalog-category.schema.ts +6 -0
- package/schemas/order-product/price-correction-analyze-item.schema.ts +7 -0
- package/schemas/pre-order-collection-item/index.ts +1 -0
- package/schemas/pre-order-collection-item/pre-order-collection-item-extended-for-admin.schema.ts +5 -3
- package/schemas/pre-order-collection-item/pre-order-collection-item-extended-with-clients-pre-order-product.schema.ts +2 -0
- package/schemas/pre-order-collection-item/pre-order-collection-item-for-admin.schema.ts +5 -1
- package/schemas/pre-order-collection-item/supplier-add-analyze-item.schema.ts +2 -0
- package/schemas/pre-order-collection-item/supplier-add-analyze-request.schema.ts +1 -0
- package/schemas/pre-order-collection-item/supplier-add-cost-price.schema.ts +4 -0
- package/schemas/pre-order-collection-item/supplier-add-execute-item.schema.ts +2 -0
- package/schemas/pre-order-collection-item/supplier-add-execute-request.schema.ts +1 -0
- 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
|
|
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 =
|
|
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
|
|
5
|
-
const
|
|
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
|
|
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 =
|
|
15
|
-
GetCategoryListContractQuery.ResponseSchema =
|
|
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
|
|
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 =
|
|
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);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DISCOUNT_RULES_PRICING_TYPE_LIST = void 0;
|
|
4
|
+
const discount_rules_type_enum_1 = require("../enum/discount-rules-type.enum");
|
|
5
|
+
/**
|
|
6
|
+
* Правила ценообразования: задают цену клиента целиком, а не уменьшают её.
|
|
7
|
+
*
|
|
8
|
+
* Цена от себестоимости или от прайса плюс наценка. Если у клиента есть такое правило, скидки к нему не
|
|
9
|
+
* применяются, и больше одного действующего правила ценообразования на клиента быть не может.
|
|
10
|
+
*/
|
|
11
|
+
exports.DISCOUNT_RULES_PRICING_TYPE_LIST = [
|
|
12
|
+
discount_rules_type_enum_1.DiscountRulesTypeEnum.COST_PLUS_MARKUP,
|
|
13
|
+
discount_rules_type_enum_1.DiscountRulesTypeEnum.PRICE_PLUS_MARKUP,
|
|
14
|
+
];
|
package/build/constant/error.js
CHANGED
|
@@ -1363,6 +1363,17 @@ exports.ERRORS = {
|
|
|
1363
1363
|
message: 'Too many products for a single consignment discount operation',
|
|
1364
1364
|
httpCode: 400,
|
|
1365
1365
|
},
|
|
1366
|
+
DISCOUNT_RULES_PRICING_RULE_CONFLICT: {
|
|
1367
|
+
code: 'DR007',
|
|
1368
|
+
message: 'A client can have only one active pricing rule',
|
|
1369
|
+
httpCode: 409,
|
|
1370
|
+
},
|
|
1371
|
+
// Не дождались транзакционной блокировки правил ценообразования компании (lock_timeout).
|
|
1372
|
+
DISCOUNT_RULES_PRICING_RULE_LOCK_BUSY: {
|
|
1373
|
+
code: 'DR008',
|
|
1374
|
+
message: 'Pricing rules of this company are being changed right now, try again',
|
|
1375
|
+
httpCode: 409,
|
|
1376
|
+
},
|
|
1366
1377
|
DISCOUNT_RULES_NOT_FOUND: { code: 'DR010', message: 'Discount-rules not found', httpCode: 404 },
|
|
1367
1378
|
// ACTION LOG
|
|
1368
1379
|
ACTION_LOG_NOT_CREATED: { code: 'ALG001', message: 'Failed to create action-log', httpCode: 500 },
|
package/build/constant/index.js
CHANGED
|
@@ -31,3 +31,4 @@ __exportStar(require("./product-image-merge.constant"), exports);
|
|
|
31
31
|
__exportStar(require("./client-group-actions.constant"), exports);
|
|
32
32
|
__exportStar(require("./standing-order-positions.constant"), exports);
|
|
33
33
|
__exportStar(require("./order-external-number.constant"), exports);
|
|
34
|
+
__exportStar(require("./discount-rules-pricing-type-list.constant"), exports);
|
|
@@ -8,10 +8,8 @@ var DiscountRulesModeTypeEnum;
|
|
|
8
8
|
/**
|
|
9
9
|
* Готовая цена, а не величина скидки.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* (`discountRulesModeSchema`) знает только FIXED и PERCENT, а схема выдачи
|
|
14
|
-
* (`discountPriceOutcomeSchema`) — все три.
|
|
11
|
+
* Больше не отдаётся: правило `COST_PLUS_MARKUP` стало правилом ценообразования и задаёт цену
|
|
12
|
+
* клиента, а не вариант скидки. Значение оставлено, чтобы не ломать клиентов, которые его разбирают.
|
|
15
13
|
*/
|
|
16
14
|
DiscountRulesModeTypeEnum["TARGET_PRICE"] = "TARGET_PRICE";
|
|
17
15
|
})(DiscountRulesModeTypeEnum || (exports.DiscountRulesModeTypeEnum = DiscountRulesModeTypeEnum = {}));
|
|
@@ -9,4 +9,5 @@ var DiscountRulesTypeEnum;
|
|
|
9
9
|
DiscountRulesTypeEnum["ITEM_DISCOUNT"] = "ITEM_DISCOUNT";
|
|
10
10
|
DiscountRulesTypeEnum["DISCOUNT_PROHIBITED"] = "DISCOUNT_PROHIBITED";
|
|
11
11
|
DiscountRulesTypeEnum["COST_PLUS_MARKUP"] = "COST_PLUS_MARKUP";
|
|
12
|
+
DiscountRulesTypeEnum["PRICE_PLUS_MARKUP"] = "PRICE_PLUS_MARKUP";
|
|
12
13
|
})(DiscountRulesTypeEnum || (exports.DiscountRulesTypeEnum = DiscountRulesTypeEnum = {}));
|
|
@@ -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
|
|
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:
|
|
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.
|
|
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,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
|
+
});
|
|
@@ -22,10 +22,9 @@ exports.discountRulesModeSchema = zod_1.z.discriminatedUnion('typeDiscount', [di
|
|
|
22
22
|
/**
|
|
23
23
|
* Итог применения правила к товару — то, что уезжает клиенту в `discountDataList`.
|
|
24
24
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* создании правила нельзя, `discountRulesModeSchema` его не принимает.
|
|
25
|
+
* Ветка TARGET_PRICE больше не отдаётся: правило от себестоимости стало правилом ценообразования и
|
|
26
|
+
* задаёт цену клиента (`price`, `clientPrice`), а не вариант скидки. Ветка оставлена, чтобы не ломать
|
|
27
|
+
* клиентов, которые её разбирают.
|
|
29
28
|
*/
|
|
30
29
|
exports.discountPriceOutcomeSchema = zod_1.z.discriminatedUnion('typeDiscount', [
|
|
31
30
|
discountPercentModeSchema,
|
|
@@ -61,18 +60,29 @@ const DiscountRulesQuantityBasedDataSchema = zod_1.z
|
|
|
61
60
|
const DiscountRulesItemDiscountDataSchema = exports.discountRulesModeSchema;
|
|
62
61
|
const DiscountRulesDiscountProhibitedDataSchema = zod_1.z.object({}).default({});
|
|
63
62
|
/**
|
|
64
|
-
* Наценка
|
|
63
|
+
* Наценка правила ценообразования: процент или сумма на единицу.
|
|
65
64
|
*
|
|
66
|
-
*
|
|
67
|
-
* — только вверх, знака у величины
|
|
68
|
-
* — ноль допустим (
|
|
69
|
-
* `NonNegativeMoneySchema`, а не `PositiveMoneySchema`;
|
|
65
|
+
* Отличия от режима скидки намеренные:
|
|
66
|
+
* — только вверх, знака у величины нет;
|
|
67
|
+
* — ноль допустим (цена ровно равна источнику), поэтому FIXED берёт `NonNegativeMoneySchema`;
|
|
70
68
|
* — у процента нет верхней границы: наценка в 150 % законна, в отличие от скидки в 150 %.
|
|
71
69
|
*/
|
|
70
|
+
const pricingMarkupPercentSchema = zod_1.z.object({ typeMarkup: zod_1.z.literal(enum_1.DiscountRulesModeTypeEnum.PERCENT), markupValue: zod_1.z.number().min(0) });
|
|
71
|
+
const pricingMarkupFixedSchema = zod_1.z.object({ typeMarkup: zod_1.z.literal(enum_1.DiscountRulesModeTypeEnum.FIXED), markupValue: non_negative_money_schema_1.NonNegativeMoneySchema });
|
|
72
|
+
/**
|
|
73
|
+
* Потолок «не выше прайса» есть только у цены от себестоимости: цена от прайса с наценкой выше
|
|
74
|
+
* прайса по определению. Поле необязательное, и отсутствие значит разное: при создании — потолка
|
|
75
|
+
* нет, при правке — оставить как было. Так старая панель, которая флага не знает, не снимает потолок
|
|
76
|
+
* у правил, которым его проставила миграция.
|
|
77
|
+
*/
|
|
78
|
+
const costPlusCapShape = { isCappedByPrice: zod_1.z.boolean().optional() };
|
|
79
|
+
/** Цена клиента = себестоимость + наценка. */
|
|
72
80
|
const DiscountRulesCostPlusMarkupDataSchema = zod_1.z.discriminatedUnion('typeMarkup', [
|
|
73
|
-
|
|
74
|
-
|
|
81
|
+
pricingMarkupPercentSchema.extend(costPlusCapShape),
|
|
82
|
+
pricingMarkupFixedSchema.extend(costPlusCapShape),
|
|
75
83
|
]);
|
|
84
|
+
/** Цена клиента = цена позиции (фасовки, если она выбрана) + наценка. */
|
|
85
|
+
const DiscountRulesPricePlusMarkupDataSchema = zod_1.z.discriminatedUnion('typeMarkup', [pricingMarkupPercentSchema, pricingMarkupFixedSchema]);
|
|
76
86
|
exports.DiscountRulesTypeSchema = zod_1.z.discriminatedUnion('type', [
|
|
77
87
|
zod_1.z.object({
|
|
78
88
|
type: zod_1.z.literal(enum_1.DiscountRulesTypeEnum.PERSONAL_DISCOUNT),
|
|
@@ -98,6 +108,10 @@ exports.DiscountRulesTypeSchema = zod_1.z.discriminatedUnion('type', [
|
|
|
98
108
|
type: zod_1.z.literal(enum_1.DiscountRulesTypeEnum.COST_PLUS_MARKUP),
|
|
99
109
|
data: DiscountRulesCostPlusMarkupDataSchema,
|
|
100
110
|
}),
|
|
111
|
+
zod_1.z.object({
|
|
112
|
+
type: zod_1.z.literal(enum_1.DiscountRulesTypeEnum.PRICE_PLUS_MARKUP),
|
|
113
|
+
data: DiscountRulesPricePlusMarkupDataSchema,
|
|
114
|
+
}),
|
|
101
115
|
]);
|
|
102
116
|
exports.DiscountRulesBaseSchema = zod_1.z.object({
|
|
103
117
|
uuid: zod_1.z.string(),
|
|
@@ -5,9 +5,18 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const money_schema_1 = require("../money.schema");
|
|
6
6
|
const product_discount_price_item_schema_1 = require("./product-discount-price-item.schema");
|
|
7
7
|
const product_discount_price_multiplicity_option_schema_1 = require("./product-discount-price-multiplicity-option.schema");
|
|
8
|
+
/**
|
|
9
|
+
* Две базы рядом, и это намеренно. `price` / `optionPrice` — прайс, одинаковый для всех.
|
|
10
|
+
* `clientPrice` / `clientOptionPrice` — цена этого клиента до скидок: у клиента с правилом
|
|
11
|
+
* ценообразования (от себестоимости или от прайса с наценкой) это цена по правилу, у остальных — тот
|
|
12
|
+
* же прайс. Скидки считаются от прайса и только у клиентов без правила ценообразования: у клиента с
|
|
13
|
+
* таким правилом скидок нет, списки вариантов пусты. Цену позиции без скидки берите из `clientPrice`,
|
|
14
|
+
* а не из `price`: иначе цена по правилу потеряется.
|
|
15
|
+
*/
|
|
8
16
|
exports.ProductDiscountPriceDataSchema = zod_1.z.object({
|
|
9
17
|
productUUID: zod_1.z.string(),
|
|
10
18
|
price: money_schema_1.MoneySchema,
|
|
19
|
+
clientPrice: money_schema_1.MoneySchema,
|
|
11
20
|
priceWithBestDiscount: money_schema_1.MoneySchema.nullable(),
|
|
12
21
|
multiplicityOptions: product_discount_price_multiplicity_option_schema_1.ProductDiscountPriceMultiplicityOptionSchema.array(),
|
|
13
22
|
/**
|
|
@@ -7,6 +7,8 @@ const product_discount_price_item_schema_1 = require("./product-discount-price-i
|
|
|
7
7
|
exports.ProductDiscountPriceMultiplicityOptionSchema = zod_1.z.object({
|
|
8
8
|
uuid: zod_1.z.string(),
|
|
9
9
|
optionPrice: money_schema_1.MoneySchema.nullable(),
|
|
10
|
+
/** `null` ровно тогда, когда `null` у `optionPrice`: своей цены у фасовки нет, база — `clientPrice`. */
|
|
11
|
+
clientOptionPrice: money_schema_1.MoneySchema.nullable(),
|
|
10
12
|
optionPriceWithDiscount: money_schema_1.MoneySchema.nullable(),
|
|
11
13
|
isDiscountApplicable: zod_1.z.boolean(),
|
|
12
14
|
/**
|
package/build/schemas/integration/ozexport/get-ozexport-catalog-filters-response-data.schema.js
ADDED
|
@@ -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
|
+
});
|
|
@@ -34,6 +34,12 @@ exports.PriceCorrectionAnalyzeItemSchema = zod_1.z.object({
|
|
|
34
34
|
// Разницы могут быть отрицательными — цена корректируется в обе стороны, поэтому без ограничения знака.
|
|
35
35
|
priceDifferenceWithoutDiscount: money_schema_1.MoneySchema,
|
|
36
36
|
priceDifferenceWithDiscount: money_schema_1.MoneySchema,
|
|
37
|
+
/**
|
|
38
|
+
* У клиента действует правило ценообразования (от себестоимости или от прайса с наценкой).
|
|
39
|
+
* Его цена — `newPriceWithDiscount`; «без скидок» для него означает прайс, то есть снятие наценки.
|
|
40
|
+
* Сотруднику стоит показать это до применения.
|
|
41
|
+
*/
|
|
42
|
+
hasPricingRule: zod_1.z.boolean(),
|
|
37
43
|
isSkipped: zod_1.z.boolean(),
|
|
38
44
|
skipReason: error_message_schema_1.ErrorMessageSchema.optional(),
|
|
39
45
|
});
|
|
@@ -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
|
-
|
|
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
|
});
|
package/build/schemas/pre-order-collection-item/pre-order-collection-item-for-admin.schema.js
CHANGED
|
@@ -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
|
-
|
|
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
|
});
|