@floristcloud/api-lib 1.0.41 → 1.0.47
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/bank-payment/apply-bank-payment-event.command.js +18 -0
- package/build/commands/bank-payment/get-bank-payment-match-suggestions.query.js +12 -0
- package/build/commands/bank-payment/index.js +2 -0
- package/build/commands/bank-payment-rule/create-bank-payment-rule.command.js +22 -0
- package/build/commands/bank-payment-rule/delete-bank-payment-rule.command.js +14 -0
- package/build/commands/bank-payment-rule/get-bank-payment-rule-list.query.js +18 -0
- package/build/commands/bank-payment-rule/get-bank-payment-rule.query.js +13 -0
- package/build/commands/bank-payment-rule/index.js +21 -0
- package/build/commands/bank-payment-rule/update-bank-payment-rule.command.js +22 -0
- package/build/commands/client-payment-identifier/create-client-payment-identifier.command.js +22 -0
- package/build/commands/client-payment-identifier/delete-client-payment-identifier.command.js +14 -0
- package/build/commands/client-payment-identifier/get-client-payment-identifier-list.query.js +27 -0
- package/build/commands/client-payment-identifier/index.js +19 -0
- package/build/constant/error.js +43 -12
- package/build/enum/index.js +1 -0
- package/build/enum/match-confidence.enum.js +9 -0
- package/build/schemas/bank-payment/get-bank-payment-match-suggestions.schema.js +18 -0
- package/build/schemas/bank-payment-rule/bank-payment-rule.schema.js +19 -0
- package/build/schemas/client-payment-identifier/client-payment-identifier.schema.js +20 -0
- package/build/schemas/index.js +3 -0
- package/commands/bank-payment/apply-bank-payment-event.command.ts +20 -0
- package/commands/bank-payment/get-bank-payment-match-suggestions.query.ts +15 -0
- package/commands/bank-payment/index.ts +2 -0
- package/commands/bank-payment-rule/create-bank-payment-rule.command.ts +24 -0
- package/commands/bank-payment-rule/delete-bank-payment-rule.command.ts +13 -0
- package/commands/bank-payment-rule/get-bank-payment-rule-list.query.ts +20 -0
- package/commands/bank-payment-rule/get-bank-payment-rule.query.ts +12 -0
- package/commands/bank-payment-rule/index.ts +5 -0
- package/commands/bank-payment-rule/update-bank-payment-rule.command.ts +24 -0
- package/commands/client-payment-identifier/create-client-payment-identifier.command.ts +24 -0
- package/commands/client-payment-identifier/delete-client-payment-identifier.command.ts +13 -0
- package/commands/client-payment-identifier/get-client-payment-identifier-list.query.ts +28 -0
- package/commands/client-payment-identifier/index.ts +3 -0
- package/constant/error.ts +46 -12
- package/enum/index.ts +1 -0
- package/enum/match-confidence.enum.ts +5 -0
- package/package.json +1 -1
- package/schemas/bank-payment/get-bank-payment-match-suggestions.schema.ts +18 -0
- package/schemas/bank-payment-rule/bank-payment-rule.schema.ts +18 -0
- package/schemas/client-payment-identifier/client-payment-identifier.schema.ts +19 -0
- package/schemas/index.ts +3 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApplyBankPaymentEventContractCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const ApplyBankPaymentEventRequestSchema = zod_1.z.object({
|
|
6
|
+
clientUUID: zod_1.z.uuid().optional().nullable(),
|
|
7
|
+
orderUUID: zod_1.z.uuid().optional().nullable(),
|
|
8
|
+
moneyAccountUUID: zod_1.z.uuid().optional().nullable(),
|
|
9
|
+
});
|
|
10
|
+
const ApplyBankPaymentEventResponseSchema = zod_1.z.object({
|
|
11
|
+
transactionUUID: zod_1.z.uuid().optional().nullable(),
|
|
12
|
+
appliedAt: zod_1.z.date(),
|
|
13
|
+
});
|
|
14
|
+
var ApplyBankPaymentEventContractCommand;
|
|
15
|
+
(function (ApplyBankPaymentEventContractCommand) {
|
|
16
|
+
ApplyBankPaymentEventContractCommand.RequestSchema = ApplyBankPaymentEventRequestSchema;
|
|
17
|
+
ApplyBankPaymentEventContractCommand.ResponseSchema = ApplyBankPaymentEventResponseSchema;
|
|
18
|
+
})(ApplyBankPaymentEventContractCommand || (exports.ApplyBankPaymentEventContractCommand = ApplyBankPaymentEventContractCommand = {}));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetBankPaymentMatchSuggestionsContractQuery = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const get_bank_payment_match_suggestions_schema_1 = require("../../schemas/bank-payment/get-bank-payment-match-suggestions.schema");
|
|
6
|
+
var GetBankPaymentMatchSuggestionsContractQuery;
|
|
7
|
+
(function (GetBankPaymentMatchSuggestionsContractQuery) {
|
|
8
|
+
GetBankPaymentMatchSuggestionsContractQuery.RequestSchema = get_bank_payment_match_suggestions_schema_1.GetBankPaymentMatchSuggestionsRequestSchema;
|
|
9
|
+
GetBankPaymentMatchSuggestionsContractQuery.ResponseSchema = zod_1.z.object({
|
|
10
|
+
data: get_bank_payment_match_suggestions_schema_1.GetBankPaymentMatchSuggestionsResponseSchema,
|
|
11
|
+
});
|
|
12
|
+
})(GetBankPaymentMatchSuggestionsContractQuery || (exports.GetBankPaymentMatchSuggestionsContractQuery = GetBankPaymentMatchSuggestionsContractQuery = {}));
|
|
@@ -16,3 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./get-bank-payment-list.query"), exports);
|
|
18
18
|
__exportStar(require("./update-bank-payment-status.query"), exports);
|
|
19
|
+
__exportStar(require("./get-bank-payment-match-suggestions.query"), exports);
|
|
20
|
+
__exportStar(require("./apply-bank-payment-event.command"), exports);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateBankPaymentRuleContractCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const bank_payment_rule_match_type_enum_1 = require("../../enum/bank-payment-rule-match-type.enum");
|
|
6
|
+
const bank_payment_rule_schema_1 = require("../../schemas/bank-payment-rule/bank-payment-rule.schema");
|
|
7
|
+
const CreateBankPaymentRuleRequestSchema = zod_1.z.object({
|
|
8
|
+
priority: zod_1.z.number().int().min(0).max(1000),
|
|
9
|
+
enabled: zod_1.z.boolean().default(true),
|
|
10
|
+
matchType: zod_1.z.nativeEnum(bank_payment_rule_match_type_enum_1.BankPaymentRuleMatchTypeEnum),
|
|
11
|
+
pattern: zod_1.z.string().min(1).max(500),
|
|
12
|
+
moneyAccountUUID: zod_1.z.uuid(),
|
|
13
|
+
});
|
|
14
|
+
const CreateBankPaymentRuleResponseSchema = zod_1.z.object({
|
|
15
|
+
message: zod_1.z.string().optional(),
|
|
16
|
+
data: bank_payment_rule_schema_1.BankPaymentRuleSchema,
|
|
17
|
+
});
|
|
18
|
+
var CreateBankPaymentRuleContractCommand;
|
|
19
|
+
(function (CreateBankPaymentRuleContractCommand) {
|
|
20
|
+
CreateBankPaymentRuleContractCommand.RequestSchema = CreateBankPaymentRuleRequestSchema;
|
|
21
|
+
CreateBankPaymentRuleContractCommand.ResponseSchema = CreateBankPaymentRuleResponseSchema;
|
|
22
|
+
})(CreateBankPaymentRuleContractCommand || (exports.CreateBankPaymentRuleContractCommand = CreateBankPaymentRuleContractCommand = {}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteBankPaymentRuleContractCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const DeleteBankPaymentRuleResponseSchema = zod_1.z.object({
|
|
6
|
+
message: zod_1.z.string().optional(),
|
|
7
|
+
data: zod_1.z.object({
|
|
8
|
+
success: zod_1.z.boolean(),
|
|
9
|
+
}),
|
|
10
|
+
});
|
|
11
|
+
var DeleteBankPaymentRuleContractCommand;
|
|
12
|
+
(function (DeleteBankPaymentRuleContractCommand) {
|
|
13
|
+
DeleteBankPaymentRuleContractCommand.ResponseSchema = DeleteBankPaymentRuleResponseSchema;
|
|
14
|
+
})(DeleteBankPaymentRuleContractCommand || (exports.DeleteBankPaymentRuleContractCommand = DeleteBankPaymentRuleContractCommand = {}));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetBankPaymentRuleListContractQuery = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const bank_payment_rule_schema_1 = require("../../schemas/bank-payment-rule/bank-payment-rule.schema");
|
|
6
|
+
const GetBankPaymentRuleListRequestSchema = zod_1.z.object({
|
|
7
|
+
page: zod_1.z.coerce.number().int().positive().default(1),
|
|
8
|
+
count: zod_1.z.coerce.number().int().positive().default(10),
|
|
9
|
+
});
|
|
10
|
+
const GetBankPaymentRuleListResponseSchema = zod_1.z.object({
|
|
11
|
+
message: zod_1.z.string().optional(),
|
|
12
|
+
data: bank_payment_rule_schema_1.BankPaymentRuleListSchema,
|
|
13
|
+
});
|
|
14
|
+
var GetBankPaymentRuleListContractQuery;
|
|
15
|
+
(function (GetBankPaymentRuleListContractQuery) {
|
|
16
|
+
GetBankPaymentRuleListContractQuery.RequestSchema = GetBankPaymentRuleListRequestSchema;
|
|
17
|
+
GetBankPaymentRuleListContractQuery.ResponseSchema = GetBankPaymentRuleListResponseSchema;
|
|
18
|
+
})(GetBankPaymentRuleListContractQuery || (exports.GetBankPaymentRuleListContractQuery = GetBankPaymentRuleListContractQuery = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetBankPaymentRuleContractQuery = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const bank_payment_rule_schema_1 = require("../../schemas/bank-payment-rule/bank-payment-rule.schema");
|
|
6
|
+
const GetBankPaymentRuleResponseSchema = zod_1.z.object({
|
|
7
|
+
message: zod_1.z.string().optional(),
|
|
8
|
+
data: bank_payment_rule_schema_1.BankPaymentRuleSchema,
|
|
9
|
+
});
|
|
10
|
+
var GetBankPaymentRuleContractQuery;
|
|
11
|
+
(function (GetBankPaymentRuleContractQuery) {
|
|
12
|
+
GetBankPaymentRuleContractQuery.ResponseSchema = GetBankPaymentRuleResponseSchema;
|
|
13
|
+
})(GetBankPaymentRuleContractQuery || (exports.GetBankPaymentRuleContractQuery = GetBankPaymentRuleContractQuery = {}));
|
|
@@ -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-bank-payment-rule.command"), exports);
|
|
18
|
+
__exportStar(require("./update-bank-payment-rule.command"), exports);
|
|
19
|
+
__exportStar(require("./delete-bank-payment-rule.command"), exports);
|
|
20
|
+
__exportStar(require("./get-bank-payment-rule-list.query"), exports);
|
|
21
|
+
__exportStar(require("./get-bank-payment-rule.query"), exports);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateBankPaymentRuleContractCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const bank_payment_rule_match_type_enum_1 = require("../../enum/bank-payment-rule-match-type.enum");
|
|
6
|
+
const bank_payment_rule_schema_1 = require("../../schemas/bank-payment-rule/bank-payment-rule.schema");
|
|
7
|
+
const UpdateBankPaymentRuleRequestSchema = zod_1.z.object({
|
|
8
|
+
priority: zod_1.z.number().int().min(0).max(1000).optional(),
|
|
9
|
+
enabled: zod_1.z.boolean().optional(),
|
|
10
|
+
matchType: zod_1.z.nativeEnum(bank_payment_rule_match_type_enum_1.BankPaymentRuleMatchTypeEnum).optional(),
|
|
11
|
+
pattern: zod_1.z.string().min(1).max(500).optional(),
|
|
12
|
+
moneyAccountUUID: zod_1.z.uuid().optional(),
|
|
13
|
+
});
|
|
14
|
+
const UpdateBankPaymentRuleResponseSchema = zod_1.z.object({
|
|
15
|
+
message: zod_1.z.string().optional(),
|
|
16
|
+
data: bank_payment_rule_schema_1.BankPaymentRuleSchema,
|
|
17
|
+
});
|
|
18
|
+
var UpdateBankPaymentRuleContractCommand;
|
|
19
|
+
(function (UpdateBankPaymentRuleContractCommand) {
|
|
20
|
+
UpdateBankPaymentRuleContractCommand.RequestSchema = UpdateBankPaymentRuleRequestSchema;
|
|
21
|
+
UpdateBankPaymentRuleContractCommand.ResponseSchema = UpdateBankPaymentRuleResponseSchema;
|
|
22
|
+
})(UpdateBankPaymentRuleContractCommand || (exports.UpdateBankPaymentRuleContractCommand = UpdateBankPaymentRuleContractCommand = {}));
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateClientPaymentIdentifierContractCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const bank_provider_enum_1 = require("../../enum/bank-provider.enum");
|
|
6
|
+
const schemas_1 = require("../../schemas");
|
|
7
|
+
const CreateClientPaymentIdentifierRequestSchema = zod_1.z.object({
|
|
8
|
+
clientUUID: zod_1.z.uuid(),
|
|
9
|
+
provider: zod_1.z.nativeEnum(bank_provider_enum_1.BankProviderEnum),
|
|
10
|
+
identifierKey: zod_1.z.string().min(1).max(100),
|
|
11
|
+
identifierValue: zod_1.z.string().min(1).max(255),
|
|
12
|
+
description: zod_1.z.string().max(500).optional(),
|
|
13
|
+
});
|
|
14
|
+
const CreateClientPaymentIdentifierResponseSchema = zod_1.z.object({
|
|
15
|
+
message: zod_1.z.string().optional(),
|
|
16
|
+
data: schemas_1.ClientPaymentIdentifierSchema,
|
|
17
|
+
});
|
|
18
|
+
var CreateClientPaymentIdentifierContractCommand;
|
|
19
|
+
(function (CreateClientPaymentIdentifierContractCommand) {
|
|
20
|
+
CreateClientPaymentIdentifierContractCommand.RequestSchema = CreateClientPaymentIdentifierRequestSchema;
|
|
21
|
+
CreateClientPaymentIdentifierContractCommand.ResponseSchema = CreateClientPaymentIdentifierResponseSchema;
|
|
22
|
+
})(CreateClientPaymentIdentifierContractCommand || (exports.CreateClientPaymentIdentifierContractCommand = CreateClientPaymentIdentifierContractCommand = {}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteClientPaymentIdentifierContractCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const DeleteClientPaymentIdentifierResponseSchema = zod_1.z.object({
|
|
6
|
+
message: zod_1.z.string().optional(),
|
|
7
|
+
data: zod_1.z.object({
|
|
8
|
+
success: zod_1.z.boolean(),
|
|
9
|
+
}),
|
|
10
|
+
});
|
|
11
|
+
var DeleteClientPaymentIdentifierContractCommand;
|
|
12
|
+
(function (DeleteClientPaymentIdentifierContractCommand) {
|
|
13
|
+
DeleteClientPaymentIdentifierContractCommand.ResponseSchema = DeleteClientPaymentIdentifierResponseSchema;
|
|
14
|
+
})(DeleteClientPaymentIdentifierContractCommand || (exports.DeleteClientPaymentIdentifierContractCommand = DeleteClientPaymentIdentifierContractCommand = {}));
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetClientPaymentIdentifierListContractQuery = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const schemas_1 = require("../../schemas");
|
|
6
|
+
const bank_provider_enum_1 = require("../../enum/bank-provider.enum");
|
|
7
|
+
const GetClientPaymentIdentifierListRequestSchema = zod_1.z.object({
|
|
8
|
+
clientUUID: zod_1.z.uuid().optional(),
|
|
9
|
+
provider: zod_1.z.nativeEnum(bank_provider_enum_1.BankProviderEnum).optional(),
|
|
10
|
+
isActive: zod_1.z
|
|
11
|
+
.string()
|
|
12
|
+
.optional()
|
|
13
|
+
.transform(val => {
|
|
14
|
+
if (val === undefined)
|
|
15
|
+
return undefined;
|
|
16
|
+
return val === 'true';
|
|
17
|
+
}),
|
|
18
|
+
});
|
|
19
|
+
const GetClientPaymentIdentifierListResponseSchema = zod_1.z.object({
|
|
20
|
+
message: zod_1.z.string().optional(),
|
|
21
|
+
data: schemas_1.ClientPaymentIdentifierListSchema,
|
|
22
|
+
});
|
|
23
|
+
var GetClientPaymentIdentifierListContractQuery;
|
|
24
|
+
(function (GetClientPaymentIdentifierListContractQuery) {
|
|
25
|
+
GetClientPaymentIdentifierListContractQuery.RequestSchema = GetClientPaymentIdentifierListRequestSchema;
|
|
26
|
+
GetClientPaymentIdentifierListContractQuery.ResponseSchema = GetClientPaymentIdentifierListResponseSchema;
|
|
27
|
+
})(GetClientPaymentIdentifierListContractQuery || (exports.GetClientPaymentIdentifierListContractQuery = GetClientPaymentIdentifierListContractQuery = {}));
|
|
@@ -0,0 +1,19 @@
|
|
|
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-client-payment-identifier.command"), exports);
|
|
18
|
+
__exportStar(require("./delete-client-payment-identifier.command"), exports);
|
|
19
|
+
__exportStar(require("./get-client-payment-identifier-list.query"), exports);
|
package/build/constant/error.js
CHANGED
|
@@ -402,22 +402,53 @@ exports.ERRORS = {
|
|
|
402
402
|
TRANSACTION_FETCH_SUM_FAILED: { code: 'TR009', message: 'Failed get sum transaction', httpCode: 500 },
|
|
403
403
|
TRANSACTION_AMOUNT_NEGATIVE: { code: 'TR010', message: 'Transaction amount is negative', httpCode: 400 },
|
|
404
404
|
TRANSACTION_NOT_APPLIED: { code: 'TR011', message: 'Transaction not applied', httpCode: 500 },
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
405
|
+
MONEY_ACCOUNT_REQUIRED: { code: 'TR012', message: 'moneyAccountUUID is required to apply bank payment event', httpCode: 400 },
|
|
406
|
+
TRANSACTION_CREATE_FAILED: { code: 'TR013', message: 'Failed to create transaction', httpCode: 500 },
|
|
407
|
+
// CLIENT_PAYMENT_IDENTIFIER
|
|
408
|
+
CLIENT_PAYMENT_IDENTIFIER_NOT_CREATED: { code: 'CPI001', message: 'Failed to create client payment identifier', httpCode: 500 },
|
|
409
|
+
CLIENT_PAYMENT_IDENTIFIER_NOT_DELETED: { code: 'CPI002', message: 'Failed to delete client payment identifier', httpCode: 500 },
|
|
410
|
+
CLIENT_PAYMENT_IDENTIFIER_NOT_FOUND: { code: 'CPI003', message: 'Client payment identifier not found', httpCode: 404 },
|
|
411
|
+
CLIENT_PAYMENT_IDENTIFIER_ALREADY_EXISTS: {
|
|
412
|
+
code: 'CPI004',
|
|
413
|
+
message: 'Client payment identifier with this provider, key and value already exists',
|
|
414
|
+
httpCode: 409,
|
|
415
|
+
},
|
|
416
|
+
CLIENT_PAYMENT_IDENTIFIER_FETCH_FAILED: {
|
|
417
|
+
code: 'CPI005',
|
|
418
|
+
message: 'Failed to fetch client payment identifiers',
|
|
419
|
+
httpCode: 500,
|
|
420
|
+
},
|
|
421
|
+
// BANK_PAYMENT_RULE
|
|
422
|
+
BANK_PAYMENT_RULE_NOT_FOUND: { code: 'BPR001', message: 'Bank payment rule not found', httpCode: 404 },
|
|
423
|
+
BANK_PAYMENT_RULE_NOT_CREATED: { code: 'BPR002', message: 'Failed to create bank payment rule', httpCode: 500 },
|
|
424
|
+
BANK_PAYMENT_RULE_NOT_UPDATED: { code: 'BPR003', message: 'Failed to update bank payment rule', httpCode: 500 },
|
|
425
|
+
BANK_PAYMENT_RULE_NOT_DELETED: { code: 'BPR004', message: 'Failed to delete bank payment rule', httpCode: 500 },
|
|
426
|
+
BANK_PAYMENT_RULE_PRIORITY_CONFLICT: {
|
|
427
|
+
code: 'BPR005',
|
|
428
|
+
message: 'A bank payment rule with the same priority already exists',
|
|
429
|
+
httpCode: 409,
|
|
430
|
+
},
|
|
431
|
+
BANK_PAYMENT_RULE_FETCH_FAILED: { code: 'BPR006', message: 'Failed to fetch bank payment rules', httpCode: 500 },
|
|
432
|
+
// BANK_PAYMENT_EVENT
|
|
433
|
+
BANK_EVENT_NOT_FOUND: { code: 'BPE001', message: 'Bank payment event not found', httpCode: 404 },
|
|
434
|
+
BANK_EVENT_LIST_FAILED: { code: 'BPE002', message: 'Error when retrieving bank payment events list', httpCode: 500 },
|
|
435
|
+
BANK_EVENT_GET_FAILED: { code: 'BPE003', message: 'Error when retrieving bank payment event', httpCode: 500 },
|
|
436
|
+
BANK_EVENT_FETCH_FAILED: { code: 'BPE004', message: 'Failed to fetch bank payment event', httpCode: 500 },
|
|
437
|
+
BANK_EVENT_UPSERT_FAILED: { code: 'BPE005', message: 'Failed to upsert bank payment event', httpCode: 500 },
|
|
438
|
+
BANK_EVENT_UNSUPPORTED_STATUS: { code: 'BPE006', message: 'Unsupported bank payment event status', httpCode: 400 },
|
|
439
|
+
BANK_EVENT_ALREADY_APPLIED: { code: 'BPE007', message: 'Bank payment event already applied', httpCode: 400 },
|
|
440
|
+
BANK_EVENT_UPDATE_STATUS_FAILED: { code: 'BPE008', message: 'Failed to update bank payment event status', httpCode: 500 },
|
|
414
441
|
BANK_EVENT_NOT_FOUND_OR_NOT_NEW: {
|
|
415
|
-
code: '
|
|
442
|
+
code: 'BPE009',
|
|
416
443
|
message: 'Bank payment event not found or not in NEW status',
|
|
417
444
|
httpCode: 400,
|
|
418
445
|
},
|
|
419
|
-
|
|
420
|
-
|
|
446
|
+
BANK_PAYMENT_APPLY_FAILED: { code: 'BPE010', message: 'Failed to apply bank payment event', httpCode: 500 },
|
|
447
|
+
BANK_EVENT_MATCH_SUGGESTIONS_FAILED: {
|
|
448
|
+
code: 'BPE011',
|
|
449
|
+
message: 'Failed to get match suggestions for bank payment event',
|
|
450
|
+
httpCode: 500,
|
|
451
|
+
},
|
|
421
452
|
// EXCEL
|
|
422
453
|
EXCEL_CREATE_FAILED: { code: 'E001', message: 'Failed to create excel', httpCode: 500 },
|
|
423
454
|
EXCEL_GET_DATA_BY_BUFFER_FAILED: { code: 'E002', message: 'Failed to get buffer', httpCode: 500 },
|
package/build/enum/index.js
CHANGED
|
@@ -77,3 +77,4 @@ __exportStar(require("./order-webshop-available-status-list"), exports);
|
|
|
77
77
|
__exportStar(require("./transaction-type-groups"), exports);
|
|
78
78
|
__exportStar(require("./chat-has-manager-mode.enum"), exports);
|
|
79
79
|
__exportStar(require("./chat-no-manager-mode.enum"), exports);
|
|
80
|
+
__exportStar(require("./match-confidence.enum"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MatchConfidenceEnum = void 0;
|
|
4
|
+
var MatchConfidenceEnum;
|
|
5
|
+
(function (MatchConfidenceEnum) {
|
|
6
|
+
MatchConfidenceEnum["HIGH"] = "HIGH";
|
|
7
|
+
MatchConfidenceEnum["MEDIUM"] = "MEDIUM";
|
|
8
|
+
MatchConfidenceEnum["LOW"] = "LOW";
|
|
9
|
+
})(MatchConfidenceEnum || (exports.MatchConfidenceEnum = MatchConfidenceEnum = {}));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetBankPaymentMatchSuggestionsResponseSchema = exports.GetBankPaymentMatchSuggestionsRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.GetBankPaymentMatchSuggestionsRequestSchema = zod_1.z.object({
|
|
6
|
+
eventUUID: zod_1.z.uuid(),
|
|
7
|
+
});
|
|
8
|
+
const ClientMatchSuggestionSchema = zod_1.z.object({
|
|
9
|
+
clientUUID: zod_1.z.uuid(),
|
|
10
|
+
clientName: zod_1.z.string(),
|
|
11
|
+
confidence: zod_1.z.enum(['HIGH', 'MEDIUM', 'LOW']),
|
|
12
|
+
matchedBy: zod_1.z.string(),
|
|
13
|
+
matchedValue: zod_1.z.string().optional(),
|
|
14
|
+
suggestedMoneyAccountUUID: zod_1.z.string().uuid().nullable().optional(),
|
|
15
|
+
});
|
|
16
|
+
exports.GetBankPaymentMatchSuggestionsResponseSchema = zod_1.z.object({
|
|
17
|
+
suggestions: zod_1.z.array(ClientMatchSuggestionSchema),
|
|
18
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BankPaymentRuleListSchema = exports.BankPaymentRuleSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const bank_payment_rule_match_type_enum_1 = require("../../enum/bank-payment-rule-match-type.enum");
|
|
6
|
+
exports.BankPaymentRuleSchema = zod_1.z.object({
|
|
7
|
+
uuid: zod_1.z.uuid(),
|
|
8
|
+
priority: zod_1.z.number(),
|
|
9
|
+
enabled: zod_1.z.boolean(),
|
|
10
|
+
matchType: zod_1.z.nativeEnum(bank_payment_rule_match_type_enum_1.BankPaymentRuleMatchTypeEnum),
|
|
11
|
+
pattern: zod_1.z.string(),
|
|
12
|
+
moneyAccountUUID: zod_1.z.uuid(),
|
|
13
|
+
createdAt: zod_1.z.date(),
|
|
14
|
+
updatedAt: zod_1.z.date(),
|
|
15
|
+
});
|
|
16
|
+
exports.BankPaymentRuleListSchema = zod_1.z.object({
|
|
17
|
+
list: exports.BankPaymentRuleSchema.array(),
|
|
18
|
+
total: zod_1.z.number(),
|
|
19
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClientPaymentIdentifierListSchema = exports.ClientPaymentIdentifierSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const bank_provider_enum_1 = require("../../enum/bank-provider.enum");
|
|
6
|
+
exports.ClientPaymentIdentifierSchema = zod_1.z.object({
|
|
7
|
+
uuid: zod_1.z.uuid(),
|
|
8
|
+
clientUUID: zod_1.z.uuid(),
|
|
9
|
+
provider: zod_1.z.nativeEnum(bank_provider_enum_1.BankProviderEnum),
|
|
10
|
+
identifierKey: zod_1.z.string(),
|
|
11
|
+
identifierValue: zod_1.z.string(),
|
|
12
|
+
isActive: zod_1.z.boolean(),
|
|
13
|
+
description: zod_1.z.string().nullable(),
|
|
14
|
+
createdAt: zod_1.z.date(),
|
|
15
|
+
updatedAt: zod_1.z.date(),
|
|
16
|
+
});
|
|
17
|
+
exports.ClientPaymentIdentifierListSchema = zod_1.z.object({
|
|
18
|
+
list: exports.ClientPaymentIdentifierSchema.array(),
|
|
19
|
+
total: zod_1.z.number(),
|
|
20
|
+
});
|
package/build/schemas/index.js
CHANGED
|
@@ -68,6 +68,9 @@ __exportStar(require("./pre-order-collection-item/pre-order-collection-item-mult
|
|
|
68
68
|
__exportStar(require("./message"), exports);
|
|
69
69
|
__exportStar(require("./product-configuration/product-configuration.schema"), exports);
|
|
70
70
|
__exportStar(require("./bank-payment"), exports);
|
|
71
|
+
__exportStar(require("./bank-payment-rule/bank-payment-rule.schema"), exports);
|
|
71
72
|
__exportStar(require("./client"), exports);
|
|
73
|
+
__exportStar(require("./client-payment-identifier/client-payment-identifier.schema"), exports);
|
|
74
|
+
__exportStar(require("./bank-payment/get-bank-payment-match-suggestions.schema"), exports);
|
|
72
75
|
__exportStar(require("./messenger-profile"), exports);
|
|
73
76
|
__exportStar(require("./error-message.schema"), exports);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
const ApplyBankPaymentEventRequestSchema = z.object({
|
|
4
|
+
clientUUID: z.uuid().optional().nullable(),
|
|
5
|
+
orderUUID: z.uuid().optional().nullable(),
|
|
6
|
+
moneyAccountUUID: z.uuid().optional().nullable(),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
const ApplyBankPaymentEventResponseSchema = z.object({
|
|
10
|
+
transactionUUID: z.uuid().optional().nullable(),
|
|
11
|
+
appliedAt: z.date(),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export namespace ApplyBankPaymentEventContractCommand {
|
|
15
|
+
export const RequestSchema = ApplyBankPaymentEventRequestSchema;
|
|
16
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
17
|
+
|
|
18
|
+
export const ResponseSchema = ApplyBankPaymentEventResponseSchema;
|
|
19
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import {
|
|
3
|
+
GetBankPaymentMatchSuggestionsRequestSchema,
|
|
4
|
+
GetBankPaymentMatchSuggestionsResponseSchema,
|
|
5
|
+
} from '../../schemas/bank-payment/get-bank-payment-match-suggestions.schema';
|
|
6
|
+
|
|
7
|
+
export namespace GetBankPaymentMatchSuggestionsContractQuery {
|
|
8
|
+
export const RequestSchema = GetBankPaymentMatchSuggestionsRequestSchema;
|
|
9
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
10
|
+
|
|
11
|
+
export const ResponseSchema = z.object({
|
|
12
|
+
data: GetBankPaymentMatchSuggestionsResponseSchema,
|
|
13
|
+
});
|
|
14
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BankPaymentRuleMatchTypeEnum } from '../../enum/bank-payment-rule-match-type.enum';
|
|
3
|
+
import { BankPaymentRuleSchema } from '../../schemas/bank-payment-rule/bank-payment-rule.schema';
|
|
4
|
+
|
|
5
|
+
const CreateBankPaymentRuleRequestSchema = z.object({
|
|
6
|
+
priority: z.number().int().min(0).max(1000),
|
|
7
|
+
enabled: z.boolean().default(true),
|
|
8
|
+
matchType: z.nativeEnum(BankPaymentRuleMatchTypeEnum),
|
|
9
|
+
pattern: z.string().min(1).max(500),
|
|
10
|
+
moneyAccountUUID: z.uuid(),
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const CreateBankPaymentRuleResponseSchema = z.object({
|
|
14
|
+
message: z.string().optional(),
|
|
15
|
+
data: BankPaymentRuleSchema,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export namespace CreateBankPaymentRuleContractCommand {
|
|
19
|
+
export const RequestSchema = CreateBankPaymentRuleRequestSchema;
|
|
20
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
21
|
+
|
|
22
|
+
export const ResponseSchema = CreateBankPaymentRuleResponseSchema;
|
|
23
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
const DeleteBankPaymentRuleResponseSchema = z.object({
|
|
4
|
+
message: z.string().optional(),
|
|
5
|
+
data: z.object({
|
|
6
|
+
success: z.boolean(),
|
|
7
|
+
}),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export namespace DeleteBankPaymentRuleContractCommand {
|
|
11
|
+
export const ResponseSchema = DeleteBankPaymentRuleResponseSchema;
|
|
12
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BankPaymentRuleListSchema } from '../../schemas/bank-payment-rule/bank-payment-rule.schema';
|
|
3
|
+
|
|
4
|
+
const GetBankPaymentRuleListRequestSchema = z.object({
|
|
5
|
+
page: z.coerce.number().int().positive().default(1),
|
|
6
|
+
count: z.coerce.number().int().positive().default(10),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
const GetBankPaymentRuleListResponseSchema = z.object({
|
|
10
|
+
message: z.string().optional(),
|
|
11
|
+
data: BankPaymentRuleListSchema,
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export namespace GetBankPaymentRuleListContractQuery {
|
|
15
|
+
export const RequestSchema = GetBankPaymentRuleListRequestSchema;
|
|
16
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
17
|
+
|
|
18
|
+
export const ResponseSchema = GetBankPaymentRuleListResponseSchema;
|
|
19
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BankPaymentRuleSchema } from '../../schemas/bank-payment-rule/bank-payment-rule.schema';
|
|
3
|
+
|
|
4
|
+
const GetBankPaymentRuleResponseSchema = z.object({
|
|
5
|
+
message: z.string().optional(),
|
|
6
|
+
data: BankPaymentRuleSchema,
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export namespace GetBankPaymentRuleContractQuery {
|
|
10
|
+
export const ResponseSchema = GetBankPaymentRuleResponseSchema;
|
|
11
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BankPaymentRuleMatchTypeEnum } from '../../enum/bank-payment-rule-match-type.enum';
|
|
3
|
+
import { BankPaymentRuleSchema } from '../../schemas/bank-payment-rule/bank-payment-rule.schema';
|
|
4
|
+
|
|
5
|
+
const UpdateBankPaymentRuleRequestSchema = z.object({
|
|
6
|
+
priority: z.number().int().min(0).max(1000).optional(),
|
|
7
|
+
enabled: z.boolean().optional(),
|
|
8
|
+
matchType: z.nativeEnum(BankPaymentRuleMatchTypeEnum).optional(),
|
|
9
|
+
pattern: z.string().min(1).max(500).optional(),
|
|
10
|
+
moneyAccountUUID: z.uuid().optional(),
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const UpdateBankPaymentRuleResponseSchema = z.object({
|
|
14
|
+
message: z.string().optional(),
|
|
15
|
+
data: BankPaymentRuleSchema,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export namespace UpdateBankPaymentRuleContractCommand {
|
|
19
|
+
export const RequestSchema = UpdateBankPaymentRuleRequestSchema;
|
|
20
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
21
|
+
|
|
22
|
+
export const ResponseSchema = UpdateBankPaymentRuleResponseSchema;
|
|
23
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BankProviderEnum } from '../../enum/bank-provider.enum';
|
|
3
|
+
import { ClientPaymentIdentifierSchema } from '../../schemas';
|
|
4
|
+
|
|
5
|
+
const CreateClientPaymentIdentifierRequestSchema = z.object({
|
|
6
|
+
clientUUID: z.uuid(),
|
|
7
|
+
provider: z.nativeEnum(BankProviderEnum),
|
|
8
|
+
identifierKey: z.string().min(1).max(100),
|
|
9
|
+
identifierValue: z.string().min(1).max(255),
|
|
10
|
+
description: z.string().max(500).optional(),
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const CreateClientPaymentIdentifierResponseSchema = z.object({
|
|
14
|
+
message: z.string().optional(),
|
|
15
|
+
data: ClientPaymentIdentifierSchema,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export namespace CreateClientPaymentIdentifierContractCommand {
|
|
19
|
+
export const RequestSchema = CreateClientPaymentIdentifierRequestSchema;
|
|
20
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
21
|
+
|
|
22
|
+
export const ResponseSchema = CreateClientPaymentIdentifierResponseSchema;
|
|
23
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
const DeleteClientPaymentIdentifierResponseSchema = z.object({
|
|
4
|
+
message: z.string().optional(),
|
|
5
|
+
data: z.object({
|
|
6
|
+
success: z.boolean(),
|
|
7
|
+
}),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export namespace DeleteClientPaymentIdentifierContractCommand {
|
|
11
|
+
export const ResponseSchema = DeleteClientPaymentIdentifierResponseSchema;
|
|
12
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ClientPaymentIdentifierListSchema } from '../../schemas';
|
|
3
|
+
import { BankProviderEnum } from '../../enum/bank-provider.enum';
|
|
4
|
+
|
|
5
|
+
const GetClientPaymentIdentifierListRequestSchema = z.object({
|
|
6
|
+
clientUUID: z.uuid().optional(),
|
|
7
|
+
provider: z.nativeEnum(BankProviderEnum).optional(),
|
|
8
|
+
isActive: z
|
|
9
|
+
.string()
|
|
10
|
+
.optional()
|
|
11
|
+
.transform(val => {
|
|
12
|
+
if (val === undefined) return undefined;
|
|
13
|
+
return val === 'true';
|
|
14
|
+
}),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const GetClientPaymentIdentifierListResponseSchema = z.object({
|
|
18
|
+
message: z.string().optional(),
|
|
19
|
+
data: ClientPaymentIdentifierListSchema,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export namespace GetClientPaymentIdentifierListContractQuery {
|
|
23
|
+
export const RequestSchema = GetClientPaymentIdentifierListRequestSchema;
|
|
24
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
25
|
+
|
|
26
|
+
export const ResponseSchema = GetClientPaymentIdentifierListResponseSchema;
|
|
27
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
28
|
+
}
|
package/constant/error.ts
CHANGED
|
@@ -419,22 +419,56 @@ export const ERRORS = {
|
|
|
419
419
|
TRANSACTION_FETCH_SUM_FAILED: { code: 'TR009', message: 'Failed get sum transaction', httpCode: 500 },
|
|
420
420
|
TRANSACTION_AMOUNT_NEGATIVE: { code: 'TR010', message: 'Transaction amount is negative', httpCode: 400 },
|
|
421
421
|
TRANSACTION_NOT_APPLIED: { code: 'TR011', message: 'Transaction not applied', httpCode: 500 },
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
422
|
+
MONEY_ACCOUNT_REQUIRED: { code: 'TR012', message: 'moneyAccountUUID is required to apply bank payment event', httpCode: 400 },
|
|
423
|
+
TRANSACTION_CREATE_FAILED: { code: 'TR013', message: 'Failed to create transaction', httpCode: 500 },
|
|
424
|
+
|
|
425
|
+
// CLIENT_PAYMENT_IDENTIFIER
|
|
426
|
+
CLIENT_PAYMENT_IDENTIFIER_NOT_CREATED: { code: 'CPI001', message: 'Failed to create client payment identifier', httpCode: 500 },
|
|
427
|
+
CLIENT_PAYMENT_IDENTIFIER_NOT_DELETED: { code: 'CPI002', message: 'Failed to delete client payment identifier', httpCode: 500 },
|
|
428
|
+
CLIENT_PAYMENT_IDENTIFIER_NOT_FOUND: { code: 'CPI003', message: 'Client payment identifier not found', httpCode: 404 },
|
|
429
|
+
CLIENT_PAYMENT_IDENTIFIER_ALREADY_EXISTS: {
|
|
430
|
+
code: 'CPI004',
|
|
431
|
+
message: 'Client payment identifier with this provider, key and value already exists',
|
|
432
|
+
httpCode: 409,
|
|
433
|
+
},
|
|
434
|
+
CLIENT_PAYMENT_IDENTIFIER_FETCH_FAILED: {
|
|
435
|
+
code: 'CPI005',
|
|
436
|
+
message: 'Failed to fetch client payment identifiers',
|
|
437
|
+
httpCode: 500,
|
|
438
|
+
},
|
|
439
|
+
|
|
440
|
+
// BANK_PAYMENT_RULE
|
|
441
|
+
BANK_PAYMENT_RULE_NOT_FOUND: { code: 'BPR001', message: 'Bank payment rule not found', httpCode: 404 },
|
|
442
|
+
BANK_PAYMENT_RULE_NOT_CREATED: { code: 'BPR002', message: 'Failed to create bank payment rule', httpCode: 500 },
|
|
443
|
+
BANK_PAYMENT_RULE_NOT_UPDATED: { code: 'BPR003', message: 'Failed to update bank payment rule', httpCode: 500 },
|
|
444
|
+
BANK_PAYMENT_RULE_NOT_DELETED: { code: 'BPR004', message: 'Failed to delete bank payment rule', httpCode: 500 },
|
|
445
|
+
BANK_PAYMENT_RULE_PRIORITY_CONFLICT: {
|
|
446
|
+
code: 'BPR005',
|
|
447
|
+
message: 'A bank payment rule with the same priority already exists',
|
|
448
|
+
httpCode: 409,
|
|
449
|
+
},
|
|
450
|
+
BANK_PAYMENT_RULE_FETCH_FAILED: { code: 'BPR006', message: 'Failed to fetch bank payment rules', httpCode: 500 },
|
|
451
|
+
|
|
452
|
+
// BANK_PAYMENT_EVENT
|
|
453
|
+
BANK_EVENT_NOT_FOUND: { code: 'BPE001', message: 'Bank payment event not found', httpCode: 404 },
|
|
454
|
+
BANK_EVENT_LIST_FAILED: { code: 'BPE002', message: 'Error when retrieving bank payment events list', httpCode: 500 },
|
|
455
|
+
BANK_EVENT_GET_FAILED: { code: 'BPE003', message: 'Error when retrieving bank payment event', httpCode: 500 },
|
|
456
|
+
BANK_EVENT_FETCH_FAILED: { code: 'BPE004', message: 'Failed to fetch bank payment event', httpCode: 500 },
|
|
457
|
+
BANK_EVENT_UPSERT_FAILED: { code: 'BPE005', message: 'Failed to upsert bank payment event', httpCode: 500 },
|
|
458
|
+
BANK_EVENT_UNSUPPORTED_STATUS: { code: 'BPE006', message: 'Unsupported bank payment event status', httpCode: 400 },
|
|
459
|
+
BANK_EVENT_ALREADY_APPLIED: { code: 'BPE007', message: 'Bank payment event already applied', httpCode: 400 },
|
|
460
|
+
BANK_EVENT_UPDATE_STATUS_FAILED: { code: 'BPE008', message: 'Failed to update bank payment event status', httpCode: 500 },
|
|
431
461
|
BANK_EVENT_NOT_FOUND_OR_NOT_NEW: {
|
|
432
|
-
code: '
|
|
462
|
+
code: 'BPE009',
|
|
433
463
|
message: 'Bank payment event not found or not in NEW status',
|
|
434
464
|
httpCode: 400,
|
|
435
465
|
},
|
|
436
|
-
|
|
437
|
-
|
|
466
|
+
BANK_PAYMENT_APPLY_FAILED: { code: 'BPE010', message: 'Failed to apply bank payment event', httpCode: 500 },
|
|
467
|
+
BANK_EVENT_MATCH_SUGGESTIONS_FAILED: {
|
|
468
|
+
code: 'BPE011',
|
|
469
|
+
message: 'Failed to get match suggestions for bank payment event',
|
|
470
|
+
httpCode: 500,
|
|
471
|
+
},
|
|
438
472
|
|
|
439
473
|
// EXCEL
|
|
440
474
|
EXCEL_CREATE_FAILED: { code: 'E001', message: 'Failed to create excel', httpCode: 500 },
|
package/enum/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export const GetBankPaymentMatchSuggestionsRequestSchema = z.object({
|
|
4
|
+
eventUUID: z.uuid(),
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
const ClientMatchSuggestionSchema = z.object({
|
|
8
|
+
clientUUID: z.uuid(),
|
|
9
|
+
clientName: z.string(),
|
|
10
|
+
confidence: z.enum(['HIGH', 'MEDIUM', 'LOW']),
|
|
11
|
+
matchedBy: z.string(),
|
|
12
|
+
matchedValue: z.string().optional(),
|
|
13
|
+
suggestedMoneyAccountUUID: z.string().uuid().nullable().optional(),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const GetBankPaymentMatchSuggestionsResponseSchema = z.object({
|
|
17
|
+
suggestions: z.array(ClientMatchSuggestionSchema),
|
|
18
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BankPaymentRuleMatchTypeEnum } from '../../enum/bank-payment-rule-match-type.enum';
|
|
3
|
+
|
|
4
|
+
export const BankPaymentRuleSchema = z.object({
|
|
5
|
+
uuid: z.uuid(),
|
|
6
|
+
priority: z.number(),
|
|
7
|
+
enabled: z.boolean(),
|
|
8
|
+
matchType: z.nativeEnum(BankPaymentRuleMatchTypeEnum),
|
|
9
|
+
pattern: z.string(),
|
|
10
|
+
moneyAccountUUID: z.uuid(),
|
|
11
|
+
createdAt: z.date(),
|
|
12
|
+
updatedAt: z.date(),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export const BankPaymentRuleListSchema = z.object({
|
|
16
|
+
list: BankPaymentRuleSchema.array(),
|
|
17
|
+
total: z.number(),
|
|
18
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BankProviderEnum } from '../../enum/bank-provider.enum';
|
|
3
|
+
|
|
4
|
+
export const ClientPaymentIdentifierSchema = z.object({
|
|
5
|
+
uuid: z.uuid(),
|
|
6
|
+
clientUUID: z.uuid(),
|
|
7
|
+
provider: z.nativeEnum(BankProviderEnum),
|
|
8
|
+
identifierKey: z.string(),
|
|
9
|
+
identifierValue: z.string(),
|
|
10
|
+
isActive: z.boolean(),
|
|
11
|
+
description: z.string().nullable(),
|
|
12
|
+
createdAt: z.date(),
|
|
13
|
+
updatedAt: z.date(),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const ClientPaymentIdentifierListSchema = z.object({
|
|
17
|
+
list: ClientPaymentIdentifierSchema.array(),
|
|
18
|
+
total: z.number(),
|
|
19
|
+
});
|
package/schemas/index.ts
CHANGED
|
@@ -52,6 +52,9 @@ export * from './pre-order-collection-item/pre-order-collection-item-multiplicit
|
|
|
52
52
|
export * from './message';
|
|
53
53
|
export * from './product-configuration/product-configuration.schema';
|
|
54
54
|
export * from './bank-payment';
|
|
55
|
+
export * from './bank-payment-rule/bank-payment-rule.schema';
|
|
55
56
|
export * from './client';
|
|
57
|
+
export * from './client-payment-identifier/client-payment-identifier.schema';
|
|
58
|
+
export * from './bank-payment/get-bank-payment-match-suggestions.schema';
|
|
56
59
|
export * from './messenger-profile';
|
|
57
60
|
export * from './error-message.schema';
|