@fiado/type-kit 3.321.0 → 3.322.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 (61) hide show
  1. package/_test_/unit/retailCustomer/welcomeBonusRequests.test.ts +71 -0
  2. package/bin/common/decorators/Trim.d.ts +5 -0
  3. package/bin/common/decorators/Trim.js +10 -0
  4. package/bin/common/index.d.ts +1 -0
  5. package/bin/common/index.js +2 -0
  6. package/bin/networkConnector/dtos/CreateProfileRequest.d.ts +1 -4
  7. package/bin/networkConnector/dtos/CreateProfileRequest.js +1 -1
  8. package/bin/networkConnector/dtos/ProfileResponse.d.ts +0 -3
  9. package/bin/networkConnector/dtos/UpdateProfileRequest.d.ts +1 -0
  10. package/bin/networkConnector/dtos/UpdateProfileRequest.js +6 -0
  11. package/bin/retailCustomer/dtos/requests/WelcomeAccreditationRequest.d.ts +1 -3
  12. package/bin/retailCustomer/dtos/requests/WelcomeAccreditationRequest.js +11 -14
  13. package/bin/retailCustomer/dtos/requests/WelcomeAccreditationResultRequest.d.ts +8 -0
  14. package/bin/retailCustomer/dtos/requests/WelcomeAccreditationResultRequest.js +29 -6
  15. package/bin/retailCustomer/dtos/responses/WelcomeBonusResponse.d.ts +4 -0
  16. package/bin/retailWizard/dtos/WizardBlocked.d.ts +7 -2
  17. package/bin/retailWizard/dtos/WizardSession.d.ts +5 -6
  18. package/bin/retailWizard/dtos/requests/CreateProspectRequest.d.ts +2 -0
  19. package/bin/retailWizard/dtos/requests/CreateProspectRequest.js +6 -0
  20. package/bin/retailWizard/enums/PendingReasonEnum.d.ts +14 -2
  21. package/bin/retailWizard/enums/PendingReasonEnum.js +17 -2
  22. package/bin/walletFunding/dtos/GetWalletFundingLimitResponse.d.ts +57 -11
  23. package/bin/walletFunding/dtos/GetWalletFundingLimitResponse.js +22 -11
  24. package/package.json +1 -1
  25. package/src/common/decorators/Trim.ts +8 -0
  26. package/src/common/index.ts +3 -0
  27. package/src/networkConnector/dtos/CreateProfileRequest.ts +2 -5
  28. package/src/networkConnector/dtos/ProfileResponse.ts +0 -3
  29. package/src/networkConnector/dtos/UpdateProfileRequest.ts +1 -2
  30. package/src/retailCustomer/dtos/requests/WelcomeAccreditationRequest.ts +12 -17
  31. package/src/retailCustomer/dtos/requests/WelcomeAccreditationResultRequest.ts +32 -9
  32. package/src/retailCustomer/dtos/responses/WelcomeBonusResponse.ts +4 -0
  33. package/src/retailWizard/dtos/WizardBlocked.ts +7 -2
  34. package/src/retailWizard/dtos/WizardSession.ts +5 -6
  35. package/src/retailWizard/dtos/requests/CreateProspectRequest.ts +6 -0
  36. package/src/retailWizard/enums/PendingReasonEnum.ts +17 -1
  37. package/src/walletFunding/dtos/GetWalletFundingLimitResponse.ts +60 -11
  38. package/bin/identity/enums/SelfieSourceEnum.d.ts +0 -10
  39. package/bin/identity/enums/SelfieSourceEnum.js +0 -14
  40. package/bin/retailCards/dtos/requests/AssignCardRequest.d.ts +0 -6
  41. package/bin/retailCards/dtos/requests/AssignCardRequest.js +0 -30
  42. package/bin/retailCards/dtos/requests/CancelCardRequest.d.ts +0 -5
  43. package/bin/retailCards/dtos/requests/CancelCardRequest.js +0 -22
  44. package/bin/retailCards/dtos/responses/RetailCardResponse.d.ts +0 -12
  45. package/bin/retailCards/dtos/responses/RetailCardResponse.js +0 -2
  46. package/bin/retailCards/enums/CardBatchStatusEnum.d.ts +0 -17
  47. package/bin/retailCards/enums/CardBatchStatusEnum.js +0 -21
  48. package/bin/retailCards/enums/CardCancelReasonEnum.d.ts +0 -13
  49. package/bin/retailCards/enums/CardCancelReasonEnum.js +0 -17
  50. package/bin/retailCards/enums/RetailCardStatusEnum.d.ts +0 -13
  51. package/bin/retailCards/enums/RetailCardStatusEnum.js +0 -17
  52. package/bin/retailCards/events/RetailCardAssignedV1.d.ts +0 -10
  53. package/bin/retailCards/events/RetailCardAssignedV1.js +0 -2
  54. package/bin/retailCards/events/RetailCardCancelledV1.d.ts +0 -9
  55. package/bin/retailCards/events/RetailCardCancelledV1.js +0 -2
  56. package/bin/retailCards/events/RetailCardReleasedV1.d.ts +0 -7
  57. package/bin/retailCards/events/RetailCardReleasedV1.js +0 -2
  58. package/bin/retailWizard/dtos/requests/CompleteSaleRequest.d.ts +0 -9
  59. package/bin/retailWizard/dtos/requests/CompleteSaleRequest.js +0 -29
  60. package/bin/retailWizard/dtos/requests/MarkPcfCardDeliveredRequest.d.ts +0 -4
  61. package/bin/retailWizard/dtos/requests/MarkPcfCardDeliveredRequest.js +0 -23
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "3.321.0",
3
+ "version": "3.322.0",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -0,0 +1,8 @@
1
+ import { Transform } from 'class-transformer';
2
+
3
+ /**
4
+ * Recorta los espacios del borde de un string; deja pasar cualquier otro tipo sin tocarlo.
5
+ * Se aplica antes de los validadores, así que `' '` llega como `''` y `@IsNotEmpty` lo rechaza.
6
+ */
7
+ export const Trim = (): PropertyDecorator =>
8
+ Transform(({ value }) => (typeof value === 'string' ? value.trim() : value));
@@ -1,3 +1,6 @@
1
+ //decorators
2
+ export * from './decorators/Trim';
3
+
1
4
  //dtos
2
5
  export * from './dtos/ProcessValidationResultDto';
3
6
 
@@ -1,5 +1,5 @@
1
1
  import { Expose } from 'class-transformer';
2
- import { IsString, IsOptional, IsNotEmpty, IsObject, MaxLength, MinLength } from 'class-validator';
2
+ import { IsString, IsOptional, IsObject, MaxLength, MinLength } from 'class-validator';
3
3
 
4
4
  export class CreateProfileRequest {
5
5
  @Expose() @IsString() @MinLength(1) @MaxLength(100) firstName!: string;
@@ -8,10 +8,7 @@ export class CreateProfileRequest {
8
8
  @Expose() @IsOptional() @IsString() @MaxLength(200) company?: string;
9
9
  @Expose() @IsString() @MinLength(2) @MaxLength(100) slug!: string;
10
10
  @Expose() @IsString() directoryId!: string;
11
- /** Requerido desde DEC: se usa como llave para resolver el codigo de referido
12
- * (IOnboardingBusinessApi.getByPhoneNumber) al crear el perfil. Inmutable tras la creacion
13
- * (UpdateProfileRequest ya no acepta este campo). */
14
- @Expose() @IsString() @IsNotEmpty() phone!: string;
11
+ @Expose() @IsOptional() @IsString() phone?: string;
15
12
  @Expose() @IsOptional() @IsString() email?: string;
16
13
  @Expose() @IsOptional() @IsString() @MaxLength(500) bio?: string;
17
14
  @Expose() @IsOptional() @IsObject() socialLinks?: Record<string, string>;
@@ -13,9 +13,6 @@ export interface ProfileResponse {
13
13
  logoUrl?: string;
14
14
  bio?: string;
15
15
  socialLinks?: Record<string, string>;
16
- /** Codigo de referido del promotor (myReferralCode de Onboarding), resuelto por telefono al
17
- * crear el perfil. null si el telefono no tiene codigo asociado en Onboarding. */
18
- referralCode?: string | null;
19
16
  status: ProfileStatusEnum;
20
17
  directoryId: string;
21
18
  createdAt: number;
@@ -8,8 +8,7 @@ export class UpdateProfileRequest {
8
8
  @Expose() @IsOptional() @IsString() @MaxLength(200) title?: string;
9
9
  @Expose() @IsOptional() @IsString() @MaxLength(200) company?: string;
10
10
  @Expose() @IsOptional() @IsString() @MinLength(2) @MaxLength(100) slug?: string;
11
- // phone es inmutable tras la creacion del perfil (queda asociado al numero con el que se
12
- // creo la cuenta, usado para resolver el codigo de referido). No se acepta en Update.
11
+ @Expose() @IsOptional() @IsString() phone?: string;
13
12
  @Expose() @IsOptional() @IsString() email?: string;
14
13
  @Expose() @IsOptional() @IsString() @MaxLength(500) bio?: string;
15
14
  @Expose() @IsOptional() @IsObject() socialLinks?: Record<string, string>;
@@ -1,31 +1,26 @@
1
- import { Expose, Transform } from 'class-transformer';
1
+ import { Expose } from 'class-transformer';
2
2
  import { IsEnum, IsInt, IsNotEmpty, IsOptional, IsPositive, IsString } from 'class-validator';
3
+ import { Trim } from '../../../common/decorators/Trim';
3
4
  import { WelcomeBonusAmountSourceEnum } from '../../enums/WelcomeBonusAmountSourceEnum';
4
5
 
5
- /** Recorta los strings del borde: un valor con espacios ensucia claves y cortes de conciliación. */
6
- const trim = (): PropertyDecorator =>
7
- Transform(({ value }) => (typeof value === 'string' ? value.trim() : value));
8
-
9
6
  /**
10
7
  * Datos de la venta que acompañan la reserva del bono de bienvenida (D33):
11
8
  * `POST /private/customers/:id/welcome-accreditation`. SureKeep Fase 2 — pista Retail.
12
9
  *
13
- * **TODOS los campos son opcionales a propósito.** El customer despliega antes que el wizard, así que
14
- * durante la ventana el wizard viejo sigue llamando sin body: el asiento nace incompleto y se acredita
15
- * igual. Exigirlos convertiría esa ventana en un 400 que deja al cliente sin bono.
10
+ * Todos los campos son opcionales: un caller que no los manda abre el asiento igual, incompleto.
16
11
  */
17
12
  export class WelcomeAccreditationRequest {
18
13
  /** Tienda donde se dio el bono — es la partición del asiento. */
19
14
  @Expose()
20
15
  @IsOptional()
21
- @trim()
16
+ @Trim()
22
17
  @IsString()
23
18
  @IsNotEmpty()
24
19
  storeId?: string;
25
20
 
26
21
  @Expose()
27
22
  @IsOptional()
28
- @trim()
23
+ @Trim()
29
24
  @IsString()
30
25
  @IsNotEmpty()
31
26
  retailerId?: string;
@@ -33,14 +28,14 @@ export class WelcomeAccreditationRequest {
33
28
  /** Vendedor que cerró la venta. */
34
29
  @Expose()
35
30
  @IsOptional()
36
- @trim()
31
+ @Trim()
37
32
  @IsString()
38
33
  @IsNotEmpty()
39
34
  sellerRetailUserId?: string;
40
35
 
41
36
  @Expose()
42
37
  @IsOptional()
43
- @trim()
38
+ @Trim()
44
39
  @IsString()
45
40
  @IsNotEmpty()
46
41
  saleId?: string;
@@ -48,14 +43,14 @@ export class WelcomeAccreditationRequest {
48
43
  /** Folio de la venta, tal como lo ve el vendedor en el ticket. */
49
44
  @Expose()
50
45
  @IsOptional()
51
- @trim()
46
+ @Trim()
52
47
  @IsString()
53
48
  @IsNotEmpty()
54
49
  folio?: string;
55
50
 
56
51
  @Expose()
57
52
  @IsOptional()
58
- @trim()
53
+ @Trim()
59
54
  @IsString()
60
55
  @IsNotEmpty()
61
56
  wizardSessionId?: string;
@@ -69,7 +64,7 @@ export class WelcomeAccreditationRequest {
69
64
  /** ISO-4217. Ausente ⇒ el server asienta `MXN`. */
70
65
  @Expose()
71
66
  @IsOptional()
72
- @trim()
67
+ @Trim()
73
68
  @IsString()
74
69
  @IsNotEmpty()
75
70
  currency?: string;
@@ -82,14 +77,14 @@ export class WelcomeAccreditationRequest {
82
77
  /** Clave con la que el caller acredita en el processor — ata el asiento al movimiento de plata. */
83
78
  @Expose()
84
79
  @IsOptional()
85
- @trim()
80
+ @Trim()
86
81
  @IsString()
87
82
  @IsNotEmpty()
88
83
  idempotencyKey?: string;
89
84
 
90
85
  @Expose()
91
86
  @IsOptional()
92
- @trim()
87
+ @Trim()
93
88
  @IsString()
94
89
  @IsNotEmpty()
95
90
  providerName?: string;
@@ -1,10 +1,10 @@
1
- import { Expose, Transform } from 'class-transformer';
2
- import { IsIn, IsNotEmpty, IsOptional, IsString, ValidateIf } from 'class-validator';
1
+ import { Expose } from 'class-transformer';
2
+ import { IsIn, IsNotEmpty, IsOptional, IsString, MaxLength, ValidateIf } from 'class-validator';
3
+ import { Trim } from '../../../common/decorators/Trim';
3
4
  import { WelcomeBonusStatusEnum } from '../../enums/WelcomeBonusStatusEnum';
4
5
 
5
- /** Recorta los strings del borde: un valor con espacios ensucia claves y cortes de conciliación. */
6
- const trim = (): PropertyDecorator =>
7
- Transform(({ value }) => (typeof value === 'string' ? value.trim() : value));
6
+ /** Tope de los textos libres que el caller escribe en el asiento. */
7
+ const FREE_TEXT_MAX_LENGTH = 256;
8
8
 
9
9
  /** Resultados que el caller puede asentar. `PENDING` lo escribe el server al reservar, no el caller. */
10
10
  const RESULT_STATUSES = [
@@ -26,11 +26,14 @@ const STATUSES_REQUIRING_REASON: WelcomeBonusStatusEnum[] = [
26
26
  * `FAILED` libera el candado `welcomeAccredited` para que la venta se reintente. `UNVERIFIED` lo deja
27
27
  * tomado: el `walletFundingCredit` del processor no deduplica, así que liberar tras un timeout podría
28
28
  * acreditar plata real dos veces.
29
+ *
30
+ * Un asiento `UNVERIFIED` se cierra después con `ACCREDITED` o `FAILED` mandando además `reconciledBy`
31
+ * y `reconciliationReason` — ese par es lo que marca el cierre como reconciliación.
29
32
  */
30
33
  export class WelcomeAccreditationResultRequest {
31
34
  /** Referencia opaca del asiento, tal como la devolvió la reserva. */
32
35
  @Expose()
33
- @trim()
36
+ @Trim()
34
37
  @IsString()
35
38
  @IsNotEmpty()
36
39
  bonusKey!: string;
@@ -41,22 +44,42 @@ export class WelcomeAccreditationResultRequest {
41
44
 
42
45
  @Expose()
43
46
  @ValidateIf((o: WelcomeAccreditationResultRequest) => o.status === WelcomeBonusStatusEnum.ACCREDITED)
44
- @trim()
47
+ @Trim()
45
48
  @IsString()
46
49
  @IsNotEmpty({ message: 'processorTransactionId es obligatorio cuando status es ACCREDITED' })
47
50
  processorTransactionId?: string;
48
51
 
52
+ /** Motivo legible del fallo — un resumen, NO el payload crudo del processor (el libro va sin PII). */
49
53
  @Expose()
50
54
  @ValidateIf((o: WelcomeAccreditationResultRequest) => STATUSES_REQUIRING_REASON.includes(o.status))
51
- @trim()
55
+ @Trim()
52
56
  @IsString()
53
57
  @IsNotEmpty({ message: 'failReason es obligatorio cuando status es FAILED o UNVERIFIED' })
58
+ @MaxLength(FREE_TEXT_MAX_LENGTH)
54
59
  failReason?: string;
55
60
 
56
61
  @Expose()
57
62
  @IsOptional()
58
- @trim()
63
+ @Trim()
59
64
  @IsString()
60
65
  @IsNotEmpty()
61
66
  providerName?: string;
67
+
68
+ /** Quién cierra a mano un asiento `UNVERIFIED`. Va junto con `reconciliationReason`. */
69
+ @Expose()
70
+ @ValidateIf((o: WelcomeAccreditationResultRequest) => o.reconciliationReason !== undefined)
71
+ @Trim()
72
+ @IsString()
73
+ @IsNotEmpty({ message: 'reconciledBy es obligatorio en un cierre de reconciliación' })
74
+ @MaxLength(FREE_TEXT_MAX_LENGTH)
75
+ reconciledBy?: string;
76
+
77
+ /** Por qué se cerró a mano — un resumen, NO el payload crudo del processor. */
78
+ @Expose()
79
+ @ValidateIf((o: WelcomeAccreditationResultRequest) => o.reconciledBy !== undefined)
80
+ @Trim()
81
+ @IsString()
82
+ @IsNotEmpty({ message: 'reconciliationReason es obligatorio en un cierre de reconciliación' })
83
+ @MaxLength(FREE_TEXT_MAX_LENGTH)
84
+ reconciliationReason?: string;
62
85
  }
@@ -32,6 +32,10 @@ export interface WelcomeBonusResponse {
32
32
  failReason: string | null;
33
33
  requestedAt: string;
34
34
  resolvedAt: string | null;
35
+ /** Instante del cierre de reconciliación. No nulo = el asiento se cerró a mano, no por el flujo. */
36
+ reconciledAt: string | null;
37
+ reconciledBy: string | null;
38
+ reconciliationReason: string | null;
35
39
  processorTransactionId: string | null;
36
40
  idempotencyKey: string | null;
37
41
  providerName: string | null;
@@ -24,10 +24,15 @@ export interface WizardBlocked {
24
24
  }
25
25
 
26
26
  /**
27
- * Lo mínimo del bloqueo que necesita la ficha de Prospectos: la etiqueta y el «hace N días». Deja
28
- * fuera `code` y `detail`, que son de soporte y admin.
27
+ * Lo del bloqueo que puede viajar al navegador del vendedor: qué pantalla toca, la etiqueta y el
28
+ * «hace N días». Deja fuera `code` y `detail`, que son de soporte y admin.
29
29
  */
30
30
  export interface WizardBlockedSummary {
31
+ /**
32
+ * Cuál de las dos pantallas del paso 02 toca: la espera, o «no se pudo abrir». Opcional: la ficha
33
+ * de Prospectos no lo manda, y un consumidor que no lo conoce sigue leyendo `category`.
34
+ */
35
+ reason?: BlockedReasonEnum;
31
36
  category: BlockedCategoryEnum | null;
32
37
  /** ISO 8601, copiado tal cual de `WizardBlocked.since`. */
33
38
  since: string;
@@ -4,7 +4,7 @@ import type { FiadoPhoneStatusEnum } from '../enums/FiadoPhoneStatusEnum';
4
4
  import type { PaymentMethodEnum } from '../enums/PaymentMethodEnum';
5
5
  import type { ExternalProviderEnum } from '../enums/ExternalProviderEnum';
6
6
  import type { OccupationEnum } from '../enums/OccupationEnum';
7
- import type { WizardBlocked } from './WizardBlocked';
7
+ import type { WizardBlockedSummary } from './WizardBlocked';
8
8
  import type { WizardConsents } from './WizardConsents';
9
9
  import type { WizardLoan } from './WizardLoan';
10
10
  import type { WizardPayment } from './WizardPayment';
@@ -98,12 +98,11 @@ export interface WizardSession {
98
98
  accountOpened: boolean;
99
99
  accountStatus: AccountStatus | null;
100
100
  /**
101
- * La venta está detenida esperando la cuenta. Es un campo y no un estado: `state` sigue `ACTIVE`,
102
- * así el retorno, las mutaciones del paso 10 y los barridos de mantenimiento siguen corriendo.
103
- *
104
- * Opcional por lo mismo que `resumeOtpRequired`. Ausente o `null` = la venta va bien.
101
+ * La venta está detenida esperando la cuenta. Resumen y no el bloqueo entero: el motivo crudo del
102
+ * emisor puede nombrar una coincidencia en listas de PLD, y avisarlo es delito se sirve por su
103
+ * propio endpoint con permiso. Ausente o `null` = la venta va bien.
105
104
  */
106
- blocked?: WizardBlocked | null;
105
+ blocked?: WizardBlockedSummary | null;
107
106
  reservedSku: string | null;
108
107
  reservedImei: string | null;
109
108
  /**
@@ -44,4 +44,10 @@ export class CreateProspectRequest {
44
44
  @IsString()
45
45
  @MaxLength(200)
46
46
  notes?: string;
47
+
48
+ /** La venta de la que sale el prospecto: el único camino de vuelta del prospecto a su sesión. */
49
+ @Expose()
50
+ @IsOptional()
51
+ @IsString()
52
+ wizardSessionId?: string;
47
53
  }
@@ -1,5 +1,8 @@
1
1
  /**
2
- * Motivo por el que un cliente quedó como prospecto (15 valores, filtrados por paso).
2
+ * Motivo por el que un cliente quedó como prospecto, filtrados por paso.
3
+ *
4
+ * Los primeros quince son objeciones del CLIENTE y los elige el vendedor. Los dos últimos los pone
5
+ * el sistema cuando la venta se traba por la cuenta: no se ofrecen en el desplegable ni se editan.
3
6
  * SureKeep Fase 2 — pista Retail.
4
7
  */
5
8
  export enum PendingReasonEnum {
@@ -18,4 +21,17 @@ export enum PendingReasonEnum {
18
21
  DEVICE_ISSUE = 'DEVICE_ISSUE',
19
22
  CLIENT_THINKING = 'CLIENT_THINKING',
20
23
  OTHER = 'OTHER',
24
+ /**
25
+ * La cuenta espera a que una persona la revise. Nunca nombra el área ni la causa: decir que hubo
26
+ * coincidencia en una lista de PLD es aviso indebido.
27
+ */
28
+ ACCOUNT_UNDER_REVIEW = 'ACCOUNT_UNDER_REVIEW',
29
+ /** La cuenta no abrió por un dato del expediente o una falla del proveedor. */
30
+ ACCOUNT_OPEN_FAILED = 'ACCOUNT_OPEN_FAILED',
21
31
  }
32
+
33
+ /** Los que pone el sistema al trabarse la venta: no se ofrecen al vendedor ni se pueden editar. */
34
+ export const SYSTEM_PENDING_REASONS: readonly PendingReasonEnum[] = [
35
+ PendingReasonEnum.ACCOUNT_UNDER_REVIEW,
36
+ PendingReasonEnum.ACCOUNT_OPEN_FAILED,
37
+ ] as const;
@@ -1,22 +1,71 @@
1
1
  /**
2
- * Response del endpoint `POST /wallet-funding/limit` (processor).
2
+ * Response del endpoint de limites de wallet funding.
3
3
  *
4
- * Reporta el cap mensual del nivel del usuario (en MXN) y cuanto le queda
5
- * disponible este mes, para que el wallet-app pueda mostrar "Disponible este
6
- * mes: $X" antes de que el usuario haga cualquier deposito.
4
+ * Lo consume el wallet-app para decirle al usuario cuanto puede fondear ANTES
5
+ * de que vaya a la tienda. Hay dos topes distintos que lo pueden frenar, y el
6
+ * usuario tiene derecho a saber cual — asi que cada uno viaja en su propia
7
+ * propiedad en vez de colapsarlos en un solo numero:
7
8
  *
8
- * Semantica de los campos opcionales:
9
- * - `monthlyLimit === undefined` el nivel del usuario es ILIMITADO (el
10
- * accountLevel tiene `maxMonthlyIncomingAmount = 0` en UDIs). En ese caso
11
- * `remainingAmount` tambien viene undefined; el front muestra "Sin limite".
12
- * - `monthlyLimit` definido → hay cap. `remainingAmount = max(0, monthlyLimit
13
- * − monthlyConsumed)`. Si el usuario ya copo el cap, `remainingAmount = 0`.
9
+ * 1. TOPE DEL NIVEL DE CUENTA (`monthly*`) — regulatorio (CFPE / Contrato
10
+ * EDM). Cubre TODAS las entradas del usuario: P2P, SPEI, Pomelo y tambien
11
+ * el cash-in. Es el TECHO: nada puede pasarlo.
14
12
  *
15
- * `currency` siempre presente (default "MXN").
13
+ * 2. TOPE DE CASH IN (`cashIn*`) — decision de negocio Fiado, por cliente y
14
+ * por mes calendario. Dice cuanto de ese techo puede venir por efectivo en
15
+ * tienda. NO lo reemplaza: es un sub-limite dentro de el.
16
+ *
17
+ * El cap AGREGADO de exposicion FSA no se reporta aca: es global, no un limite
18
+ * personal del usuario. Si el servicio esta suspendido se comunica por otra via.
19
+ *
20
+ * `availableToFund` es la respuesta a "cuanto puedo depositar ahora": el MENOR
21
+ * de los dos, ya descontando lo pendiente. Es el unico numero que el front
22
+ * necesita para habilitar o bloquear; los demas sirven para explicar POR QUE,
23
+ * que es lo que evita el ticket de soporte.
24
+ *
25
+ * Compatibilidad: los cuatro campos originales conservan su semantica exacta.
26
+ * Los nuevos son opcionales — un caller viejo sigue funcionando igual.
16
27
  */
17
28
  export class GetWalletFundingLimitResponse {
29
+ /**
30
+ * Tope mensual de ENTRADAS del nivel de cuenta, en MXN.
31
+ * `undefined` = nivel ilimitado (`maxMonthlyIncomingAmount = 0` en UDIs);
32
+ * el front muestra "Sin limite".
33
+ */
18
34
  monthlyLimit?: number;
35
+ /** Entradas ya recibidas este mes por CUALQUIER via, no solo cash-in. */
19
36
  monthlyConsumed?: number;
37
+ /** `max(0, monthlyLimit − monthlyConsumed)`. `undefined` si no hay tope. */
20
38
  remainingAmount?: number;
39
+
40
+ /** Tope mensual de cash-in por cliente, en MXN. */
41
+ cashInMonthlyLimit?: number;
42
+ /** Cash-in ya ACREDITADO al cliente este mes. */
43
+ cashInMonthlyConsumed?: number;
44
+ /**
45
+ * Cash-in AUTORIZADO pero todavia no acreditado (pagos en verificacion).
46
+ *
47
+ * Cuenta contra el disponible aunque aun no toque el saldo: el cliente ya
48
+ * entrego ese efectivo en la caja y el dinero esta comprometido. Sin esto,
49
+ * en la ventana entre autorizar y acreditar el usuario veria un disponible
50
+ * inflado y podria pasarse del tope.
51
+ */
52
+ cashInMonthlyPending?: number;
53
+ /** `max(0, cashInMonthlyLimit − consumido − pendiente)`. */
54
+ cashInRemainingAmount?: number;
55
+
56
+ /**
57
+ * Cuanto puede fondear el usuario AHORA por cash-in: el menor entre
58
+ * `remainingAmount` y `cashInRemainingAmount`.
59
+ *
60
+ * Es el numero que el front debe usar para habilitar o bloquear el flujo.
61
+ */
62
+ availableToFund?: number;
63
+ /**
64
+ * Que tope esta limitando: `ACCOUNT_LEVEL` (el regulatorio del nivel) o
65
+ * `CASH_IN` (el de negocio). Permite explicarle al usuario por que no puede
66
+ * depositar mas, en vez de mostrarle un cero sin razon.
67
+ */
68
+ limitedBy?: "ACCOUNT_LEVEL" | "CASH_IN";
69
+
21
70
  currency!: string;
22
71
  }
@@ -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 = {}));
@@ -1,6 +0,0 @@
1
- /** Body de la asignación de una tarjeta física a un cliente. */
2
- export declare class AssignCardRequest {
3
- assignedToCustomerId: string;
4
- assignedByUserId: string;
5
- creditId?: string;
6
- }
@@ -1,30 +0,0 @@
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.AssignCardRequest = void 0;
13
- const class_validator_1 = require("class-validator");
14
- /** Body de la asignación de una tarjeta física a un cliente. */
15
- class AssignCardRequest {
16
- }
17
- exports.AssignCardRequest = AssignCardRequest;
18
- __decorate([
19
- (0, class_validator_1.IsString)(),
20
- __metadata("design:type", String)
21
- ], AssignCardRequest.prototype, "assignedToCustomerId", void 0);
22
- __decorate([
23
- (0, class_validator_1.IsString)(),
24
- __metadata("design:type", String)
25
- ], AssignCardRequest.prototype, "assignedByUserId", void 0);
26
- __decorate([
27
- (0, class_validator_1.IsOptional)(),
28
- (0, class_validator_1.IsString)(),
29
- __metadata("design:type", String)
30
- ], AssignCardRequest.prototype, "creditId", void 0);
@@ -1,5 +0,0 @@
1
- import { CardCancelReasonEnum } from '../../enums/CardCancelReasonEnum';
2
- /** Body de la cancelación (anulación) de una tarjeta física. */
3
- export declare class CancelCardRequest {
4
- reason: CardCancelReasonEnum;
5
- }
@@ -1,22 +0,0 @@
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.CancelCardRequest = void 0;
13
- const class_validator_1 = require("class-validator");
14
- const CardCancelReasonEnum_1 = require("../../enums/CardCancelReasonEnum");
15
- /** Body de la cancelación (anulación) de una tarjeta física. */
16
- class CancelCardRequest {
17
- }
18
- exports.CancelCardRequest = CancelCardRequest;
19
- __decorate([
20
- (0, class_validator_1.IsEnum)(CardCancelReasonEnum_1.CardCancelReasonEnum),
21
- __metadata("design:type", String)
22
- ], CancelCardRequest.prototype, "reason", void 0);
@@ -1,12 +0,0 @@
1
- import { RetailCardStatusEnum } from '../../enums/RetailCardStatusEnum';
2
- /** Representación de una tarjeta física hacia el cliente. */
3
- export interface RetailCardResponse {
4
- cardNumber: string;
5
- retailerId: string;
6
- batchId: string;
7
- storeId: string;
8
- status: RetailCardStatusEnum;
9
- assignedToCustomerId: string | null;
10
- assignedAt: string | null;
11
- assignedByUserId: string | null;
12
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,17 +0,0 @@
1
- /**
2
- * Estado de un lote de tarjetas.
3
- * @enum {string}
4
- *
5
- * @property {string} RECEIVING - Transitorio, carga en curso (DEC-004/DEC-008).
6
- * @property {string} RECEIVED - Carga completada, lote atado a una tienda (happy-path F1).
7
- * @property {string} FAILED - Terminal, la carga del lote falló (DEC-004/DEC-008).
8
- * @property {string} DISTRIBUTED - Reservado F1 — lote centralizado repartido a varias tiendas (TD-008).
9
- * @property {string} CLOSED - Reservado F1 — cierre manual del lote (TD-008).
10
- */
11
- export declare enum CardBatchStatusEnum {
12
- RECEIVING = "RECEIVING",
13
- RECEIVED = "RECEIVED",
14
- FAILED = "FAILED",
15
- DISTRIBUTED = "DISTRIBUTED",
16
- CLOSED = "CLOSED"
17
- }
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CardBatchStatusEnum = void 0;
4
- /**
5
- * Estado de un lote de tarjetas.
6
- * @enum {string}
7
- *
8
- * @property {string} RECEIVING - Transitorio, carga en curso (DEC-004/DEC-008).
9
- * @property {string} RECEIVED - Carga completada, lote atado a una tienda (happy-path F1).
10
- * @property {string} FAILED - Terminal, la carga del lote falló (DEC-004/DEC-008).
11
- * @property {string} DISTRIBUTED - Reservado F1 — lote centralizado repartido a varias tiendas (TD-008).
12
- * @property {string} CLOSED - Reservado F1 — cierre manual del lote (TD-008).
13
- */
14
- var CardBatchStatusEnum;
15
- (function (CardBatchStatusEnum) {
16
- CardBatchStatusEnum["RECEIVING"] = "RECEIVING";
17
- CardBatchStatusEnum["RECEIVED"] = "RECEIVED";
18
- CardBatchStatusEnum["FAILED"] = "FAILED";
19
- CardBatchStatusEnum["DISTRIBUTED"] = "DISTRIBUTED";
20
- CardBatchStatusEnum["CLOSED"] = "CLOSED";
21
- })(CardBatchStatusEnum || (exports.CardBatchStatusEnum = CardBatchStatusEnum = {}));
@@ -1,13 +0,0 @@
1
- /**
2
- * Motivo de cancelación de una tarjeta física.
3
- * @enum {string}
4
- *
5
- * @property {string} PLASTIC_DAMAGED - Plástico dañado.
6
- * @property {string} LOST - Tarjeta perdida.
7
- * @property {string} THEFT_REPORTED - Robo reportado.
8
- */
9
- export declare enum CardCancelReasonEnum {
10
- PLASTIC_DAMAGED = "PLASTIC_DAMAGED",
11
- LOST = "LOST",
12
- THEFT_REPORTED = "THEFT_REPORTED"
13
- }
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CardCancelReasonEnum = void 0;
4
- /**
5
- * Motivo de cancelación de una tarjeta física.
6
- * @enum {string}
7
- *
8
- * @property {string} PLASTIC_DAMAGED - Plástico dañado.
9
- * @property {string} LOST - Tarjeta perdida.
10
- * @property {string} THEFT_REPORTED - Robo reportado.
11
- */
12
- var CardCancelReasonEnum;
13
- (function (CardCancelReasonEnum) {
14
- CardCancelReasonEnum["PLASTIC_DAMAGED"] = "PLASTIC_DAMAGED";
15
- CardCancelReasonEnum["LOST"] = "LOST";
16
- CardCancelReasonEnum["THEFT_REPORTED"] = "THEFT_REPORTED";
17
- })(CardCancelReasonEnum || (exports.CardCancelReasonEnum = CardCancelReasonEnum = {}));
@@ -1,13 +0,0 @@
1
- /**
2
- * Estado de una tarjeta física individual.
3
- * @enum {string}
4
- *
5
- * @property {string} AVAILABLE - Cargada en stock, disponible para asignar.
6
- * @property {string} ASSIGNED - Asignada a un cliente.
7
- * @property {string} CANCELLED - Anulada (plástico dañado, pérdida o robo). Estado terminal.
8
- */
9
- export declare enum RetailCardStatusEnum {
10
- AVAILABLE = "AVAILABLE",
11
- ASSIGNED = "ASSIGNED",
12
- CANCELLED = "CANCELLED"
13
- }
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RetailCardStatusEnum = void 0;
4
- /**
5
- * Estado de una tarjeta física individual.
6
- * @enum {string}
7
- *
8
- * @property {string} AVAILABLE - Cargada en stock, disponible para asignar.
9
- * @property {string} ASSIGNED - Asignada a un cliente.
10
- * @property {string} CANCELLED - Anulada (plástico dañado, pérdida o robo). Estado terminal.
11
- */
12
- var RetailCardStatusEnum;
13
- (function (RetailCardStatusEnum) {
14
- RetailCardStatusEnum["AVAILABLE"] = "AVAILABLE";
15
- RetailCardStatusEnum["ASSIGNED"] = "ASSIGNED";
16
- RetailCardStatusEnum["CANCELLED"] = "CANCELLED";
17
- })(RetailCardStatusEnum || (exports.RetailCardStatusEnum = RetailCardStatusEnum = {}));