@fiado/type-kit 3.199.0 → 3.202.0

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 (68) hide show
  1. package/_test_/unit/auth/SignUpProspectRequest.test.ts +32 -0
  2. package/_test_/unit/auth/SignUpProspectResponse.test.ts +26 -0
  3. package/_test_/unit/kyc/KycByDirectoryResponse.test.ts +139 -0
  4. package/_test_/unit/kyc/KycVerificationChangedV1.test.ts +99 -0
  5. package/_test_/unit/messagesConnector/SendMessageRequest.test.ts +48 -0
  6. package/bin/auth/dtos/SignUpProspectRequest.d.ts +15 -0
  7. package/bin/auth/dtos/SignUpProspectRequest.js +44 -0
  8. package/bin/auth/dtos/SignUpProspectResponse.d.ts +11 -0
  9. package/bin/auth/dtos/SignUpProspectResponse.js +36 -0
  10. package/bin/auth/index.d.ts +2 -0
  11. package/bin/auth/index.js +2 -0
  12. package/bin/benefitCenter/enums/BenefitFlowEnum.d.ts +11 -0
  13. package/bin/benefitCenter/enums/BenefitFlowEnum.js +15 -0
  14. package/bin/index.d.ts +1 -0
  15. package/bin/index.js +5 -0
  16. package/bin/kyc/dtos/responses/KycByDirectoryResponse.d.ts +49 -0
  17. package/bin/kyc/dtos/responses/KycByDirectoryResponse.js +91 -0
  18. package/bin/kyc/dtos/responses/KycPersonData.d.ts +11 -0
  19. package/bin/{loanCredit/dtos/requests/UpdateActivationChecklistRequest.js → kyc/dtos/responses/KycPersonData.js} +23 -18
  20. package/bin/kyc/enums/KycVerificationStatusEnum.d.ts +18 -0
  21. package/bin/kyc/enums/KycVerificationStatusEnum.js +22 -0
  22. package/bin/kyc/events/KycVerificationChangedV1.d.ts +35 -0
  23. package/bin/kyc/events/KycVerificationChangedV1.js +76 -0
  24. package/bin/kyc/index.d.ts +4 -0
  25. package/bin/kyc/index.js +24 -0
  26. package/bin/loanConfig/enums/ModifiableByRoleEnum.d.ts +11 -0
  27. package/bin/loanConfig/enums/ModifiableByRoleEnum.js +15 -0
  28. package/bin/messagesConnector/dtos/SendMessageRequest.js +2 -1
  29. package/bin/places/dtos/CashInFeeDto.d.ts +17 -0
  30. package/bin/places/dtos/CashInFeeDto.js +12 -0
  31. package/bin/platformRbac/dtos/ResendOtpRequest.d.ts +22 -0
  32. package/bin/platformRbac/dtos/ResendOtpRequest.js +36 -0
  33. package/bin/platformRbac/dtos/ResendSelfRegisterOtpRequest.d.ts +11 -0
  34. package/bin/platformRbac/dtos/ResendSelfRegisterOtpRequest.js +36 -0
  35. package/bin/retailCustomer/dtos/RetailCustomer.d.ts +24 -2
  36. package/bin/retailCustomer/dtos/RetailCustomer.js +64 -1
  37. package/bin/retailCustomer/dtos/requests/CreateCustomerRequest.d.ts +7 -1
  38. package/bin/retailCustomer/dtos/requests/CreateCustomerRequest.js +30 -1
  39. package/bin/retailCustomer/dtos/requests/UpdateCustomerRequest.d.ts +7 -1
  40. package/bin/retailCustomer/dtos/requests/UpdateCustomerRequest.js +31 -1
  41. package/bin/retailCustomer/dtos/requests/UpsertCustomerFromKycRequest.d.ts +13 -1
  42. package/bin/retailCustomer/dtos/requests/UpsertCustomerFromKycRequest.js +41 -1
  43. package/bin/retailCustomer/dtos/responses/CustomerResponse.d.ts +14 -2
  44. package/bin/retailCustomer/enums/RetailCustomerStatusEnum.d.ts +10 -0
  45. package/bin/retailCustomer/enums/RetailCustomerStatusEnum.js +14 -0
  46. package/bin/retailCustomer/index.d.ts +1 -0
  47. package/bin/retailCustomer/index.js +1 -0
  48. package/package.json +1 -1
  49. package/src/auth/dtos/SignUpProspectRequest.ts +23 -0
  50. package/src/auth/dtos/SignUpProspectResponse.ts +17 -0
  51. package/src/auth/index.ts +2 -0
  52. package/src/index.ts +4 -0
  53. package/src/kyc/dtos/responses/KycByDirectoryResponse.ts +69 -0
  54. package/src/kyc/dtos/responses/KycPersonData.ts +23 -0
  55. package/src/kyc/enums/KycVerificationStatusEnum.ts +18 -0
  56. package/src/kyc/events/KycVerificationChangedV1.ts +51 -0
  57. package/src/kyc/index.ts +10 -0
  58. package/src/messagesConnector/dtos/SendMessageRequest.ts +8 -1
  59. package/src/retailCustomer/dtos/RetailCustomer.ts +75 -3
  60. package/src/retailCustomer/dtos/requests/CreateCustomerRequest.ts +26 -2
  61. package/src/retailCustomer/dtos/requests/UpdateCustomerRequest.ts +28 -2
  62. package/src/retailCustomer/dtos/requests/UpsertCustomerFromKycRequest.ts +49 -2
  63. package/src/retailCustomer/dtos/responses/CustomerResponse.ts +14 -2
  64. package/src/retailCustomer/enums/RetailCustomerStatusEnum.ts +10 -0
  65. package/src/retailCustomer/index.ts +1 -0
  66. package/bin/loanCredit/dtos/requests/UpdateActivationChecklistRequest.d.ts +0 -11
  67. package/bin/loanCredit/enums/ClientLevelEnum.d.ts +0 -11
  68. package/bin/loanCredit/enums/ClientLevelEnum.js +0 -15
@@ -16,6 +16,7 @@ const regex_1 = require("../../helpers/constans/regex");
16
16
  const AddressBase_1 = require("../../address/dtos/AddressBase");
17
17
  const AccountStatusEnum_1 = require("../enums/AccountStatusEnum");
18
18
  const KycModalityEnum_1 = require("../enums/KycModalityEnum");
19
+ const RetailCustomerStatusEnum_1 = require("../enums/RetailCustomerStatusEnum");
19
20
  const RetailKycStatusEnum_1 = require("../enums/RetailKycStatusEnum");
20
21
  const KycReview_1 = require("./KycReview");
21
22
  /**
@@ -41,7 +42,23 @@ __decorate([
41
42
  (0, class_transformer_1.Expose)(),
42
43
  (0, class_validator_1.IsString)(),
43
44
  __metadata("design:type", String)
44
- ], RetailCustomer.prototype, "name", void 0);
45
+ ], RetailCustomer.prototype, "originStoreId", void 0);
46
+ __decorate([
47
+ (0, class_transformer_1.Expose)(),
48
+ (0, class_validator_1.IsString)(),
49
+ __metadata("design:type", String)
50
+ ], RetailCustomer.prototype, "names", void 0);
51
+ __decorate([
52
+ (0, class_transformer_1.Expose)(),
53
+ (0, class_validator_1.IsString)(),
54
+ __metadata("design:type", String)
55
+ ], RetailCustomer.prototype, "paternalLastName", void 0);
56
+ __decorate([
57
+ (0, class_transformer_1.Expose)(),
58
+ (0, class_validator_1.IsOptional)(),
59
+ (0, class_validator_1.IsString)(),
60
+ __metadata("design:type", String)
61
+ ], RetailCustomer.prototype, "maternalLastName", void 0);
45
62
  __decorate([
46
63
  (0, class_transformer_1.Expose)(),
47
64
  (0, class_validator_1.IsString)(),
@@ -49,9 +66,27 @@ __decorate([
49
66
  ], RetailCustomer.prototype, "phone", void 0);
50
67
  __decorate([
51
68
  (0, class_transformer_1.Expose)(),
69
+ (0, class_validator_1.IsBoolean)(),
70
+ __metadata("design:type", Boolean)
71
+ ], RetailCustomer.prototype, "phoneVerified", void 0);
72
+ __decorate([
73
+ (0, class_transformer_1.Expose)(),
74
+ (0, class_validator_1.IsOptional)(),
52
75
  (0, class_validator_1.IsString)(),
53
76
  __metadata("design:type", String)
54
77
  ], RetailCustomer.prototype, "curp", void 0);
78
+ __decorate([
79
+ (0, class_transformer_1.Expose)(),
80
+ (0, class_validator_1.IsOptional)(),
81
+ (0, class_validator_1.IsString)(),
82
+ __metadata("design:type", String)
83
+ ], RetailCustomer.prototype, "rfc", void 0);
84
+ __decorate([
85
+ (0, class_transformer_1.Expose)(),
86
+ (0, class_validator_1.IsOptional)(),
87
+ (0, class_validator_1.IsEmail)(),
88
+ __metadata("design:type", String)
89
+ ], RetailCustomer.prototype, "email", void 0);
55
90
  __decorate([
56
91
  (0, class_transformer_1.Expose)(),
57
92
  (0, class_validator_1.IsOptional)(),
@@ -136,6 +171,34 @@ __decorate([
136
171
  (0, class_transformer_1.Type)(() => KycReview_1.KycReview),
137
172
  __metadata("design:type", KycReview_1.KycReview)
138
173
  ], RetailCustomer.prototype, "kycReview", void 0);
174
+ __decorate([
175
+ (0, class_transformer_1.Expose)(),
176
+ (0, class_validator_1.IsOptional)(),
177
+ (0, class_validator_1.IsNumber)(),
178
+ __metadata("design:type", Number)
179
+ ], RetailCustomer.prototype, "kycScore", void 0);
180
+ __decorate([
181
+ (0, class_transformer_1.Expose)(),
182
+ (0, class_validator_1.IsOptional)(),
183
+ (0, class_validator_1.IsString)(),
184
+ __metadata("design:type", String)
185
+ ], RetailCustomer.prototype, "metamapVerificationId", void 0);
186
+ __decorate([
187
+ (0, class_transformer_1.Expose)(),
188
+ (0, class_validator_1.IsBoolean)(),
189
+ __metadata("design:type", Boolean)
190
+ ], RetailCustomer.prototype, "pldFlag", void 0);
191
+ __decorate([
192
+ (0, class_transformer_1.Expose)(),
193
+ (0, class_validator_1.IsOptional)(),
194
+ (0, class_validator_1.IsString)(),
195
+ __metadata("design:type", String)
196
+ ], RetailCustomer.prototype, "notes", void 0);
197
+ __decorate([
198
+ (0, class_transformer_1.Expose)(),
199
+ (0, class_validator_1.IsEnum)(RetailCustomerStatusEnum_1.RetailCustomerStatusEnum),
200
+ __metadata("design:type", String)
201
+ ], RetailCustomer.prototype, "status", void 0);
139
202
  __decorate([
140
203
  (0, class_transformer_1.Expose)(),
141
204
  (0, class_validator_1.IsString)(),
@@ -1,10 +1,16 @@
1
1
  /**
2
2
  * Alta básica de un cliente retail (identidad comercial mínima; el KYC la enriquece después).
3
+ * Nombre partido por convención Fiado y CURP opcional — "null hasta KYC" (F1 §3.5).
3
4
  * SureKeep Fase 2 — pista Retail.
4
5
  */
5
6
  export declare class CreateCustomerRequest {
6
- name: string;
7
+ originStoreId: string;
8
+ names: string;
9
+ paternalLastName: string;
10
+ maternalLastName?: string;
7
11
  phone: string;
8
12
  curp?: string;
13
+ rfc?: string;
14
+ email?: string;
9
15
  birthDate?: string;
10
16
  }
@@ -15,6 +15,7 @@ const class_validator_1 = require("class-validator");
15
15
  const regex_1 = require("../../../helpers/constans/regex");
16
16
  /**
17
17
  * Alta básica de un cliente retail (identidad comercial mínima; el KYC la enriquece después).
18
+ * Nombre partido por convención Fiado y CURP opcional — "null hasta KYC" (F1 §3.5).
18
19
  * SureKeep Fase 2 — pista Retail.
19
20
  */
20
21
  class CreateCustomerRequest {
@@ -24,7 +25,23 @@ __decorate([
24
25
  (0, class_transformer_1.Expose)(),
25
26
  (0, class_validator_1.IsString)(),
26
27
  __metadata("design:type", String)
27
- ], CreateCustomerRequest.prototype, "name", void 0);
28
+ ], CreateCustomerRequest.prototype, "originStoreId", void 0);
29
+ __decorate([
30
+ (0, class_transformer_1.Expose)(),
31
+ (0, class_validator_1.IsString)(),
32
+ __metadata("design:type", String)
33
+ ], CreateCustomerRequest.prototype, "names", void 0);
34
+ __decorate([
35
+ (0, class_transformer_1.Expose)(),
36
+ (0, class_validator_1.IsString)(),
37
+ __metadata("design:type", String)
38
+ ], CreateCustomerRequest.prototype, "paternalLastName", void 0);
39
+ __decorate([
40
+ (0, class_transformer_1.Expose)(),
41
+ (0, class_validator_1.IsOptional)(),
42
+ (0, class_validator_1.IsString)(),
43
+ __metadata("design:type", String)
44
+ ], CreateCustomerRequest.prototype, "maternalLastName", void 0);
28
45
  __decorate([
29
46
  (0, class_transformer_1.Expose)(),
30
47
  (0, class_validator_1.IsString)(),
@@ -36,6 +53,18 @@ __decorate([
36
53
  (0, class_validator_1.IsString)(),
37
54
  __metadata("design:type", String)
38
55
  ], CreateCustomerRequest.prototype, "curp", void 0);
56
+ __decorate([
57
+ (0, class_transformer_1.Expose)(),
58
+ (0, class_validator_1.IsOptional)(),
59
+ (0, class_validator_1.IsString)(),
60
+ __metadata("design:type", String)
61
+ ], CreateCustomerRequest.prototype, "rfc", void 0);
62
+ __decorate([
63
+ (0, class_transformer_1.Expose)(),
64
+ (0, class_validator_1.IsOptional)(),
65
+ (0, class_validator_1.IsEmail)(),
66
+ __metadata("design:type", String)
67
+ ], CreateCustomerRequest.prototype, "email", void 0);
39
68
  __decorate([
40
69
  (0, class_transformer_1.Expose)(),
41
70
  (0, class_validator_1.IsOptional)(),
@@ -3,8 +3,14 @@
3
3
  * AuditTrail + PiiAccessLog en el lambda. SureKeep Fase 2 — pista Retail.
4
4
  */
5
5
  export declare class UpdateCustomerRequest {
6
- name?: string;
6
+ names?: string;
7
+ paternalLastName?: string;
8
+ maternalLastName?: string;
7
9
  phone?: string;
8
10
  curp?: string;
11
+ rfc?: string;
12
+ email?: string;
13
+ /** Notas operativas del BO (F1 §3.5). */
14
+ notes?: string;
9
15
  birthDate?: string;
10
16
  }
@@ -25,7 +25,19 @@ __decorate([
25
25
  (0, class_validator_1.IsOptional)(),
26
26
  (0, class_validator_1.IsString)(),
27
27
  __metadata("design:type", String)
28
- ], UpdateCustomerRequest.prototype, "name", void 0);
28
+ ], UpdateCustomerRequest.prototype, "names", void 0);
29
+ __decorate([
30
+ (0, class_transformer_1.Expose)(),
31
+ (0, class_validator_1.IsOptional)(),
32
+ (0, class_validator_1.IsString)(),
33
+ __metadata("design:type", String)
34
+ ], UpdateCustomerRequest.prototype, "paternalLastName", void 0);
35
+ __decorate([
36
+ (0, class_transformer_1.Expose)(),
37
+ (0, class_validator_1.IsOptional)(),
38
+ (0, class_validator_1.IsString)(),
39
+ __metadata("design:type", String)
40
+ ], UpdateCustomerRequest.prototype, "maternalLastName", void 0);
29
41
  __decorate([
30
42
  (0, class_transformer_1.Expose)(),
31
43
  (0, class_validator_1.IsOptional)(),
@@ -38,6 +50,24 @@ __decorate([
38
50
  (0, class_validator_1.IsString)(),
39
51
  __metadata("design:type", String)
40
52
  ], UpdateCustomerRequest.prototype, "curp", void 0);
53
+ __decorate([
54
+ (0, class_transformer_1.Expose)(),
55
+ (0, class_validator_1.IsOptional)(),
56
+ (0, class_validator_1.IsString)(),
57
+ __metadata("design:type", String)
58
+ ], UpdateCustomerRequest.prototype, "rfc", void 0);
59
+ __decorate([
60
+ (0, class_transformer_1.Expose)(),
61
+ (0, class_validator_1.IsOptional)(),
62
+ (0, class_validator_1.IsEmail)(),
63
+ __metadata("design:type", String)
64
+ ], UpdateCustomerRequest.prototype, "email", void 0);
65
+ __decorate([
66
+ (0, class_transformer_1.Expose)(),
67
+ (0, class_validator_1.IsOptional)(),
68
+ (0, class_validator_1.IsString)(),
69
+ __metadata("design:type", String)
70
+ ], UpdateCustomerRequest.prototype, "notes", void 0);
41
71
  __decorate([
42
72
  (0, class_transformer_1.Expose)(),
43
73
  (0, class_validator_1.IsOptional)(),
@@ -7,10 +7,22 @@ import { RetailKycStatusEnum } from '../../enums/RetailKycStatusEnum';
7
7
  * SureKeep Fase 2 — pista Retail.
8
8
  */
9
9
  export declare class UpsertCustomerFromKycRequest {
10
- name: string;
10
+ /** Tienda de alta/origen — del JWT del vendedor dueño de la sesión del wizard (F1 §3.5). */
11
+ originStoreId: string;
12
+ /** Nombre partido por convención Fiado (F1 §3.5) — lo entrega el OCR del INE, NO se deriva de un string. */
13
+ names: string;
14
+ paternalLastName: string;
15
+ /** Segundo apellido — opcional (F1 §3.5: "el 2º apellido nullable"). */
16
+ maternalLastName?: string;
11
17
  phone: string;
12
18
  curp: string;
13
19
  birthDate?: string;
20
+ rfc?: string;
21
+ email?: string;
22
+ /** Score de confianza que devuelve Metamap junto con el resultado del KYC (F1 §3.5). */
23
+ kycScore?: number;
24
+ /** Referencia a la verificación en `kyc-verifications-business` (INT1, F1 §3.5). */
25
+ metamapVerificationId?: string;
14
26
  fiadoDirectoryId: string;
15
27
  fiadoPeopleId: string;
16
28
  pcfAccountId?: string;
@@ -28,7 +28,23 @@ __decorate([
28
28
  (0, class_transformer_1.Expose)(),
29
29
  (0, class_validator_1.IsString)(),
30
30
  __metadata("design:type", String)
31
- ], UpsertCustomerFromKycRequest.prototype, "name", void 0);
31
+ ], UpsertCustomerFromKycRequest.prototype, "originStoreId", void 0);
32
+ __decorate([
33
+ (0, class_transformer_1.Expose)(),
34
+ (0, class_validator_1.IsString)(),
35
+ __metadata("design:type", String)
36
+ ], UpsertCustomerFromKycRequest.prototype, "names", void 0);
37
+ __decorate([
38
+ (0, class_transformer_1.Expose)(),
39
+ (0, class_validator_1.IsString)(),
40
+ __metadata("design:type", String)
41
+ ], UpsertCustomerFromKycRequest.prototype, "paternalLastName", void 0);
42
+ __decorate([
43
+ (0, class_transformer_1.Expose)(),
44
+ (0, class_validator_1.IsOptional)(),
45
+ (0, class_validator_1.IsString)(),
46
+ __metadata("design:type", String)
47
+ ], UpsertCustomerFromKycRequest.prototype, "maternalLastName", void 0);
32
48
  __decorate([
33
49
  (0, class_transformer_1.Expose)(),
34
50
  (0, class_transformer_1.Transform)(({ value }) => (typeof value === 'string' ? value.replace(/[\s-]/g, '') : value)),
@@ -50,6 +66,30 @@ __decorate([
50
66
  (0, class_validator_1.Matches)(regex_1.regexIso8601Date, { message: 'birthDate debe ser una fecha ISO 8601' }),
51
67
  __metadata("design:type", String)
52
68
  ], UpsertCustomerFromKycRequest.prototype, "birthDate", void 0);
69
+ __decorate([
70
+ (0, class_transformer_1.Expose)(),
71
+ (0, class_validator_1.IsOptional)(),
72
+ (0, class_validator_1.IsString)(),
73
+ __metadata("design:type", String)
74
+ ], UpsertCustomerFromKycRequest.prototype, "rfc", void 0);
75
+ __decorate([
76
+ (0, class_transformer_1.Expose)(),
77
+ (0, class_validator_1.IsOptional)(),
78
+ (0, class_validator_1.IsEmail)(),
79
+ __metadata("design:type", String)
80
+ ], UpsertCustomerFromKycRequest.prototype, "email", void 0);
81
+ __decorate([
82
+ (0, class_transformer_1.Expose)(),
83
+ (0, class_validator_1.IsOptional)(),
84
+ (0, class_validator_1.IsNumber)(),
85
+ __metadata("design:type", Number)
86
+ ], UpsertCustomerFromKycRequest.prototype, "kycScore", void 0);
87
+ __decorate([
88
+ (0, class_transformer_1.Expose)(),
89
+ (0, class_validator_1.IsOptional)(),
90
+ (0, class_validator_1.IsString)(),
91
+ __metadata("design:type", String)
92
+ ], UpsertCustomerFromKycRequest.prototype, "metamapVerificationId", void 0);
53
93
  __decorate([
54
94
  (0, class_transformer_1.Expose)(),
55
95
  (0, class_validator_1.IsString)(),
@@ -1,6 +1,7 @@
1
1
  import { AddressBase } from '../../../address/dtos/AddressBase';
2
2
  import { AccountStatusEnum } from '../../enums/AccountStatusEnum';
3
3
  import { KycModalityEnum } from '../../enums/KycModalityEnum';
4
+ import { RetailCustomerStatusEnum } from '../../enums/RetailCustomerStatusEnum';
4
5
  import { RetailKycStatusEnum } from '../../enums/RetailKycStatusEnum';
5
6
  /**
6
7
  * Vista de un cliente retail hacia el consumidor (BO / api-invoker). SureKeep Fase 2 — pista Retail.
@@ -9,9 +10,15 @@ import { RetailKycStatusEnum } from '../../enums/RetailKycStatusEnum';
9
10
  export interface CustomerResponse {
10
11
  retailCustomerId: string;
11
12
  retailerId: string;
12
- name: string;
13
+ originStoreId: string;
14
+ names: string;
15
+ paternalLastName: string;
16
+ maternalLastName: string | null;
13
17
  phone: string;
14
- curp: string;
18
+ phoneVerified: boolean;
19
+ curp: string | null;
20
+ rfc: string | null;
21
+ email: string | null;
15
22
  birthDate: string | null;
16
23
  fiadoDirectoryId: string | null;
17
24
  fiadoPeopleId: string | null;
@@ -25,6 +32,11 @@ export interface CustomerResponse {
25
32
  addressConfirmed: boolean;
26
33
  kycStatus: RetailKycStatusEnum;
27
34
  kycModality: KycModalityEnum | null;
35
+ kycScore: number | null;
36
+ metamapVerificationId: string | null;
37
+ pldFlag: boolean;
38
+ notes: string | null;
39
+ status: RetailCustomerStatusEnum;
28
40
  createdAt: string;
29
41
  updatedAt: string;
30
42
  }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Estado de vigencia del cliente retail — soft-delete de la convención F1 (modelo-datos F1 §1-§2:
3
+ * "soft-delete" es obligatorio en todas las entidades del silo). ACTIVE es el default del alta;
4
+ * INACTIVE marca la baja lógica (nunca se borra el ítem, para trazabilidad regulatoria).
5
+ * SureKeep Fase 2 — pista Retail.
6
+ */
7
+ export declare enum RetailCustomerStatusEnum {
8
+ ACTIVE = "ACTIVE",
9
+ INACTIVE = "INACTIVE"
10
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RetailCustomerStatusEnum = void 0;
4
+ /**
5
+ * Estado de vigencia del cliente retail — soft-delete de la convención F1 (modelo-datos F1 §1-§2:
6
+ * "soft-delete" es obligatorio en todas las entidades del silo). ACTIVE es el default del alta;
7
+ * INACTIVE marca la baja lógica (nunca se borra el ítem, para trazabilidad regulatoria).
8
+ * SureKeep Fase 2 — pista Retail.
9
+ */
10
+ var RetailCustomerStatusEnum;
11
+ (function (RetailCustomerStatusEnum) {
12
+ RetailCustomerStatusEnum["ACTIVE"] = "ACTIVE";
13
+ RetailCustomerStatusEnum["INACTIVE"] = "INACTIVE";
14
+ })(RetailCustomerStatusEnum || (exports.RetailCustomerStatusEnum = RetailCustomerStatusEnum = {}));
@@ -2,6 +2,7 @@ export * from './enums/AccountStatusEnum';
2
2
  export * from './enums/RetailKycStatusEnum';
3
3
  export * from './enums/KycModalityEnum';
4
4
  export * from './enums/KycReviewResultEnum';
5
+ export * from './enums/RetailCustomerStatusEnum';
5
6
  export * from './dtos/KycReview';
6
7
  export * from './dtos/RetailCustomer';
7
8
  export * from './dtos/requests/CreateCustomerRequest';
@@ -19,6 +19,7 @@ __exportStar(require("./enums/AccountStatusEnum"), exports);
19
19
  __exportStar(require("./enums/RetailKycStatusEnum"), exports);
20
20
  __exportStar(require("./enums/KycModalityEnum"), exports);
21
21
  __exportStar(require("./enums/KycReviewResultEnum"), exports);
22
+ __exportStar(require("./enums/RetailCustomerStatusEnum"), exports);
22
23
  // Entidades (planas, con class-validator + @Expose)
23
24
  __exportStar(require("./dtos/KycReview"), exports);
24
25
  __exportStar(require("./dtos/RetailCustomer"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "3.199.0",
3
+ "version": "3.202.0",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -0,0 +1,23 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { IsNotEmpty, IsString } from 'class-validator';
3
+
4
+ /**
5
+ * Alta de prospecto M2M en `auth-business` (crea onboarding + People + DirectoryUser).
6
+ * Contrato REDUCIDO respecto del de agente: sin caller, sin referral, sin campos de app.
7
+ *
8
+ * `tenantId` es OBLIGATORIO y explícito: la variante de agente lo tiene hardcodeado a
9
+ * `FIADO_BETA`, y eliminar ese hardcode es parte del contrato de este endpoint privado.
10
+ *
11
+ * ⚠️ PII: nombre y teléfono — nunca loguear el request completo.
12
+ */
13
+ export class SignUpProspectRequest {
14
+ @Expose() @IsString() @IsNotEmpty()
15
+ name!: string;
16
+
17
+ @Expose() @IsString() @IsNotEmpty()
18
+ phoneNumber!: string;
19
+
20
+ /** Decidido: sin `@Matches(/^[a-z0-9-]+$/)` — `FIADO_BETA` es un tenant real y ese regex lo rechazaría. */
21
+ @Expose() @IsString() @IsNotEmpty()
22
+ tenantId!: string;
23
+ }
@@ -0,0 +1,17 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { IsNotEmpty, IsString } from 'class-validator';
3
+
4
+ /**
5
+ * Identidad Fiado creada (o reusada) para el prospecto.
6
+ *
7
+ * DEC-KYC-015: `directoryId` y `peopleId` llevan `@IsNotEmpty()` — son los mismos dos
8
+ * identificadores que en el dominio `kyc`, y vienen de un destino que ya demostró devolver
9
+ * strings vacíos. `@IsString()` pelado los dejaría pasar en silencio.
10
+ */
11
+ export class SignUpProspectResponse {
12
+ @Expose() @IsString() @IsNotEmpty()
13
+ directoryId!: string;
14
+
15
+ @Expose() @IsString() @IsNotEmpty()
16
+ peopleId!: string;
17
+ }
package/src/auth/index.ts CHANGED
@@ -5,3 +5,5 @@ export * from './dtos/ResetPasswordBackofficeRequest';
5
5
  export * from './dtos/SignInBackofficeRequest';
6
6
  export * from './dtos/SignInBackofficeResponse';
7
7
  export * from './dtos/SignUpBackofficeRequest';
8
+ export * from './dtos/SignUpProspectRequest';
9
+ export * from './dtos/SignUpProspectResponse';
package/src/index.ts CHANGED
@@ -130,5 +130,9 @@ export * as LoanCredit from './loanCredit';
130
130
  // ScoringProviderRouter configurable Modelias|Círculo con contrato agnóstico ScoringDecision;
131
131
  // SureKeep Fase 2 — pista Loan/SOFOM).
132
132
  export * as LoanScoring from './loanScoring';
133
+ // Kyc: contrato de la lectura confirmatoria del KYC (kyc-verifications-business) — estado
134
+ // consolidado + estados crudos + datos de persona. El consolidado reusa RetailKycStatusEnum
135
+ // (no hay enum consolidado propio — DEC-KYC-014). SureKeep Fase 2.
136
+ export * as Kyc from './kyc';
133
137
  export * from './messaging';
134
138
  export * from './complaint';
@@ -0,0 +1,69 @@
1
+ import { Expose, Type } from 'class-transformer';
2
+ import { IsEnum, IsISO8601, IsNotEmpty, IsOptional, IsString, ValidateNested } from 'class-validator';
3
+ import { IdentificationDocumentStatus } from '../../../identity/enums/IdentificationDocumentStatus';
4
+ import { RetailKycStatusEnum } from '../../../retailCustomer/enums/RetailKycStatusEnum';
5
+ import { KycVerificationStatusEnum } from '../../enums/KycVerificationStatusEnum';
6
+ import { KycPersonData } from './KycPersonData';
7
+
8
+ /**
9
+ * Estado consolidado del KYC de un directorio + los estados crudos + los datos de persona.
10
+ *
11
+ * Los campos crudos viajan además del consolidado para que el consumidor NO tenga que
12
+ * reimplementar el mapeo de otro dominio.
13
+ *
14
+ * DEC-KYC-014: "sin verificación" se responde con 404, NO con un valor de enum. Por eso todos
15
+ * los campos de identidad y estado son REQUERIDOS — este DTO solo describe el caso en que sí
16
+ * existe una verificación.
17
+ *
18
+ * DEC-KYC-004: el vocabulario del consolidado es `RetailKycStatusEnum`, el único de la lib.
19
+ *
20
+ * DEC-KYC-016: `verificationResult` reusa `IdentificationDocumentStatus` — es el enum que el
21
+ * lambda productor (`kyc-verifications-business`) escribe literalmente en la tabla; duplicarlo
22
+ * aquí sería drift garantizado.
23
+ *
24
+ * ⚠️ Lleva PII en `person` (CURP y nombre completo).
25
+ */
26
+ export class KycByDirectoryResponse {
27
+ @Expose() @IsEnum(RetailKycStatusEnum)
28
+ consolidated!: RetailKycStatusEnum;
29
+
30
+ /** La PK de la fila (`id`) mapeada a nombre de negocio. */
31
+ @Expose() @IsString() @IsNotEmpty()
32
+ verificationId!: string;
33
+
34
+ /** DEC-KYC-015: `@IsNotEmpty()` — el 7.3% de las filas de dev trae string vacío. */
35
+ @Expose() @IsString() @IsNotEmpty()
36
+ peopleId!: string;
37
+
38
+ @Expose() @IsOptional() @IsString()
39
+ metamapFlowId?: string;
40
+
41
+ @Expose() @IsEnum(KycVerificationStatusEnum)
42
+ verificationStatus!: KycVerificationStatusEnum;
43
+
44
+ /**
45
+ * Requerido y acotado al enum: se escanearon las 193 filas de `KycVerifications` en dev y los
46
+ * valores son exactamente los tres — `IN_PROGRESS+UNVERIFIED` 104, `COMPLETED+VERIFIED` 69,
47
+ * `COMPLETED+UNVERIFIED` 19, `COMPLETED+REJECTED` 1. Cero valores fuera del set, cero vacíos.
48
+ * Verificado, no asumido (2026-07-21).
49
+ */
50
+ @Expose() @IsEnum(IdentificationDocumentStatus)
51
+ verificationResult!: IdentificationDocumentStatus;
52
+
53
+ /**
54
+ * ISO-8601 obligatorio: el ordenamiento del endpoint (spec §6) se apoya en que estas fechas
55
+ * son léxicamente ordenables — si no se valida el formato, el orden es una asunción sin red.
56
+ * Se escanearon las 193 filas de `KycVerifications` en dev: `createDate` 193/193 ISO-8601 y
57
+ * `updateDate` 193/193 — 386/386, cero excepciones (ejemplo real: '2025-10-06T21:40:58.277Z').
58
+ * Verificado, no asumido (2026-07-21).
59
+ */
60
+ @Expose() @IsString() @IsISO8601()
61
+ createDate!: string;
62
+
63
+ /** ISO-8601 obligatorio — mismo escaneo de dev: 386/386 fechas ISO-8601 (2026-07-21). */
64
+ @Expose() @IsString() @IsISO8601()
65
+ updateDate!: string;
66
+
67
+ @Expose() @IsOptional() @ValidateNested() @Type(() => KycPersonData)
68
+ person?: KycPersonData;
69
+ }
@@ -0,0 +1,23 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { IsOptional, IsString } from 'class-validator';
3
+
4
+ /**
5
+ * Datos de identidad del cliente, leídos de People tras un KYC completado.
6
+ * ⚠️ PII: nunca loguear esta estructura ni exponerla en endpoints de alta frecuencia.
7
+ */
8
+ export class KycPersonData {
9
+ @Expose() @IsOptional() @IsString()
10
+ names?: string;
11
+
12
+ @Expose() @IsOptional() @IsString()
13
+ paternalLastName?: string;
14
+
15
+ @Expose() @IsOptional() @IsString()
16
+ maternalLastName?: string;
17
+
18
+ @Expose() @IsOptional() @IsString()
19
+ curp?: string;
20
+
21
+ @Expose() @IsOptional() @IsString()
22
+ dateOfBirth?: string;
23
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Ciclo de vida de la verificación en `kyc-verifications-business` (crudo, sin colapsar).
3
+ *
4
+ * DEC-KYC-016: sí, duplica `KycVerificationStatus` de `@fiado/fiado-abstractions`
5
+ * (`bin/Fiado/Database/KycVerifications.d.ts`, mismos 5 valores) — y se queda así a propósito.
6
+ * `fiado-abstractions` es la lib legacy de la que `type-kit` está migrando: el contrato nuevo no
7
+ * debe depender de ella. No lo "arregles" importando desde abstractions.
8
+ *
9
+ * (Contraste: `verificationResult` NO se duplica — reusa `IdentificationDocumentStatus`, que ya
10
+ * vive publicado en esta misma lib bajo `identity`.)
11
+ */
12
+ export enum KycVerificationStatusEnum {
13
+ CREATED = 'CREATED',
14
+ SENT = 'SENT',
15
+ IN_PROGRESS = 'IN_PROGRESS',
16
+ COMPLETED = 'COMPLETED',
17
+ ERROR = 'ERROR',
18
+ }
@@ -0,0 +1,51 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { IsEnum, IsISO8601, IsNotEmpty, IsOptional, IsString } from 'class-validator';
3
+ import { IdentificationDocumentStatus } from '../../identity/enums/IdentificationDocumentStatus';
4
+ import { KycVerificationStatusEnum } from '../enums/KycVerificationStatusEnum';
5
+
6
+ /**
7
+ * Cambio terminal de una verificación KYC, tal como llega desde el DDB Stream de
8
+ * `KycVerifications` a través del EventBridge Pipe (filtrado a COMPLETED).
9
+ *
10
+ * NO lleva `tenantId`: el de la tabla es un valor hardcodeado que no discrimina silo.
11
+ * La pertenencia se resuelve en el consumer con el gate de `WizardSession`.
12
+ *
13
+ * Los estados viajan CRUDOS para no acoplar al consumidor con el mapeo del dominio dueño.
14
+ *
15
+ * DEC-KYC-015: los tres identificadores usan `@IsNotEmpty()`. El NewImage de DDB puede traer
16
+ * `S: ""` — que `@IsString()` aceptaría en silencio. Preferimos que el mensaje caiga al DLQ
17
+ * en el boundary antes que fallar mudo tres pasos río abajo.
18
+ *
19
+ * DEC-KYC-016: `verificationResult` reusa `IdentificationDocumentStatus` — es el enum que el
20
+ * lambda productor (`kyc-verifications-business`) escribe literalmente en la tabla; duplicarlo
21
+ * aquí sería drift garantizado.
22
+ */
23
+ export class KycVerificationChangedV1 {
24
+ /** La PK de la fila (`id`) mapeada a nombre de negocio. */
25
+ @Expose() @IsString() @IsNotEmpty()
26
+ verificationId!: string;
27
+
28
+ @Expose() @IsString() @IsNotEmpty()
29
+ directoryId!: string;
30
+
31
+ @Expose() @IsString() @IsNotEmpty()
32
+ peopleId!: string;
33
+
34
+ @Expose() @IsOptional() @IsString()
35
+ metamapFlowId?: string;
36
+
37
+ @Expose() @IsEnum(KycVerificationStatusEnum)
38
+ verificationStatus!: KycVerificationStatusEnum;
39
+
40
+ @Expose() @IsEnum(IdentificationDocumentStatus)
41
+ verificationResult!: IdentificationDocumentStatus;
42
+
43
+ /**
44
+ * ISO-8601 obligatorio: el ordenamiento del endpoint (spec §6) se apoya en que la fecha es
45
+ * léxicamente ordenable. Se escanearon las 193 filas de `KycVerifications` en dev —
46
+ * `createDate` 193/193 y `updateDate` 193/193 ISO-8601: 386/386, cero excepciones
47
+ * (ejemplo real: '2025-10-06T21:40:58.277Z'). Verificado, no asumido (2026-07-21).
48
+ */
49
+ @Expose() @IsString() @IsISO8601()
50
+ updateDate!: string;
51
+ }
@@ -0,0 +1,10 @@
1
+ // Enums (el consolidado reusa RetailKycStatusEnum del dominio retailCustomer — DEC-KYC-014;
2
+ // `verificationResult` reusa IdentificationDocumentStatus de `identity` — DEC-KYC-016)
3
+ export * from './enums/KycVerificationStatusEnum';
4
+
5
+ // Response DTOs
6
+ export * from './dtos/responses/KycPersonData';
7
+ export * from './dtos/responses/KycByDirectoryResponse';
8
+
9
+ // Events
10
+ export * from './events/KycVerificationChangedV1';
@@ -5,7 +5,14 @@ import { DeliveryChannelEnum } from '../../messaging';
5
5
  export class SendMessageRequest {
6
6
  @Expose() @IsEnum(DeliveryChannelEnum) channelType!: DeliveryChannelEnum;
7
7
  @Expose() @IsString() @IsNotEmpty() messageType!: string;
8
- @Expose() @IsUUID() directoryId!: string;
8
+ // directoryId NO se valida como @IsUUID: para messages es una LLAVE DE CORRELACIÓN opaca
9
+ // (rate-limit + log + verify), no una FK a ningún directorio — la llave real es el par
10
+ // (typeOfDirectory, directoryId). Exigir UUID rompía dos casos legítimos: los cognitoSub UUID v7
11
+ // (que class-validator @IsUUID() v1-5 rechaza) y el OTP de teléfono del wizard retail, donde el
12
+ // cliente todavía NO tiene identidad Fiado — el OTP es justamente lo que verifica el teléfono, y
13
+ // corre ANTES de crear directory/people. Las otras dos puertas ya usan @IsString:
14
+ // VerifyOtpRequest y NotificationQueueMessageRequestV2 — esto deja el SEND HTTP consistente.
15
+ @Expose() @IsString() @IsNotEmpty() directoryId!: string;
9
16
  @Expose() @IsString() @IsNotEmpty() typeOfDirectory!: string;
10
17
  @Expose() @IsString() @IsNotEmpty() language!: string;
11
18
  @Expose() @IsString() @IsNotEmpty() country!: string;