@fiado/type-kit 1.0.3 → 1.0.5
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/bin/account/dtos/AccountResponse.d.ts +21 -0
- package/bin/account/dtos/AccountResponse.js +85 -0
- package/bin/account/dtos/CreateAccountRequest.d.ts +14 -0
- package/bin/account/dtos/CreateAccountRequest.js +65 -0
- package/bin/account/dtos/CreatePockeRequest.d.ts +4 -0
- package/bin/account/dtos/CreatePockeRequest.js +31 -0
- package/bin/account/dtos/PocketResponse.d.ts +0 -0
- package/bin/account/dtos/PocketResponse.js +0 -0
- package/bin/account/enums/AccountStatus.d.ts +5 -0
- package/bin/account/enums/AccountStatus.js +9 -0
- package/bin/address/dtos/AddressBase.d.ts +34 -0
- package/bin/address/dtos/AddressBase.js +163 -0
- package/bin/address/dtos/AddressResponse.d.ts +7 -0
- package/bin/address/dtos/AddressResponse.js +47 -0
- package/bin/address/dtos/CreateAddressRequest.d.ts +3 -0
- package/bin/address/dtos/CreateAddressRequest.js +7 -0
- package/bin/address/dtos/Geometry.d.ts +3 -0
- package/bin/address/dtos/Geometry.js +2 -0
- package/bin/address/dtos/Place.d.ts +21 -0
- package/bin/address/dtos/Place.js +112 -0
- package/bin/address/dtos/Shipping.d.ts +11 -0
- package/bin/address/dtos/Shipping.js +57 -0
- package/bin/address/dtos/Timezone.d.ts +4 -0
- package/bin/address/dtos/Timezone.js +2 -0
- package/bin/address/enums/AddressProvider.d.ts +9 -0
- package/bin/address/enums/AddressProvider.js +13 -0
- package/bin/address/enums/AddressStatus.d.ts +9 -0
- package/bin/address/enums/AddressStatus.js +13 -0
- package/bin/address/index.d.ts +1 -1
- package/bin/address/index.js +1 -1
- package/bin/card/dtos/CardActivateRequest.d.ts +4 -0
- package/bin/card/dtos/CardActivateRequest.js +26 -0
- package/bin/card/dtos/CardApplicationRequest.d.ts +6 -0
- package/bin/card/dtos/CardApplicationRequest.js +34 -0
- package/bin/card/dtos/CardApplicationRequestDto.d.ts +1 -1
- package/bin/card/dtos/CardApplicationRequestDto.js +6 -6
- package/bin/card/dtos/CardUpdateRequest.d.ts +5 -0
- package/bin/card/dtos/CardUpdateRequest.js +28 -0
- package/bin/card/dtos/CreateCardRequest.d.ts +34 -0
- package/bin/card/dtos/CreateCardRequest.js +176 -0
- package/bin/card/dtos/CreateCardRequestDto.d.ts +1 -1
- package/bin/card/dtos/CreateCardRequestDto.js +29 -29
- package/bin/card/validations/CardUpdateKeyConstraint.js +1 -2
- package/bin/card/validations/IsPhoneNumberConstraint.d.ts +6 -0
- package/bin/card/validations/IsPhoneNumberConstraint.js +36 -0
- package/bin/country/enums/Country.d.ts +4 -0
- package/bin/country/enums/Country.js +8 -0
- package/bin/country/enums/CountryId.js +1 -0
- package/bin/directory/enums/TypeOfDirectoryId.d.ts +5 -0
- package/bin/directory/enums/TypeOfDirectoryId.js +9 -0
- package/bin/helpers/constans/regex.d.ts +1 -0
- package/bin/helpers/constans/regex.js +3 -1
- package/bin/index.d.ts +9 -3
- package/bin/index.js +9 -3
- package/package.json +1 -1
- package/src/account/dtos/AccountResponse.ts +60 -0
- package/src/account/dtos/CreateAccountRequest.ts +45 -0
- package/src/account/dtos/CreatePockeRequest.ts +19 -0
- package/src/account/dtos/PocketResponse.ts +0 -0
- package/src/account/enums/AccountStatus.ts +7 -0
- package/src/address/dtos/AddressBase.ts +131 -0
- package/src/address/dtos/AddressResponse.ts +41 -0
- package/src/address/dtos/CreateAddressRequest.ts +7 -0
- package/src/address/dtos/Geometry.ts +5 -0
- package/src/address/dtos/Place.ts +84 -0
- package/src/address/dtos/{AddressShippingDto.ts → Shipping.ts} +1 -1
- package/src/address/dtos/Timezone.ts +6 -0
- package/src/address/enums/AddressProvider.ts +10 -0
- package/src/address/enums/AddressStatus.ts +10 -0
- package/src/address/index.ts +1 -1
- package/src/card/dtos/{CardActivateRequestDto.ts → CardActivateRequest.ts} +1 -1
- package/src/card/dtos/{CardApplicationRequestDto.ts → CardApplicationRequest.ts} +4 -4
- package/src/card/dtos/{CardUpdateRequestDto.ts → CardUpdateRequest.ts} +1 -1
- package/src/card/dtos/{CreateCardRequestDto.ts → CreateCardRequest.ts} +4 -4
- package/src/card/validations/CardUpdateKeyConstraint.ts +3 -5
- package/src/card/validations/IsPhoneNumberConstraint.ts +26 -0
- package/src/country/enums/Country.ts +6 -0
- package/src/country/enums/CountryId.ts +3 -0
- package/src/directory/enums/TypeOfDirectoryId.ts +7 -0
- package/src/helpers/constans/regex.ts +2 -0
- package/src/index.ts +13 -3
|
@@ -9,7 +9,7 @@ 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.
|
|
12
|
+
exports.CreateCardRequestDto = void 0;
|
|
13
13
|
const class_validator_1 = require("class-validator");
|
|
14
14
|
const class_transformer_1 = require("class-transformer");
|
|
15
15
|
const CountryId_1 = require("../../country/enums/CountryId");
|
|
@@ -19,9 +19,9 @@ const Brand_1 = require("../enums/Brand");
|
|
|
19
19
|
const OwnershipType_1 = require("../enums/OwnershipType");
|
|
20
20
|
const Status_1 = require("../enums/Status");
|
|
21
21
|
const regex_1 = require("../../helpers/constans/regex");
|
|
22
|
-
class
|
|
22
|
+
class CreateCardRequestDto {
|
|
23
23
|
}
|
|
24
|
-
exports.
|
|
24
|
+
exports.CreateCardRequestDto = CreateCardRequestDto;
|
|
25
25
|
__decorate([
|
|
26
26
|
(0, class_validator_1.IsOptional)(),
|
|
27
27
|
(0, class_validator_1.IsString)(),
|
|
@@ -29,7 +29,7 @@ __decorate([
|
|
|
29
29
|
message: 'id must be a valid UUID v4',
|
|
30
30
|
}),
|
|
31
31
|
__metadata("design:type", String)
|
|
32
|
-
],
|
|
32
|
+
], CreateCardRequestDto.prototype, "id", void 0);
|
|
33
33
|
__decorate([
|
|
34
34
|
(0, class_validator_1.IsOptional)(),
|
|
35
35
|
(0, class_validator_1.IsString)(),
|
|
@@ -37,7 +37,7 @@ __decorate([
|
|
|
37
37
|
message: 'accountId must be a valid UUID v4 or null',
|
|
38
38
|
}),
|
|
39
39
|
__metadata("design:type", String)
|
|
40
|
-
],
|
|
40
|
+
], CreateCardRequestDto.prototype, "accountId", void 0);
|
|
41
41
|
__decorate([
|
|
42
42
|
(0, class_validator_1.IsOptional)(),
|
|
43
43
|
(0, class_validator_1.IsString)(),
|
|
@@ -45,132 +45,132 @@ __decorate([
|
|
|
45
45
|
message: 'activationDate must be a valid ISO 8601 date string',
|
|
46
46
|
}),
|
|
47
47
|
__metadata("design:type", String)
|
|
48
|
-
],
|
|
48
|
+
], CreateCardRequestDto.prototype, "activationDate", void 0);
|
|
49
49
|
__decorate([
|
|
50
50
|
(0, class_validator_1.IsEnum)(CountryId_1.CountryId),
|
|
51
51
|
__metadata("design:type", String)
|
|
52
|
-
],
|
|
52
|
+
], CreateCardRequestDto.prototype, "countryId", void 0);
|
|
53
53
|
__decorate([
|
|
54
54
|
(0, class_validator_1.IsEnum)(CardType_1.CardType),
|
|
55
55
|
__metadata("design:type", String)
|
|
56
|
-
],
|
|
56
|
+
], CreateCardRequestDto.prototype, "type", void 0);
|
|
57
57
|
__decorate([
|
|
58
58
|
(0, class_validator_1.IsString)(),
|
|
59
59
|
(0, class_validator_1.Matches)(regex_1.regexUuidV4, {
|
|
60
60
|
message: 'directoryId must be a valid UUID v4',
|
|
61
61
|
}),
|
|
62
62
|
__metadata("design:type", String)
|
|
63
|
-
],
|
|
63
|
+
], CreateCardRequestDto.prototype, "directoryId", void 0);
|
|
64
64
|
__decorate([
|
|
65
65
|
(0, class_validator_1.IsString)(),
|
|
66
66
|
(0, class_validator_1.Length)(1, 100),
|
|
67
67
|
__metadata("design:type", String)
|
|
68
|
-
],
|
|
68
|
+
], CreateCardRequestDto.prototype, "externalCardId", void 0);
|
|
69
69
|
__decorate([
|
|
70
70
|
(0, class_validator_1.IsString)(),
|
|
71
71
|
(0, class_validator_1.Length)(1, 100),
|
|
72
72
|
__metadata("design:type", String)
|
|
73
|
-
],
|
|
73
|
+
], CreateCardRequestDto.prototype, "externalUserId", void 0);
|
|
74
74
|
__decorate([
|
|
75
75
|
(0, class_validator_1.IsOptional)(),
|
|
76
76
|
(0, class_validator_1.IsString)(),
|
|
77
77
|
(0, class_validator_1.Length)(1, 100),
|
|
78
78
|
__metadata("design:type", String)
|
|
79
|
-
],
|
|
79
|
+
], CreateCardRequestDto.prototype, "externalShipmentId", void 0);
|
|
80
80
|
__decorate([
|
|
81
81
|
(0, class_validator_1.IsOptional)(),
|
|
82
82
|
(0, class_validator_1.IsString)(),
|
|
83
83
|
(0, class_validator_1.Length)(1, 50),
|
|
84
84
|
__metadata("design:type", String)
|
|
85
|
-
],
|
|
85
|
+
], CreateCardRequestDto.prototype, "shipmentProvider", void 0);
|
|
86
86
|
__decorate([
|
|
87
87
|
(0, class_validator_1.IsOptional)(),
|
|
88
88
|
(0, class_validator_1.IsString)(),
|
|
89
89
|
(0, class_validator_1.Length)(1, 50),
|
|
90
90
|
__metadata("design:type", String)
|
|
91
|
-
],
|
|
91
|
+
], CreateCardRequestDto.prototype, "externalShipmentTrackingId", void 0);
|
|
92
92
|
__decorate([
|
|
93
93
|
(0, class_validator_1.IsOptional)(),
|
|
94
94
|
(0, class_validator_1.IsString)(),
|
|
95
95
|
(0, class_validator_1.Length)(1, 200),
|
|
96
96
|
__metadata("design:type", String)
|
|
97
|
-
],
|
|
97
|
+
], CreateCardRequestDto.prototype, "externalShipmentTrackingUrl", void 0);
|
|
98
98
|
__decorate([
|
|
99
99
|
(0, class_validator_1.IsOptional)(),
|
|
100
100
|
(0, class_validator_1.IsString)(),
|
|
101
101
|
(0, class_validator_1.Length)(1, 50),
|
|
102
102
|
__metadata("design:type", String)
|
|
103
|
-
],
|
|
103
|
+
], CreateCardRequestDto.prototype, "holderName", void 0);
|
|
104
104
|
__decorate([
|
|
105
105
|
(0, class_validator_1.IsOptional)(),
|
|
106
106
|
(0, class_validator_1.IsString)(),
|
|
107
107
|
(0, class_validator_1.Length)(1, 50),
|
|
108
108
|
__metadata("design:type", String)
|
|
109
|
-
],
|
|
109
|
+
], CreateCardRequestDto.prototype, "holderLastName", void 0);
|
|
110
110
|
__decorate([
|
|
111
111
|
(0, class_validator_1.IsOptional)(),
|
|
112
112
|
(0, class_validator_1.IsString)(),
|
|
113
113
|
(0, class_validator_1.Length)(1, 200),
|
|
114
114
|
__metadata("design:type", String)
|
|
115
|
-
],
|
|
115
|
+
], CreateCardRequestDto.prototype, "imageUrl", void 0);
|
|
116
116
|
__decorate([
|
|
117
117
|
(0, class_validator_1.IsEnum)(Brand_1.Brand),
|
|
118
118
|
__metadata("design:type", String)
|
|
119
|
-
],
|
|
119
|
+
], CreateCardRequestDto.prototype, "brand", void 0);
|
|
120
120
|
__decorate([
|
|
121
121
|
(0, class_validator_1.IsEnum)(OwnershipType_1.OwnershipType),
|
|
122
122
|
__metadata("design:type", String)
|
|
123
|
-
],
|
|
123
|
+
], CreateCardRequestDto.prototype, "ownershipType", void 0);
|
|
124
124
|
__decorate([
|
|
125
125
|
(0, class_validator_1.IsString)(),
|
|
126
126
|
(0, class_validator_1.Length)(4, 4),
|
|
127
127
|
__metadata("design:type", String)
|
|
128
|
-
],
|
|
128
|
+
], CreateCardRequestDto.prototype, "lastFour", void 0);
|
|
129
129
|
__decorate([
|
|
130
130
|
(0, class_validator_1.IsOptional)(),
|
|
131
131
|
(0, class_validator_1.IsString)(),
|
|
132
132
|
(0, class_validator_1.Length)(1, 50),
|
|
133
133
|
__metadata("design:type", String)
|
|
134
|
-
],
|
|
134
|
+
], CreateCardRequestDto.prototype, "providerName", void 0);
|
|
135
135
|
__decorate([
|
|
136
136
|
(0, class_validator_1.IsEnum)(Status_1.Status),
|
|
137
137
|
__metadata("design:type", String)
|
|
138
|
-
],
|
|
138
|
+
], CreateCardRequestDto.prototype, "status", void 0);
|
|
139
139
|
__decorate([
|
|
140
140
|
(0, class_validator_1.IsOptional)(),
|
|
141
141
|
(0, class_validator_1.IsString)(),
|
|
142
142
|
__metadata("design:type", String)
|
|
143
|
-
],
|
|
143
|
+
], CreateCardRequestDto.prototype, "statusUpdateDate", void 0);
|
|
144
144
|
__decorate([
|
|
145
145
|
(0, class_validator_1.IsOptional)(),
|
|
146
146
|
(0, class_validator_1.IsString)(),
|
|
147
147
|
(0, class_validator_1.Length)(1, 50),
|
|
148
148
|
__metadata("design:type", String)
|
|
149
|
-
],
|
|
149
|
+
], CreateCardRequestDto.prototype, "tenantId", void 0);
|
|
150
150
|
__decorate([
|
|
151
151
|
(0, class_validator_1.IsOptional)(),
|
|
152
152
|
(0, class_validator_1.IsNumber)(),
|
|
153
153
|
(0, class_validator_1.Min)(1),
|
|
154
154
|
(0, class_validator_1.Max)(9999999999),
|
|
155
155
|
__metadata("design:type", Number)
|
|
156
|
-
],
|
|
156
|
+
], CreateCardRequestDto.prototype, "spendLimitByTransaction", void 0);
|
|
157
157
|
__decorate([
|
|
158
158
|
(0, class_validator_1.IsOptional)(),
|
|
159
159
|
(0, class_validator_1.IsNumber)(),
|
|
160
160
|
(0, class_validator_1.Min)(1),
|
|
161
161
|
(0, class_validator_1.Max)(9999999999),
|
|
162
162
|
__metadata("design:type", Number)
|
|
163
|
-
],
|
|
163
|
+
], CreateCardRequestDto.prototype, "spendLimitByDay", void 0);
|
|
164
164
|
__decorate([
|
|
165
165
|
(0, class_validator_1.IsOptional)(),
|
|
166
166
|
(0, class_validator_1.IsNumber)(),
|
|
167
167
|
(0, class_validator_1.Min)(1),
|
|
168
168
|
(0, class_validator_1.Max)(9999999999),
|
|
169
169
|
__metadata("design:type", Number)
|
|
170
|
-
],
|
|
170
|
+
], CreateCardRequestDto.prototype, "spendLimitByMonth", void 0);
|
|
171
171
|
__decorate([
|
|
172
172
|
(0, class_validator_1.IsOptional)(),
|
|
173
173
|
(0, class_validator_1.ValidateNested)(),
|
|
174
174
|
(0, class_transformer_1.Type)(() => AddressShippingDto_1.ShippingAddressDto),
|
|
175
175
|
__metadata("design:type", AddressShippingDto_1.ShippingAddressDto)
|
|
176
|
-
],
|
|
176
|
+
], CreateCardRequestDto.prototype, "shippedAddress", void 0);
|
|
@@ -36,8 +36,7 @@ let CardUpdateKeyConstraint = class CardUpdateKeyConstraint {
|
|
|
36
36
|
return false;
|
|
37
37
|
}
|
|
38
38
|
defaultMessage(args) {
|
|
39
|
-
|
|
40
|
-
return "El valor no es adecuado para el tipo de actualización.";
|
|
39
|
+
return "The value is not valid for the update type.";
|
|
41
40
|
}
|
|
42
41
|
};
|
|
43
42
|
exports.CardUpdateKeyConstraint = CardUpdateKeyConstraint;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ValidatorConstraintInterface, ValidationArguments, ValidationOptions } from 'class-validator';
|
|
2
|
+
export declare class IsPhoneNumberConstraint implements ValidatorConstraintInterface {
|
|
3
|
+
validate(phoneNumber: string, args: ValidationArguments): boolean;
|
|
4
|
+
defaultMessage(args: ValidationArguments): string;
|
|
5
|
+
}
|
|
6
|
+
export declare function IsPhoneNumberFiado(validationOptions?: ValidationOptions): (object: Object, propertyName: string) => void;
|
|
@@ -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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.IsPhoneNumberFiado = exports.IsPhoneNumberConstraint = void 0;
|
|
10
|
+
const class_validator_1 = require("class-validator");
|
|
11
|
+
const regex_1 = require("../../helpers/constans/regex");
|
|
12
|
+
let IsPhoneNumberConstraint = class IsPhoneNumberConstraint {
|
|
13
|
+
validate(phoneNumber, args) {
|
|
14
|
+
return regex_1.regexPhoneNumber.test(phoneNumber);
|
|
15
|
+
}
|
|
16
|
+
defaultMessage(args) {
|
|
17
|
+
return "The phone number is not valid. The expected format is +############.";
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
exports.IsPhoneNumberConstraint = IsPhoneNumberConstraint;
|
|
21
|
+
exports.IsPhoneNumberConstraint = IsPhoneNumberConstraint = __decorate([
|
|
22
|
+
(0, class_validator_1.ValidatorConstraint)({ async: true })
|
|
23
|
+
], IsPhoneNumberConstraint);
|
|
24
|
+
// Decorador que usaremos en nuestras clases DTO
|
|
25
|
+
function IsPhoneNumberFiado(validationOptions) {
|
|
26
|
+
return function (object, propertyName) {
|
|
27
|
+
(0, class_validator_1.registerDecorator)({
|
|
28
|
+
target: object.constructor,
|
|
29
|
+
propertyName: propertyName,
|
|
30
|
+
options: validationOptions,
|
|
31
|
+
constraints: [],
|
|
32
|
+
validator: IsPhoneNumberConstraint,
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
exports.IsPhoneNumberFiado = IsPhoneNumberFiado;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TypeOfDirectoryId = void 0;
|
|
4
|
+
var TypeOfDirectoryId;
|
|
5
|
+
(function (TypeOfDirectoryId) {
|
|
6
|
+
TypeOfDirectoryId["USER"] = "USER";
|
|
7
|
+
TypeOfDirectoryId["BACKOFFICE"] = "BACKOFFICE";
|
|
8
|
+
TypeOfDirectoryId["AGENT"] = "AGENT";
|
|
9
|
+
})(TypeOfDirectoryId || (exports.TypeOfDirectoryId = TypeOfDirectoryId = {}));
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.regexIso8601 = exports.regexUuidV4 = void 0;
|
|
3
|
+
exports.regexPhoneNumber = exports.regexIso8601 = exports.regexUuidV4 = void 0;
|
|
4
4
|
// Expresión regular para validar UUID v4
|
|
5
5
|
exports.regexUuidV4 = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
6
6
|
// Expresión regular para validar fecha ISO 8601
|
|
7
7
|
exports.regexIso8601 = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/;
|
|
8
|
+
// Expresión regular para validar un número de teléfono
|
|
9
|
+
exports.regexPhoneNumber = /^\+\d{12}$/;
|
package/bin/index.d.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
export * from './card/dtos/
|
|
2
|
-
export * from './card/dtos/
|
|
3
|
-
export * from './card/dtos/
|
|
1
|
+
export * from './card/dtos/CardActivateRequest';
|
|
2
|
+
export * from './card/dtos/CardApplicationRequest';
|
|
3
|
+
export * from './card/dtos/CreateCardRequest';
|
|
4
|
+
export * from './card/dtos/CardUpdateRequest';
|
|
4
5
|
export * from './card/enums/CardType';
|
|
5
6
|
export * from './card/enums/CardUpdateKey';
|
|
6
7
|
export * from './card/enums/IssuanceType';
|
|
7
8
|
export * from './card/enums/Status';
|
|
8
9
|
export * from './card/enums/IssuanceType';
|
|
9
10
|
export * from './card/enums/OwnershipType';
|
|
11
|
+
export * from './card/enums/Brand';
|
|
12
|
+
export * from './card/enums/UpdateKey';
|
|
13
|
+
export * from './card/enums/Status';
|
|
14
|
+
export * from './card/enums/CardType';
|
|
15
|
+
export * from './card/enums/OwnershipType';
|
package/bin/index.js
CHANGED
|
@@ -14,12 +14,18 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./card/dtos/
|
|
18
|
-
__exportStar(require("./card/dtos/
|
|
19
|
-
__exportStar(require("./card/dtos/
|
|
17
|
+
__exportStar(require("./card/dtos/CardActivateRequest"), exports);
|
|
18
|
+
__exportStar(require("./card/dtos/CardApplicationRequest"), exports);
|
|
19
|
+
__exportStar(require("./card/dtos/CreateCardRequest"), exports);
|
|
20
|
+
__exportStar(require("./card/dtos/CardUpdateRequest"), exports);
|
|
20
21
|
__exportStar(require("./card/enums/CardType"), exports);
|
|
21
22
|
__exportStar(require("./card/enums/CardUpdateKey"), exports);
|
|
22
23
|
__exportStar(require("./card/enums/IssuanceType"), exports);
|
|
23
24
|
__exportStar(require("./card/enums/Status"), exports);
|
|
24
25
|
__exportStar(require("./card/enums/IssuanceType"), exports);
|
|
25
26
|
__exportStar(require("./card/enums/OwnershipType"), exports);
|
|
27
|
+
__exportStar(require("./card/enums/Brand"), exports);
|
|
28
|
+
__exportStar(require("./card/enums/UpdateKey"), exports);
|
|
29
|
+
__exportStar(require("./card/enums/Status"), exports);
|
|
30
|
+
__exportStar(require("./card/enums/CardType"), exports);
|
|
31
|
+
__exportStar(require("./card/enums/OwnershipType"), exports);
|
package/package.json
CHANGED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import { IsEnum, IsNumber, IsOptional, IsString, IsDateString } from 'class-validator';
|
|
4
|
+
import { Provider } from '../../provider/enums/Provider';
|
|
5
|
+
import { Country } from '../../country/enums/Country';
|
|
6
|
+
import { AccountStatus } from '../enums/AccountStatus';
|
|
7
|
+
import { TypeOfDirectoryId } from '../../directory/enums/TypeOfDirectoryId';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export class AccountResponse {
|
|
11
|
+
@IsString()
|
|
12
|
+
id: string;
|
|
13
|
+
|
|
14
|
+
@IsOptional()
|
|
15
|
+
@IsString()
|
|
16
|
+
typeOfAccountId: string;
|
|
17
|
+
|
|
18
|
+
@IsOptional()
|
|
19
|
+
@IsString()
|
|
20
|
+
externalAccountId: string;
|
|
21
|
+
|
|
22
|
+
@IsOptional()
|
|
23
|
+
@IsString()
|
|
24
|
+
externalSubAccountId: string | null;
|
|
25
|
+
|
|
26
|
+
@IsEnum(Provider)
|
|
27
|
+
provider: Provider;
|
|
28
|
+
|
|
29
|
+
@IsString()
|
|
30
|
+
directoryId: string;
|
|
31
|
+
|
|
32
|
+
@IsEnum(TypeOfDirectoryId)
|
|
33
|
+
typeOfDirectoryId: TypeOfDirectoryId;
|
|
34
|
+
|
|
35
|
+
@IsNumber()
|
|
36
|
+
currentBalance: number;
|
|
37
|
+
|
|
38
|
+
@IsNumber()
|
|
39
|
+
balanceLock: number;
|
|
40
|
+
|
|
41
|
+
@IsEnum(Country)
|
|
42
|
+
countryId: Country;
|
|
43
|
+
|
|
44
|
+
@IsDateString()
|
|
45
|
+
createDate: string;
|
|
46
|
+
|
|
47
|
+
@IsDateString()
|
|
48
|
+
lastUpdateDate: string;
|
|
49
|
+
|
|
50
|
+
@IsOptional()
|
|
51
|
+
@IsString()
|
|
52
|
+
accountNumber: string
|
|
53
|
+
|
|
54
|
+
@IsOptional()
|
|
55
|
+
@IsString()
|
|
56
|
+
routingNumber: string;
|
|
57
|
+
|
|
58
|
+
@IsEnum(AccountStatus)
|
|
59
|
+
status: AccountStatus;
|
|
60
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { IsEmail, IsEnum, IsString, ValidateNested, IsDateString, Matches, Length } from 'class-validator';
|
|
2
|
+
import { AddressResponse } from "../../address/dtos/AddressResponse";
|
|
3
|
+
import { Country } from "../../country/enums/Country";
|
|
4
|
+
import { regexUuidV4 } from '../../helpers/constans/regex';
|
|
5
|
+
import { TypeOfDirectoryId } from '../../directory/enums/TypeOfDirectoryId';
|
|
6
|
+
import { IsPhoneNumberFiado } from '../../card/validations/IsPhoneNumberConstraint';
|
|
7
|
+
|
|
8
|
+
export class CreateAccountRequest {
|
|
9
|
+
|
|
10
|
+
@IsString()
|
|
11
|
+
@Matches(regexUuidV4,
|
|
12
|
+
{
|
|
13
|
+
message: 'directoryId must be a valid UUID v4',
|
|
14
|
+
})
|
|
15
|
+
directoryId: string;
|
|
16
|
+
|
|
17
|
+
@IsEnum(TypeOfDirectoryId)
|
|
18
|
+
typeOfDirectoryId: string;
|
|
19
|
+
|
|
20
|
+
@IsString()
|
|
21
|
+
firstName: string;
|
|
22
|
+
|
|
23
|
+
@IsString()
|
|
24
|
+
|
|
25
|
+
lastName: string;
|
|
26
|
+
|
|
27
|
+
@IsPhoneNumberFiado()
|
|
28
|
+
phoneNumber: string;
|
|
29
|
+
|
|
30
|
+
@ValidateNested()
|
|
31
|
+
address: AddressResponse;
|
|
32
|
+
|
|
33
|
+
@IsEmail()
|
|
34
|
+
email: string;
|
|
35
|
+
|
|
36
|
+
@IsDateString()
|
|
37
|
+
dob: string;
|
|
38
|
+
|
|
39
|
+
@IsString()
|
|
40
|
+
@Length(1, 30)
|
|
41
|
+
documentNumber: string;
|
|
42
|
+
|
|
43
|
+
@IsEnum(Country)
|
|
44
|
+
countryId: Country;
|
|
45
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IsString, Matches } from "class-validator";
|
|
2
|
+
import { regexUuidV4 } from "../../helpers/constans/regex";
|
|
3
|
+
|
|
4
|
+
export class CreatePocketRequest {
|
|
5
|
+
|
|
6
|
+
@IsString()
|
|
7
|
+
@Matches(regexUuidV4,
|
|
8
|
+
{
|
|
9
|
+
message: 'beneficiaryDirectoryId must be a valid UUID v4',
|
|
10
|
+
})
|
|
11
|
+
beneficiaryDirectoryId?: string;
|
|
12
|
+
|
|
13
|
+
@IsString()
|
|
14
|
+
@Matches(regexUuidV4,
|
|
15
|
+
{
|
|
16
|
+
message: 'accountId must be a valid UUID v4',
|
|
17
|
+
})
|
|
18
|
+
accountId: string;
|
|
19
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import { IsBoolean, IsEnum, IsNumber, IsOptional, IsString, Length, Matches, ValidateNested } from 'class-validator';
|
|
5
|
+
import { TypeOfDirectoryId } from "../../directory/enums/TypeOfDirectoryId";
|
|
6
|
+
import { AddressProvider } from "../enums/AddressProvider";
|
|
7
|
+
import { AddressStatus } from "../enums/AddressStatus";
|
|
8
|
+
import { Place } from "./Place";
|
|
9
|
+
import { CountryId } from '../../country/enums/CountryId';
|
|
10
|
+
import { regexIso8601, regexUuidV4 } from '../../helpers/constans/regex';
|
|
11
|
+
|
|
12
|
+
export class AddressBase {
|
|
13
|
+
|
|
14
|
+
@IsOptional()
|
|
15
|
+
@IsString()
|
|
16
|
+
@Matches(regexUuidV4,
|
|
17
|
+
{
|
|
18
|
+
message: 'id must be a valid UUID v4',
|
|
19
|
+
})
|
|
20
|
+
id?: string;
|
|
21
|
+
|
|
22
|
+
@IsNumber()
|
|
23
|
+
@IsOptional()
|
|
24
|
+
distance?: number;
|
|
25
|
+
|
|
26
|
+
@IsEnum(TypeOfDirectoryId)
|
|
27
|
+
createdBy: TypeOfDirectoryId;
|
|
28
|
+
|
|
29
|
+
@IsString()
|
|
30
|
+
@Matches(regexUuidV4,
|
|
31
|
+
{
|
|
32
|
+
message: 'directoryId must be a valid UUID v4',
|
|
33
|
+
})
|
|
34
|
+
directoryId: string;
|
|
35
|
+
|
|
36
|
+
@IsBoolean()
|
|
37
|
+
isPrincipal: boolean;
|
|
38
|
+
|
|
39
|
+
@IsOptional()
|
|
40
|
+
@IsString()
|
|
41
|
+
@Length(1, 100)
|
|
42
|
+
tag?: string;
|
|
43
|
+
|
|
44
|
+
@IsString()
|
|
45
|
+
@Length(1, 100)
|
|
46
|
+
tenantId: string;
|
|
47
|
+
|
|
48
|
+
@IsString()
|
|
49
|
+
typeOfAddressId: string;
|
|
50
|
+
|
|
51
|
+
@IsEnum(TypeOfDirectoryId)
|
|
52
|
+
typeOfDirectoryId: TypeOfDirectoryId;
|
|
53
|
+
|
|
54
|
+
@IsEnum(AddressProvider)
|
|
55
|
+
provider: AddressProvider;
|
|
56
|
+
|
|
57
|
+
@ValidateNested()
|
|
58
|
+
place: Place;
|
|
59
|
+
|
|
60
|
+
@IsString()
|
|
61
|
+
@Matches(regexIso8601,
|
|
62
|
+
{
|
|
63
|
+
message: 'validFrom must be a valid ISO 8601 date string',
|
|
64
|
+
})
|
|
65
|
+
validFrom: string;
|
|
66
|
+
|
|
67
|
+
@IsOptional()
|
|
68
|
+
@IsString()
|
|
69
|
+
@Matches(regexIso8601,
|
|
70
|
+
{
|
|
71
|
+
message: 'validUntil must be a valid ISO 8601 date string',
|
|
72
|
+
})
|
|
73
|
+
validUntil?: string;
|
|
74
|
+
|
|
75
|
+
@IsEnum(AddressStatus)
|
|
76
|
+
addressStatus: AddressStatus;
|
|
77
|
+
|
|
78
|
+
@IsOptional()
|
|
79
|
+
@IsString()
|
|
80
|
+
@Length(1, 200)
|
|
81
|
+
additionalInformation?: string;
|
|
82
|
+
|
|
83
|
+
@IsBoolean()
|
|
84
|
+
helpNeeded: boolean;
|
|
85
|
+
|
|
86
|
+
@IsOptional()
|
|
87
|
+
@IsString()
|
|
88
|
+
@Length(1, 10)
|
|
89
|
+
internalNumber?: string;
|
|
90
|
+
|
|
91
|
+
@IsEnum(CountryId)
|
|
92
|
+
countryId: CountryId;
|
|
93
|
+
|
|
94
|
+
@IsString()
|
|
95
|
+
@Length(1, 100)
|
|
96
|
+
street?: string;
|
|
97
|
+
|
|
98
|
+
@IsString()
|
|
99
|
+
@Length(1, 10)
|
|
100
|
+
addressNumber?: string;
|
|
101
|
+
|
|
102
|
+
@IsOptional()
|
|
103
|
+
@IsString()
|
|
104
|
+
@Length(2, 60)
|
|
105
|
+
municipality?: string;
|
|
106
|
+
|
|
107
|
+
@IsOptional()
|
|
108
|
+
@IsString()
|
|
109
|
+
subMunicipality?: string;
|
|
110
|
+
|
|
111
|
+
@IsOptional()
|
|
112
|
+
@IsString()
|
|
113
|
+
@Length(2, 60)
|
|
114
|
+
neighborhood?: string;
|
|
115
|
+
|
|
116
|
+
@IsOptional()
|
|
117
|
+
@IsString()
|
|
118
|
+
@Length(2, 60)
|
|
119
|
+
subRegion?: string;
|
|
120
|
+
|
|
121
|
+
@IsString()
|
|
122
|
+
@Length(5, 10)
|
|
123
|
+
region?: string;
|
|
124
|
+
|
|
125
|
+
@IsString()
|
|
126
|
+
@Length(5, 10)
|
|
127
|
+
postalCode?: string;
|
|
128
|
+
|
|
129
|
+
@IsEnum(CountryId)
|
|
130
|
+
country: string;
|
|
131
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import { IsOptional, IsString, Length, Matches } from 'class-validator';
|
|
5
|
+
|
|
6
|
+
import { regexIso8601, regexUuidV4 } from '../../helpers/constans/regex';
|
|
7
|
+
import { AddressBase } from './AddressBase';
|
|
8
|
+
|
|
9
|
+
export class AddressResponse extends AddressBase {
|
|
10
|
+
|
|
11
|
+
@IsString()
|
|
12
|
+
@Matches(regexUuidV4,
|
|
13
|
+
{
|
|
14
|
+
message: 'id must be a valid UUID v4',
|
|
15
|
+
})
|
|
16
|
+
id: string
|
|
17
|
+
|
|
18
|
+
@IsOptional()
|
|
19
|
+
@IsString()
|
|
20
|
+
@Matches(regexIso8601,
|
|
21
|
+
{
|
|
22
|
+
message: 'createDate must be a valid ISO 8601 date string',
|
|
23
|
+
})
|
|
24
|
+
createDate: string;
|
|
25
|
+
|
|
26
|
+
@IsOptional()
|
|
27
|
+
@IsString()
|
|
28
|
+
@Matches(regexIso8601,
|
|
29
|
+
{
|
|
30
|
+
message: 'updateDate must be a valid ISO 8601 date string',
|
|
31
|
+
})
|
|
32
|
+
updateDate?: string;
|
|
33
|
+
|
|
34
|
+
@IsOptional()
|
|
35
|
+
@IsString()
|
|
36
|
+
@Length(1, 100)
|
|
37
|
+
updatedBy?: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|