@fiado/type-kit 3.286.0 → 3.288.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.
- package/_test_/unit/identity/SsnItinSentinel.test.ts +54 -0
- package/bin/benefitCenter/enums/BenefitFlowEnum.d.ts +11 -0
- package/bin/benefitCenter/enums/BenefitFlowEnum.js +15 -0
- package/bin/identity/SsnItinSentinel.d.ts +27 -0
- package/bin/identity/SsnItinSentinel.js +34 -0
- package/bin/identity/index.d.ts +1 -0
- package/bin/identity/index.js +2 -0
- package/bin/places/dtos/CashInFeeDto.d.ts +17 -0
- package/bin/places/dtos/CashInFeeDto.js +12 -0
- package/bin/platformRbac/dtos/CompleteMyProfileRequest.d.ts +9 -0
- package/bin/platformRbac/dtos/CompleteMyProfileRequest.js +34 -0
- package/bin/walletFunding/dtos/CancelFundingReferenceRequest.d.ts +14 -0
- package/bin/walletFunding/dtos/CancelFundingReferenceRequest.js +41 -0
- package/bin/walletFunding/dtos/CancelFundingReferenceResponse.d.ts +15 -0
- package/bin/walletFunding/dtos/CancelFundingReferenceResponse.js +13 -0
- package/bin/walletFunding/dtos/CancelWalletFundingRequest.d.ts +3 -0
- package/bin/walletFunding/dtos/CancelWalletFundingRequest.js +21 -0
- package/bin/walletFunding/dtos/CancelWalletFundingResponse.d.ts +7 -0
- package/bin/walletFunding/dtos/CancelWalletFundingResponse.js +6 -0
- package/package.json +1 -1
- package/src/identity/SsnItinSentinel.ts +31 -0
- package/src/identity/index.ts +3 -0
- package/bin/identity/enums/SelfieSourceEnum.d.ts +0 -10
- package/bin/identity/enums/SelfieSourceEnum.js +0 -14
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { SSN_ITIN_DOESNT_HAVE, hasRealSsn } from '../../../src/identity/index';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Centinela del SSN/ITIN.
|
|
5
|
+
*
|
|
6
|
+
* El campo `SSN_ITIN` guarda tres cosas distintas y cada una significa algo:
|
|
7
|
+
* - un número real => el cliente entregó su SSN o ITIN
|
|
8
|
+
* - `DOESNT_HAVE` (centinela) => se le preguntó y respondió que NO tiene
|
|
9
|
+
* - vacío / null / ausente => todavía no se le preguntó
|
|
10
|
+
*
|
|
11
|
+
* `hasRealSsn` es el criterio único para distinguir el primero de los otros dos. Sin él, todo
|
|
12
|
+
* lector que pregunte "¿el campo trae contenido?" da verdadero para quien declaró lo contrario, y
|
|
13
|
+
* el centinela termina viajando a proveedores externos como si fuera una identificación.
|
|
14
|
+
*
|
|
15
|
+
* Vive acá además de en `@fiado/fiado-abstractions` porque los repos que envían el dato a terceros
|
|
16
|
+
* (card-business, el connector de Central Payments, lista negra, account-fiadoinc) consumen
|
|
17
|
+
* type-kit y no aquella. Las dos definiciones deben mantenerse idénticas.
|
|
18
|
+
*/
|
|
19
|
+
describe('SSN_ITIN_DOESNT_HAVE / hasRealSsn', () => {
|
|
20
|
+
|
|
21
|
+
test('el centinela es exactamente "DOESNT_HAVE"', () => {
|
|
22
|
+
// La grafía importa: es el valor que queda persistido y con el que comparan los lectores.
|
|
23
|
+
expect(SSN_ITIN_DOESNT_HAVE).toBe('DOESNT_HAVE');
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
test('un SSN real es un SSN real', () => {
|
|
27
|
+
expect(hasRealSsn('123456789')).toBe(true);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test('un valor con prefijo también (así lo guarda la app)', () => {
|
|
31
|
+
expect(hasRealSsn('SSN_123456789')).toBe(true);
|
|
32
|
+
expect(hasRealSsn('ITIN_912345678')).toBe(true);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
test('el centinela NO es un SSN real', () => {
|
|
36
|
+
expect(hasRealSsn(SSN_ITIN_DOESNT_HAVE)).toBe(false);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test('vacío, null y undefined tampoco', () => {
|
|
40
|
+
expect(hasRealSsn('')).toBe(false);
|
|
41
|
+
expect(hasRealSsn(null)).toBe(false);
|
|
42
|
+
expect(hasRealSsn(undefined)).toBe(false);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
test('tolera espacios alrededor del centinela', () => {
|
|
46
|
+
expect(hasRealSsn(' DOESNT_HAVE ')).toBe(false);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test('es sensible a mayúsculas: otra grafía no es el centinela', () => {
|
|
50
|
+
// Deliberado: si aparece "doesnt_have" en la base, es un dato mal escrito y queremos verlo,
|
|
51
|
+
// no absorberlo en silencio.
|
|
52
|
+
expect(hasRealSsn('doesnt_have')).toBe(true);
|
|
53
|
+
});
|
|
54
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare enum BenefitFlowEnum {
|
|
2
|
+
TOPUPS = "TOPUPS",
|
|
3
|
+
BILL_PAYMENT = "BILL_PAYMENT",
|
|
4
|
+
CREDIT = "CREDIT",
|
|
5
|
+
INSURANCE = "INSURANCE",
|
|
6
|
+
DONATION = "DONATION",
|
|
7
|
+
PHARMACY = "PHARMACY",
|
|
8
|
+
REMITTANCE = "REMITTANCE",
|
|
9
|
+
/** Fondeo de wallet PCF con efectivo via provider externo (Equality/Passport, OpenPay, …) — spec 13. */
|
|
10
|
+
WALLET_FUNDING = "WALLET_FUNDING"
|
|
11
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BenefitFlowEnum = void 0;
|
|
4
|
+
var BenefitFlowEnum;
|
|
5
|
+
(function (BenefitFlowEnum) {
|
|
6
|
+
BenefitFlowEnum["TOPUPS"] = "TOPUPS";
|
|
7
|
+
BenefitFlowEnum["BILL_PAYMENT"] = "BILL_PAYMENT";
|
|
8
|
+
BenefitFlowEnum["CREDIT"] = "CREDIT";
|
|
9
|
+
BenefitFlowEnum["INSURANCE"] = "INSURANCE";
|
|
10
|
+
BenefitFlowEnum["DONATION"] = "DONATION";
|
|
11
|
+
BenefitFlowEnum["PHARMACY"] = "PHARMACY";
|
|
12
|
+
BenefitFlowEnum["REMITTANCE"] = "REMITTANCE";
|
|
13
|
+
/** Fondeo de wallet PCF con efectivo via provider externo (Equality/Passport, OpenPay, …) — spec 13. */
|
|
14
|
+
BenefitFlowEnum["WALLET_FUNDING"] = "WALLET_FUNDING";
|
|
15
|
+
})(BenefitFlowEnum || (exports.BenefitFlowEnum = BenefitFlowEnum = {}));
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centinela del campo `SSN_ITIN`.
|
|
3
|
+
*
|
|
4
|
+
* El campo guarda tres estados distintos y cada uno significa algo:
|
|
5
|
+
* - un número real (con o sin prefijo `SSN_` / `ITIN_`) => el cliente entregó su SSN o ITIN.
|
|
6
|
+
* - `SSN_ITIN_DOESNT_HAVE` => se le preguntó y respondió que NO tiene.
|
|
7
|
+
* - vacío / null / ausente => todavía no se le preguntó.
|
|
8
|
+
*
|
|
9
|
+
* La distinción entre el segundo y el tercero es la que gobierna el paso del onboarding, y la que
|
|
10
|
+
* el valor vacío no permitía hacer.
|
|
11
|
+
*
|
|
12
|
+
* ⚠️ Esta misma definición vive en `@fiado/fiado-abstractions`. Está duplicada a propósito: los
|
|
13
|
+
* repos que envían el dato hacia afuera (card-business, el connector de Central Payments, lista
|
|
14
|
+
* negra, account-fiadoinc) consumen type-kit y no aquella librería. Si una cambia, la otra también.
|
|
15
|
+
*/
|
|
16
|
+
export declare const SSN_ITIN_DOESNT_HAVE = "DOESNT_HAVE";
|
|
17
|
+
/**
|
|
18
|
+
* Criterio único para "este cliente tiene un SSN/ITIN de verdad".
|
|
19
|
+
*
|
|
20
|
+
* Usalo en lugar de preguntar si el campo trae contenido. Un chequeo por contenido (`if (ssn)`,
|
|
21
|
+
* `!= null`, `.length > 4`) da verdadero para el centinela, y ahí es donde el valor termina
|
|
22
|
+
* viajando a un proveedor externo como identificación de una persona real.
|
|
23
|
+
*
|
|
24
|
+
* Tolera espacios alrededor y es sensible a mayúsculas: una grafía distinta a la del centinela es
|
|
25
|
+
* un dato mal escrito y conviene que se note, no que se absorba en silencio.
|
|
26
|
+
*/
|
|
27
|
+
export declare function hasRealSsn(ssnItin: string | null | undefined): boolean;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SSN_ITIN_DOESNT_HAVE = void 0;
|
|
4
|
+
exports.hasRealSsn = hasRealSsn;
|
|
5
|
+
/**
|
|
6
|
+
* Centinela del campo `SSN_ITIN`.
|
|
7
|
+
*
|
|
8
|
+
* El campo guarda tres estados distintos y cada uno significa algo:
|
|
9
|
+
* - un número real (con o sin prefijo `SSN_` / `ITIN_`) => el cliente entregó su SSN o ITIN.
|
|
10
|
+
* - `SSN_ITIN_DOESNT_HAVE` => se le preguntó y respondió que NO tiene.
|
|
11
|
+
* - vacío / null / ausente => todavía no se le preguntó.
|
|
12
|
+
*
|
|
13
|
+
* La distinción entre el segundo y el tercero es la que gobierna el paso del onboarding, y la que
|
|
14
|
+
* el valor vacío no permitía hacer.
|
|
15
|
+
*
|
|
16
|
+
* ⚠️ Esta misma definición vive en `@fiado/fiado-abstractions`. Está duplicada a propósito: los
|
|
17
|
+
* repos que envían el dato hacia afuera (card-business, el connector de Central Payments, lista
|
|
18
|
+
* negra, account-fiadoinc) consumen type-kit y no aquella librería. Si una cambia, la otra también.
|
|
19
|
+
*/
|
|
20
|
+
exports.SSN_ITIN_DOESNT_HAVE = "DOESNT_HAVE";
|
|
21
|
+
/**
|
|
22
|
+
* Criterio único para "este cliente tiene un SSN/ITIN de verdad".
|
|
23
|
+
*
|
|
24
|
+
* Usalo en lugar de preguntar si el campo trae contenido. Un chequeo por contenido (`if (ssn)`,
|
|
25
|
+
* `!= null`, `.length > 4`) da verdadero para el centinela, y ahí es donde el valor termina
|
|
26
|
+
* viajando a un proveedor externo como identificación de una persona real.
|
|
27
|
+
*
|
|
28
|
+
* Tolera espacios alrededor y es sensible a mayúsculas: una grafía distinta a la del centinela es
|
|
29
|
+
* un dato mal escrito y conviene que se note, no que se absorba en silencio.
|
|
30
|
+
*/
|
|
31
|
+
function hasRealSsn(ssnItin) {
|
|
32
|
+
const value = (ssnItin ?? "").trim();
|
|
33
|
+
return !!value && value !== exports.SSN_ITIN_DOESNT_HAVE;
|
|
34
|
+
}
|
package/bin/identity/index.d.ts
CHANGED
package/bin/identity/index.js
CHANGED
|
@@ -36,3 +36,5 @@ __exportStar(require("./enums/AuthorizationNeededMXNStatus"), exports);
|
|
|
36
36
|
__exportStar(require("./enums/DocumentSideEnum"), exports);
|
|
37
37
|
__exportStar(require("./enums/CPStatusEnum"), exports);
|
|
38
38
|
__exportStar(require("./enums/AccountRequirementStatusEnum"), exports);
|
|
39
|
+
//helpers
|
|
40
|
+
__exportStar(require("./SsnItinSentinel"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CurrencyId } from '../../currency/enums/CurrencyId';
|
|
2
|
+
/**
|
|
3
|
+
* Comisión que cobra un punto de cash-in (lo que el lambda MUESTRA, no cobra).
|
|
4
|
+
* - GreenDot (US): representativo por cadena → `fixed` + `cap` (cada tienda cobra hasta el tope).
|
|
5
|
+
* - Passport (MX): por red → `fixed` + `percentage`.
|
|
6
|
+
* Response DTO — sin decoradores de validación.
|
|
7
|
+
*/
|
|
8
|
+
export declare class CashInFeeDto {
|
|
9
|
+
/** Comisión fija, en la moneda del país. */
|
|
10
|
+
fixed?: number;
|
|
11
|
+
/** Porcentaje del monto depositado (0–100). */
|
|
12
|
+
percentage?: number;
|
|
13
|
+
/** Tope máximo de comisión (GreenDot: el asociado cobra hasta este cap). */
|
|
14
|
+
cap?: number;
|
|
15
|
+
/** Moneda del fee: USD (GreenDot) | MXN (Passport). */
|
|
16
|
+
currency: CurrencyId;
|
|
17
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CashInFeeDto = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Comisión que cobra un punto de cash-in (lo que el lambda MUESTRA, no cobra).
|
|
6
|
+
* - GreenDot (US): representativo por cadena → `fixed` + `cap` (cada tienda cobra hasta el tope).
|
|
7
|
+
* - Passport (MX): por red → `fixed` + `percentage`.
|
|
8
|
+
* Response DTO — sin decoradores de validación.
|
|
9
|
+
*/
|
|
10
|
+
class CashInFeeDto {
|
|
11
|
+
}
|
|
12
|
+
exports.CashInFeeDto = CashInFeeDto;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Body del PUT /me/profile/complete (autenticado, gate post-MFA del autoregistro). DEC-RBAC-034.
|
|
3
|
+
* Opera sobre el propio usuario (cognitoSub del token). Valida nombre + los `userFieldDefs` requeridos
|
|
4
|
+
* del tenant (422 MISSING_REQUIRED_FIELDS si faltan) y flipea `profileComplete=true`.
|
|
5
|
+
*/
|
|
6
|
+
export declare class CompleteMyProfileRequest {
|
|
7
|
+
displayName: string;
|
|
8
|
+
customFields?: Record<string, string>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CompleteMyProfileRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
/**
|
|
16
|
+
* Body del PUT /me/profile/complete (autenticado, gate post-MFA del autoregistro). DEC-RBAC-034.
|
|
17
|
+
* Opera sobre el propio usuario (cognitoSub del token). Valida nombre + los `userFieldDefs` requeridos
|
|
18
|
+
* del tenant (422 MISSING_REQUIRED_FIELDS si faltan) y flipea `profileComplete=true`.
|
|
19
|
+
*/
|
|
20
|
+
class CompleteMyProfileRequest {
|
|
21
|
+
}
|
|
22
|
+
exports.CompleteMyProfileRequest = CompleteMyProfileRequest;
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, class_transformer_1.Expose)(),
|
|
25
|
+
(0, class_validator_1.IsString)(),
|
|
26
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], CompleteMyProfileRequest.prototype, "displayName", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, class_transformer_1.Expose)(),
|
|
31
|
+
(0, class_validator_1.IsOptional)(),
|
|
32
|
+
(0, class_validator_1.IsObject)(),
|
|
33
|
+
__metadata("design:type", Object)
|
|
34
|
+
], CompleteMyProfileRequest.prototype, "customFields", void 0);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Body para cancelar una referencia de funding ya creada. La referencia/fundingId
|
|
3
|
+
* viaja en la URL (`/funding/{moduleName}/{fundingId}/cancel`); este body aporta
|
|
4
|
+
* el contexto del solicitante + idempotencia.
|
|
5
|
+
*
|
|
6
|
+
* NOTA: shape inferido desde el uso en `@fiado/api-invoker`
|
|
7
|
+
* (benefits-marketplace / equality-connector) — confirmar con el dueño del
|
|
8
|
+
* módulo walletFunding / el lambda equality-connector que implementa el cancel.
|
|
9
|
+
*/
|
|
10
|
+
export declare class CancelFundingReferenceRequest {
|
|
11
|
+
directoryId: string;
|
|
12
|
+
reason?: string;
|
|
13
|
+
idempotencyKey: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CancelFundingReferenceRequest = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
/**
|
|
15
|
+
* Body para cancelar una referencia de funding ya creada. La referencia/fundingId
|
|
16
|
+
* viaja en la URL (`/funding/{moduleName}/{fundingId}/cancel`); este body aporta
|
|
17
|
+
* el contexto del solicitante + idempotencia.
|
|
18
|
+
*
|
|
19
|
+
* NOTA: shape inferido desde el uso en `@fiado/api-invoker`
|
|
20
|
+
* (benefits-marketplace / equality-connector) — confirmar con el dueño del
|
|
21
|
+
* módulo walletFunding / el lambda equality-connector que implementa el cancel.
|
|
22
|
+
*/
|
|
23
|
+
class CancelFundingReferenceRequest {
|
|
24
|
+
}
|
|
25
|
+
exports.CancelFundingReferenceRequest = CancelFundingReferenceRequest;
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, class_validator_1.IsString)(),
|
|
28
|
+
(0, class_validator_1.MaxLength)(64),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], CancelFundingReferenceRequest.prototype, "directoryId", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, class_validator_1.IsOptional)(),
|
|
33
|
+
(0, class_validator_1.IsString)(),
|
|
34
|
+
(0, class_validator_1.MaxLength)(256),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], CancelFundingReferenceRequest.prototype, "reason", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, class_validator_1.IsString)(),
|
|
39
|
+
(0, class_validator_1.MaxLength)(64),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], CancelFundingReferenceRequest.prototype, "idempotencyKey", void 0);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BenefitPaymentStatusEnum } from "../../benefitCenter/enums/BenefitPaymentStatusEnum";
|
|
2
|
+
import { WalletFundingErrorCodeEnum } from "../enums/WalletFundingErrorCodeEnum";
|
|
3
|
+
/**
|
|
4
|
+
* Respuesta de la cancelación de una referencia de funding. Mismo estilo que
|
|
5
|
+
* CreateFundingReferenceResponse.
|
|
6
|
+
*
|
|
7
|
+
* NOTA: shape inferido desde el uso en `@fiado/api-invoker` — confirmar con el
|
|
8
|
+
* dueño del módulo walletFunding / el lambda equality-connector.
|
|
9
|
+
*/
|
|
10
|
+
export declare class CancelFundingReferenceResponse {
|
|
11
|
+
/** Referencia cancelada (misma PK que se creó). */
|
|
12
|
+
reference: string;
|
|
13
|
+
status: BenefitPaymentStatusEnum;
|
|
14
|
+
errorCode?: WalletFundingErrorCodeEnum;
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CancelFundingReferenceResponse = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Respuesta de la cancelación de una referencia de funding. Mismo estilo que
|
|
6
|
+
* CreateFundingReferenceResponse.
|
|
7
|
+
*
|
|
8
|
+
* NOTA: shape inferido desde el uso en `@fiado/api-invoker` — confirmar con el
|
|
9
|
+
* dueño del módulo walletFunding / el lambda equality-connector.
|
|
10
|
+
*/
|
|
11
|
+
class CancelFundingReferenceResponse {
|
|
12
|
+
}
|
|
13
|
+
exports.CancelFundingReferenceResponse = CancelFundingReferenceResponse;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CancelWalletFundingRequest = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class CancelWalletFundingRequest {
|
|
15
|
+
}
|
|
16
|
+
exports.CancelWalletFundingRequest = CancelWalletFundingRequest;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.IsString)(),
|
|
19
|
+
(0, class_validator_1.MaxLength)(64),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], CancelWalletFundingRequest.prototype, "idempotencyKey", void 0);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BenefitPaymentStatusEnum } from "../../benefitCenter/enums/BenefitPaymentStatusEnum";
|
|
2
|
+
import { WalletFundingErrorCodeEnum } from "../enums/WalletFundingErrorCodeEnum";
|
|
3
|
+
export declare class CancelWalletFundingResponse {
|
|
4
|
+
status: BenefitPaymentStatusEnum;
|
|
5
|
+
errorCode?: WalletFundingErrorCodeEnum;
|
|
6
|
+
fundingId?: string;
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centinela del campo `SSN_ITIN`.
|
|
3
|
+
*
|
|
4
|
+
* El campo guarda tres estados distintos y cada uno significa algo:
|
|
5
|
+
* - un número real (con o sin prefijo `SSN_` / `ITIN_`) => el cliente entregó su SSN o ITIN.
|
|
6
|
+
* - `SSN_ITIN_DOESNT_HAVE` => se le preguntó y respondió que NO tiene.
|
|
7
|
+
* - vacío / null / ausente => todavía no se le preguntó.
|
|
8
|
+
*
|
|
9
|
+
* La distinción entre el segundo y el tercero es la que gobierna el paso del onboarding, y la que
|
|
10
|
+
* el valor vacío no permitía hacer.
|
|
11
|
+
*
|
|
12
|
+
* ⚠️ Esta misma definición vive en `@fiado/fiado-abstractions`. Está duplicada a propósito: los
|
|
13
|
+
* repos que envían el dato hacia afuera (card-business, el connector de Central Payments, lista
|
|
14
|
+
* negra, account-fiadoinc) consumen type-kit y no aquella librería. Si una cambia, la otra también.
|
|
15
|
+
*/
|
|
16
|
+
export const SSN_ITIN_DOESNT_HAVE = "DOESNT_HAVE";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Criterio único para "este cliente tiene un SSN/ITIN de verdad".
|
|
20
|
+
*
|
|
21
|
+
* Usalo en lugar de preguntar si el campo trae contenido. Un chequeo por contenido (`if (ssn)`,
|
|
22
|
+
* `!= null`, `.length > 4`) da verdadero para el centinela, y ahí es donde el valor termina
|
|
23
|
+
* viajando a un proveedor externo como identificación de una persona real.
|
|
24
|
+
*
|
|
25
|
+
* Tolera espacios alrededor y es sensible a mayúsculas: una grafía distinta a la del centinela es
|
|
26
|
+
* un dato mal escrito y conviene que se note, no que se absorba en silencio.
|
|
27
|
+
*/
|
|
28
|
+
export function hasRealSsn(ssnItin: string | null | undefined): boolean {
|
|
29
|
+
const value = (ssnItin ?? "").trim();
|
|
30
|
+
return !!value && value !== SSN_ITIN_DOESNT_HAVE;
|
|
31
|
+
}
|
package/src/identity/index.ts
CHANGED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Con qué criterio se resolvió cuál archivo de S3 es la selfie del usuario.
|
|
3
|
-
* Le dice al consumidor qué tan confiable es el match antes de mandarla a un facematch.
|
|
4
|
-
*/
|
|
5
|
-
export declare enum SelfieSourceEnum {
|
|
6
|
-
/** Matcheó el verificationId de la verificación vigente en People. */
|
|
7
|
-
VERIFICATION = "VERIFICATION",
|
|
8
|
-
/** No hubo match por verificación: se tomó el archivo de selfie más reciente del bucket. */
|
|
9
|
-
LATEST = "LATEST"
|
|
10
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SelfieSourceEnum = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Con qué criterio se resolvió cuál archivo de S3 es la selfie del usuario.
|
|
6
|
-
* Le dice al consumidor qué tan confiable es el match antes de mandarla a un facematch.
|
|
7
|
-
*/
|
|
8
|
-
var SelfieSourceEnum;
|
|
9
|
-
(function (SelfieSourceEnum) {
|
|
10
|
-
/** Matcheó el verificationId de la verificación vigente en People. */
|
|
11
|
-
SelfieSourceEnum["VERIFICATION"] = "VERIFICATION";
|
|
12
|
-
/** No hubo match por verificación: se tomó el archivo de selfie más reciente del bucket. */
|
|
13
|
-
SelfieSourceEnum["LATEST"] = "LATEST";
|
|
14
|
-
})(SelfieSourceEnum || (exports.SelfieSourceEnum = SelfieSourceEnum = {}));
|