@fiado/type-kit 3.555.0 → 3.557.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 (58) hide show
  1. package/_test_/unit/retailWizard/accountOpeningCancelReasons.test.ts +9 -0
  2. package/_test_/unit/retailWizard/accountOpeningFlag.test.ts +37 -0
  3. package/_test_/unit/retailWizard/accountOpeningOccupation.test.ts +44 -0
  4. package/_test_/unit/retailWizard/accountOpeningsResponse.test.ts +22 -0
  5. package/bin/notificationMessages/dtos/DisputeNotificationData.d.ts +9 -0
  6. package/bin/notificationMessages/dtos/DisputeNotificationData.js +10 -0
  7. package/bin/notificationMessages/index.d.ts +1 -0
  8. package/bin/notificationMessages/index.js +1 -0
  9. package/bin/retailWizard/dtos/WizardSession.d.ts +2 -0
  10. package/bin/retailWizard/dtos/requests/OccupationRequest.d.ts +5 -0
  11. package/bin/retailWizard/dtos/requests/OccupationRequest.js +29 -0
  12. package/bin/retailWizard/dtos/requests/StartSessionRequest.d.ts +2 -0
  13. package/bin/retailWizard/dtos/requests/StartSessionRequest.js +6 -0
  14. package/bin/retailWizard/dtos/responses/BackofficeAccountOpeningsResponse.d.ts +19 -0
  15. package/bin/retailWizard/dtos/responses/BackofficeAccountOpeningsResponse.js +2 -0
  16. package/bin/retailWizard/enums/SystemCancelReasonEnum.d.ts +5 -1
  17. package/bin/retailWizard/enums/SystemCancelReasonEnum.js +4 -0
  18. package/bin/retailWizard/index.d.ts +1 -0
  19. package/bin/retailWizard/index.js +1 -0
  20. package/bin/transaction/dtos/DisputeGetDetailResponse.d.ts +32 -0
  21. package/bin/transaction/dtos/DisputeGetDetailResponse.js +12 -0
  22. package/bin/transaction/dtos/DisputeRefundSummary.d.ts +14 -0
  23. package/bin/transaction/dtos/DisputeRefundSummary.js +10 -0
  24. package/bin/transaction/dtos/R27EventPayload.d.ts +11 -0
  25. package/bin/transaction/dtos/R27EventPayload.js +11 -0
  26. package/bin/transaction/dtos/RefundInstruction.d.ts +12 -0
  27. package/bin/transaction/dtos/RefundInstruction.js +13 -0
  28. package/bin/transaction/dtos/ReopenDisputeResponse.d.ts +15 -0
  29. package/bin/transaction/dtos/ReopenDisputeResponse.js +11 -0
  30. package/bin/transaction/dtos/UpdateR27StatusRequest.d.ts +3 -0
  31. package/bin/transaction/dtos/UpdateR27StatusRequest.js +0 -4
  32. package/bin/transaction/dtos/UpdateR27StatusResponse.d.ts +3 -0
  33. package/bin/transaction/dtos/UpdateR27StatusResponse.js +0 -5
  34. package/bin/transaction/enums/R27ActorRoleEnum.d.ts +8 -0
  35. package/bin/transaction/enums/R27ActorRoleEnum.js +12 -0
  36. package/bin/transaction/enums/R27StatusEnum.d.ts +11 -0
  37. package/bin/transaction/enums/R27StatusEnum.js +15 -0
  38. package/bin/transaction/index.d.ts +7 -0
  39. package/bin/transaction/index.js +7 -0
  40. package/package.json +1 -1
  41. package/src/notificationMessages/dtos/DisputeNotificationData.ts +9 -0
  42. package/src/notificationMessages/index.ts +1 -0
  43. package/src/retailWizard/dtos/WizardSession.ts +2 -0
  44. package/src/retailWizard/dtos/requests/OccupationRequest.ts +31 -0
  45. package/src/retailWizard/dtos/requests/StartSessionRequest.ts +7 -1
  46. package/src/retailWizard/dtos/responses/BackofficeAccountOpeningsResponse.ts +20 -0
  47. package/src/retailWizard/enums/SystemCancelReasonEnum.ts +4 -0
  48. package/src/retailWizard/index.ts +1 -0
  49. package/src/transaction/dtos/DisputeGetDetailResponse.ts +33 -0
  50. package/src/transaction/dtos/DisputeRefundSummary.ts +15 -0
  51. package/src/transaction/dtos/R27EventPayload.ts +12 -0
  52. package/src/transaction/dtos/RefundInstruction.ts +12 -0
  53. package/src/transaction/dtos/ReopenDisputeResponse.ts +16 -0
  54. package/src/transaction/dtos/UpdateR27StatusRequest.ts +4 -0
  55. package/src/transaction/dtos/UpdateR27StatusResponse.ts +4 -0
  56. package/src/transaction/enums/R27ActorRoleEnum.ts +8 -0
  57. package/src/transaction/enums/R27StatusEnum.ts +11 -0
  58. package/src/transaction/index.ts +7 -0
@@ -0,0 +1,9 @@
1
+ import 'reflect-metadata';
2
+ import { SystemCancelReasonEnum } from '../../../src/retailWizard';
3
+
4
+ describe('SystemCancelReasonEnum — motivos de la apertura', () => {
5
+ it('declara ALREADY_HAS_ACCOUNT y CURP_OF_OTHER_CUSTOMER', () => {
6
+ expect(SystemCancelReasonEnum.ALREADY_HAS_ACCOUNT).toBe('ALREADY_HAS_ACCOUNT');
7
+ expect(SystemCancelReasonEnum.CURP_OF_OTHER_CUSTOMER).toBe('CURP_OF_OTHER_CUSTOMER');
8
+ });
9
+ });
@@ -0,0 +1,37 @@
1
+ import 'reflect-metadata';
2
+ import { plainToInstance } from 'class-transformer';
3
+ import { validateSync } from 'class-validator';
4
+ import { StartSessionRequest, type WizardSession } from '../../../src/retailWizard';
5
+
6
+ function startErrors(payload: Record<string, unknown>): string[] {
7
+ const dto = plainToInstance(StartSessionRequest, payload, { excludeExtraneousValues: true });
8
+ return validateSync(dto).map((e) => e.property);
9
+ }
10
+
11
+ describe('StartSessionRequest — marca accountOpening', () => {
12
+ it('sin la marca sigue igual que hoy', () => {
13
+ expect(startErrors({ phone: '5512345678' })).toEqual([]);
14
+ });
15
+
16
+ it.each([true, false])('acepta accountOpening=%s y lo conserva', (value) => {
17
+ const dto = plainToInstance(
18
+ StartSessionRequest,
19
+ { phone: '5512345678', accountOpening: value },
20
+ { excludeExtraneousValues: true },
21
+ );
22
+ expect(validateSync(dto)).toEqual([]);
23
+ expect(dto.accountOpening).toBe(value);
24
+ });
25
+
26
+ it.each(['true', 1, 'si'])('rechaza accountOpening no booleano (%p)', (value) => {
27
+ expect(startErrors({ phone: '5512345678', accountOpening: value })).toContain('accountOpening');
28
+ });
29
+ });
30
+
31
+ describe('WizardSession — marca accountOpening', () => {
32
+ it('es opcional en la sesión', () => {
33
+ const session: Pick<WizardSession, 'accountOpening'> = { accountOpening: true };
34
+ const legacy: Pick<WizardSession, 'accountOpening'> = {};
35
+ expect([session.accountOpening, legacy.accountOpening]).toEqual([true, undefined]);
36
+ });
37
+ });
@@ -0,0 +1,44 @@
1
+ import 'reflect-metadata';
2
+ import { plainToInstance } from 'class-transformer';
3
+ import { validateSync } from 'class-validator';
4
+ import { OccupationEnum, OccupationRequest } from '../../../src/retailWizard';
5
+
6
+ function occupationErrors(payload: Record<string, unknown>): string[] {
7
+ const dto = plainToInstance(OccupationRequest, payload, { excludeExtraneousValues: true });
8
+ return validateSync(dto).map((e) => e.property);
9
+ }
10
+
11
+ const BASE_OCCUPATION = { occupation: OccupationEnum.EMPLOYED, monthlyIncome: '20000' };
12
+ const FULL_PROFILE = {
13
+ monthlyExtraSupport: '0',
14
+ usageMonthly: '60',
15
+ maximumTx: '10000',
16
+ beneficialOwner: 'SELF',
17
+ };
18
+
19
+ describe('OccupationRequest — 4 MXN_* opcionales para la apertura', () => {
20
+ it('sin los MXN_* sigue igual que hoy', () => {
21
+ expect(occupationErrors(BASE_OCCUPATION)).toEqual([]);
22
+ });
23
+
24
+ it('acepta el perfil completo del catálogo y lo conserva', () => {
25
+ const dto = plainToInstance(
26
+ OccupationRequest,
27
+ { ...BASE_OCCUPATION, ...FULL_PROFILE },
28
+ { excludeExtraneousValues: true },
29
+ );
30
+ expect(validateSync(dto)).toEqual([]);
31
+ expect(dto).toMatchObject(FULL_PROFILE);
32
+ });
33
+
34
+ it('acepta OTHER en beneficialOwner: lo rechaza el negocio, no el DTO', () => {
35
+ expect(occupationErrors({ ...BASE_OCCUPATION, beneficialOwner: 'OTHER' })).toEqual([]);
36
+ });
37
+
38
+ it.each(['monthlyExtraSupport', 'usageMonthly', 'maximumTx', 'beneficialOwner'])(
39
+ 'rechaza %s fuera del catálogo',
40
+ (field) => {
41
+ expect(occupationErrors({ ...BASE_OCCUPATION, ...FULL_PROFILE, [field]: 'X' })).toEqual([field]);
42
+ },
43
+ );
44
+ });
@@ -0,0 +1,22 @@
1
+ import 'reflect-metadata';
2
+ import type { BackofficeAccountOpeningsResponse } from '../../../src/retailWizard';
3
+
4
+ describe('BackofficeAccountOpeningsResponse', () => {
5
+ it('declara las filas de aperturas y el cursor', () => {
6
+ const response: BackofficeAccountOpeningsResponse = {
7
+ nextToken: null,
8
+ items: [
9
+ {
10
+ sessionId: 'S1',
11
+ retailCustomerId: 'RC-1',
12
+ name: null,
13
+ phone: '5512345678',
14
+ storeId: 'ST-1',
15
+ sellerRetailUserId: 'RU-1',
16
+ openedAt: '2026-10-20T18:00:00.000Z',
17
+ },
18
+ ],
19
+ };
20
+ expect(response.items[0].sessionId).toBe('S1');
21
+ });
22
+ });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * `destinations[].data` de los pushes DISPUTE_* (dictamen, reapertura, 2° dictamen).
3
+ * La app lo usa para saber de qué folio es el push: recargar el detalle o abrir la ficha.
4
+ */
5
+ export declare class DisputeNotificationData {
6
+ id: string;
7
+ folio: string;
8
+ folioId?: string;
9
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DisputeNotificationData = void 0;
4
+ /**
5
+ * `destinations[].data` de los pushes DISPUTE_* (dictamen, reapertura, 2° dictamen).
6
+ * La app lo usa para saber de qué folio es el push: recargar el detalle o abrir la ficha.
7
+ */
8
+ class DisputeNotificationData {
9
+ }
10
+ exports.DisputeNotificationData = DisputeNotificationData;
@@ -1,5 +1,6 @@
1
1
  export * from './dtos/NotificationQueueMessageRequest';
2
2
  export * from './dtos/QueueMessageDestination';
3
+ export * from './dtos/DisputeNotificationData';
3
4
  export * from './dtos/QueueMessageVariableValues';
4
5
  export * from './dtos/NotificationTemplate';
5
6
  export * from './dtos/MomentTemplateUpsertRequest';
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./dtos/NotificationQueueMessageRequest"), exports);
18
18
  __exportStar(require("./dtos/QueueMessageDestination"), exports);
19
+ __exportStar(require("./dtos/DisputeNotificationData"), exports);
19
20
  __exportStar(require("./dtos/QueueMessageVariableValues"), exports);
20
21
  __exportStar(require("./dtos/NotificationTemplate"), exports);
21
22
  __exportStar(require("./dtos/MomentTemplateUpsertRequest"), exports);
@@ -156,6 +156,8 @@ export interface WizardSession {
156
156
  * Crédito y derivación se rechazan con `CREDIT_IN_PROGRESS_OTHER_STORE`. Ausente = venta completa.
157
157
  */
158
158
  cashOnly?: boolean;
159
+ /** Sesión de apertura de cuenta sin venta; ausente = venta de siempre. */
160
+ accountOpening?: boolean;
159
161
  /** TTL DDB ~24h de inactividad (D14). */
160
162
  ttlEpoch: number;
161
163
  createdBy: string;
@@ -8,4 +8,9 @@ export declare class OccupationRequest {
8
8
  occupationOther?: string;
9
9
  /** Mismo catálogo cerrado que el paso 10 (`ProfileQuestionsRequest`). */
10
10
  monthlyIncome: string;
11
+ /** MXN_* del perfil transaccional: opcionales aquí, la apertura de cuenta los exige en negocio. */
12
+ monthlyExtraSupport?: string;
13
+ usageMonthly?: string;
14
+ maximumTx?: string;
15
+ beneficialOwner?: string;
11
16
  }
@@ -14,6 +14,7 @@ const class_transformer_1 = require("class-transformer");
14
14
  const class_validator_1 = require("class-validator");
15
15
  const OccupationEnum_1 = require("../../enums/OccupationEnum");
16
16
  const monthlyIncome_1 = require("../../catalog/monthlyIncome");
17
+ const ProfileQuestionsRequest_1 = require("./ProfileQuestionsRequest");
17
18
  /**
18
19
  * POST /wizard/sessions/:id/occupation — registra la ocupación y el ingreso mensual del expediente
19
20
  * PCF (viven en People de Fiado — D17). Los dos obligatorios; `OTHER` abre texto ≤60.
@@ -39,3 +40,31 @@ __decorate([
39
40
  (0, class_validator_1.IsIn)(monthlyIncome_1.MONTHLY_INCOME_VALUES),
40
41
  __metadata("design:type", String)
41
42
  ], OccupationRequest.prototype, "monthlyIncome", void 0);
43
+ __decorate([
44
+ (0, class_transformer_1.Expose)(),
45
+ (0, class_validator_1.IsOptional)(),
46
+ (0, class_validator_1.IsString)(),
47
+ (0, class_validator_1.IsIn)(ProfileQuestionsRequest_1.EXTRA_SUPPORT_VALUES),
48
+ __metadata("design:type", String)
49
+ ], OccupationRequest.prototype, "monthlyExtraSupport", void 0);
50
+ __decorate([
51
+ (0, class_transformer_1.Expose)(),
52
+ (0, class_validator_1.IsOptional)(),
53
+ (0, class_validator_1.IsString)(),
54
+ (0, class_validator_1.IsIn)(ProfileQuestionsRequest_1.USAGE_MONTHLY_VALUES),
55
+ __metadata("design:type", String)
56
+ ], OccupationRequest.prototype, "usageMonthly", void 0);
57
+ __decorate([
58
+ (0, class_transformer_1.Expose)(),
59
+ (0, class_validator_1.IsOptional)(),
60
+ (0, class_validator_1.IsString)(),
61
+ (0, class_validator_1.IsIn)(ProfileQuestionsRequest_1.MAXIMUM_TX_VALUES),
62
+ __metadata("design:type", String)
63
+ ], OccupationRequest.prototype, "maximumTx", void 0);
64
+ __decorate([
65
+ (0, class_transformer_1.Expose)(),
66
+ (0, class_validator_1.IsOptional)(),
67
+ (0, class_validator_1.IsString)(),
68
+ (0, class_validator_1.IsIn)(ProfileQuestionsRequest_1.BENEFICIAL_OWNER_VALUES),
69
+ __metadata("design:type", String)
70
+ ], OccupationRequest.prototype, "beneficialOwner", void 0);
@@ -7,4 +7,6 @@ export declare class StartSessionRequest {
7
7
  phone: string;
8
8
  /** Prospecto a reanudar (opcional): si viene, la sesión se vincula al prospecto. */
9
9
  prospectId?: string;
10
+ /** Marca de apertura de cuenta sin venta; ausente = venta de siempre. */
11
+ accountOpening?: boolean;
10
12
  }
@@ -33,3 +33,9 @@ __decorate([
33
33
  (0, class_validator_1.IsString)(),
34
34
  __metadata("design:type", String)
35
35
  ], StartSessionRequest.prototype, "prospectId", void 0);
36
+ __decorate([
37
+ (0, class_transformer_1.Expose)(),
38
+ (0, class_validator_1.IsOptional)(),
39
+ (0, class_validator_1.IsBoolean)(),
40
+ __metadata("design:type", Boolean)
41
+ ], StartSessionRequest.prototype, "accountOpening", void 0);
@@ -0,0 +1,19 @@
1
+ /** Una apertura de cuenta sin venta, cerrada en COMPLETED. */
2
+ export interface AccountOpeningRow {
3
+ sessionId: string;
4
+ retailCustomerId: string;
5
+ /** `null` si el cliente no se pudo leer. */
6
+ name: string | null;
7
+ phone: string;
8
+ storeId: string;
9
+ sellerRetailUserId: string;
10
+ openedAt: string;
11
+ }
12
+ /**
13
+ * `GET /backoffice/customers/account-openings?storeId&from&to&limit&nextToken` — sección «Cuentas abiertas
14
+ * sin compra» de Clientes VL, paginada por fecha de apertura descendente.
15
+ */
16
+ export interface BackofficeAccountOpeningsResponse {
17
+ nextToken: string | null;
18
+ items: AccountOpeningRow[];
19
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -2,8 +2,12 @@
2
2
  * `cancelReason` que escribe el sistema (no el vendedor).
3
3
  * SWEEP_CREDIT_DISCARDED: la saga cierra la venta cuyo crédito se descartó.
4
4
  * TAKEN_OVER_BY_OTHER_STORE: otra tienda tomó al cliente y la venta no tenía dinero en juego.
5
+ * ALREADY_HAS_ACCOUNT: la apertura de cuenta se cierra porque el cliente ya tiene cuenta PagoConFiado.
6
+ * CURP_OF_OTHER_CUSTOMER: la apertura de cuenta se cierra porque la CURP ya es de otro cliente.
5
7
  */
6
8
  export declare enum SystemCancelReasonEnum {
7
9
  SWEEP_CREDIT_DISCARDED = "SWEEP_CREDIT_DISCARDED",
8
- TAKEN_OVER_BY_OTHER_STORE = "TAKEN_OVER_BY_OTHER_STORE"
10
+ TAKEN_OVER_BY_OTHER_STORE = "TAKEN_OVER_BY_OTHER_STORE",
11
+ ALREADY_HAS_ACCOUNT = "ALREADY_HAS_ACCOUNT",
12
+ CURP_OF_OTHER_CUSTOMER = "CURP_OF_OTHER_CUSTOMER"
9
13
  }
@@ -5,9 +5,13 @@ exports.SystemCancelReasonEnum = void 0;
5
5
  * `cancelReason` que escribe el sistema (no el vendedor).
6
6
  * SWEEP_CREDIT_DISCARDED: la saga cierra la venta cuyo crédito se descartó.
7
7
  * TAKEN_OVER_BY_OTHER_STORE: otra tienda tomó al cliente y la venta no tenía dinero en juego.
8
+ * ALREADY_HAS_ACCOUNT: la apertura de cuenta se cierra porque el cliente ya tiene cuenta PagoConFiado.
9
+ * CURP_OF_OTHER_CUSTOMER: la apertura de cuenta se cierra porque la CURP ya es de otro cliente.
8
10
  */
9
11
  var SystemCancelReasonEnum;
10
12
  (function (SystemCancelReasonEnum) {
11
13
  SystemCancelReasonEnum["SWEEP_CREDIT_DISCARDED"] = "SWEEP_CREDIT_DISCARDED";
12
14
  SystemCancelReasonEnum["TAKEN_OVER_BY_OTHER_STORE"] = "TAKEN_OVER_BY_OTHER_STORE";
15
+ SystemCancelReasonEnum["ALREADY_HAS_ACCOUNT"] = "ALREADY_HAS_ACCOUNT";
16
+ SystemCancelReasonEnum["CURP_OF_OTHER_CUSTOMER"] = "CURP_OF_OTHER_CUSTOMER";
13
17
  })(SystemCancelReasonEnum || (exports.SystemCancelReasonEnum = SystemCancelReasonEnum = {}));
@@ -160,6 +160,7 @@ export * from './dtos/responses/BackofficeSellerKpisResponse';
160
160
  export * from './enums/SellerTableSourceStatusEnum';
161
161
  export * from './dtos/responses/BackofficeSellerTableResponse';
162
162
  export * from './dtos/responses/BackofficeCustomerTableResponse';
163
+ export * from './dtos/responses/BackofficeAccountOpeningsResponse';
163
164
  export * from './enums/StoreKindEnum';
164
165
  export * from './dtos/responses/BackofficeStoreTableResponse';
165
166
  export * from './enums/StoreMixCategoryEnum';
@@ -193,6 +193,7 @@ __exportStar(require("./dtos/responses/BackofficeSellerKpisResponse"), exports);
193
193
  __exportStar(require("./enums/SellerTableSourceStatusEnum"), exports);
194
194
  __exportStar(require("./dtos/responses/BackofficeSellerTableResponse"), exports);
195
195
  __exportStar(require("./dtos/responses/BackofficeCustomerTableResponse"), exports);
196
+ __exportStar(require("./dtos/responses/BackofficeAccountOpeningsResponse"), exports);
196
197
  __exportStar(require("./enums/StoreKindEnum"), exports);
197
198
  __exportStar(require("./dtos/responses/BackofficeStoreTableResponse"), exports);
198
199
  __exportStar(require("./enums/StoreMixCategoryEnum"), exports);
@@ -0,0 +1,32 @@
1
+ import { DisputeRefundSummary } from './DisputeRefundSummary';
2
+ import { R27StatusEnum } from '../enums/R27StatusEnum';
3
+ /**
4
+ * `data` de GET disputes/transaction/{code}/{transactionNumber} (pública, app).
5
+ * Devuelve el folio completo (todos los atributos de DisputeOrFraudLog) más los campos
6
+ * normalizados/enriquecidos que la app necesita para el detalle del movimiento.
7
+ * Vale desde cualquier movimiento ligado al folio (tx reclamada, abono o reversa).
8
+ */
9
+ export declare class DisputeGetDetailResponse {
10
+ id: string;
11
+ disputeOrFraudFolio: string;
12
+ directoryId: string;
13
+ disputeOrFraudStatus: R27StatusEnum;
14
+ disputeOrFraudStatusUpdate: string;
15
+ dateOfDisputedTx: string;
16
+ disputedTxNumber: string;
17
+ amountOfDisputedTx: number;
18
+ /** Sentido del dictamen (701-705 improcedente, 706-709 procedente). '' hasta el dictamen. */
19
+ disputeResolutionCause: string;
20
+ disputeResolutionDate: string;
21
+ /** Siempre presente (0 si nunca se reabrió). Botón "segunda revisión": status 102 + causa 701-705 + reopenCount 0. */
22
+ reopenCount: number;
23
+ reopenedAt?: string;
24
+ reopenedReason?: string;
25
+ refundTransactionId?: string;
26
+ /** Abono (provisional o por dictamen). */
27
+ refund?: DisputeRefundSummary;
28
+ /** Reversa del abono; la fecha del abono original está en `refund.executedAt`. */
29
+ reversal?: DisputeRefundSummary;
30
+ /** Resto de atributos del folio (merchant, statusHistory, etc.). */
31
+ [attribute: string]: unknown;
32
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DisputeGetDetailResponse = void 0;
4
+ /**
5
+ * `data` de GET disputes/transaction/{code}/{transactionNumber} (pública, app).
6
+ * Devuelve el folio completo (todos los atributos de DisputeOrFraudLog) más los campos
7
+ * normalizados/enriquecidos que la app necesita para el detalle del movimiento.
8
+ * Vale desde cualquier movimiento ligado al folio (tx reclamada, abono o reversa).
9
+ */
10
+ class DisputeGetDetailResponse {
11
+ }
12
+ exports.DisputeGetDetailResponse = DisputeGetDetailResponse;
@@ -0,0 +1,14 @@
1
+ import { DisputeRefundStatus } from '../enums/DisputeRefundStatus';
2
+ import { RefundChannelEnum } from '../enums/RefundChannelEnum';
3
+ /**
4
+ * Reintegro (abono o reversa) ligado a una reclamación, tal como lo consume la app
5
+ * en el detalle del movimiento. Resumen de una fila de DisputeRefund_GT.
6
+ */
7
+ export declare class DisputeRefundSummary {
8
+ id: string;
9
+ transactionId?: string;
10
+ status: DisputeRefundStatus;
11
+ amount: number;
12
+ channel?: RefundChannelEnum;
13
+ executedAt?: string;
14
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DisputeRefundSummary = void 0;
4
+ /**
5
+ * Reintegro (abono o reversa) ligado a una reclamación, tal como lo consume la app
6
+ * en el detalle del movimiento. Resumen de una fila de DisputeRefund_GT.
7
+ */
8
+ class DisputeRefundSummary {
9
+ }
10
+ exports.DisputeRefundSummary = DisputeRefundSummary;
@@ -0,0 +1,11 @@
1
+ import { R27StatusEnum } from '../enums/R27StatusEnum';
2
+ /**
3
+ * Evento R27 compacto incluido en las respuestas de disputes-business
4
+ * (reapertura y firma de dictamen). El Dashboard usa `eventId` como
5
+ * `folioEventId` al autorizar el reintegro.
6
+ */
7
+ export declare class R27EventPayload {
8
+ eventId: string;
9
+ code: R27StatusEnum;
10
+ occurredAt: string;
11
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.R27EventPayload = void 0;
4
+ /**
5
+ * Evento R27 compacto incluido en las respuestas de disputes-business
6
+ * (reapertura y firma de dictamen). El Dashboard usa `eventId` como
7
+ * `folioEventId` al autorizar el reintegro.
8
+ */
9
+ class R27EventPayload {
10
+ }
11
+ exports.R27EventPayload = R27EventPayload;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Instrucción de reintegro adjunta a la firma del dictamen (UpdateR27StatusRequest.refundInstruction).
3
+ * Política SP1:
4
+ * 1 = post-dictamen 2FA (el Dashboard genera la tx antes de cerrar el folio)
5
+ * 2 = T+2 provisional (ya abonado — se confirma el id existente)
6
+ * 3 = error operativo (reintegro manual)
7
+ */
8
+ export declare class RefundInstruction {
9
+ camino: 1 | 2 | 3;
10
+ /** Id de la tx de refund en el ledger. Presente cuando el refund ya ocurrió. */
11
+ refundTransactionId?: string;
12
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RefundInstruction = void 0;
4
+ /**
5
+ * Instrucción de reintegro adjunta a la firma del dictamen (UpdateR27StatusRequest.refundInstruction).
6
+ * Política SP1:
7
+ * 1 = post-dictamen 2FA (el Dashboard genera la tx antes de cerrar el folio)
8
+ * 2 = T+2 provisional (ya abonado — se confirma el id existente)
9
+ * 3 = error operativo (reintegro manual)
10
+ */
11
+ class RefundInstruction {
12
+ }
13
+ exports.RefundInstruction = RefundInstruction;
@@ -0,0 +1,15 @@
1
+ import { R27EventPayload } from './R27EventPayload';
2
+ /**
3
+ * Response 200 de la reapertura de reclamación (102 -> 103):
4
+ * privada POST disputes/{folioId}/reopen (CS/OC) y pública POST disputes/reopen/{folioId} (app).
5
+ * Idempotente: si el folio ya estaba en 103 con el mismo motivo responde este mismo shape.
6
+ */
7
+ export declare class ReopenDisputeResponse {
8
+ success: boolean;
9
+ folio: string;
10
+ id: string;
11
+ currentStatus: number;
12
+ reopenCount: number;
13
+ updatedAt: string;
14
+ lastEvent?: R27EventPayload;
15
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReopenDisputeResponse = void 0;
4
+ /**
5
+ * Response 200 de la reapertura de reclamación (102 -> 103):
6
+ * privada POST disputes/{folioId}/reopen (CS/OC) y pública POST disputes/reopen/{folioId} (app).
7
+ * Idempotente: si el folio ya estaba en 103 con el mismo motivo responde este mismo shape.
8
+ */
9
+ class ReopenDisputeResponse {
10
+ }
11
+ exports.ReopenDisputeResponse = ReopenDisputeResponse;
@@ -2,6 +2,7 @@
2
2
  * Request del endpoint BO-R27 (cierre de dictamen UNE) en disputes-business.
3
3
  * POST disputes/{id}/r27-status — privado (VPC/VPN, sin Cognito).
4
4
  */
5
+ import { RefundInstruction } from './RefundInstruction';
5
6
  export declare class UpdateR27StatusRequest {
6
7
  newR27Status: number;
7
8
  resolutionDate: string;
@@ -10,4 +11,6 @@ export declare class UpdateR27StatusRequest {
10
11
  signedByName: string;
11
12
  dictamenS3Key: string;
12
13
  contentHash: string;
14
+ /** Opcional (backward compat). Sólo se persiste refundTransactionId si resolutionCause ∈ 706-709. */
15
+ refundInstruction?: RefundInstruction;
13
16
  }
@@ -1,10 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UpdateR27StatusRequest = void 0;
4
- /**
5
- * Request del endpoint BO-R27 (cierre de dictamen UNE) en disputes-business.
6
- * POST disputes/{id}/r27-status — privado (VPC/VPN, sin Cognito).
7
- */
8
4
  class UpdateR27StatusRequest {
9
5
  }
10
6
  exports.UpdateR27StatusRequest = UpdateR27StatusRequest;
@@ -3,6 +3,7 @@
3
3
  * mismo valor numerico (101-104): r27Status es el nombre del contrato, mapeado
4
4
  * internamente a disputeOrFraudStatus (vocabulario que ya lee la app).
5
5
  */
6
+ import { R27EventPayload } from './R27EventPayload';
6
7
  export declare class UpdateR27StatusResponse {
7
8
  success: boolean;
8
9
  folio: string;
@@ -10,4 +11,6 @@ export declare class UpdateR27StatusResponse {
10
11
  r27Status: number;
11
12
  disputeOrFraudStatus: string;
12
13
  updatedAt: string;
14
+ lastEvent?: R27EventPayload;
15
+ refundTransactionId?: string;
13
16
  }
@@ -1,11 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UpdateR27StatusResponse = void 0;
4
- /**
5
- * Response 200 del endpoint BO-R27. `r27Status` y `disputeOrFraudStatus` son el
6
- * mismo valor numerico (101-104): r27Status es el nombre del contrato, mapeado
7
- * internamente a disputeOrFraudStatus (vocabulario que ya lee la app).
8
- */
9
4
  class UpdateR27StatusResponse {
10
5
  }
11
6
  exports.UpdateR27StatusResponse = UpdateR27StatusResponse;
@@ -0,0 +1,8 @@
1
+ /** Rol de quien ejecuta una transición R27 (`statusHistory[].actor.role`). Valores reales en DDB. */
2
+ export declare enum R27ActorRoleEnum {
3
+ CLIENT = "client",
4
+ OFICIAL_CUMPLIMIENTO = "oficial_cumplimiento",
5
+ TITULAR_UNE = "TitularUNE",
6
+ BACKOFFICE = "BACKOFFICE",
7
+ SYSTEM = "System"
8
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.R27ActorRoleEnum = void 0;
4
+ /** Rol de quien ejecuta una transición R27 (`statusHistory[].actor.role`). Valores reales en DDB. */
5
+ var R27ActorRoleEnum;
6
+ (function (R27ActorRoleEnum) {
7
+ R27ActorRoleEnum["CLIENT"] = "client";
8
+ R27ActorRoleEnum["OFICIAL_CUMPLIMIENTO"] = "oficial_cumplimiento";
9
+ R27ActorRoleEnum["TITULAR_UNE"] = "TitularUNE";
10
+ R27ActorRoleEnum["BACKOFFICE"] = "BACKOFFICE";
11
+ R27ActorRoleEnum["SYSTEM"] = "System";
12
+ })(R27ActorRoleEnum || (exports.R27ActorRoleEnum = R27ActorRoleEnum = {}));
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Estado R27 (CNBV) de una reclamación. Se persiste como string en
3
+ * `DisputeOrFraudLog.disputeOrFraudStatus` y en `statusHistory[].code`.
4
+ * 101 pendiente · 102 1er dictamen · 103 reapertura (máx 1) · 104 2° dictamen (terminal)
5
+ */
6
+ export declare enum R27StatusEnum {
7
+ PENDING = "101",
8
+ RESOLVED = "102",
9
+ REOPENED = "103",
10
+ RESOLVED_AFTER_REOPEN = "104"
11
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.R27StatusEnum = void 0;
4
+ /**
5
+ * Estado R27 (CNBV) de una reclamación. Se persiste como string en
6
+ * `DisputeOrFraudLog.disputeOrFraudStatus` y en `statusHistory[].code`.
7
+ * 101 pendiente · 102 1er dictamen · 103 reapertura (máx 1) · 104 2° dictamen (terminal)
8
+ */
9
+ var R27StatusEnum;
10
+ (function (R27StatusEnum) {
11
+ R27StatusEnum["PENDING"] = "101";
12
+ R27StatusEnum["RESOLVED"] = "102";
13
+ R27StatusEnum["REOPENED"] = "103";
14
+ R27StatusEnum["RESOLVED_AFTER_REOPEN"] = "104";
15
+ })(R27StatusEnum || (exports.R27StatusEnum = R27StatusEnum = {}));
@@ -2,6 +2,11 @@ export * from './dtos/CounterQueryResponse';
2
2
  export * from './dtos/UpdateR27StatusRequest';
3
3
  export * from './dtos/UpdateR27StatusResponse';
4
4
  export * from './dtos/ReopenDisputeRequest';
5
+ export * from './dtos/ReopenDisputeResponse';
6
+ export * from './dtos/R27EventPayload';
7
+ export * from './dtos/RefundInstruction';
8
+ export * from './dtos/DisputeRefundSummary';
9
+ export * from './dtos/DisputeGetDetailResponse';
5
10
  export * from './dtos/CreateDisputePrivateRequest';
6
11
  export * from './dtos/TransactionCreateRequest';
7
12
  export * from './dtos/TransactionCreateResponse';
@@ -36,6 +41,8 @@ export * from './enums/TransactionSourceEnum';
36
41
  export * from './enums/TransactionStatusEnum';
37
42
  export * from './enums/DisputeOrFraudEnum';
38
43
  export * from './enums/DisputeOrFraudStatusEnum';
44
+ export * from './enums/R27StatusEnum';
45
+ export * from './enums/R27ActorRoleEnum';
39
46
  export * from './enums/ActivityProblemStatusEnum';
40
47
  export * from './enums/RefundChannelEnum';
41
48
  export * from './enums/RefundPathTypeEnum';
@@ -19,6 +19,11 @@ __exportStar(require("./dtos/CounterQueryResponse"), exports);
19
19
  __exportStar(require("./dtos/UpdateR27StatusRequest"), exports);
20
20
  __exportStar(require("./dtos/UpdateR27StatusResponse"), exports);
21
21
  __exportStar(require("./dtos/ReopenDisputeRequest"), exports);
22
+ __exportStar(require("./dtos/ReopenDisputeResponse"), exports);
23
+ __exportStar(require("./dtos/R27EventPayload"), exports);
24
+ __exportStar(require("./dtos/RefundInstruction"), exports);
25
+ __exportStar(require("./dtos/DisputeRefundSummary"), exports);
26
+ __exportStar(require("./dtos/DisputeGetDetailResponse"), exports);
22
27
  __exportStar(require("./dtos/CreateDisputePrivateRequest"), exports);
23
28
  __exportStar(require("./dtos/TransactionCreateRequest"), exports);
24
29
  __exportStar(require("./dtos/TransactionCreateResponse"), exports);
@@ -54,6 +59,8 @@ __exportStar(require("./enums/TransactionSourceEnum"), exports);
54
59
  __exportStar(require("./enums/TransactionStatusEnum"), exports);
55
60
  __exportStar(require("./enums/DisputeOrFraudEnum"), exports);
56
61
  __exportStar(require("./enums/DisputeOrFraudStatusEnum"), exports);
62
+ __exportStar(require("./enums/R27StatusEnum"), exports);
63
+ __exportStar(require("./enums/R27ActorRoleEnum"), exports);
57
64
  __exportStar(require("./enums/ActivityProblemStatusEnum"), exports);
58
65
  __exportStar(require("./enums/RefundChannelEnum"), exports);
59
66
  __exportStar(require("./enums/RefundPathTypeEnum"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "3.555.0",
3
+ "version": "3.557.0",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -0,0 +1,9 @@
1
+ /**
2
+ * `destinations[].data` de los pushes DISPUTE_* (dictamen, reapertura, 2° dictamen).
3
+ * La app lo usa para saber de qué folio es el push: recargar el detalle o abrir la ficha.
4
+ */
5
+ export class DisputeNotificationData {
6
+ id: string; // templateId (DISPUTE_DICTAMEN_PROCEDENTE, DISPUTE_REOPEN_CONFIRMED, ...)
7
+ folio: string; // disputeOrFraudFolio
8
+ folioId?: string; // id del folio en DisputeOrFraudLog
9
+ }
@@ -1,5 +1,6 @@
1
1
  export * from './dtos/NotificationQueueMessageRequest';
2
2
  export * from './dtos/QueueMessageDestination';
3
+ export * from './dtos/DisputeNotificationData';
3
4
  export * from './dtos/QueueMessageVariableValues';
4
5
  export * from './dtos/NotificationTemplate';
5
6
  export * from './dtos/MomentTemplateUpsertRequest';
@@ -160,6 +160,8 @@ export interface WizardSession {
160
160
  * Crédito y derivación se rechazan con `CREDIT_IN_PROGRESS_OTHER_STORE`. Ausente = venta completa.
161
161
  */
162
162
  cashOnly?: boolean;
163
+ /** Sesión de apertura de cuenta sin venta; ausente = venta de siempre. */
164
+ accountOpening?: boolean;
163
165
  /** TTL DDB ~24h de inactividad (D14). */
164
166
  ttlEpoch: number;
165
167
  createdBy: string;
@@ -2,6 +2,12 @@ import { Expose } from 'class-transformer';
2
2
  import { IsEnum, IsIn, IsOptional, IsString, MaxLength } from 'class-validator';
3
3
  import { OccupationEnum } from '../../enums/OccupationEnum';
4
4
  import { MONTHLY_INCOME_VALUES } from '../../catalog/monthlyIncome';
5
+ import {
6
+ BENEFICIAL_OWNER_VALUES,
7
+ EXTRA_SUPPORT_VALUES,
8
+ MAXIMUM_TX_VALUES,
9
+ USAGE_MONTHLY_VALUES,
10
+ } from './ProfileQuestionsRequest';
5
11
 
6
12
  /**
7
13
  * POST /wizard/sessions/:id/occupation — registra la ocupación y el ingreso mensual del expediente
@@ -23,4 +29,29 @@ export class OccupationRequest {
23
29
  @IsString()
24
30
  @IsIn(MONTHLY_INCOME_VALUES as unknown as string[])
25
31
  monthlyIncome!: string;
32
+
33
+ /** MXN_* del perfil transaccional: opcionales aquí, la apertura de cuenta los exige en negocio. */
34
+ @Expose()
35
+ @IsOptional()
36
+ @IsString()
37
+ @IsIn(EXTRA_SUPPORT_VALUES as unknown as string[])
38
+ monthlyExtraSupport?: string;
39
+
40
+ @Expose()
41
+ @IsOptional()
42
+ @IsString()
43
+ @IsIn(USAGE_MONTHLY_VALUES as unknown as string[])
44
+ usageMonthly?: string;
45
+
46
+ @Expose()
47
+ @IsOptional()
48
+ @IsString()
49
+ @IsIn(MAXIMUM_TX_VALUES as unknown as string[])
50
+ maximumTx?: string;
51
+
52
+ @Expose()
53
+ @IsOptional()
54
+ @IsString()
55
+ @IsIn(BENEFICIAL_OWNER_VALUES as unknown as string[])
56
+ beneficialOwner?: string;
26
57
  }
@@ -1,5 +1,5 @@
1
1
  import { Expose } from 'class-transformer';
2
- import { IsOptional, IsString, Matches } from 'class-validator';
2
+ import { IsBoolean, IsOptional, IsString, Matches } from 'class-validator';
3
3
  import { regexPhoneMx } from '../../../helpers/constans/regex';
4
4
 
5
5
  /**
@@ -18,4 +18,10 @@ export class StartSessionRequest {
18
18
  @IsOptional()
19
19
  @IsString()
20
20
  prospectId?: string;
21
+
22
+ /** Marca de apertura de cuenta sin venta; ausente = venta de siempre. */
23
+ @Expose()
24
+ @IsOptional()
25
+ @IsBoolean()
26
+ accountOpening?: boolean;
21
27
  }
@@ -0,0 +1,20 @@
1
+ /** Una apertura de cuenta sin venta, cerrada en COMPLETED. */
2
+ export interface AccountOpeningRow {
3
+ sessionId: string;
4
+ retailCustomerId: string;
5
+ /** `null` si el cliente no se pudo leer. */
6
+ name: string | null;
7
+ phone: string;
8
+ storeId: string;
9
+ sellerRetailUserId: string;
10
+ openedAt: string;
11
+ }
12
+
13
+ /**
14
+ * `GET /backoffice/customers/account-openings?storeId&from&to&limit&nextToken` — sección «Cuentas abiertas
15
+ * sin compra» de Clientes VL, paginada por fecha de apertura descendente.
16
+ */
17
+ export interface BackofficeAccountOpeningsResponse {
18
+ nextToken: string | null;
19
+ items: AccountOpeningRow[];
20
+ }
@@ -2,8 +2,12 @@
2
2
  * `cancelReason` que escribe el sistema (no el vendedor).
3
3
  * SWEEP_CREDIT_DISCARDED: la saga cierra la venta cuyo crédito se descartó.
4
4
  * TAKEN_OVER_BY_OTHER_STORE: otra tienda tomó al cliente y la venta no tenía dinero en juego.
5
+ * ALREADY_HAS_ACCOUNT: la apertura de cuenta se cierra porque el cliente ya tiene cuenta PagoConFiado.
6
+ * CURP_OF_OTHER_CUSTOMER: la apertura de cuenta se cierra porque la CURP ya es de otro cliente.
5
7
  */
6
8
  export enum SystemCancelReasonEnum {
7
9
  SWEEP_CREDIT_DISCARDED = 'SWEEP_CREDIT_DISCARDED',
8
10
  TAKEN_OVER_BY_OTHER_STORE = 'TAKEN_OVER_BY_OTHER_STORE',
11
+ ALREADY_HAS_ACCOUNT = 'ALREADY_HAS_ACCOUNT',
12
+ CURP_OF_OTHER_CUSTOMER = 'CURP_OF_OTHER_CUSTOMER',
9
13
  }
@@ -185,6 +185,7 @@ export * from './dtos/responses/BackofficeSellerKpisResponse';
185
185
  export * from './enums/SellerTableSourceStatusEnum';
186
186
  export * from './dtos/responses/BackofficeSellerTableResponse';
187
187
  export * from './dtos/responses/BackofficeCustomerTableResponse';
188
+ export * from './dtos/responses/BackofficeAccountOpeningsResponse';
188
189
  export * from './enums/StoreKindEnum';
189
190
  export * from './dtos/responses/BackofficeStoreTableResponse';
190
191
  export * from './enums/StoreMixCategoryEnum';
@@ -0,0 +1,33 @@
1
+ import { DisputeRefundSummary } from './DisputeRefundSummary';
2
+ import { R27StatusEnum } from '../enums/R27StatusEnum';
3
+
4
+ /**
5
+ * `data` de GET disputes/transaction/{code}/{transactionNumber} (pública, app).
6
+ * Devuelve el folio completo (todos los atributos de DisputeOrFraudLog) más los campos
7
+ * normalizados/enriquecidos que la app necesita para el detalle del movimiento.
8
+ * Vale desde cualquier movimiento ligado al folio (tx reclamada, abono o reversa).
9
+ */
10
+ export class DisputeGetDetailResponse {
11
+ id: string;
12
+ disputeOrFraudFolio: string;
13
+ directoryId: string;
14
+ disputeOrFraudStatus: R27StatusEnum;
15
+ disputeOrFraudStatusUpdate: string;
16
+ dateOfDisputedTx: string;
17
+ disputedTxNumber: string;
18
+ amountOfDisputedTx: number;
19
+ /** Sentido del dictamen (701-705 improcedente, 706-709 procedente). '' hasta el dictamen. */
20
+ disputeResolutionCause: string;
21
+ disputeResolutionDate: string;
22
+ /** Siempre presente (0 si nunca se reabrió). Botón "segunda revisión": status 102 + causa 701-705 + reopenCount 0. */
23
+ reopenCount: number;
24
+ reopenedAt?: string;
25
+ reopenedReason?: string;
26
+ refundTransactionId?: string;
27
+ /** Abono (provisional o por dictamen). */
28
+ refund?: DisputeRefundSummary;
29
+ /** Reversa del abono; la fecha del abono original está en `refund.executedAt`. */
30
+ reversal?: DisputeRefundSummary;
31
+ /** Resto de atributos del folio (merchant, statusHistory, etc.). */
32
+ [attribute: string]: unknown;
33
+ }
@@ -0,0 +1,15 @@
1
+ import { DisputeRefundStatus } from '../enums/DisputeRefundStatus';
2
+ import { RefundChannelEnum } from '../enums/RefundChannelEnum';
3
+
4
+ /**
5
+ * Reintegro (abono o reversa) ligado a una reclamación, tal como lo consume la app
6
+ * en el detalle del movimiento. Resumen de una fila de DisputeRefund_GT.
7
+ */
8
+ export class DisputeRefundSummary {
9
+ id: string;
10
+ transactionId?: string; // id de la tx en PagoConfiadoTx_GT
11
+ status: DisputeRefundStatus;
12
+ amount: number;
13
+ channel?: RefundChannelEnum;
14
+ executedAt?: string; // ISO — fecha del abono / de la reversa
15
+ }
@@ -0,0 +1,12 @@
1
+ import { R27StatusEnum } from '../enums/R27StatusEnum';
2
+
3
+ /**
4
+ * Evento R27 compacto incluido en las respuestas de disputes-business
5
+ * (reapertura y firma de dictamen). El Dashboard usa `eventId` como
6
+ * `folioEventId` al autorizar el reintegro.
7
+ */
8
+ export class R27EventPayload {
9
+ eventId: string;
10
+ code: R27StatusEnum;
11
+ occurredAt: string;
12
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Instrucción de reintegro adjunta a la firma del dictamen (UpdateR27StatusRequest.refundInstruction).
3
+ * Política SP1:
4
+ * 1 = post-dictamen 2FA (el Dashboard genera la tx antes de cerrar el folio)
5
+ * 2 = T+2 provisional (ya abonado — se confirma el id existente)
6
+ * 3 = error operativo (reintegro manual)
7
+ */
8
+ export class RefundInstruction {
9
+ camino: 1 | 2 | 3;
10
+ /** Id de la tx de refund en el ledger. Presente cuando el refund ya ocurrió. */
11
+ refundTransactionId?: string;
12
+ }
@@ -0,0 +1,16 @@
1
+ import { R27EventPayload } from './R27EventPayload';
2
+
3
+ /**
4
+ * Response 200 de la reapertura de reclamación (102 -> 103):
5
+ * privada POST disputes/{folioId}/reopen (CS/OC) y pública POST disputes/reopen/{folioId} (app).
6
+ * Idempotente: si el folio ya estaba en 103 con el mismo motivo responde este mismo shape.
7
+ */
8
+ export class ReopenDisputeResponse {
9
+ success: boolean;
10
+ folio: string;
11
+ id: string;
12
+ currentStatus: number; // 103
13
+ reopenCount: number; // 1
14
+ updatedAt: string; // ISO
15
+ lastEvent?: R27EventPayload; // ausente en folios legacy sin statusHistory
16
+ }
@@ -2,6 +2,8 @@
2
2
  * Request del endpoint BO-R27 (cierre de dictamen UNE) en disputes-business.
3
3
  * POST disputes/{id}/r27-status — privado (VPC/VPN, sin Cognito).
4
4
  */
5
+ import { RefundInstruction } from './RefundInstruction';
6
+
5
7
  export class UpdateR27StatusRequest {
6
8
  newR27Status: number; // 102 | 104
7
9
  resolutionDate: string; // ISO datetime, <= ahora
@@ -10,4 +12,6 @@ export class UpdateR27StatusRequest {
10
12
  signedByName: string;
11
13
  dictamenS3Key: string; // path en fiado-prod-data-lake
12
14
  contentHash: string; // sha256:...
15
+ /** Opcional (backward compat). Sólo se persiste refundTransactionId si resolutionCause ∈ 706-709. */
16
+ refundInstruction?: RefundInstruction;
13
17
  }
@@ -3,6 +3,8 @@
3
3
  * mismo valor numerico (101-104): r27Status es el nombre del contrato, mapeado
4
4
  * internamente a disputeOrFraudStatus (vocabulario que ya lee la app).
5
5
  */
6
+ import { R27EventPayload } from './R27EventPayload';
7
+
6
8
  export class UpdateR27StatusResponse {
7
9
  success: boolean;
8
10
  folio: string;
@@ -10,4 +12,6 @@ export class UpdateR27StatusResponse {
10
12
  r27Status: number;
11
13
  disputeOrFraudStatus: string;
12
14
  updatedAt: string;
15
+ lastEvent?: R27EventPayload; // evento 102/104 recién agregado a statusHistory
16
+ refundTransactionId?: string; // sólo cierres procedentes con refund ligado
13
17
  }
@@ -0,0 +1,8 @@
1
+ /** Rol de quien ejecuta una transición R27 (`statusHistory[].actor.role`). Valores reales en DDB. */
2
+ export enum R27ActorRoleEnum {
3
+ CLIENT = "client",
4
+ OFICIAL_CUMPLIMIENTO = "oficial_cumplimiento",
5
+ TITULAR_UNE = "TitularUNE",
6
+ BACKOFFICE = "BACKOFFICE",
7
+ SYSTEM = "System",
8
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Estado R27 (CNBV) de una reclamación. Se persiste como string en
3
+ * `DisputeOrFraudLog.disputeOrFraudStatus` y en `statusHistory[].code`.
4
+ * 101 pendiente · 102 1er dictamen · 103 reapertura (máx 1) · 104 2° dictamen (terminal)
5
+ */
6
+ export enum R27StatusEnum {
7
+ PENDING = "101",
8
+ RESOLVED = "102",
9
+ REOPENED = "103",
10
+ RESOLVED_AFTER_REOPEN = "104",
11
+ }
@@ -3,6 +3,11 @@ export * from './dtos/CounterQueryResponse';
3
3
  export * from './dtos/UpdateR27StatusRequest';
4
4
  export * from './dtos/UpdateR27StatusResponse';
5
5
  export * from './dtos/ReopenDisputeRequest';
6
+ export * from './dtos/ReopenDisputeResponse';
7
+ export * from './dtos/R27EventPayload';
8
+ export * from './dtos/RefundInstruction';
9
+ export * from './dtos/DisputeRefundSummary';
10
+ export * from './dtos/DisputeGetDetailResponse';
6
11
  export * from './dtos/CreateDisputePrivateRequest';
7
12
  export * from './dtos/TransactionCreateRequest';
8
13
  export * from './dtos/TransactionCreateResponse';
@@ -41,6 +46,8 @@ export * from './enums/TransactionSourceEnum';
41
46
  export * from './enums/TransactionStatusEnum';
42
47
  export * from './enums/DisputeOrFraudEnum';
43
48
  export * from './enums/DisputeOrFraudStatusEnum';
49
+ export * from './enums/R27StatusEnum';
50
+ export * from './enums/R27ActorRoleEnum';
44
51
  export * from './enums/ActivityProblemStatusEnum';
45
52
  export * from './enums/RefundChannelEnum';
46
53
  export * from './enums/RefundPathTypeEnum';