@fiado/type-kit 3.452.0 → 3.454.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.
@@ -21,6 +21,8 @@ describe('Refund DTOs', () => {
21
21
  refundCase: {
22
22
  pathType: RefundPathTypeEnum.DICTAMEN_PROCEDE,
23
23
  caseFolio: 'FOLIO-001',
24
+ folioId: 'e8b34db9-11cc-4d7a-b6c9-7f2a91b8c001',
25
+ folioEventId: '9a41c3d0-f78b-4d54-9c62-1e8d5f2b7003',
24
26
  originalTransactionId: 'TX-123',
25
27
  originalAmount: 1000,
26
28
  originalChannel: 'SPEI_IN',
@@ -75,4 +77,31 @@ describe('Refund DTOs', () => {
75
77
  expect(confirmRequest.speiTrackingKey).toBe('SPE-TRACK-001');
76
78
  expect(confirmRequest.executedAt).toBe('2026-09-17T22:00:00Z');
77
79
  });
80
+
81
+ it('AuthorizeRefundRequest expone folioId y folioEventId como campos requeridos de refundCase', () => {
82
+ const req: AuthorizeRefundRequest = {
83
+ idempotencyKey: 'k',
84
+ directoryId: 'd',
85
+ peopleId: 'p',
86
+ productCatalogId: 'MEX_REFUND_PCF',
87
+ operation: 'ADD',
88
+ amount: { total: 100, currencyId: 'MXN' },
89
+ refundChannel: RefundChannelEnum.INTERNAL_PCF,
90
+ refundCase: {
91
+ pathType: RefundPathTypeEnum.DICTAMEN_PROCEDE,
92
+ caseFolio: 'F',
93
+ folioId: 'uuid-folio',
94
+ folioEventId: 'uuid-event',
95
+ originalTransactionId: null,
96
+ originalAmount: 100,
97
+ originalChannel: 'PCF_P2P',
98
+ },
99
+ approval: { makerUserId: 'm', checkerUserId: null, minuteS3Key: null },
100
+ reason: 'r',
101
+ evidence: { dictamenS3Key: null, incidentReportS3Key: null, objectionFormS3Key: null },
102
+ pldOverrideMinuteS3Key: null,
103
+ };
104
+ expect(req.refundCase.folioId).toBe('uuid-folio');
105
+ expect(req.refundCase.folioEventId).toBe('uuid-event');
106
+ });
78
107
  });
@@ -19,6 +19,25 @@ export interface AuthorizeRefundRequest {
19
19
  refundCase: {
20
20
  pathType: RefundPathTypeEnum;
21
21
  caseFolio: string;
22
+ /**
23
+ * UUID del registro `DisputeOrFraudLog` que originó el reintegro (fuente
24
+ * autoritativa del folio). El BO lo persiste en el ledger como
25
+ * `PagoConfiadoTx_GT.disputeOrFraudLogId` para cerrar el vínculo con la
26
+ * reclamación (antes del rediseño quedaba en "ND").
27
+ */
28
+ folioId: string;
29
+ /**
30
+ * UUID del evento R27 específico dentro de `DisputeOrFraudLog.statusHistory[]`
31
+ * que autoriza este reintegro. Preserva el ligado inmutable evento↔movimiento
32
+ * en `DisputeRefund_GT.folioEventId`: un folio que reingresa (103) tras un
33
+ * dictamen no procedente y genera un segundo refund puede tener 2 entradas
34
+ * en `DisputeRefund_GT`, cada una apuntando a su evento R27 propio.
35
+ *
36
+ * Lo obtiene el Dashboard del response de `disputes-business` al firmar el
37
+ * dictamen (`lastEvent.eventId`). Es inmutable — no se recalcula ni se
38
+ * reasigna una vez enviado.
39
+ */
40
+ folioEventId: string;
22
41
  originalTransactionId: string | null;
23
42
  originalAmount: number;
24
43
  /**
@@ -27,6 +27,18 @@ export declare class TransactionCreateRequest {
27
27
  sessionId: string;
28
28
  disputeOrFraudFolio?: string;
29
29
  disputeOrFraudId?: string;
30
+ /**
31
+ * UUID del `DisputeOrFraudLog` que originó esta transacción (típicamente un
32
+ * reintegro PCF). Se persiste en `PagoConfiadoTx_GT.disputeOrFraudLogId`, que
33
+ * indexa el GSI `disputeOrFraudLogId-createdAt-index` usado por el Dashboard
34
+ * y por el reporte R27 CNBV para conectar el ledger con el folio.
35
+ *
36
+ * Antes del rediseño refund/eventos R27 este campo no viajaba en el
37
+ * `TransactionCreateRequest` y quedaba en "ND" en el ledger — el join
38
+ * folio↔tx sólo era posible por `disputeOrFraudFolio` (el folio humano), que
39
+ * no basta cuando un mismo folio genera dos movimientos (REFUND + REVERSAL).
40
+ */
41
+ disputeOrFraudLogId?: string;
30
42
  currencyId: CountryId;
31
43
  operation: OperationEnum;
32
44
  notional: Notional;
@@ -121,6 +121,11 @@ __decorate([
121
121
  (0, class_validator_1.IsOptional)(),
122
122
  __metadata("design:type", String)
123
123
  ], TransactionCreateRequest.prototype, "disputeOrFraudId", void 0);
124
+ __decorate([
125
+ (0, class_validator_1.IsString)(),
126
+ (0, class_validator_1.IsOptional)(),
127
+ __metadata("design:type", String)
128
+ ], TransactionCreateRequest.prototype, "disputeOrFraudLogId", void 0);
124
129
  __decorate([
125
130
  (0, class_validator_1.IsNotEmpty)(),
126
131
  (0, class_validator_1.IsEnum)(country_1.CountryId),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "3.452.0",
3
+ "version": "3.454.0",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -17,6 +17,25 @@ export interface AuthorizeRefundRequest {
17
17
  refundCase: {
18
18
  pathType: RefundPathTypeEnum;
19
19
  caseFolio: string;
20
+ /**
21
+ * UUID del registro `DisputeOrFraudLog` que originó el reintegro (fuente
22
+ * autoritativa del folio). El BO lo persiste en el ledger como
23
+ * `PagoConfiadoTx_GT.disputeOrFraudLogId` para cerrar el vínculo con la
24
+ * reclamación (antes del rediseño quedaba en "ND").
25
+ */
26
+ folioId: string;
27
+ /**
28
+ * UUID del evento R27 específico dentro de `DisputeOrFraudLog.statusHistory[]`
29
+ * que autoriza este reintegro. Preserva el ligado inmutable evento↔movimiento
30
+ * en `DisputeRefund_GT.folioEventId`: un folio que reingresa (103) tras un
31
+ * dictamen no procedente y genera un segundo refund puede tener 2 entradas
32
+ * en `DisputeRefund_GT`, cada una apuntando a su evento R27 propio.
33
+ *
34
+ * Lo obtiene el Dashboard del response de `disputes-business` al firmar el
35
+ * dictamen (`lastEvent.eventId`). Es inmutable — no se recalcula ni se
36
+ * reasigna una vez enviado.
37
+ */
38
+ folioEventId: string;
20
39
  originalTransactionId: string | null;
21
40
  originalAmount: number;
22
41
  /**
@@ -93,6 +93,21 @@ export class TransactionCreateRequest {
93
93
  @IsOptional()
94
94
  disputeOrFraudId?: string;
95
95
 
96
+ /**
97
+ * UUID del `DisputeOrFraudLog` que originó esta transacción (típicamente un
98
+ * reintegro PCF). Se persiste en `PagoConfiadoTx_GT.disputeOrFraudLogId`, que
99
+ * indexa el GSI `disputeOrFraudLogId-createdAt-index` usado por el Dashboard
100
+ * y por el reporte R27 CNBV para conectar el ledger con el folio.
101
+ *
102
+ * Antes del rediseño refund/eventos R27 este campo no viajaba en el
103
+ * `TransactionCreateRequest` y quedaba en "ND" en el ledger — el join
104
+ * folio↔tx sólo era posible por `disputeOrFraudFolio` (el folio humano), que
105
+ * no basta cuando un mismo folio genera dos movimientos (REFUND + REVERSAL).
106
+ */
107
+ @IsString()
108
+ @IsOptional()
109
+ disputeOrFraudLogId?: string;
110
+
96
111
  @IsNotEmpty()
97
112
  @IsEnum(CountryId)
98
113
  currencyId: CountryId;