@floristcloud/api-lib 1.2.101 → 1.2.103
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/cash-flow-item/create-cash-flow-item.command.js +18 -0
- package/build/commands/cash-flow-item/delete-cash-flow-item.command.js +15 -0
- package/build/commands/cash-flow-item/get-cash-flow-item-list.query.js +18 -0
- package/build/commands/cash-flow-item/get-cash-flow-item.query.js +13 -0
- package/build/commands/cash-flow-item/index.js +21 -0
- package/build/commands/cash-flow-item/update-cash-flow-item.command.js +20 -0
- package/build/commands/index.js +1 -0
- package/build/commands/report/get-cash-flow.query.js +55 -0
- package/build/commands/report/index.js +1 -0
- package/build/commands/transaction/assign-cash-flow-item-to-transactions.command.js +20 -0
- package/build/commands/transaction/create-transaction.command.js +2 -0
- package/build/commands/transaction/export-transactions.command.js +1 -0
- package/build/commands/transaction/get-transaction-list.query.js +1 -0
- package/build/commands/transaction/get-transaction-summary.query.js +1 -0
- package/build/commands/transaction/index.js +1 -0
- package/build/commands/transaction/update-transaction.command.js +2 -0
- package/build/constant/error.js +22 -0
- package/build/enum/cash-flow-item-status.enum.js +8 -0
- package/build/enum/index.js +1 -0
- package/build/enum/permission-key.enum.js +16 -0
- package/build/enum/transaction-import-entity-property.enum.js +1 -0
- package/build/enum/transaction-import-errors.enum.js +2 -0
- package/build/schemas/cash-flow-item/cash-flow-item.schema.js +14 -0
- package/build/schemas/index.js +1 -0
- package/build/schemas/transaction/transaction.schema.js +1 -0
- package/commands/cash-flow-item/create-cash-flow-item.command.ts +20 -0
- package/commands/cash-flow-item/delete-cash-flow-item.command.ts +17 -0
- package/commands/cash-flow-item/get-cash-flow-item-list.query.ts +20 -0
- package/commands/cash-flow-item/get-cash-flow-item.query.ts +12 -0
- package/commands/cash-flow-item/index.ts +5 -0
- package/commands/cash-flow-item/update-cash-flow-item.command.ts +22 -0
- package/commands/index.ts +1 -0
- package/commands/report/get-cash-flow.query.ts +59 -0
- package/commands/report/index.ts +1 -0
- package/commands/transaction/assign-cash-flow-item-to-transactions.command.ts +22 -0
- package/commands/transaction/create-transaction.command.ts +2 -0
- package/commands/transaction/export-transactions.command.ts +1 -0
- package/commands/transaction/get-transaction-list.query.ts +1 -0
- package/commands/transaction/get-transaction-summary.query.ts +1 -0
- package/commands/transaction/index.ts +1 -0
- package/commands/transaction/update-transaction.command.ts +2 -0
- package/constant/error.ts +22 -0
- package/enum/cash-flow-item-status.enum.ts +4 -0
- package/enum/index.ts +1 -0
- package/enum/permission-key.enum.ts +16 -0
- package/enum/transaction-import-entity-property.enum.ts +1 -0
- package/enum/transaction-import-errors.enum.ts +2 -0
- package/package.json +1 -1
- package/schemas/cash-flow-item/cash-flow-item.schema.ts +12 -0
- package/schemas/index.ts +1 -0
- package/schemas/transaction/transaction.schema.ts +2 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateCashFlowItemContractCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const schemas_1 = require("../../schemas");
|
|
6
|
+
const CreateCashFlowItemRequestSchema = zod_1.z.object({
|
|
7
|
+
name: zod_1.z.string().trim().min(1).max(255),
|
|
8
|
+
sortOrder: zod_1.z.coerce.number().int().optional(),
|
|
9
|
+
});
|
|
10
|
+
const CreateCashFlowItemResponseSchema = zod_1.z.object({
|
|
11
|
+
message: zod_1.z.string().optional(),
|
|
12
|
+
data: schemas_1.CashFlowItemSchema.nullable(),
|
|
13
|
+
});
|
|
14
|
+
var CreateCashFlowItemContractCommand;
|
|
15
|
+
(function (CreateCashFlowItemContractCommand) {
|
|
16
|
+
CreateCashFlowItemContractCommand.RequestSchema = CreateCashFlowItemRequestSchema;
|
|
17
|
+
CreateCashFlowItemContractCommand.ResponseSchema = CreateCashFlowItemResponseSchema;
|
|
18
|
+
})(CreateCashFlowItemContractCommand || (exports.CreateCashFlowItemContractCommand = CreateCashFlowItemContractCommand = {}));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteCashFlowItemContractCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const delete_data_response_schema_1 = require("../../schemas/delete-data-response.schema");
|
|
6
|
+
const DeleteCashFlowItemRequestSchema = zod_1.z.object({});
|
|
7
|
+
const DeleteCashFlowItemResponseSchema = zod_1.z.object({
|
|
8
|
+
message: zod_1.z.string().optional(),
|
|
9
|
+
data: delete_data_response_schema_1.DeleteDataResponseSchema,
|
|
10
|
+
});
|
|
11
|
+
var DeleteCashFlowItemContractCommand;
|
|
12
|
+
(function (DeleteCashFlowItemContractCommand) {
|
|
13
|
+
DeleteCashFlowItemContractCommand.RequestSchema = DeleteCashFlowItemRequestSchema;
|
|
14
|
+
DeleteCashFlowItemContractCommand.ResponseSchema = DeleteCashFlowItemResponseSchema;
|
|
15
|
+
})(DeleteCashFlowItemContractCommand || (exports.DeleteCashFlowItemContractCommand = DeleteCashFlowItemContractCommand = {}));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetCashFlowItemListContractQuery = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const schemas_1 = require("../../schemas");
|
|
6
|
+
const cash_flow_item_status_enum_1 = require("../../enum/cash-flow-item-status.enum");
|
|
7
|
+
const GetCashFlowItemListRequestSchema = zod_1.z.object({
|
|
8
|
+
status: zod_1.z.nativeEnum(cash_flow_item_status_enum_1.CashFlowItemStatusEnum).optional(),
|
|
9
|
+
});
|
|
10
|
+
const GetCashFlowItemListResponseSchema = zod_1.z.object({
|
|
11
|
+
message: zod_1.z.string().optional(),
|
|
12
|
+
data: schemas_1.CashFlowItemSchema.array(),
|
|
13
|
+
});
|
|
14
|
+
var GetCashFlowItemListContractQuery;
|
|
15
|
+
(function (GetCashFlowItemListContractQuery) {
|
|
16
|
+
GetCashFlowItemListContractQuery.RequestSchema = GetCashFlowItemListRequestSchema;
|
|
17
|
+
GetCashFlowItemListContractQuery.ResponseSchema = GetCashFlowItemListResponseSchema;
|
|
18
|
+
})(GetCashFlowItemListContractQuery || (exports.GetCashFlowItemListContractQuery = GetCashFlowItemListContractQuery = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetCashFlowItemContractQuery = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const schemas_1 = require("../../schemas");
|
|
6
|
+
const GetCashFlowItemResponseSchema = zod_1.z.object({
|
|
7
|
+
message: zod_1.z.string().optional(),
|
|
8
|
+
data: schemas_1.CashFlowItemSchema.nullable(),
|
|
9
|
+
});
|
|
10
|
+
var GetCashFlowItemContractQuery;
|
|
11
|
+
(function (GetCashFlowItemContractQuery) {
|
|
12
|
+
GetCashFlowItemContractQuery.ResponseSchema = GetCashFlowItemResponseSchema;
|
|
13
|
+
})(GetCashFlowItemContractQuery || (exports.GetCashFlowItemContractQuery = GetCashFlowItemContractQuery = {}));
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./create-cash-flow-item.command"), exports);
|
|
18
|
+
__exportStar(require("./update-cash-flow-item.command"), exports);
|
|
19
|
+
__exportStar(require("./delete-cash-flow-item.command"), exports);
|
|
20
|
+
__exportStar(require("./get-cash-flow-item.query"), exports);
|
|
21
|
+
__exportStar(require("./get-cash-flow-item-list.query"), exports);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateCashFlowItemContractCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const schemas_1 = require("../../schemas");
|
|
6
|
+
const cash_flow_item_status_enum_1 = require("../../enum/cash-flow-item-status.enum");
|
|
7
|
+
const UpdateCashFlowItemRequestSchema = zod_1.z.object({
|
|
8
|
+
name: zod_1.z.string().trim().min(1).max(255).optional(),
|
|
9
|
+
status: zod_1.z.nativeEnum(cash_flow_item_status_enum_1.CashFlowItemStatusEnum).optional(),
|
|
10
|
+
sortOrder: zod_1.z.coerce.number().int().optional(),
|
|
11
|
+
});
|
|
12
|
+
const UpdateCashFlowItemResponseSchema = zod_1.z.object({
|
|
13
|
+
message: zod_1.z.string().optional(),
|
|
14
|
+
data: schemas_1.CashFlowItemSchema.nullable(),
|
|
15
|
+
});
|
|
16
|
+
var UpdateCashFlowItemContractCommand;
|
|
17
|
+
(function (UpdateCashFlowItemContractCommand) {
|
|
18
|
+
UpdateCashFlowItemContractCommand.RequestSchema = UpdateCashFlowItemRequestSchema;
|
|
19
|
+
UpdateCashFlowItemContractCommand.ResponseSchema = UpdateCashFlowItemResponseSchema;
|
|
20
|
+
})(UpdateCashFlowItemContractCommand || (exports.UpdateCashFlowItemContractCommand = UpdateCashFlowItemContractCommand = {}));
|
package/build/commands/index.js
CHANGED
|
@@ -18,6 +18,7 @@ exports.ValidateWsTicketS2SContractQuery = exports.CreateWsTicketContractCommand
|
|
|
18
18
|
__exportStar(require("./access-policy"), exports);
|
|
19
19
|
__exportStar(require("./auth"), exports);
|
|
20
20
|
__exportStar(require("./branch"), exports);
|
|
21
|
+
__exportStar(require("./cash-flow-item"), exports);
|
|
21
22
|
__exportStar(require("./category"), exports);
|
|
22
23
|
__exportStar(require("./category-alias"), exports);
|
|
23
24
|
__exportStar(require("./category-template"), exports);
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetCashFlowContractQuery = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const date_helper_1 = require("../../helpers/date.helper");
|
|
6
|
+
const GetCashFlowRequestSchema = zod_1.z
|
|
7
|
+
.object({
|
|
8
|
+
startDate: zod_1.z.coerce.date(),
|
|
9
|
+
endDate: zod_1.z.coerce.date(),
|
|
10
|
+
moneyAccountUUID: zod_1.z.string().optional(),
|
|
11
|
+
// Разбивка оборотов по месяцам внутри периода.
|
|
12
|
+
// Не z.coerce.boolean(): в query-строке приходит текст, и Boolean('false') === true —
|
|
13
|
+
// флаг было бы невозможно выключить явным значением.
|
|
14
|
+
withMonthBreakdown: zod_1.z
|
|
15
|
+
.union([zod_1.z.boolean(), zod_1.z.string()])
|
|
16
|
+
.optional()
|
|
17
|
+
.default(false)
|
|
18
|
+
.transform(value => (typeof value === 'boolean' ? value : value === 'true' || value === '1')),
|
|
19
|
+
})
|
|
20
|
+
.refine(value => (0, date_helper_1.dateRangeCheck)(value.startDate, value.endDate), {
|
|
21
|
+
message: 'validation.dateRange',
|
|
22
|
+
path: ['endDate', 'startDate'],
|
|
23
|
+
})
|
|
24
|
+
.refine(value => (0, date_helper_1.isStatementPeriodWithinLimit)(value.startDate, value.endDate), {
|
|
25
|
+
message: 'validation.reportPeriodMax',
|
|
26
|
+
path: ['endDate', 'startDate'],
|
|
27
|
+
});
|
|
28
|
+
const CashFlowItemRowSchema = zod_1.z.object({
|
|
29
|
+
// null — строка "Без статьи": платежи, которым статью ещё не проставили.
|
|
30
|
+
cashFlowItemUUID: zod_1.z.string().nullable(),
|
|
31
|
+
cashFlowItemName: zod_1.z.string().nullable(),
|
|
32
|
+
income: zod_1.z.number(),
|
|
33
|
+
expense: zod_1.z.number(),
|
|
34
|
+
transactionCount: zod_1.z.number(),
|
|
35
|
+
});
|
|
36
|
+
const CashFlowMonthRowSchema = CashFlowItemRowSchema.extend({
|
|
37
|
+
month: zod_1.z.string(),
|
|
38
|
+
});
|
|
39
|
+
const GetCashFlowResponseSchema = zod_1.z.object({
|
|
40
|
+
message: zod_1.z.string().optional(),
|
|
41
|
+
data: zod_1.z.object({
|
|
42
|
+
byItem: CashFlowItemRowSchema.array(),
|
|
43
|
+
byMonth: CashFlowMonthRowSchema.array(),
|
|
44
|
+
totals: zod_1.z.object({
|
|
45
|
+
income: zod_1.z.number(),
|
|
46
|
+
expense: zod_1.z.number(),
|
|
47
|
+
total: zod_1.z.number(),
|
|
48
|
+
}),
|
|
49
|
+
}),
|
|
50
|
+
});
|
|
51
|
+
var GetCashFlowContractQuery;
|
|
52
|
+
(function (GetCashFlowContractQuery) {
|
|
53
|
+
GetCashFlowContractQuery.RequestSchema = GetCashFlowRequestSchema;
|
|
54
|
+
GetCashFlowContractQuery.ResponseSchema = GetCashFlowResponseSchema;
|
|
55
|
+
})(GetCashFlowContractQuery || (exports.GetCashFlowContractQuery = GetCashFlowContractQuery = {}));
|
|
@@ -27,3 +27,4 @@ __exportStar(require("./export-inventory-turnover.query"), exports);
|
|
|
27
27
|
__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
|
+
__exportStar(require("./get-cash-flow.query"), exports);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AssignCashFlowItemToTransactionsContractCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const AssignCashFlowItemToTransactionsRequestSchema = zod_1.z.object({
|
|
6
|
+
transactionUUIDs: zod_1.z.uuid().array().min(1).max(500),
|
|
7
|
+
// null снимает статью с выбранных платежей.
|
|
8
|
+
cashFlowItemUUID: zod_1.z.uuid().nullable(),
|
|
9
|
+
});
|
|
10
|
+
const AssignCashFlowItemToTransactionsResponseSchema = zod_1.z.object({
|
|
11
|
+
message: zod_1.z.string().optional(),
|
|
12
|
+
data: zod_1.z.object({
|
|
13
|
+
updated: zod_1.z.number(),
|
|
14
|
+
}),
|
|
15
|
+
});
|
|
16
|
+
var AssignCashFlowItemToTransactionsContractCommand;
|
|
17
|
+
(function (AssignCashFlowItemToTransactionsContractCommand) {
|
|
18
|
+
AssignCashFlowItemToTransactionsContractCommand.RequestSchema = AssignCashFlowItemToTransactionsRequestSchema;
|
|
19
|
+
AssignCashFlowItemToTransactionsContractCommand.ResponseSchema = AssignCashFlowItemToTransactionsResponseSchema;
|
|
20
|
+
})(AssignCashFlowItemToTransactionsContractCommand || (exports.AssignCashFlowItemToTransactionsContractCommand = AssignCashFlowItemToTransactionsContractCommand = {}));
|
|
@@ -12,6 +12,8 @@ const CreateTransactionRequestSchema = schemas_1.TransactionSchema.pick({
|
|
|
12
12
|
type: true,
|
|
13
13
|
}).extend({
|
|
14
14
|
createdAt: zod_1.z.coerce.date().optional(),
|
|
15
|
+
// Статья необязательна: система помогает разметить расходы, а не требует этого при оплате.
|
|
16
|
+
cashFlowItemUUID: zod_1.z.uuid().nullable().optional(),
|
|
15
17
|
});
|
|
16
18
|
const CreateTransactionResponseSchema = zod_1.z.object({
|
|
17
19
|
message: zod_1.z.string().optional(),
|
|
@@ -12,6 +12,7 @@ const ExportTransactionsRequestSchema = zod_1.z
|
|
|
12
12
|
moneyAccountUUID: zod_1.z.string().optional(),
|
|
13
13
|
clientUUID: zod_1.z.string().optional(),
|
|
14
14
|
orderUUID: zod_1.z.string().optional(),
|
|
15
|
+
cashFlowItemUUID: zod_1.z.string().optional(),
|
|
15
16
|
})
|
|
16
17
|
.refine(value => {
|
|
17
18
|
const { startDate, endDate } = value;
|
|
@@ -15,6 +15,7 @@ const GetTransactionListRequestSchema = zod_1.z
|
|
|
15
15
|
moneyAccountUUID: zod_1.z.string().optional(),
|
|
16
16
|
clientUUID: zod_1.z.string().optional(),
|
|
17
17
|
orderUUID: zod_1.z.string().optional(),
|
|
18
|
+
cashFlowItemUUID: zod_1.z.string().optional(),
|
|
18
19
|
searchQuery: zod_1.z.string().optional(),
|
|
19
20
|
})
|
|
20
21
|
.refine(value => {
|
|
@@ -12,6 +12,7 @@ const GetTransactionSummaryRequestSchema = zod_1.z
|
|
|
12
12
|
moneyAccountUUID: zod_1.z.string().optional(),
|
|
13
13
|
clientUUID: zod_1.z.string().optional(),
|
|
14
14
|
orderUUID: zod_1.z.string().optional(),
|
|
15
|
+
cashFlowItemUUID: zod_1.z.string().optional(),
|
|
15
16
|
searchQuery: zod_1.z.string().optional(),
|
|
16
17
|
})
|
|
17
18
|
.refine(value => {
|
|
@@ -27,3 +27,4 @@ __exportStar(require("./get-transaction-summary.query"), exports);
|
|
|
27
27
|
__exportStar(require("./generate-pre-payment-check.command"), exports);
|
|
28
28
|
__exportStar(require("./apply-prepayment-transaction.command"), exports);
|
|
29
29
|
__exportStar(require("./import-transaction.command"), exports);
|
|
30
|
+
__exportStar(require("./assign-cash-flow-item-to-transactions.command"), exports);
|
|
@@ -7,6 +7,8 @@ const UpdateTransactionRequestSchema = schemas_1.TransactionSchema.pick({
|
|
|
7
7
|
comment: true,
|
|
8
8
|
}).extend({
|
|
9
9
|
createdAt: zod_1.z.coerce.date(),
|
|
10
|
+
// Проставить/сменить статью можно задним числом — основной способ разметки расходов.
|
|
11
|
+
cashFlowItemUUID: zod_1.z.uuid().nullable().optional(),
|
|
10
12
|
});
|
|
11
13
|
const UpdateTransactionResponseSchema = zod_1.z.object({
|
|
12
14
|
message: zod_1.z.string().optional(),
|
package/build/constant/error.js
CHANGED
|
@@ -1367,4 +1367,26 @@ exports.ERRORS = {
|
|
|
1367
1367
|
CONSIGNMENT_TRANSFER_ACCEPT_FAILED: { code: 'CTR013', message: 'Failed to accept consignment transfer request', httpCode: 500 },
|
|
1368
1368
|
ACCESS_POLICY_FETCH_FAILED: { code: 'AP001', message: 'Error when retrieving the access policy', httpCode: 500 },
|
|
1369
1369
|
ACCESS_POLICY_NOT_UPDATED: { code: 'AP002', message: 'Failed to update the access policy', httpCode: 500 },
|
|
1370
|
+
CASH_FLOW_ITEM_NOT_CREATED: { code: 'CFI001', message: 'Failed to create cash flow item', httpCode: 500 },
|
|
1371
|
+
CASH_FLOW_ITEM_NOT_UPDATED: { code: 'CFI002', message: 'Failed to update cash flow item', httpCode: 500 },
|
|
1372
|
+
CASH_FLOW_ITEM_NOT_DELETED: { code: 'CFI003', message: 'Failed to delete cash flow item', httpCode: 500 },
|
|
1373
|
+
CASH_FLOW_ITEM_NOT_FOUND: { code: 'CFI004', message: 'The cash flow item with the specified UUID was not found', httpCode: 404 },
|
|
1374
|
+
CASH_FLOW_ITEM_FETCH_FAILED: { code: 'CFI005', message: 'Error when retrieving cash flow items', httpCode: 500 },
|
|
1375
|
+
CASH_FLOW_ITEM_WITH_SAME_NAME_ALREADY_EXISTS: {
|
|
1376
|
+
code: 'CFI006',
|
|
1377
|
+
message: 'The cash flow item with the specified name already exists',
|
|
1378
|
+
httpCode: 400,
|
|
1379
|
+
},
|
|
1380
|
+
CASH_FLOW_ITEM_IN_USE: {
|
|
1381
|
+
code: 'CFI007',
|
|
1382
|
+
message: 'The cash flow item is referenced by transactions and cannot be deleted, archive it instead',
|
|
1383
|
+
httpCode: 409,
|
|
1384
|
+
},
|
|
1385
|
+
CASH_FLOW_ITEM_IS_ARCHIVED: { code: 'CFI008', message: 'The cash flow item is archived', httpCode: 400 },
|
|
1386
|
+
CASH_FLOW_REPORT_FAILED: { code: 'CFI009', message: 'Failed to build cash flow report', httpCode: 500 },
|
|
1387
|
+
TRANSACTIONS_CASH_FLOW_ITEM_NOT_ASSIGNED: {
|
|
1388
|
+
code: 'CFI010',
|
|
1389
|
+
message: 'Failed to assign cash flow item to transactions',
|
|
1390
|
+
httpCode: 500,
|
|
1391
|
+
},
|
|
1370
1392
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CashFlowItemStatusEnum = void 0;
|
|
4
|
+
var CashFlowItemStatusEnum;
|
|
5
|
+
(function (CashFlowItemStatusEnum) {
|
|
6
|
+
CashFlowItemStatusEnum["ACTIVE"] = "ACTIVE";
|
|
7
|
+
CashFlowItemStatusEnum["ARCHIVE"] = "ARCHIVE";
|
|
8
|
+
})(CashFlowItemStatusEnum || (exports.CashFlowItemStatusEnum = CashFlowItemStatusEnum = {}));
|
package/build/enum/index.js
CHANGED
|
@@ -109,3 +109,4 @@ __exportStar(require("./consignment-transfer-request-status.enum"), exports);
|
|
|
109
109
|
__exportStar(require("./consignment-transfer-direction.enum"), exports);
|
|
110
110
|
__exportStar(require("./legal-identifier-field.enum"), exports);
|
|
111
111
|
__exportStar(require("./permission-key.enum"), exports);
|
|
112
|
+
__exportStar(require("./cash-flow-item-status.enum"), exports);
|
|
@@ -13,6 +13,14 @@ var PermissionKeyEnum;
|
|
|
13
13
|
PermissionKeyEnum["COST_VIEW"] = "cost.view";
|
|
14
14
|
// Consignment-level financial totals: total cost + profit (итоги по поставке).
|
|
15
15
|
PermissionKeyEnum["CONSIGNMENT_FINANCIALS_VIEW"] = "consignment.financials.view";
|
|
16
|
+
PermissionKeyEnum["PAGE_ORDER_VIEW"] = "page.order.view";
|
|
17
|
+
PermissionKeyEnum["PAGE_STOCK_VIEW"] = "page.stock.view";
|
|
18
|
+
PermissionKeyEnum["PAGE_CLIENTS_VIEW"] = "page.clients.view";
|
|
19
|
+
PermissionKeyEnum["PAGE_PAYMENTS_VIEW"] = "page.payments.view";
|
|
20
|
+
PermissionKeyEnum["PAGE_CATEGORIES_VIEW"] = "page.categories.view";
|
|
21
|
+
PermissionKeyEnum["PAGE_PRE_ORDERS_VIEW"] = "page.pre_orders.view";
|
|
22
|
+
PermissionKeyEnum["PAGE_REPORT_VIEW"] = "page.report.view";
|
|
23
|
+
PermissionKeyEnum["PAGE_STAFF_VIEW"] = "page.staff.view";
|
|
16
24
|
})(PermissionKeyEnum || (exports.PermissionKeyEnum = PermissionKeyEnum = {}));
|
|
17
25
|
exports.PERMISSION_KEY_LIST = [
|
|
18
26
|
PermissionKeyEnum.PRODUCT_VIEW,
|
|
@@ -23,4 +31,12 @@ exports.PERMISSION_KEY_LIST = [
|
|
|
23
31
|
PermissionKeyEnum.CONSIGNMENT_DELETE,
|
|
24
32
|
PermissionKeyEnum.COST_VIEW,
|
|
25
33
|
PermissionKeyEnum.CONSIGNMENT_FINANCIALS_VIEW,
|
|
34
|
+
PermissionKeyEnum.PAGE_ORDER_VIEW,
|
|
35
|
+
PermissionKeyEnum.PAGE_STOCK_VIEW,
|
|
36
|
+
PermissionKeyEnum.PAGE_CLIENTS_VIEW,
|
|
37
|
+
PermissionKeyEnum.PAGE_PAYMENTS_VIEW,
|
|
38
|
+
PermissionKeyEnum.PAGE_CATEGORIES_VIEW,
|
|
39
|
+
PermissionKeyEnum.PAGE_PRE_ORDERS_VIEW,
|
|
40
|
+
PermissionKeyEnum.PAGE_REPORT_VIEW,
|
|
41
|
+
PermissionKeyEnum.PAGE_STAFF_VIEW,
|
|
26
42
|
];
|
|
@@ -13,4 +13,5 @@ var TransactionImportEntityPropertyEnum;
|
|
|
13
13
|
TransactionImportEntityPropertyEnum["TYPE"] = "type";
|
|
14
14
|
TransactionImportEntityPropertyEnum["DATE"] = "date";
|
|
15
15
|
TransactionImportEntityPropertyEnum["COMMENT"] = "comment";
|
|
16
|
+
TransactionImportEntityPropertyEnum["CASH_FLOW_ITEM"] = "cashFlowItem";
|
|
16
17
|
})(TransactionImportEntityPropertyEnum || (exports.TransactionImportEntityPropertyEnum = TransactionImportEntityPropertyEnum = {}));
|
|
@@ -9,5 +9,7 @@ var TransactionImportErrorsEnum;
|
|
|
9
9
|
TransactionImportErrorsEnum["CLIENT_AMBIGUOUS"] = "CLIENT_AMBIGUOUS";
|
|
10
10
|
TransactionImportErrorsEnum["MONEY_ACCOUNT_NOT_FOUND"] = "MONEY_ACCOUNT_NOT_FOUND";
|
|
11
11
|
TransactionImportErrorsEnum["MONEY_ACCOUNT_AMBIGUOUS"] = "MONEY_ACCOUNT_AMBIGUOUS";
|
|
12
|
+
TransactionImportErrorsEnum["CASH_FLOW_ITEM_NOT_FOUND"] = "CASH_FLOW_ITEM_NOT_FOUND";
|
|
13
|
+
TransactionImportErrorsEnum["CASH_FLOW_ITEM_AMBIGUOUS"] = "CASH_FLOW_ITEM_AMBIGUOUS";
|
|
12
14
|
TransactionImportErrorsEnum["CREATE_FAILED"] = "CREATE_FAILED";
|
|
13
15
|
})(TransactionImportErrorsEnum || (exports.TransactionImportErrorsEnum = TransactionImportErrorsEnum = {}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CashFlowItemSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const cash_flow_item_status_enum_1 = require("../../enum/cash-flow-item-status.enum");
|
|
6
|
+
exports.CashFlowItemSchema = zod_1.z.object({
|
|
7
|
+
uuid: zod_1.z.uuid(),
|
|
8
|
+
companyUUID: zod_1.z.string(),
|
|
9
|
+
name: zod_1.z.string(),
|
|
10
|
+
status: zod_1.z.nativeEnum(cash_flow_item_status_enum_1.CashFlowItemStatusEnum),
|
|
11
|
+
sortOrder: zod_1.z.number(),
|
|
12
|
+
createdAt: zod_1.z.date(),
|
|
13
|
+
updatedAt: zod_1.z.date(),
|
|
14
|
+
});
|
package/build/schemas/index.js
CHANGED
|
@@ -32,6 +32,7 @@ __exportStar(require("./order-product/price-correction-analyze-item.schema"), ex
|
|
|
32
32
|
__exportStar(require("./order-product/price-correction-execute-result-item.schema"), exports);
|
|
33
33
|
__exportStar(require("./transaction/transaction.schema"), exports);
|
|
34
34
|
__exportStar(require("./transaction/transaction-list.schema"), exports);
|
|
35
|
+
__exportStar(require("./cash-flow-item/cash-flow-item.schema"), exports);
|
|
35
36
|
__exportStar(require("./file"), exports);
|
|
36
37
|
__exportStar(require("./product-image/product-image.schema"), exports);
|
|
37
38
|
__exportStar(require("./settings/settings.schema"), exports);
|
|
@@ -15,6 +15,7 @@ exports.TransactionSchema = zod_1.z.object({
|
|
|
15
15
|
orderUUID: zod_1.z.string().nullable(),
|
|
16
16
|
type: zod_1.z.nativeEnum(enum_1.TransactionTypeEnum),
|
|
17
17
|
createdByUserUUID: zod_1.z.string(),
|
|
18
|
+
cashFlowItemUUID: zod_1.z.string().nullable(),
|
|
18
19
|
createdAt: zod_1.z.date(),
|
|
19
20
|
updatedAt: zod_1.z.date(),
|
|
20
21
|
deletedAt: zod_1.z.date().nullable(),
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { CashFlowItemSchema } from '../../schemas';
|
|
3
|
+
|
|
4
|
+
const CreateCashFlowItemRequestSchema = z.object({
|
|
5
|
+
name: z.string().trim().min(1).max(255),
|
|
6
|
+
sortOrder: z.coerce.number().int().optional(),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
const CreateCashFlowItemResponseSchema = z.object({
|
|
10
|
+
message: z.string().optional(),
|
|
11
|
+
data: CashFlowItemSchema.nullable(),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export namespace CreateCashFlowItemContractCommand {
|
|
15
|
+
export const RequestSchema = CreateCashFlowItemRequestSchema;
|
|
16
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
17
|
+
|
|
18
|
+
export const ResponseSchema = CreateCashFlowItemResponseSchema;
|
|
19
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { DeleteDataResponseSchema } from '../../schemas/delete-data-response.schema';
|
|
3
|
+
|
|
4
|
+
const DeleteCashFlowItemRequestSchema = z.object({});
|
|
5
|
+
|
|
6
|
+
const DeleteCashFlowItemResponseSchema = z.object({
|
|
7
|
+
message: z.string().optional(),
|
|
8
|
+
data: DeleteDataResponseSchema,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export namespace DeleteCashFlowItemContractCommand {
|
|
12
|
+
export const RequestSchema = DeleteCashFlowItemRequestSchema;
|
|
13
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
14
|
+
|
|
15
|
+
export const ResponseSchema = DeleteCashFlowItemResponseSchema;
|
|
16
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { CashFlowItemSchema } from '../../schemas';
|
|
3
|
+
import { CashFlowItemStatusEnum } from '../../enum/cash-flow-item-status.enum';
|
|
4
|
+
|
|
5
|
+
const GetCashFlowItemListRequestSchema = z.object({
|
|
6
|
+
status: z.nativeEnum(CashFlowItemStatusEnum).optional(),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
const GetCashFlowItemListResponseSchema = z.object({
|
|
10
|
+
message: z.string().optional(),
|
|
11
|
+
data: CashFlowItemSchema.array(),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export namespace GetCashFlowItemListContractQuery {
|
|
15
|
+
export const RequestSchema = GetCashFlowItemListRequestSchema;
|
|
16
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
17
|
+
|
|
18
|
+
export const ResponseSchema = GetCashFlowItemListResponseSchema;
|
|
19
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { CashFlowItemSchema } from '../../schemas';
|
|
3
|
+
|
|
4
|
+
const GetCashFlowItemResponseSchema = z.object({
|
|
5
|
+
message: z.string().optional(),
|
|
6
|
+
data: CashFlowItemSchema.nullable(),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export namespace GetCashFlowItemContractQuery {
|
|
10
|
+
export const ResponseSchema = GetCashFlowItemResponseSchema;
|
|
11
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { CashFlowItemSchema } from '../../schemas';
|
|
3
|
+
import { CashFlowItemStatusEnum } from '../../enum/cash-flow-item-status.enum';
|
|
4
|
+
|
|
5
|
+
const UpdateCashFlowItemRequestSchema = z.object({
|
|
6
|
+
name: z.string().trim().min(1).max(255).optional(),
|
|
7
|
+
status: z.nativeEnum(CashFlowItemStatusEnum).optional(),
|
|
8
|
+
sortOrder: z.coerce.number().int().optional(),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
const UpdateCashFlowItemResponseSchema = z.object({
|
|
12
|
+
message: z.string().optional(),
|
|
13
|
+
data: CashFlowItemSchema.nullable(),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export namespace UpdateCashFlowItemContractCommand {
|
|
17
|
+
export const RequestSchema = UpdateCashFlowItemRequestSchema;
|
|
18
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
19
|
+
|
|
20
|
+
export const ResponseSchema = UpdateCashFlowItemResponseSchema;
|
|
21
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
22
|
+
}
|
package/commands/index.ts
CHANGED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { dateRangeCheck, isStatementPeriodWithinLimit } from '../../helpers/date.helper';
|
|
3
|
+
|
|
4
|
+
const GetCashFlowRequestSchema = z
|
|
5
|
+
.object({
|
|
6
|
+
startDate: z.coerce.date(),
|
|
7
|
+
endDate: z.coerce.date(),
|
|
8
|
+
moneyAccountUUID: z.string().optional(),
|
|
9
|
+
// Разбивка оборотов по месяцам внутри периода.
|
|
10
|
+
// Не z.coerce.boolean(): в query-строке приходит текст, и Boolean('false') === true —
|
|
11
|
+
// флаг было бы невозможно выключить явным значением.
|
|
12
|
+
withMonthBreakdown: z
|
|
13
|
+
.union([z.boolean(), z.string()])
|
|
14
|
+
.optional()
|
|
15
|
+
.default(false)
|
|
16
|
+
.transform(value => (typeof value === 'boolean' ? value : value === 'true' || value === '1')),
|
|
17
|
+
})
|
|
18
|
+
.refine(value => dateRangeCheck(value.startDate, value.endDate), {
|
|
19
|
+
message: 'validation.dateRange',
|
|
20
|
+
path: ['endDate', 'startDate'],
|
|
21
|
+
})
|
|
22
|
+
.refine(value => isStatementPeriodWithinLimit(value.startDate, value.endDate), {
|
|
23
|
+
message: 'validation.reportPeriodMax',
|
|
24
|
+
path: ['endDate', 'startDate'],
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const CashFlowItemRowSchema = z.object({
|
|
28
|
+
// null — строка "Без статьи": платежи, которым статью ещё не проставили.
|
|
29
|
+
cashFlowItemUUID: z.string().nullable(),
|
|
30
|
+
cashFlowItemName: z.string().nullable(),
|
|
31
|
+
income: z.number(),
|
|
32
|
+
expense: z.number(),
|
|
33
|
+
transactionCount: z.number(),
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const CashFlowMonthRowSchema = CashFlowItemRowSchema.extend({
|
|
37
|
+
month: z.string(),
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const GetCashFlowResponseSchema = z.object({
|
|
41
|
+
message: z.string().optional(),
|
|
42
|
+
data: z.object({
|
|
43
|
+
byItem: CashFlowItemRowSchema.array(),
|
|
44
|
+
byMonth: CashFlowMonthRowSchema.array(),
|
|
45
|
+
totals: z.object({
|
|
46
|
+
income: z.number(),
|
|
47
|
+
expense: z.number(),
|
|
48
|
+
total: z.number(),
|
|
49
|
+
}),
|
|
50
|
+
}),
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
export namespace GetCashFlowContractQuery {
|
|
54
|
+
export const RequestSchema = GetCashFlowRequestSchema;
|
|
55
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
56
|
+
|
|
57
|
+
export const ResponseSchema = GetCashFlowResponseSchema;
|
|
58
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
59
|
+
}
|
package/commands/report/index.ts
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
const AssignCashFlowItemToTransactionsRequestSchema = z.object({
|
|
4
|
+
transactionUUIDs: z.uuid().array().min(1).max(500),
|
|
5
|
+
// null снимает статью с выбранных платежей.
|
|
6
|
+
cashFlowItemUUID: z.uuid().nullable(),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
const AssignCashFlowItemToTransactionsResponseSchema = z.object({
|
|
10
|
+
message: z.string().optional(),
|
|
11
|
+
data: z.object({
|
|
12
|
+
updated: z.number(),
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export namespace AssignCashFlowItemToTransactionsContractCommand {
|
|
17
|
+
export const RequestSchema = AssignCashFlowItemToTransactionsRequestSchema;
|
|
18
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
19
|
+
|
|
20
|
+
export const ResponseSchema = AssignCashFlowItemToTransactionsResponseSchema;
|
|
21
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
22
|
+
}
|
|
@@ -10,6 +10,8 @@ const CreateTransactionRequestSchema = TransactionSchema.pick({
|
|
|
10
10
|
type: true,
|
|
11
11
|
}).extend({
|
|
12
12
|
createdAt: z.coerce.date().optional(),
|
|
13
|
+
// Статья необязательна: система помогает разметить расходы, а не требует этого при оплате.
|
|
14
|
+
cashFlowItemUUID: z.uuid().nullable().optional(),
|
|
13
15
|
});
|
|
14
16
|
|
|
15
17
|
const CreateTransactionResponseSchema = z.object({
|
|
@@ -10,6 +10,7 @@ const GetTransactionSummaryRequestSchema = z
|
|
|
10
10
|
moneyAccountUUID: z.string().optional(),
|
|
11
11
|
clientUUID: z.string().optional(),
|
|
12
12
|
orderUUID: z.string().optional(),
|
|
13
|
+
cashFlowItemUUID: z.string().optional(),
|
|
13
14
|
searchQuery: z.string().optional(),
|
|
14
15
|
})
|
|
15
16
|
.refine(
|
|
@@ -11,3 +11,4 @@ export * from './get-transaction-summary.query';
|
|
|
11
11
|
export * from './generate-pre-payment-check.command';
|
|
12
12
|
export * from './apply-prepayment-transaction.command';
|
|
13
13
|
export * from './import-transaction.command';
|
|
14
|
+
export * from './assign-cash-flow-item-to-transactions.command';
|
|
@@ -5,6 +5,8 @@ const UpdateTransactionRequestSchema = TransactionSchema.pick({
|
|
|
5
5
|
comment: true,
|
|
6
6
|
}).extend({
|
|
7
7
|
createdAt: z.coerce.date(),
|
|
8
|
+
// Проставить/сменить статью можно задним числом — основной способ разметки расходов.
|
|
9
|
+
cashFlowItemUUID: z.uuid().nullable().optional(),
|
|
8
10
|
});
|
|
9
11
|
|
|
10
12
|
const UpdateTransactionResponseSchema = z.object({
|
package/constant/error.ts
CHANGED
|
@@ -1435,4 +1435,26 @@ export const ERRORS = {
|
|
|
1435
1435
|
CONSIGNMENT_TRANSFER_ACCEPT_FAILED: { code: 'CTR013', message: 'Failed to accept consignment transfer request', httpCode: 500 },
|
|
1436
1436
|
ACCESS_POLICY_FETCH_FAILED: { code: 'AP001', message: 'Error when retrieving the access policy', httpCode: 500 },
|
|
1437
1437
|
ACCESS_POLICY_NOT_UPDATED: { code: 'AP002', message: 'Failed to update the access policy', httpCode: 500 },
|
|
1438
|
+
CASH_FLOW_ITEM_NOT_CREATED: { code: 'CFI001', message: 'Failed to create cash flow item', httpCode: 500 },
|
|
1439
|
+
CASH_FLOW_ITEM_NOT_UPDATED: { code: 'CFI002', message: 'Failed to update cash flow item', httpCode: 500 },
|
|
1440
|
+
CASH_FLOW_ITEM_NOT_DELETED: { code: 'CFI003', message: 'Failed to delete cash flow item', httpCode: 500 },
|
|
1441
|
+
CASH_FLOW_ITEM_NOT_FOUND: { code: 'CFI004', message: 'The cash flow item with the specified UUID was not found', httpCode: 404 },
|
|
1442
|
+
CASH_FLOW_ITEM_FETCH_FAILED: { code: 'CFI005', message: 'Error when retrieving cash flow items', httpCode: 500 },
|
|
1443
|
+
CASH_FLOW_ITEM_WITH_SAME_NAME_ALREADY_EXISTS: {
|
|
1444
|
+
code: 'CFI006',
|
|
1445
|
+
message: 'The cash flow item with the specified name already exists',
|
|
1446
|
+
httpCode: 400,
|
|
1447
|
+
},
|
|
1448
|
+
CASH_FLOW_ITEM_IN_USE: {
|
|
1449
|
+
code: 'CFI007',
|
|
1450
|
+
message: 'The cash flow item is referenced by transactions and cannot be deleted, archive it instead',
|
|
1451
|
+
httpCode: 409,
|
|
1452
|
+
},
|
|
1453
|
+
CASH_FLOW_ITEM_IS_ARCHIVED: { code: 'CFI008', message: 'The cash flow item is archived', httpCode: 400 },
|
|
1454
|
+
CASH_FLOW_REPORT_FAILED: { code: 'CFI009', message: 'Failed to build cash flow report', httpCode: 500 },
|
|
1455
|
+
TRANSACTIONS_CASH_FLOW_ITEM_NOT_ASSIGNED: {
|
|
1456
|
+
code: 'CFI010',
|
|
1457
|
+
message: 'Failed to assign cash flow item to transactions',
|
|
1458
|
+
httpCode: 500,
|
|
1459
|
+
},
|
|
1438
1460
|
} as const;
|
package/enum/index.ts
CHANGED
|
@@ -9,6 +9,14 @@ export enum PermissionKeyEnum {
|
|
|
9
9
|
COST_VIEW = 'cost.view',
|
|
10
10
|
// Consignment-level financial totals: total cost + profit (итоги по поставке).
|
|
11
11
|
CONSIGNMENT_FINANCIALS_VIEW = 'consignment.financials.view',
|
|
12
|
+
PAGE_ORDER_VIEW = 'page.order.view',
|
|
13
|
+
PAGE_STOCK_VIEW = 'page.stock.view',
|
|
14
|
+
PAGE_CLIENTS_VIEW = 'page.clients.view',
|
|
15
|
+
PAGE_PAYMENTS_VIEW = 'page.payments.view',
|
|
16
|
+
PAGE_CATEGORIES_VIEW = 'page.categories.view',
|
|
17
|
+
PAGE_PRE_ORDERS_VIEW = 'page.pre_orders.view',
|
|
18
|
+
PAGE_REPORT_VIEW = 'page.report.view',
|
|
19
|
+
PAGE_STAFF_VIEW = 'page.staff.view',
|
|
12
20
|
}
|
|
13
21
|
|
|
14
22
|
export const PERMISSION_KEY_LIST: PermissionKeyEnum[] = [
|
|
@@ -20,4 +28,12 @@ export const PERMISSION_KEY_LIST: PermissionKeyEnum[] = [
|
|
|
20
28
|
PermissionKeyEnum.CONSIGNMENT_DELETE,
|
|
21
29
|
PermissionKeyEnum.COST_VIEW,
|
|
22
30
|
PermissionKeyEnum.CONSIGNMENT_FINANCIALS_VIEW,
|
|
31
|
+
PermissionKeyEnum.PAGE_ORDER_VIEW,
|
|
32
|
+
PermissionKeyEnum.PAGE_STOCK_VIEW,
|
|
33
|
+
PermissionKeyEnum.PAGE_CLIENTS_VIEW,
|
|
34
|
+
PermissionKeyEnum.PAGE_PAYMENTS_VIEW,
|
|
35
|
+
PermissionKeyEnum.PAGE_CATEGORIES_VIEW,
|
|
36
|
+
PermissionKeyEnum.PAGE_PRE_ORDERS_VIEW,
|
|
37
|
+
PermissionKeyEnum.PAGE_REPORT_VIEW,
|
|
38
|
+
PermissionKeyEnum.PAGE_STAFF_VIEW,
|
|
23
39
|
];
|
|
@@ -5,5 +5,7 @@ export enum TransactionImportErrorsEnum {
|
|
|
5
5
|
CLIENT_AMBIGUOUS = 'CLIENT_AMBIGUOUS',
|
|
6
6
|
MONEY_ACCOUNT_NOT_FOUND = 'MONEY_ACCOUNT_NOT_FOUND',
|
|
7
7
|
MONEY_ACCOUNT_AMBIGUOUS = 'MONEY_ACCOUNT_AMBIGUOUS',
|
|
8
|
+
CASH_FLOW_ITEM_NOT_FOUND = 'CASH_FLOW_ITEM_NOT_FOUND',
|
|
9
|
+
CASH_FLOW_ITEM_AMBIGUOUS = 'CASH_FLOW_ITEM_AMBIGUOUS',
|
|
8
10
|
CREATE_FAILED = 'CREATE_FAILED',
|
|
9
11
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { CashFlowItemStatusEnum } from '../../enum/cash-flow-item-status.enum';
|
|
3
|
+
|
|
4
|
+
export const CashFlowItemSchema = z.object({
|
|
5
|
+
uuid: z.uuid(),
|
|
6
|
+
companyUUID: z.string(),
|
|
7
|
+
name: z.string(),
|
|
8
|
+
status: z.nativeEnum(CashFlowItemStatusEnum),
|
|
9
|
+
sortOrder: z.number(),
|
|
10
|
+
createdAt: z.date(),
|
|
11
|
+
updatedAt: z.date(),
|
|
12
|
+
});
|
package/schemas/index.ts
CHANGED
|
@@ -16,6 +16,7 @@ export * from './order-product/price-correction-analyze-item.schema';
|
|
|
16
16
|
export * from './order-product/price-correction-execute-result-item.schema';
|
|
17
17
|
export * from './transaction/transaction.schema';
|
|
18
18
|
export * from './transaction/transaction-list.schema';
|
|
19
|
+
export * from './cash-flow-item/cash-flow-item.schema';
|
|
19
20
|
export * from './file';
|
|
20
21
|
export * from './product-image/product-image.schema';
|
|
21
22
|
export * from './settings/settings.schema';
|