@fiado/type-kit 1.1.12 → 1.1.13

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.
Files changed (28) hide show
  1. package/bin/account/dtos/CreateBankAccountOutput.d.ts +5 -0
  2. package/bin/account/dtos/CreateBankAccountOutput.js +6 -0
  3. package/bin/account/dtos/CreateBankAccountUserOutput.d.ts +8 -0
  4. package/bin/account/dtos/CreateBankAccountUserOutput.js +6 -0
  5. package/bin/transaction/TransactionCreateRequest.d.ts +2 -0
  6. package/bin/transaction/TransactionCreateRequest.js +6 -0
  7. package/bin/transaction/TransactionCreateResponse.d.ts +2 -0
  8. package/bin/transaction/TransactionCreateResponse.js +6 -0
  9. package/bin/transaction/dtos/Credit.d.ts +7 -0
  10. package/bin/transaction/dtos/Credit.js +45 -0
  11. package/bin/transaction/dtos/Debit.d.ts +6 -0
  12. package/bin/transaction/dtos/Debit.js +36 -0
  13. package/bin/transaction/dtos/Notional.d.ts +6 -0
  14. package/bin/transaction/dtos/Notional.js +36 -0
  15. package/bin/transaction/dtos/Product.d.ts +6 -0
  16. package/bin/{group/dtos/GroupDirectoryRetationsUpdateRequest.js → transaction/dtos/Product.js} +20 -6
  17. package/bin/transaction/dtos/Total.d.ts +6 -0
  18. package/bin/transaction/dtos/Total.js +36 -0
  19. package/bin/transaction/dtos/TransactionCreateRequest.d.ts +23 -0
  20. package/bin/transaction/dtos/TransactionCreateRequest.js +111 -0
  21. package/package.json +1 -1
  22. package/src/transaction/dtos/Credit.ts +29 -0
  23. package/src/transaction/dtos/Debit.ts +20 -0
  24. package/src/transaction/dtos/Notional.ts +20 -0
  25. package/src/transaction/dtos/Product.ts +20 -0
  26. package/src/transaction/dtos/Total.ts +20 -0
  27. package/src/transaction/dtos/TransactionCreateRequest.ts +94 -0
  28. package/bin/group/dtos/GroupDirectoryRetationsUpdateRequest.d.ts +0 -3
@@ -0,0 +1,5 @@
1
+ import { Provider } from "../../provider";
2
+ export declare class CreateBankAccountOutput {
3
+ externalAccountId: string;
4
+ provider: Provider;
5
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateBankAccountOutput = void 0;
4
+ class CreateBankAccountOutput {
5
+ }
6
+ exports.CreateBankAccountOutput = CreateBankAccountOutput;
@@ -0,0 +1,8 @@
1
+ import { Provider } from "../../provider";
2
+ export declare class CreateBankAccountUserOutput {
3
+ externalUserId: string;
4
+ externalAccountId?: string;
5
+ provider: Provider;
6
+ accountNumber?: string;
7
+ routingNumber?: string;
8
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateBankAccountUserOutput = void 0;
4
+ class CreateBankAccountUserOutput {
5
+ }
6
+ exports.CreateBankAccountUserOutput = CreateBankAccountUserOutput;
@@ -0,0 +1,2 @@
1
+ export declare class TransactionCreateRequest {
2
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TransactionCreateRequest = void 0;
4
+ class TransactionCreateRequest {
5
+ }
6
+ exports.TransactionCreateRequest = TransactionCreateRequest;
@@ -0,0 +1,2 @@
1
+ export declare class TransactionCreateResponse {
2
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TransactionCreateResponse = void 0;
4
+ class TransactionCreateResponse {
5
+ }
6
+ exports.TransactionCreateResponse = TransactionCreateResponse;
@@ -0,0 +1,7 @@
1
+ export declare class Credit {
2
+ creditNotional: Number;
3
+ creditProductFees: Number;
4
+ creditProductTax: Number;
5
+ creditTotal: Number;
6
+ relatedCreditId: string;
7
+ }
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.Credit = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const regex_1 = require("../../helpers/constans/regex");
15
+ class Credit {
16
+ }
17
+ exports.Credit = Credit;
18
+ __decorate([
19
+ (0, class_validator_1.IsNotEmpty)(),
20
+ (0, class_validator_1.IsNumber)(),
21
+ __metadata("design:type", Number)
22
+ ], Credit.prototype, "creditNotional", void 0);
23
+ __decorate([
24
+ (0, class_validator_1.IsNotEmpty)(),
25
+ (0, class_validator_1.IsNumber)(),
26
+ __metadata("design:type", Number)
27
+ ], Credit.prototype, "creditProductFees", void 0);
28
+ __decorate([
29
+ (0, class_validator_1.IsNotEmpty)(),
30
+ (0, class_validator_1.IsNumber)(),
31
+ __metadata("design:type", Number)
32
+ ], Credit.prototype, "creditProductTax", void 0);
33
+ __decorate([
34
+ (0, class_validator_1.IsNotEmpty)(),
35
+ (0, class_validator_1.IsNumber)(),
36
+ __metadata("design:type", Number)
37
+ ], Credit.prototype, "creditTotal", void 0);
38
+ __decorate([
39
+ (0, class_validator_1.IsNotEmpty)(),
40
+ (0, class_validator_1.IsString)(),
41
+ (0, class_validator_1.Matches)(regex_1.regexUuidV4, {
42
+ message: 'relatedCreditId must be a valid UUID v4',
43
+ }),
44
+ __metadata("design:type", String)
45
+ ], Credit.prototype, "relatedCreditId", void 0);
@@ -0,0 +1,6 @@
1
+ export declare class Debit {
2
+ debitNotional: Number;
3
+ debitProductFees: Number;
4
+ debitProductTax: Number;
5
+ debitTotal: Number;
6
+ }
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.Debit = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ class Debit {
15
+ }
16
+ exports.Debit = Debit;
17
+ __decorate([
18
+ (0, class_validator_1.IsNotEmpty)(),
19
+ (0, class_validator_1.IsNumber)(),
20
+ __metadata("design:type", Number)
21
+ ], Debit.prototype, "debitNotional", void 0);
22
+ __decorate([
23
+ (0, class_validator_1.IsNotEmpty)(),
24
+ (0, class_validator_1.IsNumber)(),
25
+ __metadata("design:type", Number)
26
+ ], Debit.prototype, "debitProductFees", void 0);
27
+ __decorate([
28
+ (0, class_validator_1.IsNotEmpty)(),
29
+ (0, class_validator_1.IsNumber)(),
30
+ __metadata("design:type", Number)
31
+ ], Debit.prototype, "debitProductTax", void 0);
32
+ __decorate([
33
+ (0, class_validator_1.IsNotEmpty)(),
34
+ (0, class_validator_1.IsNumber)(),
35
+ __metadata("design:type", Number)
36
+ ], Debit.prototype, "debitTotal", void 0);
@@ -0,0 +1,6 @@
1
+ export declare class Notional {
2
+ notional: Number;
3
+ productFees: Number;
4
+ productTax: Number;
5
+ total: Number;
6
+ }
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.Notional = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ class Notional {
15
+ }
16
+ exports.Notional = Notional;
17
+ __decorate([
18
+ (0, class_validator_1.IsNotEmpty)(),
19
+ (0, class_validator_1.IsNumber)(),
20
+ __metadata("design:type", Number)
21
+ ], Notional.prototype, "notional", void 0);
22
+ __decorate([
23
+ (0, class_validator_1.IsNotEmpty)(),
24
+ (0, class_validator_1.IsNumber)(),
25
+ __metadata("design:type", Number)
26
+ ], Notional.prototype, "productFees", void 0);
27
+ __decorate([
28
+ (0, class_validator_1.IsNotEmpty)(),
29
+ (0, class_validator_1.IsNumber)(),
30
+ __metadata("design:type", Number)
31
+ ], Notional.prototype, "productTax", void 0);
32
+ __decorate([
33
+ (0, class_validator_1.IsNotEmpty)(),
34
+ (0, class_validator_1.IsNumber)(),
35
+ __metadata("design:type", Number)
36
+ ], Notional.prototype, "total", void 0);
@@ -0,0 +1,6 @@
1
+ export declare class Product {
2
+ type: String;
3
+ description: String;
4
+ displayName: String;
5
+ relatedProductId: String;
6
+ }
@@ -9,14 +9,28 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.GroupDirectoryRetationsUpdateRequest = void 0;
12
+ exports.Product = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
- class GroupDirectoryRetationsUpdateRequest {
14
+ class Product {
15
15
  }
16
- exports.GroupDirectoryRetationsUpdateRequest = GroupDirectoryRetationsUpdateRequest;
16
+ exports.Product = Product;
17
17
  __decorate([
18
- (0, class_validator_1.IsOptional)(),
18
+ (0, class_validator_1.IsNotEmpty)(),
19
19
  (0, class_validator_1.IsString)(),
20
- (0, class_validator_1.Length)(1, 20),
21
20
  __metadata("design:type", String)
22
- ], GroupDirectoryRetationsUpdateRequest.prototype, "agent", void 0);
21
+ ], Product.prototype, "type", void 0);
22
+ __decorate([
23
+ (0, class_validator_1.IsNotEmpty)(),
24
+ (0, class_validator_1.IsString)(),
25
+ __metadata("design:type", String)
26
+ ], Product.prototype, "description", void 0);
27
+ __decorate([
28
+ (0, class_validator_1.IsNotEmpty)(),
29
+ (0, class_validator_1.IsString)(),
30
+ __metadata("design:type", String)
31
+ ], Product.prototype, "displayName", void 0);
32
+ __decorate([
33
+ (0, class_validator_1.IsNotEmpty)(),
34
+ (0, class_validator_1.IsString)(),
35
+ __metadata("design:type", String)
36
+ ], Product.prototype, "relatedProductId", void 0);
@@ -0,0 +1,6 @@
1
+ export declare class Total {
2
+ totalNotional: Number;
3
+ totalFees: Number;
4
+ totalTax: Number;
5
+ totalTotal: Number;
6
+ }
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.Total = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ class Total {
15
+ }
16
+ exports.Total = Total;
17
+ __decorate([
18
+ (0, class_validator_1.IsNotEmpty)(),
19
+ (0, class_validator_1.IsNumber)(),
20
+ __metadata("design:type", Number)
21
+ ], Total.prototype, "totalNotional", void 0);
22
+ __decorate([
23
+ (0, class_validator_1.IsNotEmpty)(),
24
+ (0, class_validator_1.IsNumber)(),
25
+ __metadata("design:type", Number)
26
+ ], Total.prototype, "totalFees", void 0);
27
+ __decorate([
28
+ (0, class_validator_1.IsNotEmpty)(),
29
+ (0, class_validator_1.IsNumber)(),
30
+ __metadata("design:type", Number)
31
+ ], Total.prototype, "totalTax", void 0);
32
+ __decorate([
33
+ (0, class_validator_1.IsNotEmpty)(),
34
+ (0, class_validator_1.IsNumber)(),
35
+ __metadata("design:type", Number)
36
+ ], Total.prototype, "totalTotal", void 0);
@@ -1,2 +1,25 @@
1
+ import { CountryId } from "../../country";
2
+ import { OperationEnum } from "../enums/OperationEnum";
3
+ import { TypeOfDirectoryId } from "../../directory";
4
+ import { Notional } from "./Notional";
5
+ import { Credit } from "./Credit";
6
+ import { Debit } from "./Debit";
7
+ import { Total } from "./Total";
8
+ import { Product } from "./Product";
1
9
  export declare class TransactionCreateRequest {
10
+ transactionNumber: string;
11
+ directoryId: string;
12
+ peopleId: string;
13
+ accountId: string;
14
+ ownerDirectoryId: string;
15
+ transactionDate: Date;
16
+ sessionId: string;
17
+ currencyId: CountryId;
18
+ operation: OperationEnum;
19
+ notionalDetails: Notional;
20
+ credit: Credit;
21
+ debit: Debit;
22
+ total: Total;
23
+ product: Product;
24
+ typeOfDirectoryId: TypeOfDirectoryId;
2
25
  }
@@ -1,6 +1,117 @@
1
1
  "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
2
11
  Object.defineProperty(exports, "__esModule", { value: true });
3
12
  exports.TransactionCreateRequest = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const regex_1 = require("../../helpers/constans/regex");
15
+ const country_1 = require("../../country");
16
+ const OperationEnum_1 = require("../enums/OperationEnum");
17
+ const directory_1 = require("../../directory");
18
+ const class_transformer_1 = require("class-transformer");
19
+ const Notional_1 = require("./Notional");
20
+ const Credit_1 = require("./Credit");
21
+ const Debit_1 = require("./Debit");
22
+ const Total_1 = require("./Total");
23
+ const Product_1 = require("./Product");
4
24
  class TransactionCreateRequest {
5
25
  }
6
26
  exports.TransactionCreateRequest = TransactionCreateRequest;
27
+ __decorate([
28
+ (0, class_validator_1.IsNotEmpty)(),
29
+ (0, class_validator_1.IsString)(),
30
+ (0, class_validator_1.Length)(3, 50),
31
+ __metadata("design:type", String)
32
+ ], TransactionCreateRequest.prototype, "transactionNumber", void 0);
33
+ __decorate([
34
+ (0, class_validator_1.IsNotEmpty)(),
35
+ (0, class_validator_1.IsString)(),
36
+ (0, class_validator_1.Matches)(regex_1.regexUuidV4, {
37
+ message: 'directoryId must be a valid UUID v4',
38
+ }),
39
+ __metadata("design:type", String)
40
+ ], TransactionCreateRequest.prototype, "directoryId", void 0);
41
+ __decorate([
42
+ (0, class_validator_1.IsNotEmpty)(),
43
+ (0, class_validator_1.IsString)(),
44
+ (0, class_validator_1.Matches)(regex_1.regexUuidV4, {
45
+ message: 'peopleId must be a valid UUID v4',
46
+ }),
47
+ __metadata("design:type", String)
48
+ ], TransactionCreateRequest.prototype, "peopleId", void 0);
49
+ __decorate([
50
+ (0, class_validator_1.IsNotEmpty)(),
51
+ (0, class_validator_1.IsString)(),
52
+ (0, class_validator_1.Matches)(regex_1.regexUuidV4, {
53
+ message: 'accountId must be a valid UUID v4',
54
+ }),
55
+ __metadata("design:type", String)
56
+ ], TransactionCreateRequest.prototype, "accountId", void 0);
57
+ __decorate([
58
+ (0, class_validator_1.IsNotEmpty)(),
59
+ (0, class_validator_1.IsString)(),
60
+ (0, class_validator_1.Matches)(regex_1.regexUuidV4, {
61
+ message: 'ownerDirectoryId must be a valid UUID v4',
62
+ }),
63
+ __metadata("design:type", String)
64
+ ], TransactionCreateRequest.prototype, "ownerDirectoryId", void 0);
65
+ __decorate([
66
+ (0, class_validator_1.IsNotEmpty)(),
67
+ (0, class_validator_1.IsDate)(),
68
+ __metadata("design:type", Date)
69
+ ], TransactionCreateRequest.prototype, "transactionDate", void 0);
70
+ __decorate([
71
+ (0, class_validator_1.IsNotEmpty)(),
72
+ (0, class_validator_1.IsString)(),
73
+ (0, class_validator_1.Matches)(regex_1.regexUuidV4, {
74
+ message: 'sessionId must be a valid UUID v4',
75
+ }),
76
+ __metadata("design:type", String)
77
+ ], TransactionCreateRequest.prototype, "sessionId", void 0);
78
+ __decorate([
79
+ (0, class_validator_1.IsNotEmpty)(),
80
+ (0, class_validator_1.IsEnum)(country_1.CountryId),
81
+ __metadata("design:type", String)
82
+ ], TransactionCreateRequest.prototype, "currencyId", void 0);
83
+ __decorate([
84
+ (0, class_validator_1.IsNotEmpty)(),
85
+ (0, class_validator_1.IsEnum)(OperationEnum_1.OperationEnum),
86
+ __metadata("design:type", String)
87
+ ], TransactionCreateRequest.prototype, "operation", void 0);
88
+ __decorate([
89
+ (0, class_validator_1.ValidateNested)({ each: true }),
90
+ (0, class_transformer_1.Type)(() => Notional_1.Notional),
91
+ __metadata("design:type", Notional_1.Notional)
92
+ ], TransactionCreateRequest.prototype, "notionalDetails", void 0);
93
+ __decorate([
94
+ (0, class_validator_1.ValidateNested)({ each: true }),
95
+ (0, class_transformer_1.Type)(() => Credit_1.Credit),
96
+ __metadata("design:type", Credit_1.Credit)
97
+ ], TransactionCreateRequest.prototype, "credit", void 0);
98
+ __decorate([
99
+ (0, class_validator_1.ValidateNested)({ each: true }),
100
+ (0, class_transformer_1.Type)(() => Debit_1.Debit),
101
+ __metadata("design:type", Debit_1.Debit)
102
+ ], TransactionCreateRequest.prototype, "debit", void 0);
103
+ __decorate([
104
+ (0, class_validator_1.ValidateNested)({ each: true }),
105
+ (0, class_transformer_1.Type)(() => Total_1.Total),
106
+ __metadata("design:type", Total_1.Total)
107
+ ], TransactionCreateRequest.prototype, "total", void 0);
108
+ __decorate([
109
+ (0, class_validator_1.ValidateNested)({ each: true }),
110
+ (0, class_transformer_1.Type)(() => Product_1.Product),
111
+ __metadata("design:type", Product_1.Product)
112
+ ], TransactionCreateRequest.prototype, "product", void 0);
113
+ __decorate([
114
+ (0, class_validator_1.IsNotEmpty)(),
115
+ (0, class_validator_1.IsEnum)(directory_1.TypeOfDirectoryId),
116
+ __metadata("design:type", String)
117
+ ], TransactionCreateRequest.prototype, "typeOfDirectoryId", void 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "1.1.12",
3
+ "version": "1.1.13",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -0,0 +1,29 @@
1
+ import {IsNotEmpty, IsNumber, IsString, Matches} from "class-validator";
2
+ import { regexUuidV4 } from "../../helpers/constans/regex";
3
+
4
+ export class Credit {
5
+
6
+ @IsNotEmpty()
7
+ @IsNumber()
8
+ creditNotional: Number;
9
+
10
+ @IsNotEmpty()
11
+ @IsNumber()
12
+ creditProductFees: Number;
13
+
14
+ @IsNotEmpty()
15
+ @IsNumber()
16
+ creditProductTax: Number;
17
+
18
+ @IsNotEmpty()
19
+ @IsNumber()
20
+ creditTotal: Number;
21
+
22
+ @IsNotEmpty()
23
+ @IsString()
24
+ @Matches(regexUuidV4,
25
+ {
26
+ message: 'relatedCreditId must be a valid UUID v4',
27
+ })
28
+ relatedCreditId: string;
29
+ }
@@ -0,0 +1,20 @@
1
+ import {IsNotEmpty, IsNumber} from "class-validator";
2
+
3
+ export class Debit {
4
+
5
+ @IsNotEmpty()
6
+ @IsNumber()
7
+ debitNotional: Number;
8
+
9
+ @IsNotEmpty()
10
+ @IsNumber()
11
+ debitProductFees: Number;
12
+
13
+ @IsNotEmpty()
14
+ @IsNumber()
15
+ debitProductTax: Number;
16
+
17
+ @IsNotEmpty()
18
+ @IsNumber()
19
+ debitTotal: Number;
20
+ }
@@ -0,0 +1,20 @@
1
+ import {IsNotEmpty, IsNumber} from "class-validator";
2
+
3
+ export class Notional {
4
+
5
+ @IsNotEmpty()
6
+ @IsNumber()
7
+ notional: Number;
8
+
9
+ @IsNotEmpty()
10
+ @IsNumber()
11
+ productFees: Number;
12
+
13
+ @IsNotEmpty()
14
+ @IsNumber()
15
+ productTax: Number;
16
+
17
+ @IsNotEmpty()
18
+ @IsNumber()
19
+ total: Number;
20
+ }
@@ -0,0 +1,20 @@
1
+ import {IsNotEmpty, IsNumber, IsString} from "class-validator";
2
+
3
+ export class Product {
4
+
5
+ @IsNotEmpty()
6
+ @IsString()
7
+ type: String;
8
+
9
+ @IsNotEmpty()
10
+ @IsString()
11
+ description: String;
12
+
13
+ @IsNotEmpty()
14
+ @IsString()
15
+ displayName: String;
16
+
17
+ @IsNotEmpty()
18
+ @IsString()
19
+ relatedProductId: String;
20
+ }
@@ -0,0 +1,20 @@
1
+ import {IsNotEmpty, IsNumber} from "class-validator";
2
+
3
+ export class Total {
4
+
5
+ @IsNotEmpty()
6
+ @IsNumber()
7
+ totalNotional: Number;
8
+
9
+ @IsNotEmpty()
10
+ @IsNumber()
11
+ totalFees: Number;
12
+
13
+ @IsNotEmpty()
14
+ @IsNumber()
15
+ totalTax: Number;
16
+
17
+ @IsNotEmpty()
18
+ @IsNumber()
19
+ totalTotal: Number;
20
+ }
@@ -1,4 +1,98 @@
1
+ import {IsDate, IsEnum, IsNotEmpty, IsString, Length, Matches, ValidateNested} from "class-validator";
2
+ import { regexUuidV4 } from "../../helpers/constans/regex";
3
+ import { CountryId } from "../../country";
4
+ import { OperationEnum } from "../enums/OperationEnum";
5
+ import { TypeOfDirectoryId } from "../../directory";
6
+ import { Type } from "class-transformer";
7
+ import { Notional } from "./Notional";
8
+ import { Credit } from "./Credit";
9
+ import { Debit } from "./Debit";
10
+ import { Total } from "./Total";
11
+ import { Product } from "./Product";
1
12
 
2
13
  export class TransactionCreateRequest {
14
+
15
+ @IsNotEmpty()
16
+ @IsString()
17
+ @Length(3, 50)
18
+ transactionNumber: string;
19
+
20
+ @IsNotEmpty()
21
+ @IsString()
22
+ @Matches(regexUuidV4,
23
+ {
24
+ message: 'directoryId must be a valid UUID v4',
25
+ })
26
+ directoryId: string;
27
+
28
+ @IsNotEmpty()
29
+ @IsString()
30
+ @Matches(regexUuidV4,
31
+ {
32
+ message: 'peopleId must be a valid UUID v4',
33
+ })
34
+ peopleId: string;
35
+
36
+ @IsNotEmpty()
37
+ @IsString()
38
+ @Matches(regexUuidV4,
39
+ {
40
+ message: 'accountId must be a valid UUID v4',
41
+ })
42
+ accountId: string;
43
+
44
+ @IsNotEmpty()
45
+ @IsString()
46
+ @Matches(regexUuidV4,
47
+ {
48
+ message: 'ownerDirectoryId must be a valid UUID v4',
49
+ })
50
+ ownerDirectoryId: string;
51
+
52
+ @IsNotEmpty()
53
+ @IsDate()
54
+ transactionDate: Date;
55
+
56
+ @IsNotEmpty()
57
+ @IsString()
58
+ @Matches(regexUuidV4,
59
+ {
60
+ message: 'sessionId must be a valid UUID v4',
61
+ })
62
+ sessionId: string;
63
+
64
+ @IsNotEmpty()
65
+ @IsEnum(CountryId)
66
+ currencyId: CountryId;
67
+
68
+ @IsNotEmpty()
69
+ @IsEnum(OperationEnum)
70
+ operation: OperationEnum;
71
+
72
+ @ValidateNested({ each: true })
73
+ @Type(() => Notional)
74
+ notionalDetails: Notional;
75
+
76
+ @ValidateNested({ each: true })
77
+ @Type(() => Credit)
78
+ credit: Credit;
79
+
80
+ @ValidateNested({ each: true })
81
+ @Type(() => Debit)
82
+ debit: Debit;
83
+
84
+ @ValidateNested({ each: true })
85
+ @Type(() => Total)
86
+ total: Total;
87
+
88
+ @ValidateNested({ each: true })
89
+ @Type(() => Product)
90
+ product: Product;
91
+
92
+ @IsNotEmpty()
93
+ @IsEnum(TypeOfDirectoryId)
94
+ typeOfDirectoryId: TypeOfDirectoryId;
3
95
 
4
96
  }
97
+
98
+
@@ -1,3 +0,0 @@
1
- export declare class GroupDirectoryRetationsUpdateRequest {
2
- agent: string;
3
- }