@fiado/type-kit 3.443.0 → 3.445.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/productCatalog/enums/refund-product-enums.test.ts +18 -0
- package/_test_/unit/transaction/RefundChannelEnum.test.ts +15 -0
- package/_test_/unit/transaction/RefundManualExecutionStatus.test.ts +16 -0
- package/_test_/unit/transaction/RefundPathTypeEnum.test.ts +18 -0
- package/_test_/unit/transaction/refund-dtos.test.ts +78 -0
- package/bin/phoneSales/SaleDeliveryData.d.ts +24 -0
- package/bin/phoneSales/SaleDeliveryData.js +2 -0
- package/bin/phoneSales/SaleResponseDto.d.ts +33 -0
- package/bin/phoneSales/index.d.ts +1 -0
- package/bin/phoneSales/index.js +1 -0
- package/bin/productCatalog/enums/ProductSubtypeEnum.d.ts +7 -1
- package/bin/productCatalog/enums/ProductSubtypeEnum.js +8 -0
- package/bin/productCatalog/enums/ProductTypeEnum.d.ts +11 -1
- package/bin/productCatalog/enums/ProductTypeEnum.js +10 -0
- package/bin/transaction/dtos/AuthorizeRefundRequest.d.ts +38 -0
- package/bin/transaction/dtos/AuthorizeRefundRequest.js +2 -0
- package/bin/transaction/dtos/ConfirmManualExecutionRequest.d.ts +7 -0
- package/bin/transaction/dtos/ConfirmManualExecutionRequest.js +2 -0
- package/bin/transaction/dtos/ReverseRefundRequest.d.ts +22 -0
- package/bin/transaction/dtos/ReverseRefundRequest.js +2 -0
- package/bin/transaction/enums/RefundChannelEnum.d.ts +4 -0
- package/bin/transaction/enums/RefundChannelEnum.js +8 -0
- package/bin/transaction/enums/RefundManualExecutionStatus.d.ts +5 -0
- package/bin/transaction/enums/RefundManualExecutionStatus.js +9 -0
- package/bin/transaction/enums/RefundPathTypeEnum.d.ts +7 -0
- package/bin/transaction/enums/RefundPathTypeEnum.js +11 -0
- package/bin/transaction/index.d.ts +6 -0
- package/bin/transaction/index.js +6 -0
- package/package.json +1 -1
- package/src/phoneSales/SaleDeliveryData.ts +41 -0
- package/src/phoneSales/SaleResponseDto.ts +33 -0
- package/src/phoneSales/index.ts +1 -0
- package/src/productCatalog/enums/ProductSubtypeEnum.ts +10 -0
- package/src/productCatalog/enums/ProductTypeEnum.ts +11 -1
- package/src/transaction/dtos/AuthorizeRefundRequest.ts +36 -0
- package/src/transaction/dtos/ConfirmManualExecutionRequest.ts +7 -0
- package/src/transaction/dtos/ReverseRefundRequest.ts +19 -0
- package/src/transaction/enums/RefundChannelEnum.ts +4 -0
- package/src/transaction/enums/RefundManualExecutionStatus.ts +5 -0
- package/src/transaction/enums/RefundPathTypeEnum.ts +7 -0
- package/src/transaction/index.ts +6 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { ProductTypeEnum } from '../../../../src/productCatalog/enums/ProductTypeEnum';
|
|
3
|
+
import { ProductSubtypeEnum } from '../../../../src/productCatalog/enums/ProductSubtypeEnum';
|
|
4
|
+
|
|
5
|
+
describe('Enums refund PCF', () => {
|
|
6
|
+
it('agrega REFUND_PCF y REFUND_PCF_REVERSE a ProductTypeEnum', () => {
|
|
7
|
+
expect(ProductTypeEnum.REFUND_PCF).toBe('REFUND_PCF');
|
|
8
|
+
expect(ProductTypeEnum.REFUND_PCF_REVERSE).toBe('REFUND_PCF_REVERSE');
|
|
9
|
+
});
|
|
10
|
+
it('agrega los 6 subtypes de refund', () => {
|
|
11
|
+
expect(ProductSubtypeEnum.REFUND_PCF_DICTAMEN_PROCEDE).toBe('DICTAMEN_PROCEDE');
|
|
12
|
+
expect(ProductSubtypeEnum.REFUND_PCF_AUTO_T2_SIN_2FA).toBe('AUTO_T2_SIN_2FA');
|
|
13
|
+
expect(ProductSubtypeEnum.REFUND_PCF_ERROR_OPERATIVO).toBe('ERROR_OPERATIVO');
|
|
14
|
+
expect(ProductSubtypeEnum.REFUND_PCF_DOMICILIACION_T1_60D).toBe('DOMICILIACION_T1_60D');
|
|
15
|
+
expect(ProductSubtypeEnum.REFUND_PCF_DOMICILIACION_T1_61_90D).toBe('DOMICILIACION_T1_61_90D');
|
|
16
|
+
expect(ProductSubtypeEnum.REFUND_PCF_REVERSE_DICTAMEN_CON_2FA_TARDIO).toBe('DICTAMEN_CON_2FA_TARDIO');
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { RefundChannelEnum } from '../../../src/transaction';
|
|
3
|
+
|
|
4
|
+
describe('RefundChannelEnum', () => {
|
|
5
|
+
it('expone INTERNAL_PCF y SPEI_OUT_MANUAL', () => {
|
|
6
|
+
expect(RefundChannelEnum.INTERNAL_PCF).toBe('INTERNAL_PCF');
|
|
7
|
+
expect(RefundChannelEnum.SPEI_OUT_MANUAL).toBe('SPEI_OUT_MANUAL');
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('no tiene valores de más', () => {
|
|
11
|
+
expect(Object.values(RefundChannelEnum).sort()).toEqual(
|
|
12
|
+
['INTERNAL_PCF', 'SPEI_OUT_MANUAL'].sort()
|
|
13
|
+
);
|
|
14
|
+
});
|
|
15
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { RefundManualExecutionStatus } from '../../../src/transaction';
|
|
3
|
+
|
|
4
|
+
describe('RefundManualExecutionStatus', () => {
|
|
5
|
+
it('expone PENDING_MANUAL_EXECUTION, EXECUTED, CANCELLED', () => {
|
|
6
|
+
expect(RefundManualExecutionStatus.PENDING_MANUAL_EXECUTION).toBe('PENDING_MANUAL_EXECUTION');
|
|
7
|
+
expect(RefundManualExecutionStatus.EXECUTED).toBe('EXECUTED');
|
|
8
|
+
expect(RefundManualExecutionStatus.CANCELLED).toBe('CANCELLED');
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it('no tiene valores de más', () => {
|
|
12
|
+
expect(Object.values(RefundManualExecutionStatus).sort()).toEqual(
|
|
13
|
+
['PENDING_MANUAL_EXECUTION', 'EXECUTED', 'CANCELLED'].sort()
|
|
14
|
+
);
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { RefundPathTypeEnum } from '../../../src/transaction';
|
|
3
|
+
|
|
4
|
+
describe('RefundPathTypeEnum', () => {
|
|
5
|
+
it('expone las 5 rutas de reintegro definidas en SP1', () => {
|
|
6
|
+
expect(RefundPathTypeEnum.DICTAMEN_PROCEDE).toBe('DICTAMEN_PROCEDE');
|
|
7
|
+
expect(RefundPathTypeEnum.AUTO_T2_SIN_2FA).toBe('AUTO_T2_SIN_2FA');
|
|
8
|
+
expect(RefundPathTypeEnum.ERROR_OPERATIVO).toBe('ERROR_OPERATIVO');
|
|
9
|
+
expect(RefundPathTypeEnum.DOMICILIACION_T1_60D).toBe('DOMICILIACION_T1_60D');
|
|
10
|
+
expect(RefundPathTypeEnum.DOMICILIACION_T1_61_90D).toBe('DOMICILIACION_T1_61_90D');
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('no tiene valores de más', () => {
|
|
14
|
+
expect(Object.values(RefundPathTypeEnum).sort()).toEqual(
|
|
15
|
+
['DICTAMEN_PROCEDE', 'AUTO_T2_SIN_2FA', 'ERROR_OPERATIVO', 'DOMICILIACION_T1_60D', 'DOMICILIACION_T1_61_90D'].sort()
|
|
16
|
+
);
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { AuthorizeRefundRequest, ReverseRefundRequest, ConfirmManualExecutionRequest } from '../../../src/transaction';
|
|
3
|
+
import { RefundChannelEnum, RefundPathTypeEnum } from '../../../src/transaction';
|
|
4
|
+
|
|
5
|
+
describe('Refund DTOs', () => {
|
|
6
|
+
it('importa AuthorizeRefundRequest, ReverseRefundRequest, ConfirmManualExecutionRequest', () => {
|
|
7
|
+
// AuthorizeRefundRequest
|
|
8
|
+
const authRequest: AuthorizeRefundRequest = {
|
|
9
|
+
idempotencyKey: 'key-123',
|
|
10
|
+
directoryId: 'dir-456',
|
|
11
|
+
peopleId: 'person-789',
|
|
12
|
+
productCatalogId: 'MEX_REFUND_PCF',
|
|
13
|
+
operation: 'ADD',
|
|
14
|
+
amount: { total: 1000, currencyId: 'MXN' },
|
|
15
|
+
refundChannel: RefundChannelEnum.SPEI_OUT_MANUAL,
|
|
16
|
+
refundChannelData: {
|
|
17
|
+
targetClabe: '012180001232011635',
|
|
18
|
+
targetBankId: 'BBVAMXMM',
|
|
19
|
+
targetName: 'Beneficiario',
|
|
20
|
+
},
|
|
21
|
+
refundCase: {
|
|
22
|
+
pathType: RefundPathTypeEnum.DICTAMEN_PROCEDE,
|
|
23
|
+
caseFolio: 'FOLIO-001',
|
|
24
|
+
originalTransactionId: 'TX-123',
|
|
25
|
+
originalAmount: 1000,
|
|
26
|
+
originalChannel: 'SPEI_IN',
|
|
27
|
+
},
|
|
28
|
+
approval: {
|
|
29
|
+
makerUserId: 'user-maker-001',
|
|
30
|
+
checkerUserId: 'user-checker-001',
|
|
31
|
+
minuteS3Key: 's3://bucket/minute.pdf',
|
|
32
|
+
},
|
|
33
|
+
reason: 'Restitución por solicitud del cliente',
|
|
34
|
+
evidence: {
|
|
35
|
+
dictamenS3Key: 's3://bucket/dictamen.pdf',
|
|
36
|
+
incidentReportS3Key: 's3://bucket/incident.pdf',
|
|
37
|
+
objectionFormS3Key: null,
|
|
38
|
+
},
|
|
39
|
+
pldOverrideMinuteS3Key: null,
|
|
40
|
+
};
|
|
41
|
+
expect(authRequest.idempotencyKey).toBe('key-123');
|
|
42
|
+
expect(authRequest.refundChannel).toBe(RefundChannelEnum.SPEI_OUT_MANUAL);
|
|
43
|
+
|
|
44
|
+
// ReverseRefundRequest
|
|
45
|
+
const reverseRequest: ReverseRefundRequest = {
|
|
46
|
+
idempotencyKey: 'key-456',
|
|
47
|
+
directoryId: 'dir-456',
|
|
48
|
+
peopleId: 'person-789',
|
|
49
|
+
productCatalogId: 'MEX_REFUND_PCF_REVERSE',
|
|
50
|
+
operation: 'DEBIT',
|
|
51
|
+
originalRefundTransactionId: 'REFUND-TX-123',
|
|
52
|
+
originalIdempotencyKey: 'key-123',
|
|
53
|
+
amount: { total: 1000, currencyId: 'MXN' },
|
|
54
|
+
reverseReason: {
|
|
55
|
+
type: 'DICTAMEN_CON_2FA_TARDIO',
|
|
56
|
+
resolutionS3Key: 's3://bucket/resolution.pdf',
|
|
57
|
+
dictamenS3Key: 's3://bucket/dictamen-new.pdf',
|
|
58
|
+
},
|
|
59
|
+
approval: {
|
|
60
|
+
makerUserId: 'user-maker-002',
|
|
61
|
+
checkerUserId: 'user-checker-002',
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
expect(reverseRequest.originalRefundTransactionId).toBe('REFUND-TX-123');
|
|
65
|
+
expect(reverseRequest.reverseReason.type).toBe('DICTAMEN_CON_2FA_TARDIO');
|
|
66
|
+
|
|
67
|
+
// ConfirmManualExecutionRequest
|
|
68
|
+
const confirmRequest: ConfirmManualExecutionRequest = {
|
|
69
|
+
idempotencyKey: 'key-789',
|
|
70
|
+
speiTrackingKey: 'SPE-TRACK-001',
|
|
71
|
+
executedAt: '2026-09-17T22:00:00Z',
|
|
72
|
+
acuseS3Key: 's3://bucket/acuse.pdf',
|
|
73
|
+
executedByUserId: 'user-controller-001',
|
|
74
|
+
};
|
|
75
|
+
expect(confirmRequest.speiTrackingKey).toBe('SPE-TRACK-001');
|
|
76
|
+
expect(confirmRequest.executedAt).toBe('2026-09-17T22:00:00Z');
|
|
77
|
+
});
|
|
78
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type PickupLocationType = 'FIADO_STORE' | 'CARRIER_OFFICE';
|
|
2
|
+
export interface FiadoStorePickupData {
|
|
3
|
+
pickupLocationType: 'FIADO_STORE';
|
|
4
|
+
storeId: string;
|
|
5
|
+
}
|
|
6
|
+
export interface CarrierOfficePickupData {
|
|
7
|
+
pickupLocationType: 'CARRIER_OFFICE';
|
|
8
|
+
carrierOfficeCode: string;
|
|
9
|
+
latitude: number;
|
|
10
|
+
longitude: number;
|
|
11
|
+
recipientName: string;
|
|
12
|
+
recipientPhone: string;
|
|
13
|
+
}
|
|
14
|
+
export type PickupDeliveryData = FiadoStorePickupData | CarrierOfficePickupData;
|
|
15
|
+
export interface HomeDeliveryData {
|
|
16
|
+
street: string;
|
|
17
|
+
addressNumber: string;
|
|
18
|
+
neighborhood: string;
|
|
19
|
+
municipality: string;
|
|
20
|
+
region: string;
|
|
21
|
+
postalCode: string;
|
|
22
|
+
recipientName: string;
|
|
23
|
+
recipientPhone: string;
|
|
24
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CurrencyId } from '../currency';
|
|
2
|
+
import { PickupDeliveryData, HomeDeliveryData } from './SaleDeliveryData';
|
|
2
3
|
export declare class SaleResponseDto {
|
|
3
4
|
id: string;
|
|
4
5
|
referenceCode: string;
|
|
@@ -6,9 +7,41 @@ export declare class SaleResponseDto {
|
|
|
6
7
|
buyerDirectorId: string;
|
|
7
8
|
newAccountDirectorId: string | null;
|
|
8
9
|
deliveryType: 'PICKUP' | 'HOME';
|
|
10
|
+
/**
|
|
11
|
+
* Dónde había que entregar el dispositivo (retiro en tienda/oficina, u domicilio) —
|
|
12
|
+
* discriminado por `deliveryType`. Requerido porque `Sale_GT` lo requiere desde que existe la
|
|
13
|
+
* tabla; ventas con el objeto vacío son datos corruptos de un bug de persistencia ya corregido
|
|
14
|
+
* (ver memoria `patron-dynamoose-saveunknown-object-anidado`), no un estado válido del contrato.
|
|
15
|
+
*/
|
|
16
|
+
deliveryData: PickupDeliveryData | HomeDeliveryData;
|
|
9
17
|
trackingCode: string | null;
|
|
10
18
|
providerStatus: string | null;
|
|
19
|
+
/**
|
|
20
|
+
* Detalle textual del status reportado por el proveedor de envío (ej. "en camino a sucursal
|
|
21
|
+
* destino") — DISTINTO de `providerStatus` (arriba), que es el código/estado corto. `null`
|
|
22
|
+
* porque el conector no siempre lo trae (eventos tempranos del envío).
|
|
23
|
+
*/
|
|
24
|
+
providerStatusDetail: string | null;
|
|
25
|
+
/**
|
|
26
|
+
* Número de rastreo real que ve el comprador — DISTINTO de `trackingCode` (arriba, que es el ID
|
|
27
|
+
* de correlación interno asignado al CREAR el envío). Este es el que soporte le pasa al
|
|
28
|
+
* cliente cuando reclama. `null` porque el conector no siempre lo trae.
|
|
29
|
+
*/
|
|
30
|
+
trackingNumber: string | null;
|
|
31
|
+
/** URL pública de rastreo del proveedor — mismo motivo de nullability que `trackingNumber`. */
|
|
32
|
+
trackingUrl: string | null;
|
|
33
|
+
/** Qué transportadora gestiona el envío — relevante para cuando haya más de un proveedor. */
|
|
34
|
+
shippingProviderId: string;
|
|
35
|
+
/**
|
|
36
|
+
* ID del cobro en transaction-processor-business — el puente para investigar una reclamación de
|
|
37
|
+
* pago sin buscar a mano en logs por `buyerDirectorId` + ventana de tiempo.
|
|
38
|
+
*/
|
|
39
|
+
paymentId: string;
|
|
11
40
|
status: string;
|
|
41
|
+
/** Fecha de compra (epoch ms) — el dato base de cualquier investigación de reclamación. */
|
|
42
|
+
createdAt: number;
|
|
43
|
+
/** Última modificación de la venta (epoch ms). */
|
|
44
|
+
updatedAt: number;
|
|
12
45
|
/**
|
|
13
46
|
* Modelo de la variante (resuelto server-side por `variantId`, incluyendo variantes con
|
|
14
47
|
* stock=0). `null` si la resolución falló (variante borrada o error de infraestructura) — ver
|
|
@@ -4,6 +4,7 @@ export * from './CreateDeviceVariantRequestDto';
|
|
|
4
4
|
export * from './UpdateDeviceVariantRequestDto';
|
|
5
5
|
export * from './CreateSaleRequestDto';
|
|
6
6
|
export * from './SaleResponseDto';
|
|
7
|
+
export * from './SaleDeliveryData';
|
|
7
8
|
export * from './RedeemSaleCodeRequestDto';
|
|
8
9
|
export * from './DeviceVariantImageUploadUrlRequestDto';
|
|
9
10
|
export * from './DeviceVariantImageUploadUrlResponseDto';
|
package/bin/phoneSales/index.js
CHANGED
|
@@ -20,6 +20,7 @@ __exportStar(require("./CreateDeviceVariantRequestDto"), exports);
|
|
|
20
20
|
__exportStar(require("./UpdateDeviceVariantRequestDto"), exports);
|
|
21
21
|
__exportStar(require("./CreateSaleRequestDto"), exports);
|
|
22
22
|
__exportStar(require("./SaleResponseDto"), exports);
|
|
23
|
+
__exportStar(require("./SaleDeliveryData"), exports);
|
|
23
24
|
__exportStar(require("./RedeemSaleCodeRequestDto"), exports);
|
|
24
25
|
__exportStar(require("./DeviceVariantImageUploadUrlRequestDto"), exports);
|
|
25
26
|
__exportStar(require("./DeviceVariantImageUploadUrlResponseDto"), exports);
|
|
@@ -59,5 +59,11 @@ export declare enum ProductSubtypeEnum {
|
|
|
59
59
|
*/
|
|
60
60
|
SP_CASH_IN_CASH_IN_OXXO = "CASH_IN_OXXO",
|
|
61
61
|
SUREKEEP_BONUS_MX = "BONUS_MX",
|
|
62
|
-
STORE_PHONE = "PHONE"
|
|
62
|
+
STORE_PHONE = "PHONE",
|
|
63
|
+
REFUND_PCF_DICTAMEN_PROCEDE = "DICTAMEN_PROCEDE",
|
|
64
|
+
REFUND_PCF_AUTO_T2_SIN_2FA = "AUTO_T2_SIN_2FA",
|
|
65
|
+
REFUND_PCF_ERROR_OPERATIVO = "ERROR_OPERATIVO",
|
|
66
|
+
REFUND_PCF_DOMICILIACION_T1_60D = "DOMICILIACION_T1_60D",
|
|
67
|
+
REFUND_PCF_DOMICILIACION_T1_61_90D = "DOMICILIACION_T1_61_90D",
|
|
68
|
+
REFUND_PCF_REVERSE_DICTAMEN_CON_2FA_TARDIO = "DICTAMEN_CON_2FA_TARDIO"
|
|
63
69
|
}
|
|
@@ -77,4 +77,12 @@ var ProductSubtypeEnum;
|
|
|
77
77
|
ProductSubtypeEnum["SUREKEEP_BONUS_MX"] = "BONUS_MX";
|
|
78
78
|
//STORE
|
|
79
79
|
ProductSubtypeEnum["STORE_PHONE"] = "PHONE";
|
|
80
|
+
// REFUND_PCF
|
|
81
|
+
ProductSubtypeEnum["REFUND_PCF_DICTAMEN_PROCEDE"] = "DICTAMEN_PROCEDE";
|
|
82
|
+
ProductSubtypeEnum["REFUND_PCF_AUTO_T2_SIN_2FA"] = "AUTO_T2_SIN_2FA";
|
|
83
|
+
ProductSubtypeEnum["REFUND_PCF_ERROR_OPERATIVO"] = "ERROR_OPERATIVO";
|
|
84
|
+
ProductSubtypeEnum["REFUND_PCF_DOMICILIACION_T1_60D"] = "DOMICILIACION_T1_60D";
|
|
85
|
+
ProductSubtypeEnum["REFUND_PCF_DOMICILIACION_T1_61_90D"] = "DOMICILIACION_T1_61_90D";
|
|
86
|
+
// REFUND_PCF_REVERSE
|
|
87
|
+
ProductSubtypeEnum["REFUND_PCF_REVERSE_DICTAMEN_CON_2FA_TARDIO"] = "DICTAMEN_CON_2FA_TARDIO";
|
|
80
88
|
})(ProductSubtypeEnum || (exports.ProductSubtypeEnum = ProductSubtypeEnum = {}));
|
|
@@ -48,5 +48,15 @@ export declare enum ProductTypeEnum {
|
|
|
48
48
|
* `CreateTransactionManager` (no está en su switch), que ya arma `credit`/`debit` de forma
|
|
49
49
|
* data-driven por monto, no por este type.
|
|
50
50
|
*/
|
|
51
|
-
STORE = "STORE"
|
|
51
|
+
STORE = "STORE",
|
|
52
|
+
/**
|
|
53
|
+
* Reembolso a cliente PCF — transacción iniciada desde dashboard de reclamaciones.
|
|
54
|
+
* Tipología: transfer SPEI out manual con aprobación de maker/checker.
|
|
55
|
+
*/
|
|
56
|
+
REFUND_PCF = "REFUND_PCF",
|
|
57
|
+
/**
|
|
58
|
+
* Reversa de un reembolso anterior — se devuelve el dinero del reembolso al cliente
|
|
59
|
+
* cuando el dictamen fue incorrecto o se detectó fraude post-reembolso.
|
|
60
|
+
*/
|
|
61
|
+
REFUND_PCF_REVERSE = "REFUND_PCF_REVERSE"
|
|
52
62
|
}
|
|
@@ -53,4 +53,14 @@ var ProductTypeEnum;
|
|
|
53
53
|
* data-driven por monto, no por este type.
|
|
54
54
|
*/
|
|
55
55
|
ProductTypeEnum["STORE"] = "STORE";
|
|
56
|
+
/**
|
|
57
|
+
* Reembolso a cliente PCF — transacción iniciada desde dashboard de reclamaciones.
|
|
58
|
+
* Tipología: transfer SPEI out manual con aprobación de maker/checker.
|
|
59
|
+
*/
|
|
60
|
+
ProductTypeEnum["REFUND_PCF"] = "REFUND_PCF";
|
|
61
|
+
/**
|
|
62
|
+
* Reversa de un reembolso anterior — se devuelve el dinero del reembolso al cliente
|
|
63
|
+
* cuando el dictamen fue incorrecto o se detectó fraude post-reembolso.
|
|
64
|
+
*/
|
|
65
|
+
ProductTypeEnum["REFUND_PCF_REVERSE"] = "REFUND_PCF_REVERSE";
|
|
56
66
|
})(ProductTypeEnum || (exports.ProductTypeEnum = ProductTypeEnum = {}));
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { RefundChannelEnum } from '../enums/RefundChannelEnum';
|
|
2
|
+
import { RefundPathTypeEnum } from '../enums/RefundPathTypeEnum';
|
|
3
|
+
export interface AuthorizeRefundRequest {
|
|
4
|
+
idempotencyKey: string;
|
|
5
|
+
directoryId: string;
|
|
6
|
+
peopleId: string;
|
|
7
|
+
productCatalogId: 'MEX_REFUND_PCF';
|
|
8
|
+
operation: 'ADD';
|
|
9
|
+
amount: {
|
|
10
|
+
total: number;
|
|
11
|
+
currencyId: 'MXN';
|
|
12
|
+
};
|
|
13
|
+
refundChannel: RefundChannelEnum;
|
|
14
|
+
refundChannelData?: {
|
|
15
|
+
targetClabe?: string;
|
|
16
|
+
targetBankId?: string;
|
|
17
|
+
targetName?: string;
|
|
18
|
+
};
|
|
19
|
+
refundCase: {
|
|
20
|
+
pathType: RefundPathTypeEnum;
|
|
21
|
+
caseFolio: string;
|
|
22
|
+
originalTransactionId: string | null;
|
|
23
|
+
originalAmount: number;
|
|
24
|
+
originalChannel: 'PCF_P2P' | 'SPEI_IN' | 'SPEI_OUT' | 'CARD' | 'DOMICILIATION_FSA';
|
|
25
|
+
};
|
|
26
|
+
approval: {
|
|
27
|
+
makerUserId: string;
|
|
28
|
+
checkerUserId: string | null;
|
|
29
|
+
minuteS3Key: string | null;
|
|
30
|
+
};
|
|
31
|
+
reason: string;
|
|
32
|
+
evidence: {
|
|
33
|
+
dictamenS3Key: string | null;
|
|
34
|
+
incidentReportS3Key: string | null;
|
|
35
|
+
objectionFormS3Key: string | null;
|
|
36
|
+
};
|
|
37
|
+
pldOverrideMinuteS3Key: string | null;
|
|
38
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface ReverseRefundRequest {
|
|
2
|
+
idempotencyKey: string;
|
|
3
|
+
directoryId: string;
|
|
4
|
+
peopleId: string;
|
|
5
|
+
productCatalogId: 'MEX_REFUND_PCF_REVERSE';
|
|
6
|
+
operation: 'DEBIT';
|
|
7
|
+
originalRefundTransactionId: string;
|
|
8
|
+
originalIdempotencyKey: string;
|
|
9
|
+
amount: {
|
|
10
|
+
total: number;
|
|
11
|
+
currencyId: 'MXN';
|
|
12
|
+
};
|
|
13
|
+
reverseReason: {
|
|
14
|
+
type: 'DICTAMEN_CON_2FA_TARDIO';
|
|
15
|
+
resolutionS3Key: string;
|
|
16
|
+
dictamenS3Key: string;
|
|
17
|
+
};
|
|
18
|
+
approval: {
|
|
19
|
+
makerUserId: string;
|
|
20
|
+
checkerUserId: string | null;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RefundChannelEnum = void 0;
|
|
4
|
+
var RefundChannelEnum;
|
|
5
|
+
(function (RefundChannelEnum) {
|
|
6
|
+
RefundChannelEnum["INTERNAL_PCF"] = "INTERNAL_PCF";
|
|
7
|
+
RefundChannelEnum["SPEI_OUT_MANUAL"] = "SPEI_OUT_MANUAL";
|
|
8
|
+
})(RefundChannelEnum || (exports.RefundChannelEnum = RefundChannelEnum = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RefundManualExecutionStatus = void 0;
|
|
4
|
+
var RefundManualExecutionStatus;
|
|
5
|
+
(function (RefundManualExecutionStatus) {
|
|
6
|
+
RefundManualExecutionStatus["PENDING_MANUAL_EXECUTION"] = "PENDING_MANUAL_EXECUTION";
|
|
7
|
+
RefundManualExecutionStatus["EXECUTED"] = "EXECUTED";
|
|
8
|
+
RefundManualExecutionStatus["CANCELLED"] = "CANCELLED";
|
|
9
|
+
})(RefundManualExecutionStatus || (exports.RefundManualExecutionStatus = RefundManualExecutionStatus = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RefundPathTypeEnum = void 0;
|
|
4
|
+
var RefundPathTypeEnum;
|
|
5
|
+
(function (RefundPathTypeEnum) {
|
|
6
|
+
RefundPathTypeEnum["DICTAMEN_PROCEDE"] = "DICTAMEN_PROCEDE";
|
|
7
|
+
RefundPathTypeEnum["AUTO_T2_SIN_2FA"] = "AUTO_T2_SIN_2FA";
|
|
8
|
+
RefundPathTypeEnum["ERROR_OPERATIVO"] = "ERROR_OPERATIVO";
|
|
9
|
+
RefundPathTypeEnum["DOMICILIACION_T1_60D"] = "DOMICILIACION_T1_60D";
|
|
10
|
+
RefundPathTypeEnum["DOMICILIACION_T1_61_90D"] = "DOMICILIACION_T1_61_90D";
|
|
11
|
+
})(RefundPathTypeEnum || (exports.RefundPathTypeEnum = RefundPathTypeEnum = {}));
|
|
@@ -14,6 +14,9 @@ export * from './dtos/Product';
|
|
|
14
14
|
export * from './dtos/ProductDetail';
|
|
15
15
|
export * from './dtos/Total';
|
|
16
16
|
export * from './dtos/ActivityProblemGetResponse';
|
|
17
|
+
export * from './dtos/AuthorizeRefundRequest';
|
|
18
|
+
export * from './dtos/ReverseRefundRequest';
|
|
19
|
+
export * from './dtos/ConfirmManualExecutionRequest';
|
|
17
20
|
export * from './dtos/internal/BaseProviderTransaction';
|
|
18
21
|
export * from './dtos/internal/BaseProviderTransactionQueryParams';
|
|
19
22
|
export * from './dtos/internal/CentralPaymentsQueryParams';
|
|
@@ -33,3 +36,6 @@ export * from './enums/TransactionStatusEnum';
|
|
|
33
36
|
export * from './enums/DisputeOrFraudEnum';
|
|
34
37
|
export * from './enums/DisputeOrFraudStatusEnum';
|
|
35
38
|
export * from './enums/ActivityProblemStatusEnum';
|
|
39
|
+
export * from './enums/RefundChannelEnum';
|
|
40
|
+
export * from './enums/RefundPathTypeEnum';
|
|
41
|
+
export * from './enums/RefundManualExecutionStatus';
|
package/bin/transaction/index.js
CHANGED
|
@@ -31,6 +31,9 @@ __exportStar(require("./dtos/Product"), exports);
|
|
|
31
31
|
__exportStar(require("./dtos/ProductDetail"), exports);
|
|
32
32
|
__exportStar(require("./dtos/Total"), exports);
|
|
33
33
|
__exportStar(require("./dtos/ActivityProblemGetResponse"), exports);
|
|
34
|
+
__exportStar(require("./dtos/AuthorizeRefundRequest"), exports);
|
|
35
|
+
__exportStar(require("./dtos/ReverseRefundRequest"), exports);
|
|
36
|
+
__exportStar(require("./dtos/ConfirmManualExecutionRequest"), exports);
|
|
34
37
|
__exportStar(require("./dtos/internal/BaseProviderTransaction"), exports);
|
|
35
38
|
__exportStar(require("./dtos/internal/BaseProviderTransactionQueryParams"), exports);
|
|
36
39
|
__exportStar(require("./dtos/internal/CentralPaymentsQueryParams"), exports);
|
|
@@ -51,3 +54,6 @@ __exportStar(require("./enums/TransactionStatusEnum"), exports);
|
|
|
51
54
|
__exportStar(require("./enums/DisputeOrFraudEnum"), exports);
|
|
52
55
|
__exportStar(require("./enums/DisputeOrFraudStatusEnum"), exports);
|
|
53
56
|
__exportStar(require("./enums/ActivityProblemStatusEnum"), exports);
|
|
57
|
+
__exportStar(require("./enums/RefundChannelEnum"), exports);
|
|
58
|
+
__exportStar(require("./enums/RefundPathTypeEnum"), exports);
|
|
59
|
+
__exportStar(require("./enums/RefundManualExecutionStatus"), exports);
|
package/package.json
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Shape de `deliveryData` de una venta de celular. Portado 1:1 (mismos nombres y tipos) desde
|
|
2
|
+
// `cell-phone-sales-business/src/infrastructure/entities/SaleRow.ts` (TD-011, shape CONFIRMADO
|
|
3
|
+
// por el líder técnico, no inferido) — hasta ahora vivía SOLO como interfaces locales del lambda,
|
|
4
|
+
// nunca se había publicado a `@fiado/type-kit`. Se publica acá porque `SaleResponseDto.deliveryData`
|
|
5
|
+
// (agregado para que backoffice pueda investigar reclamaciones sin ir a logs) necesita un tipo real,
|
|
6
|
+
// no `Record<string, unknown>` — y las DTOs de type-kit no pueden depender de tipos locales de un lambda.
|
|
7
|
+
//
|
|
8
|
+
// El retiro en tienda Fiado (`FIADO_STORE`) es un flujo INTERNO que nunca dispara un envío externo;
|
|
9
|
+
// solo el retiro en oficina de transportadora (`CARRIER_OFFICE`) lo hace — por eso la unión
|
|
10
|
+
// discriminada por `pickupLocationType` en vez de un objeto plano con campos opcionales.
|
|
11
|
+
export type PickupLocationType = 'FIADO_STORE' | 'CARRIER_OFFICE';
|
|
12
|
+
|
|
13
|
+
export interface FiadoStorePickupData {
|
|
14
|
+
pickupLocationType: 'FIADO_STORE';
|
|
15
|
+
storeId: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Campos genéricos/agnósticos de proveedor a propósito (`carrierOfficeCode`, no el nombre real del
|
|
19
|
+
// campo de Estafeta): la traducción a los nombres del contrato de cada transportadora vive en el
|
|
20
|
+
// adaptador del lambda (`CreateShippingRequestMapper`), nunca en este tipo compartido.
|
|
21
|
+
export interface CarrierOfficePickupData {
|
|
22
|
+
pickupLocationType: 'CARRIER_OFFICE';
|
|
23
|
+
carrierOfficeCode: string;
|
|
24
|
+
latitude: number;
|
|
25
|
+
longitude: number;
|
|
26
|
+
recipientName: string;
|
|
27
|
+
recipientPhone: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type PickupDeliveryData = FiadoStorePickupData | CarrierOfficePickupData;
|
|
31
|
+
|
|
32
|
+
export interface HomeDeliveryData {
|
|
33
|
+
street: string;
|
|
34
|
+
addressNumber: string;
|
|
35
|
+
neighborhood: string;
|
|
36
|
+
municipality: string;
|
|
37
|
+
region: string;
|
|
38
|
+
postalCode: string;
|
|
39
|
+
recipientName: string;
|
|
40
|
+
recipientPhone: string;
|
|
41
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CurrencyId } from '../currency';
|
|
2
|
+
import { PickupDeliveryData, HomeDeliveryData } from './SaleDeliveryData';
|
|
2
3
|
|
|
3
4
|
export class SaleResponseDto {
|
|
4
5
|
id!: string;
|
|
@@ -7,9 +8,41 @@ export class SaleResponseDto {
|
|
|
7
8
|
buyerDirectorId!: string;
|
|
8
9
|
newAccountDirectorId!: string | null;
|
|
9
10
|
deliveryType!: 'PICKUP' | 'HOME';
|
|
11
|
+
/**
|
|
12
|
+
* Dónde había que entregar el dispositivo (retiro en tienda/oficina, u domicilio) —
|
|
13
|
+
* discriminado por `deliveryType`. Requerido porque `Sale_GT` lo requiere desde que existe la
|
|
14
|
+
* tabla; ventas con el objeto vacío son datos corruptos de un bug de persistencia ya corregido
|
|
15
|
+
* (ver memoria `patron-dynamoose-saveunknown-object-anidado`), no un estado válido del contrato.
|
|
16
|
+
*/
|
|
17
|
+
deliveryData!: PickupDeliveryData | HomeDeliveryData;
|
|
10
18
|
trackingCode!: string | null;
|
|
11
19
|
providerStatus!: string | null;
|
|
20
|
+
/**
|
|
21
|
+
* Detalle textual del status reportado por el proveedor de envío (ej. "en camino a sucursal
|
|
22
|
+
* destino") — DISTINTO de `providerStatus` (arriba), que es el código/estado corto. `null`
|
|
23
|
+
* porque el conector no siempre lo trae (eventos tempranos del envío).
|
|
24
|
+
*/
|
|
25
|
+
providerStatusDetail!: string | null;
|
|
26
|
+
/**
|
|
27
|
+
* Número de rastreo real que ve el comprador — DISTINTO de `trackingCode` (arriba, que es el ID
|
|
28
|
+
* de correlación interno asignado al CREAR el envío). Este es el que soporte le pasa al
|
|
29
|
+
* cliente cuando reclama. `null` porque el conector no siempre lo trae.
|
|
30
|
+
*/
|
|
31
|
+
trackingNumber!: string | null;
|
|
32
|
+
/** URL pública de rastreo del proveedor — mismo motivo de nullability que `trackingNumber`. */
|
|
33
|
+
trackingUrl!: string | null;
|
|
34
|
+
/** Qué transportadora gestiona el envío — relevante para cuando haya más de un proveedor. */
|
|
35
|
+
shippingProviderId!: string;
|
|
36
|
+
/**
|
|
37
|
+
* ID del cobro en transaction-processor-business — el puente para investigar una reclamación de
|
|
38
|
+
* pago sin buscar a mano en logs por `buyerDirectorId` + ventana de tiempo.
|
|
39
|
+
*/
|
|
40
|
+
paymentId!: string;
|
|
12
41
|
status!: string;
|
|
42
|
+
/** Fecha de compra (epoch ms) — el dato base de cualquier investigación de reclamación. */
|
|
43
|
+
createdAt!: number;
|
|
44
|
+
/** Última modificación de la venta (epoch ms). */
|
|
45
|
+
updatedAt!: number;
|
|
13
46
|
/**
|
|
14
47
|
* Modelo de la variante (resuelto server-side por `variantId`, incluyendo variantes con
|
|
15
48
|
* stock=0). `null` si la resolución falló (variante borrada o error de infraestructura) — ver
|
package/src/phoneSales/index.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './CreateDeviceVariantRequestDto';
|
|
|
4
4
|
export * from './UpdateDeviceVariantRequestDto';
|
|
5
5
|
export * from './CreateSaleRequestDto';
|
|
6
6
|
export * from './SaleResponseDto';
|
|
7
|
+
export * from './SaleDeliveryData';
|
|
7
8
|
export * from './RedeemSaleCodeRequestDto';
|
|
8
9
|
export * from './DeviceVariantImageUploadUrlRequestDto';
|
|
9
10
|
export * from './DeviceVariantImageUploadUrlResponseDto';
|
|
@@ -86,4 +86,14 @@ export enum ProductSubtypeEnum {
|
|
|
86
86
|
|
|
87
87
|
//STORE
|
|
88
88
|
STORE_PHONE = "PHONE",
|
|
89
|
+
|
|
90
|
+
// REFUND_PCF
|
|
91
|
+
REFUND_PCF_DICTAMEN_PROCEDE = "DICTAMEN_PROCEDE",
|
|
92
|
+
REFUND_PCF_AUTO_T2_SIN_2FA = "AUTO_T2_SIN_2FA",
|
|
93
|
+
REFUND_PCF_ERROR_OPERATIVO = "ERROR_OPERATIVO",
|
|
94
|
+
REFUND_PCF_DOMICILIACION_T1_60D = "DOMICILIACION_T1_60D",
|
|
95
|
+
REFUND_PCF_DOMICILIACION_T1_61_90D = "DOMICILIACION_T1_61_90D",
|
|
96
|
+
|
|
97
|
+
// REFUND_PCF_REVERSE
|
|
98
|
+
REFUND_PCF_REVERSE_DICTAMEN_CON_2FA_TARDIO = "DICTAMEN_CON_2FA_TARDIO",
|
|
89
99
|
}
|
|
@@ -48,5 +48,15 @@ export enum ProductTypeEnum {
|
|
|
48
48
|
* `CreateTransactionManager` (no está en su switch), que ya arma `credit`/`debit` de forma
|
|
49
49
|
* data-driven por monto, no por este type.
|
|
50
50
|
*/
|
|
51
|
-
STORE = "STORE"
|
|
51
|
+
STORE = "STORE",
|
|
52
|
+
/**
|
|
53
|
+
* Reembolso a cliente PCF — transacción iniciada desde dashboard de reclamaciones.
|
|
54
|
+
* Tipología: transfer SPEI out manual con aprobación de maker/checker.
|
|
55
|
+
*/
|
|
56
|
+
REFUND_PCF = "REFUND_PCF",
|
|
57
|
+
/**
|
|
58
|
+
* Reversa de un reembolso anterior — se devuelve el dinero del reembolso al cliente
|
|
59
|
+
* cuando el dictamen fue incorrecto o se detectó fraude post-reembolso.
|
|
60
|
+
*/
|
|
61
|
+
REFUND_PCF_REVERSE = "REFUND_PCF_REVERSE"
|
|
52
62
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { RefundChannelEnum } from '../enums/RefundChannelEnum';
|
|
2
|
+
import { RefundPathTypeEnum } from '../enums/RefundPathTypeEnum';
|
|
3
|
+
|
|
4
|
+
export interface AuthorizeRefundRequest {
|
|
5
|
+
idempotencyKey: string;
|
|
6
|
+
directoryId: string;
|
|
7
|
+
peopleId: string;
|
|
8
|
+
productCatalogId: 'MEX_REFUND_PCF';
|
|
9
|
+
operation: 'ADD';
|
|
10
|
+
amount: { total: number; currencyId: 'MXN' };
|
|
11
|
+
refundChannel: RefundChannelEnum;
|
|
12
|
+
refundChannelData?: {
|
|
13
|
+
targetClabe?: string;
|
|
14
|
+
targetBankId?: string;
|
|
15
|
+
targetName?: string;
|
|
16
|
+
};
|
|
17
|
+
refundCase: {
|
|
18
|
+
pathType: RefundPathTypeEnum;
|
|
19
|
+
caseFolio: string;
|
|
20
|
+
originalTransactionId: string | null;
|
|
21
|
+
originalAmount: number;
|
|
22
|
+
originalChannel: 'PCF_P2P' | 'SPEI_IN' | 'SPEI_OUT' | 'CARD' | 'DOMICILIATION_FSA';
|
|
23
|
+
};
|
|
24
|
+
approval: {
|
|
25
|
+
makerUserId: string;
|
|
26
|
+
checkerUserId: string | null;
|
|
27
|
+
minuteS3Key: string | null;
|
|
28
|
+
};
|
|
29
|
+
reason: string;
|
|
30
|
+
evidence: {
|
|
31
|
+
dictamenS3Key: string | null;
|
|
32
|
+
incidentReportS3Key: string | null;
|
|
33
|
+
objectionFormS3Key: string | null;
|
|
34
|
+
};
|
|
35
|
+
pldOverrideMinuteS3Key: string | null;
|
|
36
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface ConfirmManualExecutionRequest {
|
|
2
|
+
idempotencyKey: string;
|
|
3
|
+
speiTrackingKey: string; // Clave de rastreo Banxico devuelta por BBVA
|
|
4
|
+
executedAt: string; // ISO 8601
|
|
5
|
+
acuseS3Key: string; // Comprobante SPEI subido por el Contralor
|
|
6
|
+
executedByUserId: string; // Contralor que ejecutó el SPEI
|
|
7
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface ReverseRefundRequest {
|
|
2
|
+
idempotencyKey: string;
|
|
3
|
+
directoryId: string;
|
|
4
|
+
peopleId: string;
|
|
5
|
+
productCatalogId: 'MEX_REFUND_PCF_REVERSE';
|
|
6
|
+
operation: 'DEBIT';
|
|
7
|
+
originalRefundTransactionId: string;
|
|
8
|
+
originalIdempotencyKey: string;
|
|
9
|
+
amount: { total: number; currencyId: 'MXN' };
|
|
10
|
+
reverseReason: {
|
|
11
|
+
type: 'DICTAMEN_CON_2FA_TARDIO';
|
|
12
|
+
resolutionS3Key: string;
|
|
13
|
+
dictamenS3Key: string;
|
|
14
|
+
};
|
|
15
|
+
approval: {
|
|
16
|
+
makerUserId: string;
|
|
17
|
+
checkerUserId: string | null;
|
|
18
|
+
};
|
|
19
|
+
}
|
package/src/transaction/index.ts
CHANGED
|
@@ -15,6 +15,9 @@ export * from './dtos/Product';
|
|
|
15
15
|
export * from './dtos/ProductDetail';
|
|
16
16
|
export * from './dtos/Total';
|
|
17
17
|
export * from './dtos/ActivityProblemGetResponse';
|
|
18
|
+
export * from './dtos/AuthorizeRefundRequest';
|
|
19
|
+
export * from './dtos/ReverseRefundRequest';
|
|
20
|
+
export * from './dtos/ConfirmManualExecutionRequest';
|
|
18
21
|
|
|
19
22
|
export * from './dtos/internal/BaseProviderTransaction';
|
|
20
23
|
export * from './dtos/internal/BaseProviderTransactionQueryParams';
|
|
@@ -38,3 +41,6 @@ export * from './enums/TransactionStatusEnum';
|
|
|
38
41
|
export * from './enums/DisputeOrFraudEnum';
|
|
39
42
|
export * from './enums/DisputeOrFraudStatusEnum';
|
|
40
43
|
export * from './enums/ActivityProblemStatusEnum';
|
|
44
|
+
export * from './enums/RefundChannelEnum';
|
|
45
|
+
export * from './enums/RefundPathTypeEnum';
|
|
46
|
+
export * from './enums/RefundManualExecutionStatus';
|