@floristcloud/api-lib 1.2.167 → 1.2.169
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/client/index.js +2 -0
- package/build/commands/client/profile/create-client-legal-profile.command.js +4 -15
- package/build/commands/client/profile/delete-client-legal-profile.command.js +4 -11
- package/build/commands/client/profile/get-client-legal-profile-list.query.js +10 -0
- package/build/commands/client/profile/index.js +1 -0
- package/build/commands/client/profile/update-client-legal-profile.command.js +4 -15
- package/build/commands/client/webshop/create-client-legal-profile-for-client.command.js +10 -0
- package/build/commands/client/webshop/update-client-legal-profile-for-client.command.js +10 -0
- package/build/commands/payment-invoice/create-payment-invoice.command.js +4 -29
- package/build/constant/discount-rules-pricing-type-list.constant.js +14 -0
- package/build/constant/error.js +17 -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/client/client-extended-for-client.schema.js +2 -2
- package/build/schemas/client/client-extended.schema.js +2 -0
- package/build/schemas/client/client-legal-profile-for-client-response.schema.js +9 -0
- package/build/schemas/client/client-legal-profile-for-client.schema.js +27 -0
- package/build/schemas/client/client-legal-profile-requisites.schema.js +15 -0
- package/build/schemas/client/client-legal-profile.schema.js +3 -0
- package/build/schemas/client/create-client-legal-profile-request.schema.js +10 -0
- package/build/schemas/client/create-client-legal-profile-response.schema.js +9 -0
- package/build/schemas/client/delete-client-legal-profile-request.schema.js +5 -0
- package/build/schemas/client/delete-client-legal-profile-response.schema.js +9 -0
- package/build/schemas/client/delete-client-legal-profile-result.schema.js +9 -0
- package/build/schemas/client/get-client-legal-profile-list-request.schema.js +5 -0
- package/build/schemas/client/get-client-legal-profile-list-response.schema.js +9 -0
- package/build/schemas/client/index.js +12 -0
- package/build/schemas/client/update-client-legal-profile-request.schema.js +13 -0
- package/build/schemas/client/update-client-legal-profile-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/index.js +2 -0
- package/build/schemas/order-product/price-correction-analyze-item.schema.js +6 -0
- package/build/schemas/payment-invoice/create-payment-invoice-request.schema.js +27 -0
- package/build/schemas/payment-invoice/create-payment-invoice-response.schema.js +9 -0
- package/build/schemas/payment-invoice/payment-invoice.schema.js +2 -0
- package/commands/client/index.ts +2 -0
- package/commands/client/profile/create-client-legal-profile.command.ts +3 -15
- package/commands/client/profile/delete-client-legal-profile.command.ts +3 -12
- package/commands/client/profile/get-client-legal-profile-list.query.ts +11 -0
- package/commands/client/profile/index.ts +1 -0
- package/commands/client/profile/update-client-legal-profile.command.ts +3 -15
- package/commands/client/webshop/create-client-legal-profile-for-client.command.ts +11 -0
- package/commands/client/webshop/update-client-legal-profile-for-client.command.ts +11 -0
- package/commands/payment-invoice/create-payment-invoice.command.ts +3 -31
- package/constant/discount-rules-pricing-type-list.constant.ts +12 -0
- package/constant/error.ts +17 -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/client/client-extended-for-client.schema.ts +2 -2
- package/schemas/client/client-extended.schema.ts +2 -0
- package/schemas/client/client-legal-profile-for-client-response.schema.ts +7 -0
- package/schemas/client/client-legal-profile-for-client.schema.ts +25 -0
- package/schemas/client/client-legal-profile-requisites.schema.ts +13 -0
- package/schemas/client/client-legal-profile.schema.ts +3 -0
- package/schemas/client/create-client-legal-profile-request.schema.ts +8 -0
- package/schemas/client/create-client-legal-profile-response.schema.ts +7 -0
- package/schemas/client/delete-client-legal-profile-request.schema.ts +3 -0
- package/schemas/client/delete-client-legal-profile-response.schema.ts +7 -0
- package/schemas/client/delete-client-legal-profile-result.schema.ts +7 -0
- package/schemas/client/get-client-legal-profile-list-request.schema.ts +3 -0
- package/schemas/client/get-client-legal-profile-list-response.schema.ts +7 -0
- package/schemas/client/index.ts +12 -0
- package/schemas/client/update-client-legal-profile-request.schema.ts +11 -0
- package/schemas/client/update-client-legal-profile-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/index.ts +2 -0
- package/schemas/order-product/price-correction-analyze-item.schema.ts +7 -0
- package/schemas/payment-invoice/create-payment-invoice-request.schema.ts +26 -0
- package/schemas/payment-invoice/create-payment-invoice-response.schema.ts +7 -0
- package/schemas/payment-invoice/payment-invoice.schema.ts +2 -0
|
@@ -31,6 +31,8 @@ __exportStar(require("./detach-user-from-client.command"), exports);
|
|
|
31
31
|
__exportStar(require("./webshop/register-client-webshop.command"), exports);
|
|
32
32
|
__exportStar(require("./webshop/update-client-for-client.command"), exports);
|
|
33
33
|
__exportStar(require("./webshop/get-client-me-webshop.query"), exports);
|
|
34
|
+
__exportStar(require("./webshop/create-client-legal-profile-for-client.command"), exports);
|
|
35
|
+
__exportStar(require("./webshop/update-client-legal-profile-for-client.command"), exports);
|
|
34
36
|
//marking
|
|
35
37
|
__exportStar(require("./marking/create-client-marking.command"), exports);
|
|
36
38
|
__exportStar(require("./marking/update-client-marking.command"), exports);
|
|
@@ -1,21 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CreateClientLegalProfileContractCommand = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const CreateClientLegalProfileRequestSchema = client_1.ClientLegalProfileSchema.omit({
|
|
7
|
-
uuid: true,
|
|
8
|
-
createdAt: true,
|
|
9
|
-
updatedAt: true,
|
|
10
|
-
}).extend({
|
|
11
|
-
correspondentAccount: client_1.ClientLegalProfileSchema.shape.correspondentAccount.optional(),
|
|
12
|
-
});
|
|
13
|
-
const CreateClientLegalProfileResponseSchema = zod_1.z.object({
|
|
14
|
-
message: zod_1.z.string().optional(),
|
|
15
|
-
data: client_1.ClientLegalProfileSchema.nullable(),
|
|
16
|
-
});
|
|
4
|
+
const create_client_legal_profile_request_schema_1 = require("../../../schemas/client/create-client-legal-profile-request.schema");
|
|
5
|
+
const create_client_legal_profile_response_schema_1 = require("../../../schemas/client/create-client-legal-profile-response.schema");
|
|
17
6
|
var CreateClientLegalProfileContractCommand;
|
|
18
7
|
(function (CreateClientLegalProfileContractCommand) {
|
|
19
|
-
CreateClientLegalProfileContractCommand.RequestSchema = CreateClientLegalProfileRequestSchema;
|
|
20
|
-
CreateClientLegalProfileContractCommand.ResponseSchema = CreateClientLegalProfileResponseSchema;
|
|
8
|
+
CreateClientLegalProfileContractCommand.RequestSchema = create_client_legal_profile_request_schema_1.CreateClientLegalProfileRequestSchema;
|
|
9
|
+
CreateClientLegalProfileContractCommand.ResponseSchema = create_client_legal_profile_response_schema_1.CreateClientLegalProfileResponseSchema;
|
|
21
10
|
})(CreateClientLegalProfileContractCommand || (exports.CreateClientLegalProfileContractCommand = CreateClientLegalProfileContractCommand = {}));
|
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DeleteClientLegalProfileContractCommand = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const DeleteDataResponseSchema = zod_1.z.object({
|
|
7
|
-
success: zod_1.z.boolean(),
|
|
8
|
-
});
|
|
9
|
-
const DeleteClientLegalProfileResponseSchema = zod_1.z.object({
|
|
10
|
-
message: zod_1.z.string().optional(),
|
|
11
|
-
data: DeleteDataResponseSchema,
|
|
12
|
-
});
|
|
4
|
+
const delete_client_legal_profile_request_schema_1 = require("../../../schemas/client/delete-client-legal-profile-request.schema");
|
|
5
|
+
const delete_client_legal_profile_response_schema_1 = require("../../../schemas/client/delete-client-legal-profile-response.schema");
|
|
13
6
|
var DeleteClientLegalProfileContractCommand;
|
|
14
7
|
(function (DeleteClientLegalProfileContractCommand) {
|
|
15
|
-
DeleteClientLegalProfileContractCommand.RequestSchema = DeleteClientLegalProfileRequestSchema;
|
|
16
|
-
DeleteClientLegalProfileContractCommand.ResponseSchema = DeleteClientLegalProfileResponseSchema;
|
|
8
|
+
DeleteClientLegalProfileContractCommand.RequestSchema = delete_client_legal_profile_request_schema_1.DeleteClientLegalProfileRequestSchema;
|
|
9
|
+
DeleteClientLegalProfileContractCommand.ResponseSchema = delete_client_legal_profile_response_schema_1.DeleteClientLegalProfileResponseSchema;
|
|
17
10
|
})(DeleteClientLegalProfileContractCommand || (exports.DeleteClientLegalProfileContractCommand = DeleteClientLegalProfileContractCommand = {}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetClientLegalProfileListContractQuery = void 0;
|
|
4
|
+
const get_client_legal_profile_list_request_schema_1 = require("../../../schemas/client/get-client-legal-profile-list-request.schema");
|
|
5
|
+
const get_client_legal_profile_list_response_schema_1 = require("../../../schemas/client/get-client-legal-profile-list-response.schema");
|
|
6
|
+
var GetClientLegalProfileListContractQuery;
|
|
7
|
+
(function (GetClientLegalProfileListContractQuery) {
|
|
8
|
+
GetClientLegalProfileListContractQuery.RequestSchema = get_client_legal_profile_list_request_schema_1.GetClientLegalProfileListRequestSchema;
|
|
9
|
+
GetClientLegalProfileListContractQuery.ResponseSchema = get_client_legal_profile_list_response_schema_1.GetClientLegalProfileListResponseSchema;
|
|
10
|
+
})(GetClientLegalProfileListContractQuery || (exports.GetClientLegalProfileListContractQuery = GetClientLegalProfileListContractQuery = {}));
|
|
@@ -21,3 +21,4 @@ __exportStar(require("./delete-client-individual-profile.command"), exports);
|
|
|
21
21
|
__exportStar(require("./create-client-legal-profile.command"), exports);
|
|
22
22
|
__exportStar(require("./update-client-legal-profile.command"), exports);
|
|
23
23
|
__exportStar(require("./delete-client-legal-profile.command"), exports);
|
|
24
|
+
__exportStar(require("./get-client-legal-profile-list.query"), exports);
|
|
@@ -1,21 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UpdateClientLegalProfileContractCommand = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const UpdateClientLegalProfileRequestSchema = client_1.ClientLegalProfileSchema.omit({
|
|
7
|
-
uuid: true,
|
|
8
|
-
createdAt: true,
|
|
9
|
-
updatedAt: true,
|
|
10
|
-
}).extend({
|
|
11
|
-
correspondentAccount: client_1.ClientLegalProfileSchema.shape.correspondentAccount.optional(),
|
|
12
|
-
});
|
|
13
|
-
const UpdateClientLegalProfileResponseSchema = zod_1.z.object({
|
|
14
|
-
message: zod_1.z.string().optional(),
|
|
15
|
-
data: client_1.ClientLegalProfileSchema.nullable(),
|
|
16
|
-
});
|
|
4
|
+
const update_client_legal_profile_request_schema_1 = require("../../../schemas/client/update-client-legal-profile-request.schema");
|
|
5
|
+
const update_client_legal_profile_response_schema_1 = require("../../../schemas/client/update-client-legal-profile-response.schema");
|
|
17
6
|
var UpdateClientLegalProfileContractCommand;
|
|
18
7
|
(function (UpdateClientLegalProfileContractCommand) {
|
|
19
|
-
UpdateClientLegalProfileContractCommand.RequestSchema = UpdateClientLegalProfileRequestSchema;
|
|
20
|
-
UpdateClientLegalProfileContractCommand.ResponseSchema = UpdateClientLegalProfileResponseSchema;
|
|
8
|
+
UpdateClientLegalProfileContractCommand.RequestSchema = update_client_legal_profile_request_schema_1.UpdateClientLegalProfileRequestSchema;
|
|
9
|
+
UpdateClientLegalProfileContractCommand.ResponseSchema = update_client_legal_profile_response_schema_1.UpdateClientLegalProfileResponseSchema;
|
|
21
10
|
})(UpdateClientLegalProfileContractCommand || (exports.UpdateClientLegalProfileContractCommand = UpdateClientLegalProfileContractCommand = {}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateClientLegalProfileForClientContractCommand = void 0;
|
|
4
|
+
const client_legal_profile_requisites_schema_1 = require("../../../schemas/client/client-legal-profile-requisites.schema");
|
|
5
|
+
const client_legal_profile_for_client_response_schema_1 = require("../../../schemas/client/client-legal-profile-for-client-response.schema");
|
|
6
|
+
var CreateClientLegalProfileForClientContractCommand;
|
|
7
|
+
(function (CreateClientLegalProfileForClientContractCommand) {
|
|
8
|
+
CreateClientLegalProfileForClientContractCommand.RequestSchema = client_legal_profile_requisites_schema_1.ClientLegalProfileRequisitesSchema;
|
|
9
|
+
CreateClientLegalProfileForClientContractCommand.ResponseSchema = client_legal_profile_for_client_response_schema_1.ClientLegalProfileForClientResponseSchema;
|
|
10
|
+
})(CreateClientLegalProfileForClientContractCommand || (exports.CreateClientLegalProfileForClientContractCommand = CreateClientLegalProfileForClientContractCommand = {}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateClientLegalProfileForClientContractCommand = void 0;
|
|
4
|
+
const client_legal_profile_requisites_schema_1 = require("../../../schemas/client/client-legal-profile-requisites.schema");
|
|
5
|
+
const client_legal_profile_for_client_response_schema_1 = require("../../../schemas/client/client-legal-profile-for-client-response.schema");
|
|
6
|
+
var UpdateClientLegalProfileForClientContractCommand;
|
|
7
|
+
(function (UpdateClientLegalProfileForClientContractCommand) {
|
|
8
|
+
UpdateClientLegalProfileForClientContractCommand.RequestSchema = client_legal_profile_requisites_schema_1.ClientLegalProfileRequisitesSchema;
|
|
9
|
+
UpdateClientLegalProfileForClientContractCommand.ResponseSchema = client_legal_profile_for_client_response_schema_1.ClientLegalProfileForClientResponseSchema;
|
|
10
|
+
})(UpdateClientLegalProfileForClientContractCommand || (exports.UpdateClientLegalProfileForClientContractCommand = UpdateClientLegalProfileForClientContractCommand = {}));
|
|
@@ -1,35 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CreatePaymentInvoiceContractCommand = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const positive_money_schema_1 = require("../../schemas/positive-money.schema");
|
|
7
|
-
// Потолок числа заказов в счёте. Это защита от абсурдного запроса, а не бизнес-правило: счёт за месяц
|
|
8
|
-
// клиенту с ежедневными поставками — это уже 30 строк, поэтому 10-20 отрезали бы живые сценарии.
|
|
9
|
-
// Сто строк — это 3-4 страницы таблицы, документ такого размера собирается и читается нормально.
|
|
10
|
-
const MAX_INVOICE_ORDER_COUNT = 100;
|
|
11
|
-
// Счёт выставляется одним из двух способов:
|
|
12
|
-
// - по заказам: orderUUIDs непустой, итог считается на бэке как сумма totalCost этих заказов,
|
|
13
|
-
// а amount — необязательная правка итога (например скидка по счёту), она уходит отдельной строкой;
|
|
14
|
-
// - вручную: orderUUIDs пуст, тогда amount обязателен и становится единственной строкой счёта.
|
|
15
|
-
const CreatePaymentInvoiceRequestSchema = zod_1.z
|
|
16
|
-
.object({
|
|
17
|
-
clientUUID: zod_1.z.uuid(),
|
|
18
|
-
invoiceDate: zod_1.z.coerce.date(),
|
|
19
|
-
orderUUIDs: zod_1.z.uuid().array().max(MAX_INVOICE_ORDER_COUNT).optional(),
|
|
20
|
-
// Строго положительная сумма: отсекаем минус по знаку строки и нулевые записи вида "0" / "0.00".
|
|
21
|
-
amount: positive_money_schema_1.PositiveMoneySchema.optional(),
|
|
22
|
-
})
|
|
23
|
-
.refine(value => { var _a; return Boolean((_a = value.orderUUIDs) === null || _a === void 0 ? void 0 : _a.length) || value.amount !== undefined; }, {
|
|
24
|
-
message: 'Either orderUUIDs or amount must be provided',
|
|
25
|
-
path: ['amount'],
|
|
26
|
-
});
|
|
27
|
-
const CreatePaymentInvoiceResponseSchema = zod_1.z.object({
|
|
28
|
-
message: zod_1.z.string().optional(),
|
|
29
|
-
data: payment_invoice_schema_1.PaymentInvoiceSchema,
|
|
30
|
-
});
|
|
4
|
+
const create_payment_invoice_request_schema_1 = require("../../schemas/payment-invoice/create-payment-invoice-request.schema");
|
|
5
|
+
const create_payment_invoice_response_schema_1 = require("../../schemas/payment-invoice/create-payment-invoice-response.schema");
|
|
31
6
|
var CreatePaymentInvoiceContractCommand;
|
|
32
7
|
(function (CreatePaymentInvoiceContractCommand) {
|
|
33
|
-
CreatePaymentInvoiceContractCommand.RequestSchema = CreatePaymentInvoiceRequestSchema;
|
|
34
|
-
CreatePaymentInvoiceContractCommand.ResponseSchema = CreatePaymentInvoiceResponseSchema;
|
|
8
|
+
CreatePaymentInvoiceContractCommand.RequestSchema = create_payment_invoice_request_schema_1.CreatePaymentInvoiceRequestSchema;
|
|
9
|
+
CreatePaymentInvoiceContractCommand.ResponseSchema = create_payment_invoice_response_schema_1.CreatePaymentInvoiceResponseSchema;
|
|
35
10
|
})(CreatePaymentInvoiceContractCommand || (exports.CreatePaymentInvoiceContractCommand = CreatePaymentInvoiceContractCommand = {}));
|
|
@@ -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
|
@@ -199,6 +199,12 @@ exports.ERRORS = {
|
|
|
199
199
|
CLIENT_LEGAL_PROFILE_NOT_FOUND: { code: 'CL020', message: 'Legal profile not founded', httpCode: 404 },
|
|
200
200
|
CLIENT_LEGAL_PROFILE_NOT_DELETED: { code: 'CL021', message: 'Legal profile not deleted', httpCode: 500 },
|
|
201
201
|
CLIENT_LEGAL_PROFILE_NOT_UPDATED: { code: 'CL022', message: 'Legal profile not updated', httpCode: 500 },
|
|
202
|
+
CLIENT_LEGAL_PROFILE_ARCHIVED: { code: 'CL046', message: 'Legal profile is archived', httpCode: 409 },
|
|
203
|
+
CLIENT_LEGAL_PROFILE_DEFAULT_REQUIRED: {
|
|
204
|
+
code: 'CL047',
|
|
205
|
+
message: 'Client must keep a default legal profile: assign another one instead',
|
|
206
|
+
httpCode: 409,
|
|
207
|
+
},
|
|
202
208
|
CLIENT_CALCULATE_FAILED: { code: 'CL023', message: 'Failed calculate by client', httpCode: 500 },
|
|
203
209
|
//BRANCH
|
|
204
210
|
BRANCH_NOT_CREATED: { code: 'B001', message: 'Failed to create branch', httpCode: 500 },
|
|
@@ -1363,6 +1369,17 @@ exports.ERRORS = {
|
|
|
1363
1369
|
message: 'Too many products for a single consignment discount operation',
|
|
1364
1370
|
httpCode: 400,
|
|
1365
1371
|
},
|
|
1372
|
+
DISCOUNT_RULES_PRICING_RULE_CONFLICT: {
|
|
1373
|
+
code: 'DR007',
|
|
1374
|
+
message: 'A client can have only one active pricing rule',
|
|
1375
|
+
httpCode: 409,
|
|
1376
|
+
},
|
|
1377
|
+
// Не дождались транзакционной блокировки правил ценообразования компании (lock_timeout).
|
|
1378
|
+
DISCOUNT_RULES_PRICING_RULE_LOCK_BUSY: {
|
|
1379
|
+
code: 'DR008',
|
|
1380
|
+
message: 'Pricing rules of this company are being changed right now, try again',
|
|
1381
|
+
httpCode: 409,
|
|
1382
|
+
},
|
|
1366
1383
|
DISCOUNT_RULES_NOT_FOUND: { code: 'DR010', message: 'Discount-rules not found', httpCode: 404 },
|
|
1367
1384
|
// ACTION LOG
|
|
1368
1385
|
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 = {}));
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ClientExtendedForClientSchema = void 0;
|
|
4
4
|
const client_for_client_schema_1 = require("./client-for-client.schema");
|
|
5
5
|
const client_individual_profile_schema_1 = require("./client-individual-profile.schema");
|
|
6
|
-
const
|
|
6
|
+
const client_legal_profile_for_client_schema_1 = require("./client-legal-profile-for-client.schema");
|
|
7
7
|
const user_contact_for_client_schema_1 = require("../user/user-contact-for-client.schema");
|
|
8
8
|
const user_name_schema_1 = require("../user/user-name.schema");
|
|
9
9
|
const discount_rules_for_client_schema_1 = require("../discount-rules/discount-rules-for-client.schema");
|
|
@@ -12,6 +12,6 @@ exports.ClientExtendedForClientSchema = client_for_client_schema_1.ClientForClie
|
|
|
12
12
|
user: user_contact_for_client_schema_1.UserContactForClientSchema.nullable(),
|
|
13
13
|
responsibleUser: user_name_schema_1.UserNameSchema.nullable(),
|
|
14
14
|
clientIndividualProfile: client_individual_profile_schema_1.ClientIndividualProfileSchema.nullable(),
|
|
15
|
-
clientLegalProfile:
|
|
15
|
+
clientLegalProfile: client_legal_profile_for_client_schema_1.ClientLegalProfileForClientSchema.nullable(),
|
|
16
16
|
discountRulesList: discount_rules_for_client_schema_1.DiscountRulesForClientSchema.array(),
|
|
17
17
|
});
|
|
@@ -11,7 +11,9 @@ const client_base_schema_1 = require("./client-base.schema");
|
|
|
11
11
|
exports.ClientExtendedSchema = client_base_schema_1.ClientSchema.extend({
|
|
12
12
|
user: user_schema_1.UserSchema.nullable(),
|
|
13
13
|
clientIndividualProfile: client_individual_profile_schema_1.ClientIndividualProfileSchema.nullable(),
|
|
14
|
+
// Основная карточка реквизитов; все карточки клиента, включая архивные, — в clientLegalProfileList.
|
|
14
15
|
clientLegalProfile: client_legal_profile_schema_1.ClientLegalProfileSchema.nullable(),
|
|
16
|
+
clientLegalProfileList: client_legal_profile_schema_1.ClientLegalProfileSchema.array(),
|
|
15
17
|
discountRulesList: discount_rules_schema_1.DiscountRulesSchema.array().optional(),
|
|
16
18
|
orderCount: zod_1.z.number(),
|
|
17
19
|
responsibleUser: user_schema_1.UserSchema.nullable(),
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClientLegalProfileForClientResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const client_legal_profile_for_client_schema_1 = require("./client-legal-profile-for-client.schema");
|
|
6
|
+
exports.ClientLegalProfileForClientResponseSchema = zod_1.z.object({
|
|
7
|
+
message: zod_1.z.string().optional(),
|
|
8
|
+
data: client_legal_profile_for_client_schema_1.ClientLegalProfileForClientSchema.nullable(),
|
|
9
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClientLegalProfileForClientSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const client_legal_type_enum_1 = require("../../enum/client-legal-type.enum");
|
|
6
|
+
// Реквизиты покупателя на витрине. Подпись и флаги карточки — внутренние поля панели, наружу не отдаются.
|
|
7
|
+
exports.ClientLegalProfileForClientSchema = zod_1.z.object({
|
|
8
|
+
uuid: zod_1.z.uuid(),
|
|
9
|
+
fullCompanyName: zod_1.z.string().nullable(),
|
|
10
|
+
taxId: zod_1.z.string().nullable(),
|
|
11
|
+
ogrn: zod_1.z.string().nullable(),
|
|
12
|
+
ogrnip: zod_1.z.string().nullable(),
|
|
13
|
+
kpp: zod_1.z.string().nullable(),
|
|
14
|
+
bankName: zod_1.z.string().nullable(),
|
|
15
|
+
bankAccountNumber: zod_1.z.string().nullable(),
|
|
16
|
+
correspondentAccount: zod_1.z.string().nullable(),
|
|
17
|
+
bankBic: zod_1.z.string().nullable(),
|
|
18
|
+
directorName: zod_1.z.string().nullable(),
|
|
19
|
+
directorPosition: zod_1.z.string().nullable(),
|
|
20
|
+
directorAuthority: zod_1.z.string().nullable(),
|
|
21
|
+
edoUsage: zod_1.z.boolean(),
|
|
22
|
+
edoId: zod_1.z.string().nullable(),
|
|
23
|
+
address: zod_1.z.string().nullable(),
|
|
24
|
+
legalType: zod_1.z.nativeEnum(client_legal_type_enum_1.ClientLegalTypeEnum),
|
|
25
|
+
createdAt: zod_1.z.date(),
|
|
26
|
+
updatedAt: zod_1.z.date(),
|
|
27
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClientLegalProfileRequisitesSchema = void 0;
|
|
4
|
+
const client_legal_profile_schema_1 = require("./client-legal-profile.schema");
|
|
5
|
+
// Реквизиты карточки, которые пользователь заполняет сам: без служебных полей и флагов карточки.
|
|
6
|
+
exports.ClientLegalProfileRequisitesSchema = client_legal_profile_schema_1.ClientLegalProfileSchema.omit({
|
|
7
|
+
uuid: true,
|
|
8
|
+
label: true,
|
|
9
|
+
isDefault: true,
|
|
10
|
+
isArchived: true,
|
|
11
|
+
createdAt: true,
|
|
12
|
+
updatedAt: true,
|
|
13
|
+
}).extend({
|
|
14
|
+
correspondentAccount: client_legal_profile_schema_1.ClientLegalProfileSchema.shape.correspondentAccount.optional(),
|
|
15
|
+
});
|
|
@@ -5,6 +5,9 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const enum_1 = require("../../enum");
|
|
6
6
|
exports.ClientLegalProfileSchema = zod_1.z.object({
|
|
7
7
|
uuid: zod_1.z.uuid(),
|
|
8
|
+
label: zod_1.z.string().nullable(),
|
|
9
|
+
isDefault: zod_1.z.boolean(),
|
|
10
|
+
isArchived: zod_1.z.boolean(),
|
|
8
11
|
fullCompanyName: zod_1.z.string().nullable(),
|
|
9
12
|
taxId: zod_1.z.string().nullable(),
|
|
10
13
|
ogrn: zod_1.z.string().nullable(),
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateClientLegalProfileRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const client_legal_profile_schema_1 = require("./client-legal-profile.schema");
|
|
6
|
+
const client_legal_profile_requisites_schema_1 = require("./client-legal-profile-requisites.schema");
|
|
7
|
+
exports.CreateClientLegalProfileRequestSchema = client_legal_profile_requisites_schema_1.ClientLegalProfileRequisitesSchema.extend({
|
|
8
|
+
label: client_legal_profile_schema_1.ClientLegalProfileSchema.shape.label.optional(),
|
|
9
|
+
isDefault: zod_1.z.boolean().optional(),
|
|
10
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateClientLegalProfileResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const client_legal_profile_schema_1 = require("./client-legal-profile.schema");
|
|
6
|
+
exports.CreateClientLegalProfileResponseSchema = zod_1.z.object({
|
|
7
|
+
message: zod_1.z.string().optional(),
|
|
8
|
+
data: client_legal_profile_schema_1.ClientLegalProfileSchema.nullable(),
|
|
9
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteClientLegalProfileResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const delete_client_legal_profile_result_schema_1 = require("./delete-client-legal-profile-result.schema");
|
|
6
|
+
exports.DeleteClientLegalProfileResponseSchema = zod_1.z.object({
|
|
7
|
+
message: zod_1.z.string().optional(),
|
|
8
|
+
data: delete_client_legal_profile_result_schema_1.DeleteClientLegalProfileResultSchema,
|
|
9
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteClientLegalProfileResultSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
// isArchived — карточку не удалили, а убрали в архив: по ней уже выписаны документы.
|
|
6
|
+
exports.DeleteClientLegalProfileResultSchema = zod_1.z.object({
|
|
7
|
+
success: zod_1.z.boolean(),
|
|
8
|
+
isArchived: zod_1.z.boolean(),
|
|
9
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetClientLegalProfileListResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const client_legal_profile_schema_1 = require("./client-legal-profile.schema");
|
|
6
|
+
exports.GetClientLegalProfileListResponseSchema = zod_1.z.object({
|
|
7
|
+
message: zod_1.z.string().optional(),
|
|
8
|
+
data: client_legal_profile_schema_1.ClientLegalProfileSchema.array(),
|
|
9
|
+
});
|
|
@@ -18,12 +18,24 @@ __exportStar(require("./client.schema"), exports);
|
|
|
18
18
|
__exportStar(require("./client-name.schema"), exports);
|
|
19
19
|
__exportStar(require("./client-individual-profile.schema"), exports);
|
|
20
20
|
__exportStar(require("./client-legal-profile.schema"), exports);
|
|
21
|
+
__exportStar(require("./client-legal-profile-requisites.schema"), exports);
|
|
22
|
+
__exportStar(require("./create-client-legal-profile-request.schema"), exports);
|
|
23
|
+
__exportStar(require("./create-client-legal-profile-response.schema"), exports);
|
|
24
|
+
__exportStar(require("./update-client-legal-profile-request.schema"), exports);
|
|
25
|
+
__exportStar(require("./update-client-legal-profile-response.schema"), exports);
|
|
26
|
+
__exportStar(require("./delete-client-legal-profile-request.schema"), exports);
|
|
27
|
+
__exportStar(require("./delete-client-legal-profile-result.schema"), exports);
|
|
28
|
+
__exportStar(require("./delete-client-legal-profile-response.schema"), exports);
|
|
29
|
+
__exportStar(require("./get-client-legal-profile-list-request.schema"), exports);
|
|
30
|
+
__exportStar(require("./get-client-legal-profile-list-response.schema"), exports);
|
|
21
31
|
__exportStar(require("./client-marking.schema"), exports);
|
|
22
32
|
__exportStar(require("./client-debt.schema"), exports);
|
|
23
33
|
__exportStar(require("./client-responsible-assignment.schema"), exports);
|
|
24
34
|
__exportStar(require("./client-responsible-assignment-result.schema"), exports);
|
|
25
35
|
__exportStar(require("./client-for-client.schema"), exports);
|
|
26
36
|
__exportStar(require("./client-extended-for-client.schema"), exports);
|
|
37
|
+
__exportStar(require("./client-legal-profile-for-client.schema"), exports);
|
|
38
|
+
__exportStar(require("./client-legal-profile-for-client-response.schema"), exports);
|
|
27
39
|
__exportStar(require("./get-client-me-webshop-response.schema"), exports);
|
|
28
40
|
__exportStar(require("./register-client-webshop-request.schema"), exports);
|
|
29
41
|
__exportStar(require("./register-client-webshop-response.schema"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateClientLegalProfileRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const client_legal_profile_schema_1 = require("./client-legal-profile.schema");
|
|
6
|
+
const client_legal_profile_requisites_schema_1 = require("./client-legal-profile-requisites.schema");
|
|
7
|
+
// Правка частичная: поле, которого нет в запросе, не меняется, null — очищает. Так карточку можно сделать
|
|
8
|
+
// основной или убрать в архив, не пересылая реквизиты.
|
|
9
|
+
exports.UpdateClientLegalProfileRequestSchema = client_legal_profile_requisites_schema_1.ClientLegalProfileRequisitesSchema.partial().extend({
|
|
10
|
+
label: client_legal_profile_schema_1.ClientLegalProfileSchema.shape.label.optional(),
|
|
11
|
+
isDefault: zod_1.z.boolean().optional(),
|
|
12
|
+
isArchived: zod_1.z.boolean().optional(),
|
|
13
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateClientLegalProfileResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const client_legal_profile_schema_1 = require("./client-legal-profile.schema");
|
|
6
|
+
exports.UpdateClientLegalProfileResponseSchema = zod_1.z.object({
|
|
7
|
+
message: zod_1.z.string().optional(),
|
|
8
|
+
data: client_legal_profile_schema_1.ClientLegalProfileSchema.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/index.js
CHANGED
|
@@ -87,6 +87,8 @@ __exportStar(require("./package/validate-package.schema"), exports);
|
|
|
87
87
|
__exportStar(require("./pagination-request.schema"), exports);
|
|
88
88
|
__exportStar(require("./parser"), exports);
|
|
89
89
|
__exportStar(require("./payment-invoice/payment-invoice.schema"), exports);
|
|
90
|
+
__exportStar(require("./payment-invoice/create-payment-invoice-request.schema"), exports);
|
|
91
|
+
__exportStar(require("./payment-invoice/create-payment-invoice-response.schema"), exports);
|
|
90
92
|
__exportStar(require("./positive-decimal4.schema"), exports);
|
|
91
93
|
__exportStar(require("./positive-money.schema"), exports);
|
|
92
94
|
__exportStar(require("./pre-order"), exports);
|
|
@@ -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
|
});
|