@fiado/type-kit 3.451.0 → 3.452.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/transaction/DisputeRefundEnums.test.ts +35 -0
- package/bin/transaction/dtos/DisputeRefundRecord.d.ts +68 -0
- package/bin/transaction/dtos/DisputeRefundRecord.js +2 -0
- package/bin/transaction/enums/DisputeRefundStatus.d.ts +7 -0
- package/bin/transaction/enums/DisputeRefundStatus.js +11 -0
- package/bin/transaction/enums/DisputeRefundType.d.ts +4 -0
- package/bin/transaction/enums/DisputeRefundType.js +8 -0
- package/bin/transaction/enums/RefundManualExecutionStatus.d.ts +6 -0
- package/bin/transaction/enums/RefundManualExecutionStatus.js +6 -0
- package/bin/transaction/index.d.ts +3 -0
- package/bin/transaction/index.js +3 -0
- package/package.json +1 -1
- package/src/transaction/dtos/DisputeRefundRecord.ts +71 -0
- package/src/transaction/enums/DisputeRefundStatus.ts +7 -0
- package/src/transaction/enums/DisputeRefundType.ts +4 -0
- package/src/transaction/enums/RefundManualExecutionStatus.ts +6 -0
- package/src/transaction/index.ts +3 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { DisputeRefundType, DisputeRefundStatus } from '../../../src/transaction';
|
|
3
|
+
|
|
4
|
+
describe('DisputeRefundType', () => {
|
|
5
|
+
it('expone REFUND, REVERSAL', () => {
|
|
6
|
+
expect(DisputeRefundType.REFUND).toBe('REFUND');
|
|
7
|
+
expect(DisputeRefundType.REVERSAL).toBe('REVERSAL');
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('no tiene valores de más', () => {
|
|
11
|
+
expect(Object.values(DisputeRefundType).sort()).toEqual(['REFUND', 'REVERSAL'].sort());
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
describe('DisputeRefundStatus', () => {
|
|
16
|
+
const expected = [
|
|
17
|
+
'PENDING_AUTHORIZATION',
|
|
18
|
+
'PENDING_MANUAL_EXECUTION',
|
|
19
|
+
'EXECUTED',
|
|
20
|
+
'FAILED',
|
|
21
|
+
'CANCELLED',
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
it('expone los 5 estados del ciclo de vida', () => {
|
|
25
|
+
expect(DisputeRefundStatus.PENDING_AUTHORIZATION).toBe('PENDING_AUTHORIZATION');
|
|
26
|
+
expect(DisputeRefundStatus.PENDING_MANUAL_EXECUTION).toBe('PENDING_MANUAL_EXECUTION');
|
|
27
|
+
expect(DisputeRefundStatus.EXECUTED).toBe('EXECUTED');
|
|
28
|
+
expect(DisputeRefundStatus.FAILED).toBe('FAILED');
|
|
29
|
+
expect(DisputeRefundStatus.CANCELLED).toBe('CANCELLED');
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it('no tiene valores de más', () => {
|
|
33
|
+
expect(Object.values(DisputeRefundStatus).sort()).toEqual(expected.sort());
|
|
34
|
+
});
|
|
35
|
+
});
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { RefundChannelEnum } from '../enums/RefundChannelEnum';
|
|
2
|
+
import { DisputeRefundType } from '../enums/DisputeRefundType';
|
|
3
|
+
import { DisputeRefundStatus } from '../enums/DisputeRefundStatus';
|
|
4
|
+
/**
|
|
5
|
+
* Registro canónico de un movimiento de dinero (REFUND o REVERSAL) ligado a
|
|
6
|
+
* un folio R27 de reclamación. Es el shape 1:1 de una fila de la tabla DDB
|
|
7
|
+
* `DisputeRefund_GT`.
|
|
8
|
+
*
|
|
9
|
+
* Modelo:
|
|
10
|
+
* - Un folio R27 puede tener 0, 1 o 2 filas en DisputeRefund_GT.
|
|
11
|
+
* - 1 fila `type=REFUND` cuando el reintegro se ejecutó.
|
|
12
|
+
* - 2 filas (REFUND + REVERSAL) cuando el reintegro fue revertido por
|
|
13
|
+
* dictamen tardío que confirmó 2FA original (Circular 12/2018
|
|
14
|
+
* Disposición 35.a Banxico).
|
|
15
|
+
* - `folioEventId` apunta al evento R27 específico (no solo al folio)
|
|
16
|
+
* para preservar el ligado inmutable cuando un folio reingresa (103)
|
|
17
|
+
* tras un dictamen no procedente.
|
|
18
|
+
* - `relatedRefundId` solo aplica cuando `type=REVERSAL` — apunta al `id`
|
|
19
|
+
* del REFUND que se está revirtiendo.
|
|
20
|
+
* - `txId` es `null` durante `PENDING_AUTHORIZATION`; se popula al crear
|
|
21
|
+
* la tx en el ledger (`PagoConfiadoTx_GT`).
|
|
22
|
+
*/
|
|
23
|
+
export interface DisputeRefundRecord {
|
|
24
|
+
id: string;
|
|
25
|
+
folioId: string;
|
|
26
|
+
folioEventId: string;
|
|
27
|
+
type: DisputeRefundType;
|
|
28
|
+
channel: RefundChannelEnum;
|
|
29
|
+
status: DisputeRefundStatus;
|
|
30
|
+
relatedRefundId: string | null;
|
|
31
|
+
txId: string | null;
|
|
32
|
+
amount: number;
|
|
33
|
+
currencyId: 'MXN';
|
|
34
|
+
caseFolio: string;
|
|
35
|
+
targetDirectoryId: string;
|
|
36
|
+
manualExecution: DisputeRefundManualExecution | null;
|
|
37
|
+
approval: DisputeRefundApproval;
|
|
38
|
+
reason: string | null;
|
|
39
|
+
createdAt: number;
|
|
40
|
+
updatedAt: number;
|
|
41
|
+
failureReason: string | null;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Metadatos específicos del canal SPEI_OUT_MANUAL. `null` cuando el canal es
|
|
45
|
+
* INTERNAL_PCF (transferencia intra-wallet sin salida SPEI).
|
|
46
|
+
*/
|
|
47
|
+
export interface DisputeRefundManualExecution {
|
|
48
|
+
targetClabe: string | null;
|
|
49
|
+
targetBankId: string | null;
|
|
50
|
+
targetName: string | null;
|
|
51
|
+
instructionS3Key: string | null;
|
|
52
|
+
confirmedTrackingKey: string | null;
|
|
53
|
+
confirmedAt: number | null;
|
|
54
|
+
confirmedByUserId: string | null;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Cadena de aprobación heredada de Política SP1 §10:
|
|
58
|
+
* L1 ($5,000 MXN) → requiere checker.
|
|
59
|
+
* L2 ($50,000 MXN) → requiere checker + minuta firmada.
|
|
60
|
+
* `pldOverrideMinuteS3Key` cubre el caso en que el titular está en lista
|
|
61
|
+
* negra PLD y el reintegro procede solo con acta de comité.
|
|
62
|
+
*/
|
|
63
|
+
export interface DisputeRefundApproval {
|
|
64
|
+
makerUserId: string;
|
|
65
|
+
checkerUserId: string | null;
|
|
66
|
+
minuteS3Key: string | null;
|
|
67
|
+
pldOverrideMinuteS3Key: string | null;
|
|
68
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DisputeRefundStatus = void 0;
|
|
4
|
+
var DisputeRefundStatus;
|
|
5
|
+
(function (DisputeRefundStatus) {
|
|
6
|
+
DisputeRefundStatus["PENDING_AUTHORIZATION"] = "PENDING_AUTHORIZATION";
|
|
7
|
+
DisputeRefundStatus["PENDING_MANUAL_EXECUTION"] = "PENDING_MANUAL_EXECUTION";
|
|
8
|
+
DisputeRefundStatus["EXECUTED"] = "EXECUTED";
|
|
9
|
+
DisputeRefundStatus["FAILED"] = "FAILED";
|
|
10
|
+
DisputeRefundStatus["CANCELLED"] = "CANCELLED";
|
|
11
|
+
})(DisputeRefundStatus || (exports.DisputeRefundStatus = DisputeRefundStatus = {}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DisputeRefundType = void 0;
|
|
4
|
+
var DisputeRefundType;
|
|
5
|
+
(function (DisputeRefundType) {
|
|
6
|
+
DisputeRefundType["REFUND"] = "REFUND";
|
|
7
|
+
DisputeRefundType["REVERSAL"] = "REVERSAL";
|
|
8
|
+
})(DisputeRefundType || (exports.DisputeRefundType = DisputeRefundType = {}));
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Use `DisputeRefundStatus` en su lugar. Este enum tiene scope
|
|
3
|
+
* estrecho (solo canal SPEI_OUT_MANUAL, sin estados de autorización previa,
|
|
4
|
+
* sin failure state) y se retira junto con la tabla `RefundManualExecution_GT`
|
|
5
|
+
* en el cleanup que sigue a la migración de código a `DisputeRefund_GT`.
|
|
6
|
+
*/
|
|
1
7
|
export declare enum RefundManualExecutionStatus {
|
|
2
8
|
PENDING_MANUAL_EXECUTION = "PENDING_MANUAL_EXECUTION",
|
|
3
9
|
EXECUTED = "EXECUTED",
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RefundManualExecutionStatus = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Use `DisputeRefundStatus` en su lugar. Este enum tiene scope
|
|
6
|
+
* estrecho (solo canal SPEI_OUT_MANUAL, sin estados de autorización previa,
|
|
7
|
+
* sin failure state) y se retira junto con la tabla `RefundManualExecution_GT`
|
|
8
|
+
* en el cleanup que sigue a la migración de código a `DisputeRefund_GT`.
|
|
9
|
+
*/
|
|
4
10
|
var RefundManualExecutionStatus;
|
|
5
11
|
(function (RefundManualExecutionStatus) {
|
|
6
12
|
RefundManualExecutionStatus["PENDING_MANUAL_EXECUTION"] = "PENDING_MANUAL_EXECUTION";
|
|
@@ -17,6 +17,7 @@ export * from './dtos/ActivityProblemGetResponse';
|
|
|
17
17
|
export * from './dtos/AuthorizeRefundRequest';
|
|
18
18
|
export * from './dtos/ReverseRefundRequest';
|
|
19
19
|
export * from './dtos/ConfirmManualExecutionRequest';
|
|
20
|
+
export * from './dtos/DisputeRefundRecord';
|
|
20
21
|
export * from './dtos/internal/BaseProviderTransaction';
|
|
21
22
|
export * from './dtos/internal/BaseProviderTransactionQueryParams';
|
|
22
23
|
export * from './dtos/internal/CentralPaymentsQueryParams';
|
|
@@ -39,3 +40,5 @@ export * from './enums/ActivityProblemStatusEnum';
|
|
|
39
40
|
export * from './enums/RefundChannelEnum';
|
|
40
41
|
export * from './enums/RefundPathTypeEnum';
|
|
41
42
|
export * from './enums/RefundManualExecutionStatus';
|
|
43
|
+
export * from './enums/DisputeRefundType';
|
|
44
|
+
export * from './enums/DisputeRefundStatus';
|
package/bin/transaction/index.js
CHANGED
|
@@ -34,6 +34,7 @@ __exportStar(require("./dtos/ActivityProblemGetResponse"), exports);
|
|
|
34
34
|
__exportStar(require("./dtos/AuthorizeRefundRequest"), exports);
|
|
35
35
|
__exportStar(require("./dtos/ReverseRefundRequest"), exports);
|
|
36
36
|
__exportStar(require("./dtos/ConfirmManualExecutionRequest"), exports);
|
|
37
|
+
__exportStar(require("./dtos/DisputeRefundRecord"), exports);
|
|
37
38
|
__exportStar(require("./dtos/internal/BaseProviderTransaction"), exports);
|
|
38
39
|
__exportStar(require("./dtos/internal/BaseProviderTransactionQueryParams"), exports);
|
|
39
40
|
__exportStar(require("./dtos/internal/CentralPaymentsQueryParams"), exports);
|
|
@@ -57,3 +58,5 @@ __exportStar(require("./enums/ActivityProblemStatusEnum"), exports);
|
|
|
57
58
|
__exportStar(require("./enums/RefundChannelEnum"), exports);
|
|
58
59
|
__exportStar(require("./enums/RefundPathTypeEnum"), exports);
|
|
59
60
|
__exportStar(require("./enums/RefundManualExecutionStatus"), exports);
|
|
61
|
+
__exportStar(require("./enums/DisputeRefundType"), exports);
|
|
62
|
+
__exportStar(require("./enums/DisputeRefundStatus"), exports);
|
package/package.json
CHANGED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { RefundChannelEnum } from '../enums/RefundChannelEnum';
|
|
2
|
+
import { DisputeRefundType } from '../enums/DisputeRefundType';
|
|
3
|
+
import { DisputeRefundStatus } from '../enums/DisputeRefundStatus';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Registro canónico de un movimiento de dinero (REFUND o REVERSAL) ligado a
|
|
7
|
+
* un folio R27 de reclamación. Es el shape 1:1 de una fila de la tabla DDB
|
|
8
|
+
* `DisputeRefund_GT`.
|
|
9
|
+
*
|
|
10
|
+
* Modelo:
|
|
11
|
+
* - Un folio R27 puede tener 0, 1 o 2 filas en DisputeRefund_GT.
|
|
12
|
+
* - 1 fila `type=REFUND` cuando el reintegro se ejecutó.
|
|
13
|
+
* - 2 filas (REFUND + REVERSAL) cuando el reintegro fue revertido por
|
|
14
|
+
* dictamen tardío que confirmó 2FA original (Circular 12/2018
|
|
15
|
+
* Disposición 35.a Banxico).
|
|
16
|
+
* - `folioEventId` apunta al evento R27 específico (no solo al folio)
|
|
17
|
+
* para preservar el ligado inmutable cuando un folio reingresa (103)
|
|
18
|
+
* tras un dictamen no procedente.
|
|
19
|
+
* - `relatedRefundId` solo aplica cuando `type=REVERSAL` — apunta al `id`
|
|
20
|
+
* del REFUND que se está revirtiendo.
|
|
21
|
+
* - `txId` es `null` durante `PENDING_AUTHORIZATION`; se popula al crear
|
|
22
|
+
* la tx en el ledger (`PagoConfiadoTx_GT`).
|
|
23
|
+
*/
|
|
24
|
+
export interface DisputeRefundRecord {
|
|
25
|
+
id: string;
|
|
26
|
+
folioId: string;
|
|
27
|
+
folioEventId: string;
|
|
28
|
+
type: DisputeRefundType;
|
|
29
|
+
channel: RefundChannelEnum;
|
|
30
|
+
status: DisputeRefundStatus;
|
|
31
|
+
relatedRefundId: string | null;
|
|
32
|
+
txId: string | null;
|
|
33
|
+
amount: number;
|
|
34
|
+
currencyId: 'MXN';
|
|
35
|
+
caseFolio: string;
|
|
36
|
+
targetDirectoryId: string;
|
|
37
|
+
manualExecution: DisputeRefundManualExecution | null;
|
|
38
|
+
approval: DisputeRefundApproval;
|
|
39
|
+
reason: string | null;
|
|
40
|
+
createdAt: number;
|
|
41
|
+
updatedAt: number;
|
|
42
|
+
failureReason: string | null;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Metadatos específicos del canal SPEI_OUT_MANUAL. `null` cuando el canal es
|
|
47
|
+
* INTERNAL_PCF (transferencia intra-wallet sin salida SPEI).
|
|
48
|
+
*/
|
|
49
|
+
export interface DisputeRefundManualExecution {
|
|
50
|
+
targetClabe: string | null;
|
|
51
|
+
targetBankId: string | null;
|
|
52
|
+
targetName: string | null;
|
|
53
|
+
instructionS3Key: string | null;
|
|
54
|
+
confirmedTrackingKey: string | null;
|
|
55
|
+
confirmedAt: number | null;
|
|
56
|
+
confirmedByUserId: string | null;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Cadena de aprobación heredada de Política SP1 §10:
|
|
61
|
+
* L1 ($5,000 MXN) → requiere checker.
|
|
62
|
+
* L2 ($50,000 MXN) → requiere checker + minuta firmada.
|
|
63
|
+
* `pldOverrideMinuteS3Key` cubre el caso en que el titular está en lista
|
|
64
|
+
* negra PLD y el reintegro procede solo con acta de comité.
|
|
65
|
+
*/
|
|
66
|
+
export interface DisputeRefundApproval {
|
|
67
|
+
makerUserId: string;
|
|
68
|
+
checkerUserId: string | null;
|
|
69
|
+
minuteS3Key: string | null;
|
|
70
|
+
pldOverrideMinuteS3Key: string | null;
|
|
71
|
+
}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Use `DisputeRefundStatus` en su lugar. Este enum tiene scope
|
|
3
|
+
* estrecho (solo canal SPEI_OUT_MANUAL, sin estados de autorización previa,
|
|
4
|
+
* sin failure state) y se retira junto con la tabla `RefundManualExecution_GT`
|
|
5
|
+
* en el cleanup que sigue a la migración de código a `DisputeRefund_GT`.
|
|
6
|
+
*/
|
|
1
7
|
export enum RefundManualExecutionStatus {
|
|
2
8
|
PENDING_MANUAL_EXECUTION = "PENDING_MANUAL_EXECUTION",
|
|
3
9
|
EXECUTED = "EXECUTED",
|
package/src/transaction/index.ts
CHANGED
|
@@ -18,6 +18,7 @@ export * from './dtos/ActivityProblemGetResponse';
|
|
|
18
18
|
export * from './dtos/AuthorizeRefundRequest';
|
|
19
19
|
export * from './dtos/ReverseRefundRequest';
|
|
20
20
|
export * from './dtos/ConfirmManualExecutionRequest';
|
|
21
|
+
export * from './dtos/DisputeRefundRecord';
|
|
21
22
|
|
|
22
23
|
export * from './dtos/internal/BaseProviderTransaction';
|
|
23
24
|
export * from './dtos/internal/BaseProviderTransactionQueryParams';
|
|
@@ -44,3 +45,5 @@ export * from './enums/ActivityProblemStatusEnum';
|
|
|
44
45
|
export * from './enums/RefundChannelEnum';
|
|
45
46
|
export * from './enums/RefundPathTypeEnum';
|
|
46
47
|
export * from './enums/RefundManualExecutionStatus';
|
|
48
|
+
export * from './enums/DisputeRefundType';
|
|
49
|
+
export * from './enums/DisputeRefundStatus';
|