@floristcloud/api-lib 1.2.107 → 1.2.109
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/create-client.command.js +2 -0
- package/build/commands/client/get-client-list.query.js +8 -0
- package/build/commands/client/index.js +1 -0
- package/build/commands/client/update-client-contract-data.command.js +22 -0
- package/build/commands/client/update-client.command.js +2 -0
- package/build/commands/money-account/get-money-account-by-criteria.query.js +7 -2
- package/build/commands/money-account/get-money-account-list.query.js +5 -1
- package/build/commands/report/export-inventory-stock.query.js +4 -17
- package/build/commands/report/export-inventory-turnover.query.js +4 -27
- package/build/commands/report/export-sales-by-client.query.js +3 -0
- package/build/commands/report/export-sales-by-position.query.js +3 -0
- package/build/commands/report/export-sales-revenue.query.js +3 -0
- package/build/commands/report/get-inventory-stock.query.js +34 -0
- package/build/commands/report/get-inventory-turnover.query.js +43 -0
- package/build/commands/report/get-report-by-client-weeks.query.js +19 -0
- package/build/commands/report/get-report-group-by-client.query.js +25 -2
- package/build/commands/report/get-report-group-by-position.query.js +21 -2
- package/build/commands/report/get-sales-by-client.query.js +48 -0
- package/build/commands/report/get-sales-summary.query.js +4 -0
- package/build/commands/report/index.js +3 -0
- package/build/commands/settings/get-company-profile.query.js +24 -0
- package/build/commands/settings/index.js +1 -0
- package/build/constant/index.js +1 -0
- package/build/constant/report.constant.js +9 -0
- package/build/enum/client-contract-status.enum.js +13 -0
- package/build/enum/index.js +4 -0
- package/build/enum/report-order-date-basis.enum.js +18 -0
- package/build/enum/report-sort-by.enum.js +13 -0
- package/build/helpers/index.js +2 -0
- package/build/helpers/pagination.helper.js +12 -0
- package/build/helpers/query-boolean.helper.js +16 -0
- package/build/schemas/client/client.schema.js +2 -0
- package/build/schemas/index.js +8 -0
- package/build/schemas/money-account/money-account-with-balance.schema.js +13 -0
- package/build/schemas/report/inventory-stock-category-item.schema.js +10 -0
- package/build/schemas/report/inventory-stock-detailed-item.schema.js +14 -0
- package/build/schemas/report/inventory-turnover-category-item.schema.js +15 -0
- package/build/schemas/report/inventory-turnover-detailed-item.schema.js +19 -0
- package/build/schemas/report/report-order-filter.schema.js +28 -0
- package/build/schemas/report/sales-by-client-row.schema.js +45 -0
- package/build/schemas/report/sales-by-client-top-item.schema.js +9 -0
- package/commands/client/create-client.command.ts +2 -0
- package/commands/client/get-client-list.query.ts +8 -0
- package/commands/client/index.ts +1 -0
- package/commands/client/update-client-contract-data.command.ts +24 -0
- package/commands/client/update-client.command.ts +2 -0
- package/commands/money-account/get-money-account-by-criteria.query.ts +10 -3
- package/commands/money-account/get-money-account-list.query.ts +8 -2
- package/commands/report/export-inventory-stock.query.ts +4 -19
- package/commands/report/export-inventory-turnover.query.ts +4 -29
- package/commands/report/export-sales-by-client.query.ts +3 -0
- package/commands/report/export-sales-by-position.query.ts +3 -0
- package/commands/report/export-sales-revenue.query.ts +3 -0
- package/commands/report/get-inventory-stock.query.ts +36 -0
- package/commands/report/get-inventory-turnover.query.ts +45 -0
- package/commands/report/get-report-by-client-weeks.query.ts +20 -1
- package/commands/report/get-report-group-by-client.query.ts +26 -3
- package/commands/report/get-report-group-by-position.query.ts +23 -4
- package/commands/report/get-sales-by-client.query.ts +50 -0
- package/commands/report/get-sales-summary.query.ts +4 -0
- package/commands/report/index.ts +3 -0
- package/commands/settings/get-company-profile.query.ts +24 -0
- package/commands/settings/index.ts +1 -0
- package/constant/index.ts +1 -0
- package/constant/report.constant.ts +6 -0
- package/enum/client-contract-status.enum.ts +9 -0
- package/enum/index.ts +4 -0
- package/enum/report-order-date-basis.enum.ts +14 -0
- package/enum/report-sort-by.enum.ts +9 -0
- package/helpers/index.ts +2 -0
- package/helpers/pagination.helper.ts +9 -0
- package/helpers/query-boolean.helper.ts +14 -0
- package/package.json +1 -1
- package/schemas/client/client.schema.ts +2 -0
- package/schemas/index.ts +8 -0
- package/schemas/money-account/money-account-with-balance.schema.ts +11 -0
- package/schemas/report/inventory-stock-category-item.schema.ts +8 -0
- package/schemas/report/inventory-stock-detailed-item.schema.ts +12 -0
- package/schemas/report/inventory-turnover-category-item.schema.ts +13 -0
- package/schemas/report/inventory-turnover-detailed-item.schema.ts +17 -0
- package/schemas/report/report-order-filter.schema.ts +26 -0
- package/schemas/report/sales-by-client-row.schema.ts +43 -0
- package/schemas/report/sales-by-client-top-item.schema.ts +7 -0
|
@@ -4,6 +4,7 @@ exports.CreateClientContractCommand = void 0;
|
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const schemas_1 = require("../../schemas");
|
|
6
6
|
const client_status_enum_1 = require("../../enum/client-status.enum");
|
|
7
|
+
const client_contract_status_enum_1 = require("../../enum/client-contract-status.enum");
|
|
7
8
|
const client_type_enum_1 = require("../../enum/client-type.enum");
|
|
8
9
|
const CreateClientRequestSchema = zod_1.z.object({
|
|
9
10
|
name: zod_1.z.string(),
|
|
@@ -15,6 +16,7 @@ const CreateClientRequestSchema = zod_1.z.object({
|
|
|
15
16
|
isCommon: zod_1.z.coerce.boolean(),
|
|
16
17
|
contractNumber: zod_1.z.string().nullable().optional(),
|
|
17
18
|
contractDate: zod_1.z.coerce.date().nullable().optional(),
|
|
19
|
+
contractStatus: zod_1.z.nativeEnum(client_contract_status_enum_1.ClientContractStatusEnum).optional(),
|
|
18
20
|
address: zod_1.z.string().nullable().optional(),
|
|
19
21
|
city: zod_1.z.string().nullable().optional(),
|
|
20
22
|
code: zod_1.z.string().nullable().optional(),
|
|
@@ -4,6 +4,7 @@ exports.GetClientListContractQuery = void 0;
|
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const schemas_1 = require("../../schemas");
|
|
6
6
|
const client_status_enum_1 = require("../../enum/client-status.enum");
|
|
7
|
+
const client_contract_status_enum_1 = require("../../enum/client-contract-status.enum");
|
|
7
8
|
const client_type_enum_1 = require("../../enum/client-type.enum");
|
|
8
9
|
const GetClientListRequestSchema = zod_1.z.object({
|
|
9
10
|
page: zod_1.z.string().transform(val => Number(val) || 1),
|
|
@@ -19,6 +20,13 @@ const GetClientListRequestSchema = zod_1.z.object({
|
|
|
19
20
|
.string()
|
|
20
21
|
.optional()
|
|
21
22
|
.transform(val => (val === 'true' ? true : val === 'false' || val === '' ? false : undefined)),
|
|
23
|
+
contractStatus: zod_1.z.nativeEnum(client_contract_status_enum_1.ClientContractStatusEnum).optional(),
|
|
24
|
+
// Feeds the "Contracts" tab: a client counts as having a contract record when a number or a date
|
|
25
|
+
// is filled in, or the contract status has been moved off NONE.
|
|
26
|
+
hasContractRecord: zod_1.z
|
|
27
|
+
.string()
|
|
28
|
+
.optional()
|
|
29
|
+
.transform(val => (val === 'true' ? true : val === 'false' ? false : undefined)),
|
|
22
30
|
});
|
|
23
31
|
const GetClientListResponseSchema = zod_1.z.object({
|
|
24
32
|
message: zod_1.z.string().optional(),
|
|
@@ -20,6 +20,7 @@ __exportStar(require("./get-client-list.query"), exports);
|
|
|
20
20
|
__exportStar(require("./get-client-debt-list.query"), exports);
|
|
21
21
|
__exportStar(require("./create-client.command"), exports);
|
|
22
22
|
__exportStar(require("./update-client.command"), exports);
|
|
23
|
+
__exportStar(require("./update-client-contract-data.command"), exports);
|
|
23
24
|
__exportStar(require("./delete-client.command"), exports);
|
|
24
25
|
__exportStar(require("./get-client-calculate.query"), exports);
|
|
25
26
|
__exportStar(require("./set-balance-calculate-client.command"), exports);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateClientContractDataContractCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const schemas_1 = require("../../schemas");
|
|
6
|
+
const client_contract_status_enum_1 = require("../../enum/client-contract-status.enum");
|
|
7
|
+
// Narrow, partial counterpart of UpdateClientContract: touches only the contract fields, so a
|
|
8
|
+
// one-click status change cannot overwrite the rest of the client with a stale snapshot.
|
|
9
|
+
const UpdateClientContractDataRequestSchema = zod_1.z.object({
|
|
10
|
+
contractNumber: zod_1.z.string().nullable().optional(),
|
|
11
|
+
contractDate: zod_1.z.coerce.date().nullable().optional(),
|
|
12
|
+
contractStatus: zod_1.z.nativeEnum(client_contract_status_enum_1.ClientContractStatusEnum).optional(),
|
|
13
|
+
});
|
|
14
|
+
const UpdateClientContractDataResponseSchema = zod_1.z.object({
|
|
15
|
+
message: zod_1.z.string().optional(),
|
|
16
|
+
data: schemas_1.ClientSchema.nullable(),
|
|
17
|
+
});
|
|
18
|
+
var UpdateClientContractDataContractCommand;
|
|
19
|
+
(function (UpdateClientContractDataContractCommand) {
|
|
20
|
+
UpdateClientContractDataContractCommand.RequestSchema = UpdateClientContractDataRequestSchema;
|
|
21
|
+
UpdateClientContractDataContractCommand.ResponseSchema = UpdateClientContractDataResponseSchema;
|
|
22
|
+
})(UpdateClientContractDataContractCommand || (exports.UpdateClientContractDataContractCommand = UpdateClientContractDataContractCommand = {}));
|
|
@@ -4,6 +4,7 @@ exports.UpdateClientContractCommand = void 0;
|
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const schemas_1 = require("../../schemas");
|
|
6
6
|
const client_status_enum_1 = require("../../enum/client-status.enum");
|
|
7
|
+
const client_contract_status_enum_1 = require("../../enum/client-contract-status.enum");
|
|
7
8
|
const client_type_enum_1 = require("../../enum/client-type.enum");
|
|
8
9
|
const UpdateClientRequestSchema = zod_1.z.object({
|
|
9
10
|
name: zod_1.z.string(),
|
|
@@ -15,6 +16,7 @@ const UpdateClientRequestSchema = zod_1.z.object({
|
|
|
15
16
|
type: zod_1.z.nativeEnum(client_type_enum_1.ClientTypeEnum),
|
|
16
17
|
contractNumber: zod_1.z.string().nullable(),
|
|
17
18
|
contractDate: zod_1.z.coerce.date().nullable(),
|
|
19
|
+
contractStatus: zod_1.z.nativeEnum(client_contract_status_enum_1.ClientContractStatusEnum).optional(),
|
|
18
20
|
address: zod_1.z.string().nullable().optional(),
|
|
19
21
|
city: zod_1.z.string().nullable().optional(),
|
|
20
22
|
code: zod_1.z.string().nullable().optional(),
|
|
@@ -3,10 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.GetMoneyAccountByCriteriaContractQuery = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const schemas_1 = require("../../schemas");
|
|
6
|
-
const
|
|
6
|
+
const query_boolean_helper_1 = require("../../helpers/query-boolean.helper");
|
|
7
|
+
const GetMoneyAccountByCriteriaRequestSchema = zod_1.z.object({
|
|
8
|
+
// Опционально: посчитать остаток каждого счёта одним агрегатом вместо отдельного
|
|
9
|
+
// GET /transaction/sum/:moneyAccountUUID на каждый счёт. Описание видит и MCP-каталог.
|
|
10
|
+
withBalance: query_boolean_helper_1.queryBooleanSchema.describe('Pass "true" to include the current balance of every money account, instead of calling transaction/sum per account.'),
|
|
11
|
+
});
|
|
7
12
|
const GetMoneyAccountByCriteriaResponseSchema = zod_1.z.object({
|
|
8
13
|
message: zod_1.z.string().optional(),
|
|
9
|
-
data: schemas_1.
|
|
14
|
+
data: schemas_1.MoneyAccountWithBalanceSchema.array(),
|
|
10
15
|
});
|
|
11
16
|
var GetMoneyAccountByCriteriaContractQuery;
|
|
12
17
|
(function (GetMoneyAccountByCriteriaContractQuery) {
|
|
@@ -3,14 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.GetMoneyAccountListContractQuery = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const schemas_1 = require("../../schemas");
|
|
6
|
+
const query_boolean_helper_1 = require("../../helpers/query-boolean.helper");
|
|
6
7
|
const GetMoneyAccountListRequestSchema = zod_1.z.object({
|
|
7
8
|
page: zod_1.z.string().transform(val => Number(val) || 1),
|
|
8
9
|
count: zod_1.z.string().transform(val => Number(val) || 10),
|
|
10
|
+
// Опционально: посчитать остаток каждого счёта одним агрегатом вместо отдельного
|
|
11
|
+
// GET /transaction/sum/:moneyAccountUUID на каждый счёт. Описание видит и MCP-каталог.
|
|
12
|
+
withBalance: query_boolean_helper_1.queryBooleanSchema.describe('Pass "true" to include the current balance of every money account, instead of calling transaction/sum per account.'),
|
|
9
13
|
});
|
|
10
14
|
const GetMoneyAccountListResponseSchema = zod_1.z.object({
|
|
11
15
|
message: zod_1.z.string().optional(),
|
|
12
16
|
data: zod_1.z.object({
|
|
13
|
-
list: zod_1.z.array(schemas_1.
|
|
17
|
+
list: zod_1.z.array(schemas_1.MoneyAccountWithBalanceSchema),
|
|
14
18
|
total: zod_1.z.number(),
|
|
15
19
|
}),
|
|
16
20
|
});
|
|
@@ -2,28 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ExportInventoryStockContractQuery = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const inventory_stock_category_item_schema_1 = require("../../schemas/report/inventory-stock-category-item.schema");
|
|
6
|
+
const inventory_stock_detailed_item_schema_1 = require("../../schemas/report/inventory-stock-detailed-item.schema");
|
|
5
7
|
const ExportInventoryStockRequestSchema = zod_1.z.object({
|
|
6
8
|
categoryUUID: zod_1.z.uuid().optional(), // Фильтр по категории
|
|
7
9
|
detailed: zod_1.z.coerce.boolean().optional().default(false), // Флаг для детализации (группировка по name, size, grower)
|
|
8
10
|
});
|
|
9
|
-
//
|
|
10
|
-
const CategoryStockItemSchema = zod_1.z.object({
|
|
11
|
-
categoryUUID: zod_1.z.string(),
|
|
12
|
-
categoryName: zod_1.z.string(),
|
|
13
|
-
balance: zod_1.z.number(),
|
|
14
|
-
});
|
|
15
|
-
// Ответ для детализированного отчета (с группировкой по name, size, grower)
|
|
16
|
-
const DetailedStockItemSchema = zod_1.z.object({
|
|
17
|
-
categoryUUID: zod_1.z.string(),
|
|
18
|
-
categoryName: zod_1.z.string(),
|
|
19
|
-
name: zod_1.z.string(),
|
|
20
|
-
color: zod_1.z.string().nullable(),
|
|
21
|
-
size: zod_1.z.string().nullable(),
|
|
22
|
-
grower: zod_1.z.string().nullable(),
|
|
23
|
-
balance: zod_1.z.number(),
|
|
24
|
-
});
|
|
11
|
+
// Строки живут в schemas/report — их же отдаёт JSON-эндпоинт report/inventory/stock, форма ответа общая.
|
|
25
12
|
const ExportInventoryStockResponseSchema = zod_1.z.object({
|
|
26
|
-
data: zod_1.z.array(zod_1.z.union([
|
|
13
|
+
data: zod_1.z.array(zod_1.z.union([inventory_stock_category_item_schema_1.InventoryStockCategoryItemSchema, inventory_stock_detailed_item_schema_1.InventoryStockDetailedItemSchema])),
|
|
27
14
|
});
|
|
28
15
|
var ExportInventoryStockContractQuery;
|
|
29
16
|
(function (ExportInventoryStockContractQuery) {
|
|
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ExportInventoryTurnoverContractQuery = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const date_helper_1 = require("../../helpers/date.helper");
|
|
6
|
+
const inventory_turnover_category_item_schema_1 = require("../../schemas/report/inventory-turnover-category-item.schema");
|
|
7
|
+
const inventory_turnover_detailed_item_schema_1 = require("../../schemas/report/inventory-turnover-detailed-item.schema");
|
|
6
8
|
const ExportInventoryTurnoverRequestSchema = zod_1.z
|
|
7
9
|
.object({
|
|
8
10
|
startDate: zod_1.z.coerce.date().optional(),
|
|
@@ -20,34 +22,9 @@ const ExportInventoryTurnoverRequestSchema = zod_1.z
|
|
|
20
22
|
message: 'validation.dateRange',
|
|
21
23
|
path: ['endDate', 'startDate'],
|
|
22
24
|
});
|
|
23
|
-
//
|
|
24
|
-
const CategoryTurnoverItemSchema = zod_1.z.object({
|
|
25
|
-
categoryUUID: zod_1.z.string(),
|
|
26
|
-
categoryName: zod_1.z.string(),
|
|
27
|
-
initialBalance: zod_1.z.number(), // начальный остаток
|
|
28
|
-
receipts: zod_1.z.number(), // приходы
|
|
29
|
-
sales: zod_1.z.number(), // продажи
|
|
30
|
-
currentBalance: zod_1.z.number(), // текущий остаток
|
|
31
|
-
daysInStock: zod_1.z.number(), // дни в наличии на складе
|
|
32
|
-
turnoverRate: zod_1.z.number(), // коэффициент оборачиваемости
|
|
33
|
-
});
|
|
34
|
-
// Ответ для детализированного отчета (с группировкой по name, size, grower)
|
|
35
|
-
const DetailedTurnoverItemSchema = zod_1.z.object({
|
|
36
|
-
categoryUUID: zod_1.z.string(),
|
|
37
|
-
categoryName: zod_1.z.string(),
|
|
38
|
-
name: zod_1.z.string(),
|
|
39
|
-
color: zod_1.z.string().nullable(),
|
|
40
|
-
size: zod_1.z.string().nullable(),
|
|
41
|
-
grower: zod_1.z.string().nullable(), // производитель
|
|
42
|
-
initialBalance: zod_1.z.number(), // начальный остаток
|
|
43
|
-
receipts: zod_1.z.number(), // приходы
|
|
44
|
-
sales: zod_1.z.number(), // продажи
|
|
45
|
-
currentBalance: zod_1.z.number(), // текущий остаток
|
|
46
|
-
daysInStock: zod_1.z.number(), // дни в наличии на складе
|
|
47
|
-
turnoverRate: zod_1.z.number(), // коэффициент оборачиваемости
|
|
48
|
-
});
|
|
25
|
+
// Строки живут в schemas/report — их же отдаёт JSON-эндпоинт report/inventory/turnover, форма ответа общая.
|
|
49
26
|
const ExportInventoryTurnoverResponseSchema = zod_1.z.object({
|
|
50
|
-
data: zod_1.z.array(zod_1.z.union([
|
|
27
|
+
data: zod_1.z.array(zod_1.z.union([inventory_turnover_category_item_schema_1.InventoryTurnoverCategoryItemSchema, inventory_turnover_detailed_item_schema_1.InventoryTurnoverDetailedItemSchema])),
|
|
51
28
|
});
|
|
52
29
|
var ExportInventoryTurnoverContractQuery;
|
|
53
30
|
(function (ExportInventoryTurnoverContractQuery) {
|
|
@@ -3,11 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ExportSalesByClientContractQuery = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const date_helper_1 = require("../../helpers/date.helper");
|
|
6
|
+
const report_order_filter_schema_1 = require("../../schemas/report/report-order-filter.schema");
|
|
6
7
|
const ExportSalesByClientRequestSchema = zod_1.z
|
|
7
8
|
.object({
|
|
8
9
|
startDate: zod_1.z.coerce.date(),
|
|
9
10
|
endDate: zod_1.z.coerce.date(),
|
|
10
11
|
})
|
|
12
|
+
// dateBasis / excludeClientUUID — те же, что у JSON-эндпоинтов отчётов по заказам.
|
|
13
|
+
.merge(report_order_filter_schema_1.ReportOrderFilterSchema)
|
|
11
14
|
.refine(value => (0, date_helper_1.dateRangeCheck)(value.startDate, value.endDate), {
|
|
12
15
|
message: 'validation.dateRange',
|
|
13
16
|
path: ['endDate', 'startDate'],
|
|
@@ -4,12 +4,15 @@ exports.ExportSalesByPositionContractQuery = void 0;
|
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const date_helper_1 = require("../../helpers/date.helper");
|
|
6
6
|
const sales_by_position_group_by_enum_1 = require("../../enum/sales-by-position-group-by.enum");
|
|
7
|
+
const report_order_filter_schema_1 = require("../../schemas/report/report-order-filter.schema");
|
|
7
8
|
const ExportSalesByPositionRequestSchema = zod_1.z
|
|
8
9
|
.object({
|
|
9
10
|
startDate: zod_1.z.coerce.date(),
|
|
10
11
|
endDate: zod_1.z.coerce.date(),
|
|
11
12
|
groupBy: zod_1.z.nativeEnum(sales_by_position_group_by_enum_1.SalesByPositionGroupByEnum).default(sales_by_position_group_by_enum_1.SalesByPositionGroupByEnum.PRODUCT),
|
|
12
13
|
})
|
|
14
|
+
// dateBasis / excludeClientUUID — те же, что у JSON-эндпоинтов отчётов по заказам.
|
|
15
|
+
.merge(report_order_filter_schema_1.ReportOrderFilterSchema)
|
|
13
16
|
.refine(value => (0, date_helper_1.dateRangeCheck)(value.startDate, value.endDate), {
|
|
14
17
|
message: 'validation.dateRange',
|
|
15
18
|
path: ['endDate', 'startDate'],
|
|
@@ -4,12 +4,15 @@ exports.ExportSalesRevenueContractQuery = void 0;
|
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const date_helper_1 = require("../../helpers/date.helper");
|
|
6
6
|
const report_period_type_enum_1 = require("../../enum/report-period-type.enum");
|
|
7
|
+
const report_order_filter_schema_1 = require("../../schemas/report/report-order-filter.schema");
|
|
7
8
|
const ExportSalesRevenueRequestSchema = zod_1.z
|
|
8
9
|
.object({
|
|
9
10
|
startDate: zod_1.z.coerce.date().optional(),
|
|
10
11
|
endDate: zod_1.z.coerce.date().optional(),
|
|
11
12
|
periodType: zod_1.z.nativeEnum(report_period_type_enum_1.ReportPeriodTypeEnum).default(report_period_type_enum_1.ReportPeriodTypeEnum.DAY),
|
|
12
13
|
})
|
|
14
|
+
// dateBasis / excludeClientUUID — те же, что у JSON-эндпоинтов отчётов по заказам.
|
|
15
|
+
.merge(report_order_filter_schema_1.ReportOrderFilterSchema)
|
|
13
16
|
.refine(value => {
|
|
14
17
|
const { startDate, endDate } = value;
|
|
15
18
|
if (startDate && endDate) {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetInventoryStockContractQuery = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const pagination_helper_1 = require("../../helpers/pagination.helper");
|
|
6
|
+
const query_boolean_helper_1 = require("../../helpers/query-boolean.helper");
|
|
7
|
+
const inventory_stock_category_item_schema_1 = require("../../schemas/report/inventory-stock-category-item.schema");
|
|
8
|
+
const inventory_stock_detailed_item_schema_1 = require("../../schemas/report/inventory-stock-detailed-item.schema");
|
|
9
|
+
const GetInventoryStockRequestSchema = zod_1.z
|
|
10
|
+
.object({
|
|
11
|
+
categoryUUID: zod_1.z.uuid().optional().describe('Keep only the products of this category.'),
|
|
12
|
+
detailed: query_boolean_helper_1.queryBooleanSchema.describe('Pass "true" to group rows by product name / size / grower instead of by category only.'),
|
|
13
|
+
// Пагинация по строкам отчёта. Без count лимит не накладывается — отдаём весь отчёт,
|
|
14
|
+
// а page без count отклоняется: иначе листание молча возвращало бы одну и ту же выдачу.
|
|
15
|
+
page: zod_1.z.coerce.number().int().positive().optional().describe('1-based page number, requires "count".'),
|
|
16
|
+
count: zod_1.z.coerce.number().int().positive().optional().describe('Rows per page. Without it the whole report is returned.'),
|
|
17
|
+
})
|
|
18
|
+
.refine(pagination_helper_1.isPageAccompaniedByCount, {
|
|
19
|
+
message: 'validation.pageRequiresCount',
|
|
20
|
+
path: ['page'],
|
|
21
|
+
});
|
|
22
|
+
const GetInventoryStockResponseSchema = zod_1.z.object({
|
|
23
|
+
message: zod_1.z.string().optional(),
|
|
24
|
+
data: zod_1.z.object({
|
|
25
|
+
list: zod_1.z.array(zod_1.z.union([inventory_stock_category_item_schema_1.InventoryStockCategoryItemSchema, inventory_stock_detailed_item_schema_1.InventoryStockDetailedItemSchema])),
|
|
26
|
+
// Число строк во всём отчёте — не размер страницы.
|
|
27
|
+
total: zod_1.z.number(),
|
|
28
|
+
}),
|
|
29
|
+
});
|
|
30
|
+
var GetInventoryStockContractQuery;
|
|
31
|
+
(function (GetInventoryStockContractQuery) {
|
|
32
|
+
GetInventoryStockContractQuery.RequestSchema = GetInventoryStockRequestSchema;
|
|
33
|
+
GetInventoryStockContractQuery.ResponseSchema = GetInventoryStockResponseSchema;
|
|
34
|
+
})(GetInventoryStockContractQuery || (exports.GetInventoryStockContractQuery = GetInventoryStockContractQuery = {}));
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetInventoryTurnoverContractQuery = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const date_helper_1 = require("../../helpers/date.helper");
|
|
6
|
+
const pagination_helper_1 = require("../../helpers/pagination.helper");
|
|
7
|
+
const query_boolean_helper_1 = require("../../helpers/query-boolean.helper");
|
|
8
|
+
const inventory_turnover_category_item_schema_1 = require("../../schemas/report/inventory-turnover-category-item.schema");
|
|
9
|
+
const inventory_turnover_detailed_item_schema_1 = require("../../schemas/report/inventory-turnover-detailed-item.schema");
|
|
10
|
+
const GetInventoryTurnoverRequestSchema = zod_1.z
|
|
11
|
+
.object({
|
|
12
|
+
// Даты обязательны: без периода оборачиваемость не считается (в отличие от export/*, где
|
|
13
|
+
// отсутствие дат приводило к ошибке уже внутри сервиса).
|
|
14
|
+
startDate: zod_1.z.coerce.date(),
|
|
15
|
+
endDate: zod_1.z.coerce.date(),
|
|
16
|
+
categoryUUID: zod_1.z.uuid().optional().describe('Keep only the products of this category.'),
|
|
17
|
+
detailed: query_boolean_helper_1.queryBooleanSchema.describe('Pass "true" to group rows by product name / size / grower instead of by category only.'),
|
|
18
|
+
// Пагинация по строкам отчёта. Без count лимит не накладывается — отдаём весь отчёт,
|
|
19
|
+
// а page без count отклоняется: иначе листание молча возвращало бы одну и ту же выдачу.
|
|
20
|
+
page: zod_1.z.coerce.number().int().positive().optional().describe('1-based page number, requires "count".'),
|
|
21
|
+
count: zod_1.z.coerce.number().int().positive().optional().describe('Rows per page. Without it the whole report is returned.'),
|
|
22
|
+
})
|
|
23
|
+
.refine(value => (0, date_helper_1.dateRangeCheck)(value.startDate, value.endDate), {
|
|
24
|
+
message: 'validation.dateRange',
|
|
25
|
+
path: ['endDate', 'startDate'],
|
|
26
|
+
})
|
|
27
|
+
.refine(pagination_helper_1.isPageAccompaniedByCount, {
|
|
28
|
+
message: 'validation.pageRequiresCount',
|
|
29
|
+
path: ['page'],
|
|
30
|
+
});
|
|
31
|
+
const GetInventoryTurnoverResponseSchema = zod_1.z.object({
|
|
32
|
+
message: zod_1.z.string().optional(),
|
|
33
|
+
data: zod_1.z.object({
|
|
34
|
+
list: zod_1.z.array(zod_1.z.union([inventory_turnover_category_item_schema_1.InventoryTurnoverCategoryItemSchema, inventory_turnover_detailed_item_schema_1.InventoryTurnoverDetailedItemSchema])),
|
|
35
|
+
// Число строк во всём отчёте — не размер страницы.
|
|
36
|
+
total: zod_1.z.number(),
|
|
37
|
+
}),
|
|
38
|
+
});
|
|
39
|
+
var GetInventoryTurnoverContractQuery;
|
|
40
|
+
(function (GetInventoryTurnoverContractQuery) {
|
|
41
|
+
GetInventoryTurnoverContractQuery.RequestSchema = GetInventoryTurnoverRequestSchema;
|
|
42
|
+
GetInventoryTurnoverContractQuery.ResponseSchema = GetInventoryTurnoverResponseSchema;
|
|
43
|
+
})(GetInventoryTurnoverContractQuery || (exports.GetInventoryTurnoverContractQuery = GetInventoryTurnoverContractQuery = {}));
|
|
@@ -3,12 +3,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.GetReportByClientWeeksContractQuery = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const date_helper_1 = require("../../helpers/date.helper");
|
|
6
|
+
const pagination_helper_1 = require("../../helpers/pagination.helper");
|
|
7
|
+
const query_boolean_helper_1 = require("../../helpers/query-boolean.helper");
|
|
6
8
|
const schemas_1 = require("../../schemas");
|
|
7
9
|
const GetReportByClientWeeksRequestSchema = zod_1.z
|
|
8
10
|
.object({
|
|
9
11
|
startDate: zod_1.z.coerce.date(),
|
|
10
12
|
endDate: zod_1.z.coerce.date(),
|
|
11
13
|
responsibleUserUUID: zod_1.z.string().optional(),
|
|
14
|
+
// Отчёт — это матрица «неделя × клиент», поэтому по умолчанию отдаёт строку и на нулевые недели.
|
|
15
|
+
// Флаг оставляет только недели с заказами: то, что обычно и нужно, и на порядок меньше данных.
|
|
16
|
+
onlyWithOrders: query_boolean_helper_1.queryBooleanSchema,
|
|
17
|
+
// Фильтр по группе клиента (client."group") — дешёвый, применяется до CROSS JOIN недель.
|
|
18
|
+
clientGroup: zod_1.z.string().optional(),
|
|
19
|
+
// Пагинация по строкам матрицы. Без count лимит не накладывается — поведение по умолчанию
|
|
20
|
+
// прежнее, а page без count отклоняется: иначе листание молча возвращало бы одну и ту же выдачу.
|
|
21
|
+
page: zod_1.z.coerce.number().int().positive().optional(),
|
|
22
|
+
count: zod_1.z.coerce.number().int().positive().optional(),
|
|
12
23
|
})
|
|
13
24
|
.refine(value => {
|
|
14
25
|
const { startDate, endDate } = value;
|
|
@@ -19,10 +30,18 @@ const GetReportByClientWeeksRequestSchema = zod_1.z
|
|
|
19
30
|
}, {
|
|
20
31
|
message: 'validation.dateRange',
|
|
21
32
|
path: ['endDate', 'startDate'],
|
|
33
|
+
})
|
|
34
|
+
.refine(pagination_helper_1.isPageAccompaniedByCount, {
|
|
35
|
+
message: 'validation.pageRequiresCount',
|
|
36
|
+
path: ['page'],
|
|
22
37
|
});
|
|
23
38
|
const GetReportGroupByClientResponseSchema = zod_1.z.object({
|
|
24
39
|
message: zod_1.z.string().optional(),
|
|
25
40
|
data: zod_1.z.array(schemas_1.ClientByWeeksSchema),
|
|
41
|
+
// `total` лежит РЯДОМ с data, а не внутри неё: панель читает `data` как плоский массив строк,
|
|
42
|
+
// и обёртка `{ list, total }` (как в остальных пагинируемых отчётах) сломала бы ей рендер.
|
|
43
|
+
// Без total последняя страница неотличима от полной выдачи.
|
|
44
|
+
total: zod_1.z.number().describe('Rows in the whole report, before "page"/"count" are applied.'),
|
|
26
45
|
});
|
|
27
46
|
var GetReportByClientWeeksContractQuery;
|
|
28
47
|
(function (GetReportByClientWeeksContractQuery) {
|
|
@@ -2,12 +2,31 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GetReportGroupByClientContactQuery = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const enum_1 = require("../../enum");
|
|
5
6
|
const date_helper_1 = require("../../helpers/date.helper");
|
|
7
|
+
const report_order_filter_schema_1 = require("../../schemas/report/report-order-filter.schema");
|
|
6
8
|
const GetReportGroupByClientRequestSchema = zod_1.z
|
|
7
9
|
.object({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
// Даты приходят «сырым» днём — раскладку в полуинтервал [start, endExclusive) делает сервис
|
|
11
|
+
// в таймзоне компании, как в cash-flow. Прежний setStartDay/setEndDay в UTC разворачивал день
|
|
12
|
+
// второй раз, и в таймзоне с плюсовым сдвигом конец периода уезжал на сутки вперёд.
|
|
13
|
+
startDate: zod_1.z.coerce.date(),
|
|
14
|
+
endDate: zod_1.z.coerce.date(),
|
|
15
|
+
// Сортировка НЕ имеет значения по умолчанию: без явного sortBy/sortOrder строки отдаются
|
|
16
|
+
// в том порядке, в каком их вернул отчёт (панель рендерит map в порядке ключей, и тихая
|
|
17
|
+
// пересортировка меняла бы ей вид таблицы). Исключение — limit: он срезает хвост, что без
|
|
18
|
+
// сортировки бессмысленно, поэтому при limit применяется порядок «по прибыли, убывание».
|
|
19
|
+
sortBy: zod_1.z
|
|
20
|
+
.nativeEnum(enum_1.ReportSortByEnum)
|
|
21
|
+
.optional()
|
|
22
|
+
.describe('Sort metric. Without it (and without "limit") rows keep the report order.'),
|
|
23
|
+
sortOrder: zod_1.z.nativeEnum(enum_1.OrderByEnum).optional().describe('Sort direction. Defaults to "desc" once sorting applies.'),
|
|
24
|
+
// Без значения — ограничения нет: панель по-прежнему получает все строки.
|
|
25
|
+
limit: zod_1.z.coerce.number().int().positive().optional().describe('Keep only the top N rows; implies sorting by gross profit desc.'),
|
|
10
26
|
})
|
|
27
|
+
// dateBasis / excludeClientUUID общие с sales/summary: обе цифры живут на одном экране и должны
|
|
28
|
+
// сужаться одинаково.
|
|
29
|
+
.merge(report_order_filter_schema_1.ReportOrderFilterSchema)
|
|
11
30
|
.refine(value => {
|
|
12
31
|
const { startDate, endDate } = value;
|
|
13
32
|
if (startDate && endDate) {
|
|
@@ -38,6 +57,10 @@ const GetReportGroupByClientResponseSchema = zod_1.z.object({
|
|
|
38
57
|
grossProfit: zod_1.z.number(),
|
|
39
58
|
marginality: zod_1.z.number(),
|
|
40
59
|
})),
|
|
60
|
+
// Аддитивно к прежней форме: число клиентов во ВСЁМ отчёте до усечения и применённый limit.
|
|
61
|
+
// Без них усечённый ответ неотличим от полного.
|
|
62
|
+
total: zod_1.z.number().describe('Client rows in the whole report, before "limit".'),
|
|
63
|
+
limit: zod_1.z.number().optional().describe('Row limit that actually cut rows off. Absent when the response is complete.'),
|
|
41
64
|
}),
|
|
42
65
|
});
|
|
43
66
|
var GetReportGroupByClientContactQuery;
|
|
@@ -8,8 +8,22 @@ const GetReportGroupByPositionRequestSchema = zod_1.z
|
|
|
8
8
|
.object({
|
|
9
9
|
type: zod_1.z.nativeEnum(enum_1.PositionReportTypeEnum).default(enum_1.PositionReportTypeEnum.PRODUCT),
|
|
10
10
|
categoryUUID: zod_1.z.string().optional(),
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
// Даты приходят «сырым» днём — раскладку в полуинтервал [start, endExclusive) делает сервис
|
|
12
|
+
// в таймзоне компании, как в cash-flow. Прежний setStartDay/setEndDay в UTC разворачивал день
|
|
13
|
+
// второй раз, и в таймзоне с плюсовым сдвигом конец периода уезжал на сутки вперёд.
|
|
14
|
+
startDate: zod_1.z.coerce.date(),
|
|
15
|
+
endDate: zod_1.z.coerce.date(),
|
|
16
|
+
// Сортировка НЕ имеет значения по умолчанию: без явного sortBy/sortOrder строки отдаются
|
|
17
|
+
// в том порядке, в каком их вернул отчёт (панель рендерит map в порядке ключей, и тихая
|
|
18
|
+
// пересортировка меняла бы ей вид таблицы). Исключение — limit: он срезает хвост, что без
|
|
19
|
+
// сортировки бессмысленно, поэтому при limit применяется порядок «по прибыли, убывание».
|
|
20
|
+
sortBy: zod_1.z
|
|
21
|
+
.nativeEnum(enum_1.ReportSortByEnum)
|
|
22
|
+
.optional()
|
|
23
|
+
.describe('Sort metric. Without it (and without "limit") rows keep the report order.'),
|
|
24
|
+
sortOrder: zod_1.z.nativeEnum(enum_1.OrderByEnum).optional().describe('Sort direction. Defaults to "desc" once sorting applies.'),
|
|
25
|
+
// Без значения — ограничения нет: панель по-прежнему получает все строки.
|
|
26
|
+
limit: zod_1.z.coerce.number().int().positive().optional().describe('Keep only the top N rows; implies sorting by gross profit desc.'),
|
|
13
27
|
})
|
|
14
28
|
.refine(value => {
|
|
15
29
|
const { startDate, endDate } = value;
|
|
@@ -59,6 +73,11 @@ const GetReportGroupByPositionResponseSchema = zod_1.z.object({
|
|
|
59
73
|
marginality: zod_1.z.number(),
|
|
60
74
|
}))
|
|
61
75
|
.optional(),
|
|
76
|
+
// Аддитивно к прежней форме: отчёт отдаёт ЛИБО категории, ЛИБО товары (при categoryUUID),
|
|
77
|
+
// поэтому total относится к той группировке, что вернулась. Вместе с limit это единственный
|
|
78
|
+
// способ отличить усечённый ответ от полного.
|
|
79
|
+
total: zod_1.z.number().describe('Rows in the whole report (of the returned grouping), before "limit".'),
|
|
80
|
+
limit: zod_1.z.number().optional().describe('Row limit that actually cut rows off. Absent when the response is complete.'),
|
|
62
81
|
}),
|
|
63
82
|
});
|
|
64
83
|
var GetReportGroupByPositionContractQuery;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetSalesByClientContractQuery = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const enum_1 = require("../../enum");
|
|
6
|
+
const date_helper_1 = require("../../helpers/date.helper");
|
|
7
|
+
const pagination_helper_1 = require("../../helpers/pagination.helper");
|
|
8
|
+
const sales_by_client_row_schema_1 = require("../../schemas/report/sales-by-client-row.schema");
|
|
9
|
+
const report_order_filter_schema_1 = require("../../schemas/report/report-order-filter.schema");
|
|
10
|
+
const GetSalesByClientRequestSchema = zod_1.z
|
|
11
|
+
.object({
|
|
12
|
+
startDate: zod_1.z.coerce.date(),
|
|
13
|
+
endDate: zod_1.z.coerce.date(),
|
|
14
|
+
// По умолчанию самые прибыльные клиенты сверху, чтобы count срезал хвост, а не топ.
|
|
15
|
+
sortBy: zod_1.z.nativeEnum(enum_1.ReportSortByEnum).optional().default(enum_1.ReportSortByEnum.GROSS_PROFIT),
|
|
16
|
+
sortOrder: zod_1.z.nativeEnum(enum_1.OrderByEnum).optional().default(enum_1.OrderByEnum.DESC),
|
|
17
|
+
// Пагинация по строкам отчёта. Без count лимит не накладывается — отдаём всех клиентов,
|
|
18
|
+
// а page без count отклоняется: иначе листание молча возвращало бы одну и ту же выдачу.
|
|
19
|
+
page: zod_1.z.coerce.number().int().positive().optional().describe('1-based page number, requires "count".'),
|
|
20
|
+
count: zod_1.z.coerce.number().int().positive().optional().describe('Rows per page. Without it every client row is returned.'),
|
|
21
|
+
})
|
|
22
|
+
// dateBasis / excludeClientUUID — те же, что у JSON-эндпоинтов отчётов по заказам.
|
|
23
|
+
.merge(report_order_filter_schema_1.ReportOrderFilterSchema)
|
|
24
|
+
.refine(value => (0, date_helper_1.dateRangeCheck)(value.startDate, value.endDate), {
|
|
25
|
+
message: 'validation.dateRange',
|
|
26
|
+
path: ['endDate', 'startDate'],
|
|
27
|
+
})
|
|
28
|
+
.refine(value => (0, date_helper_1.isStatementPeriodWithinLimit)(value.startDate, value.endDate), {
|
|
29
|
+
message: 'validation.reportPeriodMax',
|
|
30
|
+
path: ['endDate', 'startDate'],
|
|
31
|
+
})
|
|
32
|
+
.refine(pagination_helper_1.isPageAccompaniedByCount, {
|
|
33
|
+
message: 'validation.pageRequiresCount',
|
|
34
|
+
path: ['page'],
|
|
35
|
+
});
|
|
36
|
+
const GetSalesByClientResponseSchema = zod_1.z.object({
|
|
37
|
+
message: zod_1.z.string().optional(),
|
|
38
|
+
data: zod_1.z.object({
|
|
39
|
+
list: zod_1.z.array(sales_by_client_row_schema_1.SalesByClientRowSchema),
|
|
40
|
+
// Число клиентов во всём отчёте — не размер страницы.
|
|
41
|
+
total: zod_1.z.number(),
|
|
42
|
+
}),
|
|
43
|
+
});
|
|
44
|
+
var GetSalesByClientContractQuery;
|
|
45
|
+
(function (GetSalesByClientContractQuery) {
|
|
46
|
+
GetSalesByClientContractQuery.RequestSchema = GetSalesByClientRequestSchema;
|
|
47
|
+
GetSalesByClientContractQuery.ResponseSchema = GetSalesByClientResponseSchema;
|
|
48
|
+
})(GetSalesByClientContractQuery || (exports.GetSalesByClientContractQuery = GetSalesByClientContractQuery = {}));
|
|
@@ -4,12 +4,16 @@ exports.GetSalesSummaryContractQuery = void 0;
|
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const date_helper_1 = require("../../helpers/date.helper");
|
|
6
6
|
const report_period_type_enum_1 = require("../../enum/report-period-type.enum");
|
|
7
|
+
const report_order_filter_schema_1 = require("../../schemas/report/report-order-filter.schema");
|
|
7
8
|
const GetSalesSummaryRequestSchema = zod_1.z
|
|
8
9
|
.object({
|
|
9
10
|
startDate: zod_1.z.coerce.date().optional(),
|
|
10
11
|
endDate: zod_1.z.coerce.date().optional(),
|
|
11
12
|
periodType: zod_1.z.nativeEnum(report_period_type_enum_1.ReportPeriodTypeEnum).default(report_period_type_enum_1.ReportPeriodTypeEnum.DAY),
|
|
12
13
|
})
|
|
14
|
+
// dateBasis / excludeClientUUID общие с group-client: обе цифры живут на одном экране и должны
|
|
15
|
+
// сужаться одинаково.
|
|
16
|
+
.merge(report_order_filter_schema_1.ReportOrderFilterSchema)
|
|
13
17
|
.refine(value => {
|
|
14
18
|
const { startDate, endDate } = value;
|
|
15
19
|
if (startDate && endDate) {
|
|
@@ -28,3 +28,6 @@ __exportStar(require("./export-client-statement.query"), exports);
|
|
|
28
28
|
__exportStar(require("./get-report-by-client-weeks.query"), exports);
|
|
29
29
|
__exportStar(require("./get-daily-orders-summary.query"), exports);
|
|
30
30
|
__exportStar(require("./get-cash-flow.query"), exports);
|
|
31
|
+
__exportStar(require("./get-inventory-stock.query"), exports);
|
|
32
|
+
__exportStar(require("./get-inventory-turnover.query"), exports);
|
|
33
|
+
__exportStar(require("./get-sales-by-client.query"), exports);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetCompanyProfileContractQuery = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Company-level facts every panel role may read: who the company is, how it is named, which time
|
|
7
|
+
* zone its calendar days are counted in and which currency its figures are in. `companyUUID` is
|
|
8
|
+
* echoed so a caller can prove the profile belongs to its own tenant — the ADMIN-only
|
|
9
|
+
* `settings/for-admin` answer carries no such marker and cannot be cross-checked.
|
|
10
|
+
*/
|
|
11
|
+
const CompanyProfileSchema = zod_1.z.object({
|
|
12
|
+
companyUUID: zod_1.z.string(),
|
|
13
|
+
companyName: zod_1.z.string().nullable(),
|
|
14
|
+
timeZone: zod_1.z.string().nullable(),
|
|
15
|
+
currency: zod_1.z.string().nullable(),
|
|
16
|
+
});
|
|
17
|
+
const GetCompanyProfileResponseSchema = zod_1.z.object({
|
|
18
|
+
message: zod_1.z.string().optional(),
|
|
19
|
+
data: CompanyProfileSchema,
|
|
20
|
+
});
|
|
21
|
+
var GetCompanyProfileContractQuery;
|
|
22
|
+
(function (GetCompanyProfileContractQuery) {
|
|
23
|
+
GetCompanyProfileContractQuery.ResponseSchema = GetCompanyProfileResponseSchema;
|
|
24
|
+
})(GetCompanyProfileContractQuery || (exports.GetCompanyProfileContractQuery = GetCompanyProfileContractQuery = {}));
|
|
@@ -17,3 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./get-settings.query"), exports);
|
|
18
18
|
__exportStar(require("./update-settings.command"), exports);
|
|
19
19
|
__exportStar(require("./get-settings-for-admin.query"), exports);
|
|
20
|
+
__exportStar(require("./get-company-profile.query"), exports);
|
package/build/constant/index.js
CHANGED
|
@@ -20,3 +20,4 @@ __exportStar(require("./error-i18n-key"), exports);
|
|
|
20
20
|
__exportStar(require("./import.constant"), exports);
|
|
21
21
|
__exportStar(require("./validation-i18n-key"), exports);
|
|
22
22
|
__exportStar(require("./validation-i18n-message"), exports);
|
|
23
|
+
__exportStar(require("./report.constant"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.REPORT_EXCLUDE_CLIENT_LIMIT = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Потолок списка исключаемых из отчёта клиентов. Список едет в query-строке и дальше в SQL
|
|
6
|
+
* как `= ANY($n::text[])`, поэтому ограничение защищает и от переполнения URL, и от запроса
|
|
7
|
+
* с массивом в тысячи элементов.
|
|
8
|
+
*/
|
|
9
|
+
exports.REPORT_EXCLUDE_CLIENT_LIMIT = 500;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClientContractStatusEnum = void 0;
|
|
4
|
+
var ClientContractStatusEnum;
|
|
5
|
+
(function (ClientContractStatusEnum) {
|
|
6
|
+
ClientContractStatusEnum["NONE"] = "NONE";
|
|
7
|
+
ClientContractStatusEnum["REQUIRED"] = "REQUIRED";
|
|
8
|
+
ClientContractStatusEnum["PREPARED"] = "PREPARED";
|
|
9
|
+
ClientContractStatusEnum["SENT"] = "SENT";
|
|
10
|
+
ClientContractStatusEnum["SIGNED"] = "SIGNED";
|
|
11
|
+
ClientContractStatusEnum["EXPIRED"] = "EXPIRED";
|
|
12
|
+
ClientContractStatusEnum["TERMINATED"] = "TERMINATED";
|
|
13
|
+
})(ClientContractStatusEnum || (exports.ClientContractStatusEnum = ClientContractStatusEnum = {}));
|
package/build/enum/index.js
CHANGED
|
@@ -52,6 +52,7 @@ __exportStar(require("./order-distribute-status-list"), exports);
|
|
|
52
52
|
__exportStar(require("./order-active-status-list"), exports);
|
|
53
53
|
__exportStar(require("./order-price-correction-skipped-status-list"), exports);
|
|
54
54
|
__exportStar(require("./client-status.enum"), exports);
|
|
55
|
+
__exportStar(require("./client-contract-status.enum"), exports);
|
|
55
56
|
__exportStar(require("./client-type.enum"), exports);
|
|
56
57
|
__exportStar(require("./consignment-distribution-validation-status.enum"), exports);
|
|
57
58
|
__exportStar(require("./consignment-distribution-validation-type.enum"), exports);
|
|
@@ -111,3 +112,6 @@ __exportStar(require("./legal-identifier-field.enum"), exports);
|
|
|
111
112
|
__exportStar(require("./permission-key.enum"), exports);
|
|
112
113
|
__exportStar(require("./cash-flow-item-status.enum"), exports);
|
|
113
114
|
__exportStar(require("./payment-invoice-status.enum"), exports);
|
|
115
|
+
__exportStar(require("./order-by.enum"), exports);
|
|
116
|
+
__exportStar(require("./report-sort-by.enum"), exports);
|
|
117
|
+
__exportStar(require("./report-order-date-basis.enum"), exports);
|