@fiado/type-kit 1.1.42 → 1.1.43

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 (213) hide show
  1. package/.idea/aws.xml +11 -0
  2. package/.idea/fiado-type-kit.iml +12 -0
  3. package/.idea/modules.xml +8 -0
  4. package/.idea/vcs.xml +6 -0
  5. package/README.md +70 -70
  6. package/bin/account/dtos/BankAccountP2pTransferRequest.d.ts +7 -0
  7. package/bin/account/dtos/BankAccountP2pTransferRequest.js +6 -0
  8. package/bin/account/enums/BankAccountP2pTransferType.d.ts +6 -0
  9. package/bin/account/enums/BankAccountP2pTransferType.js +10 -0
  10. package/bin/account/index.d.ts +2 -0
  11. package/bin/account/index.js +2 -0
  12. package/package.json +23 -23
  13. package/src/account/dtos/AccountCreateRequest.ts +75 -75
  14. package/src/account/dtos/AccountCreateResponse.ts +7 -7
  15. package/src/account/dtos/AccountInfo.ts +39 -39
  16. package/src/account/dtos/AccountUpdateBalanceRequest.ts +6 -6
  17. package/src/account/dtos/BankAccountExternalAddress.ts +17 -17
  18. package/src/account/dtos/BankAccountP2pTransferRequest.ts +8 -0
  19. package/src/account/dtos/CreateBankAccountRequest.ts +11 -11
  20. package/src/account/dtos/CreateBankAccountResponse.ts +8 -8
  21. package/src/account/dtos/CreateBankAccountUserRequest.ts +17 -17
  22. package/src/account/dtos/CreateBankAccountUserResponse.ts +11 -11
  23. package/src/account/dtos/ExchangeInfo.ts +8 -8
  24. package/src/account/dtos/GetAccountBalanceResponse.ts +36 -36
  25. package/src/account/dtos/GetAccountResponse.ts +62 -62
  26. package/src/account/dtos/GetBankAccountRequest.ts +3 -3
  27. package/src/account/dtos/GetBankAccountResponse.ts +22 -22
  28. package/src/account/dtos/GetBankAccountSensitiveInformationRequest.ts +5 -5
  29. package/src/account/dtos/GetBankAccountSensitiveInformationResponse.ts +8 -8
  30. package/src/account/dtos/GetBankAccountUserRequest.ts +2 -2
  31. package/src/account/dtos/GetBankAccountUserResponse.ts +25 -25
  32. package/src/account/dtos/GetPocketBalanceResponse.ts +46 -46
  33. package/src/account/dtos/GetPocketResponse.ts +8 -8
  34. package/src/account/dtos/PocketBalanceItem.ts +14 -14
  35. package/src/account/dtos/PocketItem.ts +43 -43
  36. package/src/account/dtos/UpdateBalanceOperation.ts +8 -8
  37. package/src/account/dtos/UpdateBankAccountUserRequest.ts +26 -26
  38. package/src/account/dtos/UpdateBankAccountUserResponse.ts +3 -3
  39. package/src/account/entities/AccountEntityBase.ts +12 -12
  40. package/src/account/enums/AccountEntityStatusEnum.ts +4 -4
  41. package/src/account/enums/AccountLevelEnum.ts +5 -5
  42. package/src/account/enums/BankAccountP2pTransferType.ts +6 -0
  43. package/src/account/enums/BankAccountTypeEnum.ts +2 -2
  44. package/src/account/enums/BankAccountUserStatusEnum.ts +4 -4
  45. package/src/account/enums/UserEntityStatusEnum.ts +4 -4
  46. package/src/account/index.ts +39 -37
  47. package/src/address/dtos/AddressBase.ts +130 -130
  48. package/src/address/dtos/AddressCreateRequest.ts +6 -6
  49. package/src/address/dtos/AddressResponse.ts +41 -41
  50. package/src/address/dtos/AddressShippingCardRequest.ts +12 -12
  51. package/src/address/dtos/AddressShippingCardResponse.ts +11 -11
  52. package/src/address/dtos/Geometry.ts +4 -4
  53. package/src/address/dtos/OfficeDetails.ts +30 -30
  54. package/src/address/dtos/OperationSchedule.ts +8 -8
  55. package/src/address/dtos/Place.ts +83 -83
  56. package/src/address/dtos/Shipping.ts +36 -36
  57. package/src/address/dtos/Timezone.ts +5 -5
  58. package/src/address/enums/AddressProvider.ts +10 -10
  59. package/src/address/enums/AddressStatus.ts +9 -9
  60. package/src/address/index.ts +16 -16
  61. package/src/app/enums/App.ts +10 -10
  62. package/src/app/index.ts +3 -3
  63. package/src/authentication/dtos/SignUpAdditionalRequest.ts +32 -32
  64. package/src/authentication/dtos/SignUpAdditionalResponse.ts +5 -5
  65. package/src/authentication/index.ts +3 -3
  66. package/src/beneficiary/dtos/AccountBeneficiaryCreateRequest.ts +41 -41
  67. package/src/beneficiary/dtos/AccountBeneficiaryResponse.ts +23 -23
  68. package/src/beneficiary/dtos/AccountBeneficiaryUpdateRequest.ts +39 -39
  69. package/src/beneficiary/enums/AccountType.ts +6 -6
  70. package/src/beneficiary/index.ts +7 -7
  71. package/src/card/dtos/CardActivateRequest.ts +12 -12
  72. package/src/card/dtos/CardAdditionalRequest.ts +25 -25
  73. package/src/card/dtos/CardAdditionalResponse.ts +12 -12
  74. package/src/card/dtos/CardApplicationRequest.ts +22 -22
  75. package/src/card/dtos/CardBalanceResponse.ts +10 -10
  76. package/src/card/dtos/CardCreateAdditionalRequest.ts +40 -40
  77. package/src/card/dtos/CardResponse.ts +34 -34
  78. package/src/card/dtos/CardSensitiveInformationResponse.ts +18 -18
  79. package/src/card/dtos/CardShipmentQueueMessage.ts +7 -7
  80. package/src/card/dtos/CardShipmentUpdateRequest.ts +19 -19
  81. package/src/card/dtos/CardSummaryResponse.ts +10 -10
  82. package/src/card/dtos/CardUpdateRequest.ts +11 -11
  83. package/src/card/dtos/Internal/ActivateBankAccountCardRequest.ts +9 -9
  84. package/src/card/dtos/Internal/ActivateBankAccountCardResponse.ts +4 -4
  85. package/src/card/dtos/Internal/AssignCardRequest.ts +8 -8
  86. package/src/card/dtos/Internal/CreateBankAccountCardRequest.ts +16 -16
  87. package/src/card/dtos/Internal/CreateBankAccountCardResponse.ts +8 -8
  88. package/src/card/dtos/Internal/CreateBankAccountCardShippingRequest.ts +14 -14
  89. package/src/card/dtos/Internal/CreateBankAccountCardShippingResponse.ts +12 -12
  90. package/src/card/dtos/Internal/GetBankAccountCardResponse.ts +32 -32
  91. package/src/card/dtos/Internal/GetBankAccountShippingRequest.ts +5 -5
  92. package/src/card/dtos/Internal/GetBankAccountShippingResponse.ts +19 -19
  93. package/src/card/dtos/Internal/UpdateBankAccountCardRequest.ts +21 -21
  94. package/src/card/dtos/Internal/UpdateBankAccountCardResponse.ts +5 -5
  95. package/src/card/enums/Brand.ts +7 -7
  96. package/src/card/enums/CardIssuanceStatus.ts +5 -5
  97. package/src/card/enums/CardIssuing.ts +6 -6
  98. package/src/card/enums/CardType.ts +4 -4
  99. package/src/card/enums/CardUpdateKey.ts +4 -4
  100. package/src/card/enums/CreditOrDebit.ts +5 -5
  101. package/src/card/enums/DeliveryChannel.ts +7 -7
  102. package/src/card/enums/ExternalShippingStatus.ts +14 -14
  103. package/src/card/enums/ExternalShippingStatusDetails.ts +53 -53
  104. package/src/card/enums/IssuanceType.ts +5 -5
  105. package/src/card/enums/NominatedOrInnominated.ts +8 -8
  106. package/src/card/enums/OwnershipType.ts +3 -3
  107. package/src/card/enums/ShippingStatus.ts +8 -8
  108. package/src/card/enums/Status.ts +6 -6
  109. package/src/card/enums/UpdateKey.ts +5 -5
  110. package/src/card/enums/VirtualOrPhysical.ts +6 -6
  111. package/src/card/index.ts +50 -50
  112. package/src/card/validations/CardUpdateKeyConstraint.ts +53 -53
  113. package/src/card/validations/IsPhoneNumberConstraint.ts +26 -26
  114. package/src/contactInfo/dtos/GetAllContactInfoResponse.ts +13 -13
  115. package/src/contactInfo/enums/TypeOfContactIdEnum.ts +3 -3
  116. package/src/contactInfo/index.ts +1 -1
  117. package/src/contract/dtos/ContractCreateRequest.ts +29 -29
  118. package/src/contract/dtos/ContractCreateResponse.ts +2 -2
  119. package/src/contract/index.ts +4 -4
  120. package/src/country/enums/Country.ts +6 -6
  121. package/src/country/enums/CountryId.ts +6 -6
  122. package/src/country/index.ts +5 -5
  123. package/src/creditContract/dtos/CreditContractCreateRequest.ts +51 -51
  124. package/src/creditContract/enums/InstrumentEnum.ts +5 -5
  125. package/src/creditContract/index.ts +5 -5
  126. package/src/currency/dtos/CurrencyResponse.ts +8 -8
  127. package/src/currency/index.ts +2 -2
  128. package/src/directory/dtos/DirectoryResponse.ts +18 -18
  129. package/src/directory/dtos/External.ts +6 -6
  130. package/src/directory/enums/Profile.ts +6 -6
  131. package/src/directory/enums/Scope.ts +7 -7
  132. package/src/directory/enums/Status.ts +8 -8
  133. package/src/directory/enums/TypeOfDirectoryId.ts +6 -6
  134. package/src/directory/index.ts +7 -7
  135. package/src/eventBridge/dto/EventBridgeMessageRequest.ts +4 -4
  136. package/src/eventBridge/index.ts +1 -1
  137. package/src/exchangeRate/dtos/ExchangeRateCreateRequest.ts +50 -50
  138. package/src/exchangeRate/dtos/ExchangeRateCreateResponse.ts +4 -4
  139. package/src/exchangeRate/dtos/ExchangeRateResponse.ts +19 -19
  140. package/src/exchangeRate/dtos/GetExchangeRatesRequest.ts +3 -3
  141. package/src/exchangeRate/enums/ExchangeRateStatus.ts +5 -5
  142. package/src/exchangeRate/index.ts +9 -9
  143. package/src/genericMessage/dto/GenericMessageRequest.ts +17 -17
  144. package/src/genericMessage/enums/GenericMessageSourceEnum.ts +3 -3
  145. package/src/genericMessage/index.ts +1 -1
  146. package/src/group/dtos/GroupAddDirectoryRequest.ts +27 -27
  147. package/src/group/dtos/GroupCreateRequest.ts +54 -54
  148. package/src/group/dtos/GroupDirectoryRelationsResponse.ts +20 -20
  149. package/src/group/dtos/GroupDirectoryRelationsUpdateRequest.ts +10 -10
  150. package/src/group/dtos/GroupResponse.ts +17 -17
  151. package/src/group/dtos/GroupUpdateRequest.ts +31 -31
  152. package/src/group/enums/GroupAction.ts +8 -8
  153. package/src/group/enums/GroupStatus.ts +6 -6
  154. package/src/group/enums/RelationStatus.ts +8 -8
  155. package/src/group/enums/RelationType.ts +9 -9
  156. package/src/group/index.ts +18 -18
  157. package/src/header/TokenPayload.ts +18 -18
  158. package/src/header/index.ts +3 -3
  159. package/src/helpers/ValidationUtils.ts +32 -32
  160. package/src/helpers/constans/regex.ts +12 -12
  161. package/src/identity/dtos/IdentificationDocument.ts +24 -24
  162. package/src/identity/dtos/PeopleCreateRequest.ts +4 -4
  163. package/src/identity/dtos/PeopleResponse.ts +72 -72
  164. package/src/identity/dtos/PeopleUpdateRequest.ts +71 -71
  165. package/src/identity/dtos/TypeOfDocument.ts +11 -11
  166. package/src/identity/enums/IdentificationDocumentStatus.ts +7 -7
  167. package/src/identity/enums/SexDocument.ts +6 -6
  168. package/src/identity/enums/TypeOfDocument.ts +5 -5
  169. package/src/identity/index.ts +12 -12
  170. package/src/index.ts +28 -28
  171. package/src/notificationMessages/dtos/NotificationQueueMessageRequest.ts +7 -7
  172. package/src/notificationMessages/dtos/QueueMessageDestination.ts +6 -6
  173. package/src/notificationMessages/dtos/QueueMessageVariableValues.ts +3 -3
  174. package/src/notificationMessages/enums/NotificationId.ts +13 -13
  175. package/src/notificationMessages/index.ts +5 -5
  176. package/src/productCatalog/dtos/CreateProductCatalogRequest.ts +14 -14
  177. package/src/productCatalog/dtos/GetProductCatalogResponse.ts +38 -38
  178. package/src/productCatalog/enums/ProductTaxFeeTypeEnum.ts +3 -3
  179. package/src/productCatalog/enums/ProductTypeEnum.ts +8 -8
  180. package/src/productCatalog/index.ts +4 -4
  181. package/src/provider/enums/Provider.ts +4 -4
  182. package/src/provider/index.ts +1 -1
  183. package/src/queue/dtos/QueueMessageBase.ts +13 -13
  184. package/src/servicePayment/dtos/ServicePaymentRequest.ts +33 -33
  185. package/src/sessionActivity/dtos/SessionActivityQueueMessageRequest.ts +10 -10
  186. package/src/sessionActivity/enums/SessionActivityActionEnum.ts +7 -7
  187. package/src/sessionActivity/enums/SessionActivityActionOriginEnum.ts +4 -4
  188. package/src/sessionActivity/index.ts +2 -2
  189. package/src/transaction/dtos/Credit.ts +21 -21
  190. package/src/transaction/dtos/Debit.ts +20 -20
  191. package/src/transaction/dtos/Notional.ts +20 -20
  192. package/src/transaction/dtos/Product.ts +21 -21
  193. package/src/transaction/dtos/Total.ts +20 -20
  194. package/src/transaction/dtos/TransactionCreateRequest.ts +93 -93
  195. package/src/transaction/dtos/TransactionCreateResponse.ts +4 -4
  196. package/src/transaction/enums/OperationEnum.ts +3 -3
  197. package/src/transaction/index.ts +5 -5
  198. package/src/transactionProcessor/dtos/private/PrivateProcessorAmountInfo.ts +6 -6
  199. package/src/transactionProcessor/dtos/private/PrivateProcessorAmountInfoItem.ts +3 -3
  200. package/src/transactionProcessor/dtos/private/PrivateProcessorCardInfo.ts +5 -5
  201. package/src/transactionProcessor/dtos/private/PrivateProcessorMerchantInfo.ts +6 -6
  202. package/src/transactionProcessor/dtos/private/PrivateProcessorTransactionInfo.ts +7 -7
  203. package/src/transactionProcessor/dtos/private/PrivateTransactionProcessorRequest.ts +16 -16
  204. package/src/transactionProcessor/enums/TransactionProcessorCodesEnum.ts +12 -12
  205. package/src/transactionProcessor/index.ts +9 -9
  206. package/bin/account/dtos/CreateBankAccountInput.d.ts +0 -8
  207. package/bin/account/dtos/CreateBankAccountInput.js +0 -6
  208. package/bin/account/dtos/CreateBankAccountUserInput.d.ts +0 -14
  209. package/bin/account/dtos/CreateBankAccountUserInput.js +0 -6
  210. package/bin/group/dtos/GroupDirectoryRetationsUpdateRequest.d.ts +0 -3
  211. package/bin/group/dtos/GroupDirectoryRetationsUpdateRequest.js +0 -22
  212. package/bin/productCatalog/dtos/GetProductCatalogRequest.d.ts +0 -3
  213. package/bin/productCatalog/dtos/GetProductCatalogRequest.js +0 -19
package/src/card/index.ts CHANGED
@@ -1,50 +1,50 @@
1
-
2
- //dtos/internal
3
- export * from './dtos/Internal/ActivateBankAccountCardRequest';
4
- export * from './dtos/Internal/ActivateBankAccountCardResponse';
5
- export * from './dtos/Internal/CreateBankAccountCardRequest';
6
- export * from './dtos/Internal/CreateBankAccountCardResponse';
7
- export * from './dtos/Internal/CreateBankAccountCardShippingRequest';
8
- export * from './dtos/Internal/CreateBankAccountCardShippingResponse';
9
- export * from './dtos/Internal/GetBankAccountShippingRequest';
10
- export * from './dtos/Internal/GetBankAccountShippingResponse';
11
- export * from './dtos/Internal/UpdateBankAccountCardRequest';
12
- export * from './dtos/Internal/UpdateBankAccountCardResponse';
13
- export * from './dtos/Internal/GetBankAccountCardResponse';
14
- export * from './dtos/Internal/AssignCardRequest';
15
-
16
- //dtos
17
- export * from './dtos/CardActivateRequest';
18
- export * from './dtos/CardApplicationRequest';
19
- export * from './dtos/CardUpdateRequest';
20
- export * from './dtos/CardCreateAdditionalRequest';
21
- export * from './dtos/CardBalanceResponse';
22
- export * from './dtos/CardResponse';
23
- export * from './dtos/CardShipmentQueueMessage'
24
- export * from './dtos/CardShipmentUpdateRequest'
25
- export * from './dtos/CardAdditionalRequest'
26
- export * from './dtos/CardSensitiveInformationResponse'
27
- export * from './dtos/CardSummaryResponse'
28
- export * from './dtos/CardAdditionalResponse'
29
-
30
- //enums
31
- export * from './enums/CardType';
32
- export * from './enums/CardUpdateKey';
33
- export * from './enums/IssuanceType';
34
- export * from './enums/Status';
35
- export * from './enums/OwnershipType';
36
- export * from './enums/Brand';
37
- export * from './enums/UpdateKey';
38
- export * from './enums/CardIssuanceStatus';
39
- export * from './enums/NominatedOrInnominated'
40
- export * from './enums/CreditOrDebit'
41
- export * from './enums/ShippingStatus'
42
- export * from './enums/Status'
43
- export * from './enums/VirtualOrPhysical'
44
- export * from './enums/DeliveryChannel'
45
- export * from './enums/ExternalShippingStatus'
46
- export * from './enums/ExternalShippingStatusDetails'
47
-
48
-
49
-
50
-
1
+
2
+ //dtos/internal
3
+ export * from './dtos/Internal/ActivateBankAccountCardRequest';
4
+ export * from './dtos/Internal/ActivateBankAccountCardResponse';
5
+ export * from './dtos/Internal/CreateBankAccountCardRequest';
6
+ export * from './dtos/Internal/CreateBankAccountCardResponse';
7
+ export * from './dtos/Internal/CreateBankAccountCardShippingRequest';
8
+ export * from './dtos/Internal/CreateBankAccountCardShippingResponse';
9
+ export * from './dtos/Internal/GetBankAccountShippingRequest';
10
+ export * from './dtos/Internal/GetBankAccountShippingResponse';
11
+ export * from './dtos/Internal/UpdateBankAccountCardRequest';
12
+ export * from './dtos/Internal/UpdateBankAccountCardResponse';
13
+ export * from './dtos/Internal/GetBankAccountCardResponse';
14
+ export * from './dtos/Internal/AssignCardRequest';
15
+
16
+ //dtos
17
+ export * from './dtos/CardActivateRequest';
18
+ export * from './dtos/CardApplicationRequest';
19
+ export * from './dtos/CardUpdateRequest';
20
+ export * from './dtos/CardCreateAdditionalRequest';
21
+ export * from './dtos/CardBalanceResponse';
22
+ export * from './dtos/CardResponse';
23
+ export * from './dtos/CardShipmentQueueMessage'
24
+ export * from './dtos/CardShipmentUpdateRequest'
25
+ export * from './dtos/CardAdditionalRequest'
26
+ export * from './dtos/CardSensitiveInformationResponse'
27
+ export * from './dtos/CardSummaryResponse'
28
+ export * from './dtos/CardAdditionalResponse'
29
+
30
+ //enums
31
+ export * from './enums/CardType';
32
+ export * from './enums/CardUpdateKey';
33
+ export * from './enums/IssuanceType';
34
+ export * from './enums/Status';
35
+ export * from './enums/OwnershipType';
36
+ export * from './enums/Brand';
37
+ export * from './enums/UpdateKey';
38
+ export * from './enums/CardIssuanceStatus';
39
+ export * from './enums/NominatedOrInnominated'
40
+ export * from './enums/CreditOrDebit'
41
+ export * from './enums/ShippingStatus'
42
+ export * from './enums/Status'
43
+ export * from './enums/VirtualOrPhysical'
44
+ export * from './enums/DeliveryChannel'
45
+ export * from './enums/ExternalShippingStatus'
46
+ export * from './enums/ExternalShippingStatusDetails'
47
+
48
+
49
+
50
+
@@ -1,54 +1,54 @@
1
- import { ValidationArguments, ValidationOptions, ValidatorConstraint, registerDecorator } from "class-validator";
2
- import { CardUpdateRequest } from "../dtos/CardUpdateRequest";
3
- import { Status } from "../enums/Status";
4
- import { UpdateKey } from "../enums/UpdateKey";
5
-
6
-
7
- @ValidatorConstraint({ async: true })
8
- export class CardUpdateKeyConstraint {
9
-
10
- public static validateUpdateKey(value: string | Status, arg: ValidationArguments) {
11
-
12
- const cardUpdateRequest = arg.object as CardUpdateRequest;
13
-
14
- // Validar si el valor es uno de los status válidos
15
- if (cardUpdateRequest.type === UpdateKey.CHANGE_STATUS) {
16
- return Object.values(Status).includes(value as Status);
17
- }
18
-
19
- // Validar si el valor es un string de 4 dígitos no consecutivos
20
- if (cardUpdateRequest.type === UpdateKey.CHANGE_PIN) {
21
-
22
- if (!/^\d{4}$/.test(value)) return false; // Debe ser un string de 4 dígitos
23
-
24
- // Verifica que no sean consecutivos asc o desc
25
- for (let i = 0; i < value.length - 1; i++) {
26
- if (Math.abs(parseInt(value[i]) - parseInt(value[i + 1])) !== 1) {
27
- continue;
28
- } else {
29
- return false;
30
- }
31
- }
32
- return true;
33
- }
34
-
35
- // En caso de que type no sea ninguno de los esperados
36
- return false;
37
- }
38
-
39
- defaultMessage(args: ValidationArguments) {
40
- return "The value is not valid for the update type.";
41
- }
42
- }
43
-
44
- export function IsValueValid(validationOptions?: ValidationOptions) {
45
- return function (object: Object, propertyName: string) {
46
- registerDecorator({
47
- target: object.constructor,
48
- propertyName: propertyName,
49
- options: validationOptions,
50
- constraints: [],
51
- validator: CardUpdateKeyConstraint,
52
- });
53
- };
1
+ import { ValidationArguments, ValidationOptions, ValidatorConstraint, registerDecorator } from "class-validator";
2
+ import { CardUpdateRequest } from "../dtos/CardUpdateRequest";
3
+ import { Status } from "../enums/Status";
4
+ import { UpdateKey } from "../enums/UpdateKey";
5
+
6
+
7
+ @ValidatorConstraint({ async: true })
8
+ export class CardUpdateKeyConstraint {
9
+
10
+ public static validateUpdateKey(value: string | Status, arg: ValidationArguments) {
11
+
12
+ const cardUpdateRequest = arg.object as CardUpdateRequest;
13
+
14
+ // Validar si el valor es uno de los status válidos
15
+ if (cardUpdateRequest.type === UpdateKey.CHANGE_STATUS) {
16
+ return Object.values(Status).includes(value as Status);
17
+ }
18
+
19
+ // Validar si el valor es un string de 4 dígitos no consecutivos
20
+ if (cardUpdateRequest.type === UpdateKey.CHANGE_PIN) {
21
+
22
+ if (!/^\d{4}$/.test(value)) return false; // Debe ser un string de 4 dígitos
23
+
24
+ // Verifica que no sean consecutivos asc o desc
25
+ for (let i = 0; i < value.length - 1; i++) {
26
+ if (Math.abs(parseInt(value[i]) - parseInt(value[i + 1])) !== 1) {
27
+ continue;
28
+ } else {
29
+ return false;
30
+ }
31
+ }
32
+ return true;
33
+ }
34
+
35
+ // En caso de que type no sea ninguno de los esperados
36
+ return false;
37
+ }
38
+
39
+ defaultMessage(args: ValidationArguments) {
40
+ return "The value is not valid for the update type.";
41
+ }
42
+ }
43
+
44
+ export function IsValueValid(validationOptions?: ValidationOptions) {
45
+ return function (object: Object, propertyName: string) {
46
+ registerDecorator({
47
+ target: object.constructor,
48
+ propertyName: propertyName,
49
+ options: validationOptions,
50
+ constraints: [],
51
+ validator: CardUpdateKeyConstraint,
52
+ });
53
+ };
54
54
  }
@@ -1,26 +1,26 @@
1
- import { ValidatorConstraint, ValidatorConstraintInterface, ValidationArguments, registerDecorator, ValidationOptions } from 'class-validator';
2
- import { regexPhoneNumber } from '../../helpers/constans/regex';
3
-
4
- @ValidatorConstraint({ async: true })
5
- export class IsPhoneNumberConstraint implements ValidatorConstraintInterface {
6
- validate(phoneNumber: string, args: ValidationArguments) {
7
- return regexPhoneNumber.test(phoneNumber);
8
- }
9
-
10
- defaultMessage(args: ValidationArguments) {
11
- return "The phone number is not valid. The expected format is +############.";
12
- }
13
- }
14
-
15
- // Decorador que usaremos en nuestras clases DTO
16
- export function IsPhoneNumberFiado(validationOptions?: ValidationOptions) {
17
- return function (object: Object, propertyName: string) {
18
- registerDecorator({
19
- target: object.constructor,
20
- propertyName: propertyName,
21
- options: validationOptions,
22
- constraints: [],
23
- validator: IsPhoneNumberConstraint,
24
- });
25
- };
26
- }
1
+ import { ValidatorConstraint, ValidatorConstraintInterface, ValidationArguments, registerDecorator, ValidationOptions } from 'class-validator';
2
+ import { regexPhoneNumber } from '../../helpers/constans/regex';
3
+
4
+ @ValidatorConstraint({ async: true })
5
+ export class IsPhoneNumberConstraint implements ValidatorConstraintInterface {
6
+ validate(phoneNumber: string, args: ValidationArguments) {
7
+ return regexPhoneNumber.test(phoneNumber);
8
+ }
9
+
10
+ defaultMessage(args: ValidationArguments) {
11
+ return "The phone number is not valid. The expected format is +############.";
12
+ }
13
+ }
14
+
15
+ // Decorador que usaremos en nuestras clases DTO
16
+ export function IsPhoneNumberFiado(validationOptions?: ValidationOptions) {
17
+ return function (object: Object, propertyName: string) {
18
+ registerDecorator({
19
+ target: object.constructor,
20
+ propertyName: propertyName,
21
+ options: validationOptions,
22
+ constraints: [],
23
+ validator: IsPhoneNumberConstraint,
24
+ });
25
+ };
26
+ }
@@ -1,14 +1,14 @@
1
- import {TypeOfContactIdEnum} from "../enums/TypeOfContactIdEnum";
2
-
3
- export class GetAllContactInfoResponse {
4
- id: string;
5
- contact: string;
6
- directoryId: string;
7
- isPrincipal: boolean
8
- typeOfContactId: TypeOfContactIdEnum;
9
- isWhatsApp: boolean;
10
- isVoice: boolean;
11
- isSMS: boolean;
12
- isApp: boolean;
13
- note: string;
1
+ import {TypeOfContactIdEnum} from "../enums/TypeOfContactIdEnum";
2
+
3
+ export class GetAllContactInfoResponse {
4
+ id: string;
5
+ contact: string;
6
+ directoryId: string;
7
+ isPrincipal: boolean
8
+ typeOfContactId: TypeOfContactIdEnum;
9
+ isWhatsApp: boolean;
10
+ isVoice: boolean;
11
+ isSMS: boolean;
12
+ isApp: boolean;
13
+ note: string;
14
14
  }
@@ -1,4 +1,4 @@
1
- export enum TypeOfContactIdEnum {
2
- PHONE = "PHONE",
3
- EMAIL = "EMAIL"
1
+ export enum TypeOfContactIdEnum {
2
+ PHONE = "PHONE",
3
+ EMAIL = "EMAIL"
4
4
  }
@@ -1,2 +1,2 @@
1
- export * from './dtos/GetAllContactInfoResponse';
1
+ export * from './dtos/GetAllContactInfoResponse';
2
2
  export * from './enums/TypeOfContactIdEnum';
@@ -1,29 +1,29 @@
1
- import { IsNotEmpty, IsString } from 'class-validator';
2
-
3
-
4
- export class ContractCreateRequest {
5
-
6
- @IsString()
7
- @IsNotEmpty()
8
- id: string;
9
-
10
- @IsString()
11
- @IsNotEmpty()
12
- indexName: string;
13
-
14
- @IsString()
15
- @IsNotEmpty()
16
- dob: string;
17
-
18
- @IsString()
19
- @IsNotEmpty()
20
- curp: string;
21
-
22
- @IsString()
23
- @IsNotEmpty()
24
- createDate: string;
25
-
26
- @IsString()
27
- @IsNotEmpty()
28
- signBase64: string;
29
- }
1
+ import { IsNotEmpty, IsString } from 'class-validator';
2
+
3
+
4
+ export class ContractCreateRequest {
5
+
6
+ @IsString()
7
+ @IsNotEmpty()
8
+ id: string;
9
+
10
+ @IsString()
11
+ @IsNotEmpty()
12
+ indexName: string;
13
+
14
+ @IsString()
15
+ @IsNotEmpty()
16
+ dob: string;
17
+
18
+ @IsString()
19
+ @IsNotEmpty()
20
+ curp: string;
21
+
22
+ @IsString()
23
+ @IsNotEmpty()
24
+ createDate: string;
25
+
26
+ @IsString()
27
+ @IsNotEmpty()
28
+ signBase64: string;
29
+ }
@@ -1,3 +1,3 @@
1
- export class ContractCreateResponse {
2
- reportBase64: string;
1
+ export class ContractCreateResponse {
2
+ reportBase64: string;
3
3
  }
@@ -1,4 +1,4 @@
1
-
2
- //dtos
3
- export * from './dtos/ContractCreateRequest';
4
- export * from './dtos/ContractCreateResponse';
1
+
2
+ //dtos
3
+ export * from './dtos/ContractCreateRequest';
4
+ export * from './dtos/ContractCreateResponse';
@@ -1,6 +1,6 @@
1
-
2
-
3
- export enum Country {
4
- MEX = "MEX",
5
- USA = "USA"
6
- }
1
+
2
+
3
+ export enum Country {
4
+ MEX = "MEX",
5
+ USA = "USA"
6
+ }
@@ -1,7 +1,7 @@
1
-
2
- //*
3
-
4
- export enum CountryId {
5
- MEX = "484",
6
- USA = "840"
1
+
2
+ //*
3
+
4
+ export enum CountryId {
5
+ MEX = "484",
6
+ USA = "840"
7
7
  }
@@ -1,6 +1,6 @@
1
- //dto
2
-
3
-
4
- //enums
5
- export * from './enums/CountryId';
1
+ //dto
2
+
3
+
4
+ //enums
5
+ export * from './enums/CountryId';
6
6
  export * from './enums/Country';
@@ -1,52 +1,52 @@
1
- import { IsEnum, IsNotEmpty, IsNumber, IsString } from "class-validator";
2
- import { CountryId } from "../../country";
3
- import { ProductTypeEnum } from "../../productCatalog";
4
-
5
-
6
- export default class CreditContractCreateRequest {
7
-
8
- @IsString()
9
- @IsNotEmpty()
10
- directoryUserId: string;
11
-
12
- @IsString()
13
- @IsNotEmpty()
14
- relatedTransaction: string;
15
-
16
- @IsString()
17
- @IsNotEmpty()
18
- peopleId: string;
19
-
20
- @IsEnum(CountryId)
21
- @IsNotEmpty()
22
- currencyId: CountryId;
23
-
24
- @IsNumber()
25
- @IsNotEmpty()
26
- creditNotional: number;
27
-
28
- @IsNumber()
29
- @IsNotEmpty()
30
- creditFee: number;
31
-
32
- @IsNumber()
33
- @IsNotEmpty()
34
- creditTax: number;
35
-
36
- @IsNumber()
37
- @IsNotEmpty()
38
- creditTotal: number;
39
-
40
- @IsEnum(ProductTypeEnum)
41
- @IsNotEmpty()
42
- instrument: ProductTypeEnum;
43
-
44
- @IsNumber()
45
- @IsNotEmpty()
46
- amountBlocked: number;
47
-
48
- @IsString()
49
- @IsNotEmpty()
50
- relatedPocketId: string;
51
-
1
+ import { IsEnum, IsNotEmpty, IsNumber, IsString } from "class-validator";
2
+ import { CountryId } from "../../country";
3
+ import { ProductTypeEnum } from "../../productCatalog";
4
+
5
+
6
+ export default class CreditContractCreateRequest {
7
+
8
+ @IsString()
9
+ @IsNotEmpty()
10
+ directoryUserId: string;
11
+
12
+ @IsString()
13
+ @IsNotEmpty()
14
+ relatedTransaction: string;
15
+
16
+ @IsString()
17
+ @IsNotEmpty()
18
+ peopleId: string;
19
+
20
+ @IsEnum(CountryId)
21
+ @IsNotEmpty()
22
+ currencyId: CountryId;
23
+
24
+ @IsNumber()
25
+ @IsNotEmpty()
26
+ creditNotional: number;
27
+
28
+ @IsNumber()
29
+ @IsNotEmpty()
30
+ creditFee: number;
31
+
32
+ @IsNumber()
33
+ @IsNotEmpty()
34
+ creditTax: number;
35
+
36
+ @IsNumber()
37
+ @IsNotEmpty()
38
+ creditTotal: number;
39
+
40
+ @IsEnum(ProductTypeEnum)
41
+ @IsNotEmpty()
42
+ instrument: ProductTypeEnum;
43
+
44
+ @IsNumber()
45
+ @IsNotEmpty()
46
+ amountBlocked: number;
47
+
48
+ @IsString()
49
+ @IsNotEmpty()
50
+ relatedPocketId: string;
51
+
52
52
  }
@@ -1,6 +1,6 @@
1
- export declare enum InstrumentEnum {
2
- CREDIT_CARD = "TdC",
3
- ATM = "ATM",
4
- TRANSFER = "TRF",
5
- SRV = "SRV"
1
+ export declare enum InstrumentEnum {
2
+ CREDIT_CARD = "TdC",
3
+ ATM = "ATM",
4
+ TRANSFER = "TRF",
5
+ SRV = "SRV"
6
6
  }
@@ -1,6 +1,6 @@
1
-
2
- //dtos
3
- export * from './dtos/CreditContractCreateRequest';
4
-
5
- //enums
1
+
2
+ //dtos
3
+ export * from './dtos/CreditContractCreateRequest';
4
+
5
+ //enums
6
6
  export * from './enums/InstrumentEnum';
@@ -1,9 +1,9 @@
1
-
2
- export class CurrencyResponse {
3
-
4
- currencyId: string;
5
- iso: string;
6
- name: string;
7
- symbol: string;
8
-
1
+
2
+ export class CurrencyResponse {
3
+
4
+ currencyId: string;
5
+ iso: string;
6
+ name: string;
7
+ symbol: string;
8
+
9
9
  }
@@ -1,3 +1,3 @@
1
-
2
-
1
+
2
+
3
3
  export * from './dtos/CurrencyResponse';
@@ -1,19 +1,19 @@
1
- import { Profile } from "../enums/Profile";
2
- import { Scope } from "../enums/Scope";
3
- import { Status } from "../enums/Status";
4
- import { External } from "./External";
5
-
6
-
7
- export interface DirectoryResponse {
8
- id: string;
9
- identityId: string | null;
10
- lastSession: string | null;
11
- ownerDirectoryId: string | null;
12
- password: string;
13
- peopleId: string;
14
- phoneNumber: string;
15
- scope: Array<Scope>;
16
- status: Status;
17
- userProfile: Profile;
18
- external: Array<External>;
1
+ import { Profile } from "../enums/Profile";
2
+ import { Scope } from "../enums/Scope";
3
+ import { Status } from "../enums/Status";
4
+ import { External } from "./External";
5
+
6
+
7
+ export interface DirectoryResponse {
8
+ id: string;
9
+ identityId: string | null;
10
+ lastSession: string | null;
11
+ ownerDirectoryId: string | null;
12
+ password: string;
13
+ peopleId: string;
14
+ phoneNumber: string;
15
+ scope: Array<Scope>;
16
+ status: Status;
17
+ userProfile: Profile;
18
+ external: Array<External>;
19
19
  }
@@ -1,7 +1,7 @@
1
- import { Provider } from "../../provider/enums/Provider";
2
-
3
-
4
- export type External = {
5
- provider: Provider;
6
- user: string;
1
+ import { Provider } from "../../provider/enums/Provider";
2
+
3
+
4
+ export type External = {
5
+ provider: Provider;
6
+ user: string;
7
7
  };
@@ -1,7 +1,7 @@
1
-
2
-
3
- export enum Profile {
4
- HOST = "HOST",
5
- GUEST = "GUEST",
6
- GUEST_MINOR = "GUEST_MINOR"
1
+
2
+
3
+ export enum Profile {
4
+ HOST = "HOST",
5
+ GUEST = "GUEST",
6
+ GUEST_MINOR = "GUEST_MINOR"
7
7
  }