@fiado/type-kit 3.321.0 → 3.321.1
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/retailCustomer/welcomeBonusRequests.test.ts +71 -0
- package/bin/benefitCenter/enums/BenefitFlowEnum.d.ts +11 -0
- package/bin/benefitCenter/enums/BenefitFlowEnum.js +15 -0
- package/bin/common/decorators/Trim.d.ts +5 -0
- package/bin/common/decorators/Trim.js +10 -0
- package/bin/common/index.d.ts +1 -0
- package/bin/common/index.js +2 -0
- package/bin/loanCredit/dtos/requests/UpdateActivationChecklistRequest.d.ts +11 -0
- package/bin/loanCredit/dtos/requests/UpdateActivationChecklistRequest.js +46 -0
- package/bin/loanCredit/enums/ClientLevelEnum.d.ts +11 -0
- package/bin/loanCredit/enums/ClientLevelEnum.js +15 -0
- package/bin/networkConnector/dtos/CreateProfileRequest.d.ts +1 -4
- package/bin/networkConnector/dtos/CreateProfileRequest.js +1 -1
- package/bin/networkConnector/dtos/ProfileResponse.d.ts +0 -3
- package/bin/networkConnector/dtos/UpdateProfileRequest.d.ts +1 -0
- package/bin/networkConnector/dtos/UpdateProfileRequest.js +6 -0
- package/bin/retailCustomer/dtos/requests/WelcomeAccreditationRequest.d.ts +1 -3
- package/bin/retailCustomer/dtos/requests/WelcomeAccreditationRequest.js +11 -14
- package/bin/retailCustomer/dtos/requests/WelcomeAccreditationResultRequest.d.ts +8 -0
- package/bin/retailCustomer/dtos/requests/WelcomeAccreditationResultRequest.js +29 -6
- package/bin/retailCustomer/dtos/responses/WelcomeBonusResponse.d.ts +4 -0
- package/bin/retailWizard/dtos/WizardBlocked.d.ts +7 -2
- package/bin/retailWizard/dtos/WizardSession.d.ts +5 -6
- package/bin/walletFunding/dtos/CancelFundingReferenceRequest.d.ts +6 -0
- package/bin/walletFunding/dtos/CancelFundingReferenceRequest.js +31 -0
- package/bin/walletFunding/dtos/CancelFundingReferenceResponse.d.ts +7 -0
- package/bin/walletFunding/dtos/CancelFundingReferenceResponse.js +6 -0
- package/bin/walletFunding/dtos/CancelFundingRequest.d.ts +11 -0
- package/bin/walletFunding/dtos/CancelFundingRequest.js +33 -0
- package/bin/walletFunding/dtos/CancelFundingResponse.d.ts +14 -0
- package/bin/walletFunding/dtos/CancelFundingResponse.js +12 -0
- package/bin/walletFunding/dtos/CancelWalletFundingRequest.d.ts +3 -0
- package/bin/walletFunding/dtos/CancelWalletFundingRequest.js +21 -0
- package/bin/walletFunding/dtos/CancelWalletFundingResponse.d.ts +7 -0
- package/bin/walletFunding/dtos/CancelWalletFundingResponse.js +6 -0
- package/bin/walletFunding/dtos/GetWalletFundingLimitResponse.d.ts +57 -11
- package/bin/walletFunding/dtos/GetWalletFundingLimitResponse.js +22 -11
- package/package.json +1 -1
- package/src/common/decorators/Trim.ts +8 -0
- package/src/common/index.ts +3 -0
- package/src/networkConnector/dtos/CreateProfileRequest.ts +2 -5
- package/src/networkConnector/dtos/ProfileResponse.ts +0 -3
- package/src/networkConnector/dtos/UpdateProfileRequest.ts +1 -2
- package/src/retailCustomer/dtos/requests/WelcomeAccreditationRequest.ts +12 -17
- package/src/retailCustomer/dtos/requests/WelcomeAccreditationResultRequest.ts +32 -9
- package/src/retailCustomer/dtos/responses/WelcomeBonusResponse.ts +4 -0
- package/src/retailWizard/dtos/WizardBlocked.ts +7 -2
- package/src/retailWizard/dtos/WizardSession.ts +5 -6
- package/src/walletFunding/dtos/GetWalletFundingLimitResponse.ts +60 -11
|
@@ -131,6 +131,77 @@ describe('WelcomeAccreditationResultRequest — cerrar el asiento', () => {
|
|
|
131
131
|
).toContain('bonusKey');
|
|
132
132
|
}
|
|
133
133
|
});
|
|
134
|
+
|
|
135
|
+
// El asiento se declara SIN PII y `failReason` es el único texto libre que escribe el caller: un
|
|
136
|
+
// payload crudo del processor podría meterle una CLABE al libro.
|
|
137
|
+
it('rechaza un failReason de más de 256 caracteres', () => {
|
|
138
|
+
expect(
|
|
139
|
+
errorsOf(WelcomeAccreditationResultRequest, {
|
|
140
|
+
bonusKey: 'key-1',
|
|
141
|
+
status: WelcomeBonusStatusEnum.FAILED,
|
|
142
|
+
failReason: 'x'.repeat(257),
|
|
143
|
+
}),
|
|
144
|
+
).toContain('failReason');
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
it('acepta un failReason de 256 caracteres', () => {
|
|
148
|
+
expect(
|
|
149
|
+
errorsOf(WelcomeAccreditationResultRequest, {
|
|
150
|
+
bonusKey: 'key-1',
|
|
151
|
+
status: WelcomeBonusStatusEnum.FAILED,
|
|
152
|
+
failReason: 'x'.repeat(256),
|
|
153
|
+
}),
|
|
154
|
+
).toEqual([]);
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
describe('WelcomeAccreditationResultRequest — cierre de reconciliación', () => {
|
|
159
|
+
const RECONCILED = {
|
|
160
|
+
bonusKey: 'key-1',
|
|
161
|
+
status: WelcomeBonusStatusEnum.ACCREDITED,
|
|
162
|
+
processorTransactionId: 'tx-1',
|
|
163
|
+
reconciledBy: 'ops@somosfiado.com',
|
|
164
|
+
reconciliationReason: 'confirmado en el estado de cuenta del processor',
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
it('acepta el cierre con actor y motivo', () => {
|
|
168
|
+
expect(errorsOf(WelcomeAccreditationResultRequest, RECONCILED)).toEqual([]);
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
// Media reconciliación no sirve: un asiento cerrado a mano sin quién o sin por qué no es auditable.
|
|
172
|
+
it('exige el motivo cuando viene el actor', () => {
|
|
173
|
+
expect(
|
|
174
|
+
errorsOf(WelcomeAccreditationResultRequest, {
|
|
175
|
+
...RECONCILED,
|
|
176
|
+
reconciliationReason: undefined,
|
|
177
|
+
}),
|
|
178
|
+
).toContain('reconciliationReason');
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
it('exige el actor cuando viene el motivo', () => {
|
|
182
|
+
expect(
|
|
183
|
+
errorsOf(WelcomeAccreditationResultRequest, { ...RECONCILED, reconciledBy: undefined }),
|
|
184
|
+
).toContain('reconciledBy');
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
it('rechaza un motivo de más de 256 caracteres', () => {
|
|
188
|
+
expect(
|
|
189
|
+
errorsOf(WelcomeAccreditationResultRequest, {
|
|
190
|
+
...RECONCILED,
|
|
191
|
+
reconciliationReason: 'x'.repeat(257),
|
|
192
|
+
}),
|
|
193
|
+
).toContain('reconciliationReason');
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
it('recorta los espacios del actor y del motivo', () => {
|
|
197
|
+
const dto = plainToInstance(
|
|
198
|
+
WelcomeAccreditationResultRequest,
|
|
199
|
+
{ ...RECONCILED, reconciledBy: ' ops@somosfiado.com ', reconciliationReason: ' ok ' },
|
|
200
|
+
{ excludeExtraneousValues: true },
|
|
201
|
+
);
|
|
202
|
+
expect(dto.reconciledBy).toBe('ops@somosfiado.com');
|
|
203
|
+
expect(dto.reconciliationReason).toBe('ok');
|
|
204
|
+
});
|
|
134
205
|
});
|
|
135
206
|
|
|
136
207
|
describe('enums del bono de bienvenida', () => {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare enum BenefitFlowEnum {
|
|
2
|
+
TOPUPS = "TOPUPS",
|
|
3
|
+
BILL_PAYMENT = "BILL_PAYMENT",
|
|
4
|
+
CREDIT = "CREDIT",
|
|
5
|
+
INSURANCE = "INSURANCE",
|
|
6
|
+
DONATION = "DONATION",
|
|
7
|
+
PHARMACY = "PHARMACY",
|
|
8
|
+
REMITTANCE = "REMITTANCE",
|
|
9
|
+
/** Fondeo de wallet PCF con efectivo via provider externo (Equality/Passport, OpenPay, …) — spec 13. */
|
|
10
|
+
WALLET_FUNDING = "WALLET_FUNDING"
|
|
11
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BenefitFlowEnum = void 0;
|
|
4
|
+
var BenefitFlowEnum;
|
|
5
|
+
(function (BenefitFlowEnum) {
|
|
6
|
+
BenefitFlowEnum["TOPUPS"] = "TOPUPS";
|
|
7
|
+
BenefitFlowEnum["BILL_PAYMENT"] = "BILL_PAYMENT";
|
|
8
|
+
BenefitFlowEnum["CREDIT"] = "CREDIT";
|
|
9
|
+
BenefitFlowEnum["INSURANCE"] = "INSURANCE";
|
|
10
|
+
BenefitFlowEnum["DONATION"] = "DONATION";
|
|
11
|
+
BenefitFlowEnum["PHARMACY"] = "PHARMACY";
|
|
12
|
+
BenefitFlowEnum["REMITTANCE"] = "REMITTANCE";
|
|
13
|
+
/** Fondeo de wallet PCF con efectivo via provider externo (Equality/Passport, OpenPay, …) — spec 13. */
|
|
14
|
+
BenefitFlowEnum["WALLET_FUNDING"] = "WALLET_FUNDING";
|
|
15
|
+
})(BenefitFlowEnum || (exports.BenefitFlowEnum = BenefitFlowEnum = {}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Trim = void 0;
|
|
4
|
+
const class_transformer_1 = require("class-transformer");
|
|
5
|
+
/**
|
|
6
|
+
* Recorta los espacios del borde de un string; deja pasar cualquier otro tipo sin tocarlo.
|
|
7
|
+
* Se aplica antes de los validadores, así que `' '` llega como `''` y `@IsNotEmpty` lo rechaza.
|
|
8
|
+
*/
|
|
9
|
+
const Trim = () => (0, class_transformer_1.Transform)(({ value }) => (typeof value === 'string' ? value.trim() : value));
|
|
10
|
+
exports.Trim = Trim;
|
package/bin/common/index.d.ts
CHANGED
package/bin/common/index.js
CHANGED
|
@@ -14,6 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
//decorators
|
|
18
|
+
__exportStar(require("./decorators/Trim"), exports);
|
|
17
19
|
//dtos
|
|
18
20
|
__exportStar(require("./dtos/ProcessValidationResultDto"), exports);
|
|
19
21
|
//Enums
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Body de PUT /credits/:creditId/checklist (loan-credit-business). Marca condiciones de activación
|
|
3
|
+
* cumplidas. Solo se mandan las que cambian; en F3 las marcarán los flujos de firma de contrato
|
|
4
|
+
* (`downPayment` + `contractSigned`) y de enrolamiento MDM (`imeiEnrolled` + `lockVerified`).
|
|
5
|
+
*/
|
|
6
|
+
export declare class UpdateActivationChecklistRequest {
|
|
7
|
+
downPayment?: boolean;
|
|
8
|
+
contractSigned?: boolean;
|
|
9
|
+
imeiEnrolled?: boolean;
|
|
10
|
+
lockVerified?: boolean;
|
|
11
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.UpdateActivationChecklistRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
/**
|
|
16
|
+
* Body de PUT /credits/:creditId/checklist (loan-credit-business). Marca condiciones de activación
|
|
17
|
+
* cumplidas. Solo se mandan las que cambian; en F3 las marcarán los flujos de firma de contrato
|
|
18
|
+
* (`downPayment` + `contractSigned`) y de enrolamiento MDM (`imeiEnrolled` + `lockVerified`).
|
|
19
|
+
*/
|
|
20
|
+
class UpdateActivationChecklistRequest {
|
|
21
|
+
}
|
|
22
|
+
exports.UpdateActivationChecklistRequest = UpdateActivationChecklistRequest;
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, class_transformer_1.Expose)(),
|
|
25
|
+
(0, class_validator_1.IsOptional)(),
|
|
26
|
+
(0, class_validator_1.IsBoolean)(),
|
|
27
|
+
__metadata("design:type", Boolean)
|
|
28
|
+
], UpdateActivationChecklistRequest.prototype, "downPayment", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, class_transformer_1.Expose)(),
|
|
31
|
+
(0, class_validator_1.IsOptional)(),
|
|
32
|
+
(0, class_validator_1.IsBoolean)(),
|
|
33
|
+
__metadata("design:type", Boolean)
|
|
34
|
+
], UpdateActivationChecklistRequest.prototype, "contractSigned", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, class_transformer_1.Expose)(),
|
|
37
|
+
(0, class_validator_1.IsOptional)(),
|
|
38
|
+
(0, class_validator_1.IsBoolean)(),
|
|
39
|
+
__metadata("design:type", Boolean)
|
|
40
|
+
], UpdateActivationChecklistRequest.prototype, "imeiEnrolled", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, class_transformer_1.Expose)(),
|
|
43
|
+
(0, class_validator_1.IsOptional)(),
|
|
44
|
+
(0, class_validator_1.IsBoolean)(),
|
|
45
|
+
__metadata("design:type", Boolean)
|
|
46
|
+
], UpdateActivationChecklistRequest.prototype, "lockVerified", void 0);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Nivel del cliente según su SCI (M7/05_MOTOR §3.2): 21-60 Bronce · 61-80 Plata · 81-100 Oro.
|
|
3
|
+
* Distinto de `CreditPlanLevelEnum` de loanOfferings (que además tiene `ALL` para planes):
|
|
4
|
+
* un CLIENTE nunca es `ALL`.
|
|
5
|
+
* @enum {string}
|
|
6
|
+
*/
|
|
7
|
+
export declare enum ClientLevelEnum {
|
|
8
|
+
BRONZE = "BRONZE",
|
|
9
|
+
SILVER = "SILVER",
|
|
10
|
+
GOLD = "GOLD"
|
|
11
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClientLevelEnum = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Nivel del cliente según su SCI (M7/05_MOTOR §3.2): 21-60 Bronce · 61-80 Plata · 81-100 Oro.
|
|
6
|
+
* Distinto de `CreditPlanLevelEnum` de loanOfferings (que además tiene `ALL` para planes):
|
|
7
|
+
* un CLIENTE nunca es `ALL`.
|
|
8
|
+
* @enum {string}
|
|
9
|
+
*/
|
|
10
|
+
var ClientLevelEnum;
|
|
11
|
+
(function (ClientLevelEnum) {
|
|
12
|
+
ClientLevelEnum["BRONZE"] = "BRONZE";
|
|
13
|
+
ClientLevelEnum["SILVER"] = "SILVER";
|
|
14
|
+
ClientLevelEnum["GOLD"] = "GOLD";
|
|
15
|
+
})(ClientLevelEnum || (exports.ClientLevelEnum = ClientLevelEnum = {}));
|
|
@@ -5,10 +5,7 @@ export declare class CreateProfileRequest {
|
|
|
5
5
|
company?: string;
|
|
6
6
|
slug: string;
|
|
7
7
|
directoryId: string;
|
|
8
|
-
|
|
9
|
-
* (IOnboardingBusinessApi.getByPhoneNumber) al crear el perfil. Inmutable tras la creacion
|
|
10
|
-
* (UpdateProfileRequest ya no acepta este campo). */
|
|
11
|
-
phone: string;
|
|
8
|
+
phone?: string;
|
|
12
9
|
email?: string;
|
|
13
10
|
bio?: string;
|
|
14
11
|
socialLinks?: Record<string, string>;
|
|
@@ -57,8 +57,8 @@ __decorate([
|
|
|
57
57
|
], CreateProfileRequest.prototype, "directoryId", void 0);
|
|
58
58
|
__decorate([
|
|
59
59
|
(0, class_transformer_1.Expose)(),
|
|
60
|
+
(0, class_validator_1.IsOptional)(),
|
|
60
61
|
(0, class_validator_1.IsString)(),
|
|
61
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
62
62
|
__metadata("design:type", String)
|
|
63
63
|
], CreateProfileRequest.prototype, "phone", void 0);
|
|
64
64
|
__decorate([
|
|
@@ -12,9 +12,6 @@ export interface ProfileResponse {
|
|
|
12
12
|
logoUrl?: string;
|
|
13
13
|
bio?: string;
|
|
14
14
|
socialLinks?: Record<string, string>;
|
|
15
|
-
/** Codigo de referido del promotor (myReferralCode de Onboarding), resuelto por telefono al
|
|
16
|
-
* crear el perfil. null si el telefono no tiene codigo asociado en Onboarding. */
|
|
17
|
-
referralCode?: string | null;
|
|
18
15
|
status: ProfileStatusEnum;
|
|
19
16
|
directoryId: string;
|
|
20
17
|
createdAt: number;
|
|
@@ -54,6 +54,12 @@ __decorate([
|
|
|
54
54
|
(0, class_validator_1.MaxLength)(100),
|
|
55
55
|
__metadata("design:type", String)
|
|
56
56
|
], UpdateProfileRequest.prototype, "slug", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, class_transformer_1.Expose)(),
|
|
59
|
+
(0, class_validator_1.IsOptional)(),
|
|
60
|
+
(0, class_validator_1.IsString)(),
|
|
61
|
+
__metadata("design:type", String)
|
|
62
|
+
], UpdateProfileRequest.prototype, "phone", void 0);
|
|
57
63
|
__decorate([
|
|
58
64
|
(0, class_transformer_1.Expose)(),
|
|
59
65
|
(0, class_validator_1.IsOptional)(),
|
|
@@ -3,9 +3,7 @@ import { WelcomeBonusAmountSourceEnum } from '../../enums/WelcomeBonusAmountSour
|
|
|
3
3
|
* Datos de la venta que acompañan la reserva del bono de bienvenida (D33):
|
|
4
4
|
* `POST /private/customers/:id/welcome-accreditation`. SureKeep Fase 2 — pista Retail.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* durante la ventana el wizard viejo sigue llamando sin body: el asiento nace incompleto y se acredita
|
|
8
|
-
* igual. Exigirlos convertiría esa ventana en un 400 que deja al cliente sin bono.
|
|
6
|
+
* Todos los campos son opcionales: un caller que no los manda abre el asiento igual, incompleto.
|
|
9
7
|
*/
|
|
10
8
|
export declare class WelcomeAccreditationRequest {
|
|
11
9
|
/** Tienda donde se dio el bono — es la partición del asiento. */
|
|
@@ -12,16 +12,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.WelcomeAccreditationRequest = void 0;
|
|
13
13
|
const class_transformer_1 = require("class-transformer");
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
|
+
const Trim_1 = require("../../../common/decorators/Trim");
|
|
15
16
|
const WelcomeBonusAmountSourceEnum_1 = require("../../enums/WelcomeBonusAmountSourceEnum");
|
|
16
|
-
/** Recorta los strings del borde: un valor con espacios ensucia claves y cortes de conciliación. */
|
|
17
|
-
const trim = () => (0, class_transformer_1.Transform)(({ value }) => (typeof value === 'string' ? value.trim() : value));
|
|
18
17
|
/**
|
|
19
18
|
* Datos de la venta que acompañan la reserva del bono de bienvenida (D33):
|
|
20
19
|
* `POST /private/customers/:id/welcome-accreditation`. SureKeep Fase 2 — pista Retail.
|
|
21
20
|
*
|
|
22
|
-
*
|
|
23
|
-
* durante la ventana el wizard viejo sigue llamando sin body: el asiento nace incompleto y se acredita
|
|
24
|
-
* igual. Exigirlos convertiría esa ventana en un 400 que deja al cliente sin bono.
|
|
21
|
+
* Todos los campos son opcionales: un caller que no los manda abre el asiento igual, incompleto.
|
|
25
22
|
*/
|
|
26
23
|
class WelcomeAccreditationRequest {
|
|
27
24
|
}
|
|
@@ -29,7 +26,7 @@ exports.WelcomeAccreditationRequest = WelcomeAccreditationRequest;
|
|
|
29
26
|
__decorate([
|
|
30
27
|
(0, class_transformer_1.Expose)(),
|
|
31
28
|
(0, class_validator_1.IsOptional)(),
|
|
32
|
-
|
|
29
|
+
(0, Trim_1.Trim)(),
|
|
33
30
|
(0, class_validator_1.IsString)(),
|
|
34
31
|
(0, class_validator_1.IsNotEmpty)(),
|
|
35
32
|
__metadata("design:type", String)
|
|
@@ -37,7 +34,7 @@ __decorate([
|
|
|
37
34
|
__decorate([
|
|
38
35
|
(0, class_transformer_1.Expose)(),
|
|
39
36
|
(0, class_validator_1.IsOptional)(),
|
|
40
|
-
|
|
37
|
+
(0, Trim_1.Trim)(),
|
|
41
38
|
(0, class_validator_1.IsString)(),
|
|
42
39
|
(0, class_validator_1.IsNotEmpty)(),
|
|
43
40
|
__metadata("design:type", String)
|
|
@@ -45,7 +42,7 @@ __decorate([
|
|
|
45
42
|
__decorate([
|
|
46
43
|
(0, class_transformer_1.Expose)(),
|
|
47
44
|
(0, class_validator_1.IsOptional)(),
|
|
48
|
-
|
|
45
|
+
(0, Trim_1.Trim)(),
|
|
49
46
|
(0, class_validator_1.IsString)(),
|
|
50
47
|
(0, class_validator_1.IsNotEmpty)(),
|
|
51
48
|
__metadata("design:type", String)
|
|
@@ -53,7 +50,7 @@ __decorate([
|
|
|
53
50
|
__decorate([
|
|
54
51
|
(0, class_transformer_1.Expose)(),
|
|
55
52
|
(0, class_validator_1.IsOptional)(),
|
|
56
|
-
|
|
53
|
+
(0, Trim_1.Trim)(),
|
|
57
54
|
(0, class_validator_1.IsString)(),
|
|
58
55
|
(0, class_validator_1.IsNotEmpty)(),
|
|
59
56
|
__metadata("design:type", String)
|
|
@@ -61,7 +58,7 @@ __decorate([
|
|
|
61
58
|
__decorate([
|
|
62
59
|
(0, class_transformer_1.Expose)(),
|
|
63
60
|
(0, class_validator_1.IsOptional)(),
|
|
64
|
-
|
|
61
|
+
(0, Trim_1.Trim)(),
|
|
65
62
|
(0, class_validator_1.IsString)(),
|
|
66
63
|
(0, class_validator_1.IsNotEmpty)(),
|
|
67
64
|
__metadata("design:type", String)
|
|
@@ -69,7 +66,7 @@ __decorate([
|
|
|
69
66
|
__decorate([
|
|
70
67
|
(0, class_transformer_1.Expose)(),
|
|
71
68
|
(0, class_validator_1.IsOptional)(),
|
|
72
|
-
|
|
69
|
+
(0, Trim_1.Trim)(),
|
|
73
70
|
(0, class_validator_1.IsString)(),
|
|
74
71
|
(0, class_validator_1.IsNotEmpty)(),
|
|
75
72
|
__metadata("design:type", String)
|
|
@@ -84,7 +81,7 @@ __decorate([
|
|
|
84
81
|
__decorate([
|
|
85
82
|
(0, class_transformer_1.Expose)(),
|
|
86
83
|
(0, class_validator_1.IsOptional)(),
|
|
87
|
-
|
|
84
|
+
(0, Trim_1.Trim)(),
|
|
88
85
|
(0, class_validator_1.IsString)(),
|
|
89
86
|
(0, class_validator_1.IsNotEmpty)(),
|
|
90
87
|
__metadata("design:type", String)
|
|
@@ -98,7 +95,7 @@ __decorate([
|
|
|
98
95
|
__decorate([
|
|
99
96
|
(0, class_transformer_1.Expose)(),
|
|
100
97
|
(0, class_validator_1.IsOptional)(),
|
|
101
|
-
|
|
98
|
+
(0, Trim_1.Trim)(),
|
|
102
99
|
(0, class_validator_1.IsString)(),
|
|
103
100
|
(0, class_validator_1.IsNotEmpty)(),
|
|
104
101
|
__metadata("design:type", String)
|
|
@@ -106,7 +103,7 @@ __decorate([
|
|
|
106
103
|
__decorate([
|
|
107
104
|
(0, class_transformer_1.Expose)(),
|
|
108
105
|
(0, class_validator_1.IsOptional)(),
|
|
109
|
-
|
|
106
|
+
(0, Trim_1.Trim)(),
|
|
110
107
|
(0, class_validator_1.IsString)(),
|
|
111
108
|
(0, class_validator_1.IsNotEmpty)(),
|
|
112
109
|
__metadata("design:type", String)
|
|
@@ -6,12 +6,20 @@ import { WelcomeBonusStatusEnum } from '../../enums/WelcomeBonusStatusEnum';
|
|
|
6
6
|
* `FAILED` libera el candado `welcomeAccredited` para que la venta se reintente. `UNVERIFIED` lo deja
|
|
7
7
|
* tomado: el `walletFundingCredit` del processor no deduplica, así que liberar tras un timeout podría
|
|
8
8
|
* acreditar plata real dos veces.
|
|
9
|
+
*
|
|
10
|
+
* Un asiento `UNVERIFIED` se cierra después con `ACCREDITED` o `FAILED` mandando además `reconciledBy`
|
|
11
|
+
* y `reconciliationReason` — ese par es lo que marca el cierre como reconciliación.
|
|
9
12
|
*/
|
|
10
13
|
export declare class WelcomeAccreditationResultRequest {
|
|
11
14
|
/** Referencia opaca del asiento, tal como la devolvió la reserva. */
|
|
12
15
|
bonusKey: string;
|
|
13
16
|
status: WelcomeBonusStatusEnum;
|
|
14
17
|
processorTransactionId?: string;
|
|
18
|
+
/** Motivo legible del fallo — un resumen, NO el payload crudo del processor (el libro va sin PII). */
|
|
15
19
|
failReason?: string;
|
|
16
20
|
providerName?: string;
|
|
21
|
+
/** Quién cierra a mano un asiento `UNVERIFIED`. Va junto con `reconciliationReason`. */
|
|
22
|
+
reconciledBy?: string;
|
|
23
|
+
/** Por qué se cerró a mano — un resumen, NO el payload crudo del processor. */
|
|
24
|
+
reconciliationReason?: string;
|
|
17
25
|
}
|
|
@@ -12,9 +12,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.WelcomeAccreditationResultRequest = void 0;
|
|
13
13
|
const class_transformer_1 = require("class-transformer");
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
|
+
const Trim_1 = require("../../../common/decorators/Trim");
|
|
15
16
|
const WelcomeBonusStatusEnum_1 = require("../../enums/WelcomeBonusStatusEnum");
|
|
16
|
-
/**
|
|
17
|
-
const
|
|
17
|
+
/** Tope de los textos libres que el caller escribe en el asiento. */
|
|
18
|
+
const FREE_TEXT_MAX_LENGTH = 256;
|
|
18
19
|
/** Resultados que el caller puede asentar. `PENDING` lo escribe el server al reservar, no el caller. */
|
|
19
20
|
const RESULT_STATUSES = [
|
|
20
21
|
WelcomeBonusStatusEnum_1.WelcomeBonusStatusEnum.ACCREDITED,
|
|
@@ -33,13 +34,16 @@ const STATUSES_REQUIRING_REASON = [
|
|
|
33
34
|
* `FAILED` libera el candado `welcomeAccredited` para que la venta se reintente. `UNVERIFIED` lo deja
|
|
34
35
|
* tomado: el `walletFundingCredit` del processor no deduplica, así que liberar tras un timeout podría
|
|
35
36
|
* acreditar plata real dos veces.
|
|
37
|
+
*
|
|
38
|
+
* Un asiento `UNVERIFIED` se cierra después con `ACCREDITED` o `FAILED` mandando además `reconciledBy`
|
|
39
|
+
* y `reconciliationReason` — ese par es lo que marca el cierre como reconciliación.
|
|
36
40
|
*/
|
|
37
41
|
class WelcomeAccreditationResultRequest {
|
|
38
42
|
}
|
|
39
43
|
exports.WelcomeAccreditationResultRequest = WelcomeAccreditationResultRequest;
|
|
40
44
|
__decorate([
|
|
41
45
|
(0, class_transformer_1.Expose)(),
|
|
42
|
-
|
|
46
|
+
(0, Trim_1.Trim)(),
|
|
43
47
|
(0, class_validator_1.IsString)(),
|
|
44
48
|
(0, class_validator_1.IsNotEmpty)(),
|
|
45
49
|
__metadata("design:type", String)
|
|
@@ -52,7 +56,7 @@ __decorate([
|
|
|
52
56
|
__decorate([
|
|
53
57
|
(0, class_transformer_1.Expose)(),
|
|
54
58
|
(0, class_validator_1.ValidateIf)((o) => o.status === WelcomeBonusStatusEnum_1.WelcomeBonusStatusEnum.ACCREDITED),
|
|
55
|
-
|
|
59
|
+
(0, Trim_1.Trim)(),
|
|
56
60
|
(0, class_validator_1.IsString)(),
|
|
57
61
|
(0, class_validator_1.IsNotEmpty)({ message: 'processorTransactionId es obligatorio cuando status es ACCREDITED' }),
|
|
58
62
|
__metadata("design:type", String)
|
|
@@ -60,16 +64,35 @@ __decorate([
|
|
|
60
64
|
__decorate([
|
|
61
65
|
(0, class_transformer_1.Expose)(),
|
|
62
66
|
(0, class_validator_1.ValidateIf)((o) => STATUSES_REQUIRING_REASON.includes(o.status)),
|
|
63
|
-
|
|
67
|
+
(0, Trim_1.Trim)(),
|
|
64
68
|
(0, class_validator_1.IsString)(),
|
|
65
69
|
(0, class_validator_1.IsNotEmpty)({ message: 'failReason es obligatorio cuando status es FAILED o UNVERIFIED' }),
|
|
70
|
+
(0, class_validator_1.MaxLength)(FREE_TEXT_MAX_LENGTH),
|
|
66
71
|
__metadata("design:type", String)
|
|
67
72
|
], WelcomeAccreditationResultRequest.prototype, "failReason", void 0);
|
|
68
73
|
__decorate([
|
|
69
74
|
(0, class_transformer_1.Expose)(),
|
|
70
75
|
(0, class_validator_1.IsOptional)(),
|
|
71
|
-
|
|
76
|
+
(0, Trim_1.Trim)(),
|
|
72
77
|
(0, class_validator_1.IsString)(),
|
|
73
78
|
(0, class_validator_1.IsNotEmpty)(),
|
|
74
79
|
__metadata("design:type", String)
|
|
75
80
|
], WelcomeAccreditationResultRequest.prototype, "providerName", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, class_transformer_1.Expose)(),
|
|
83
|
+
(0, class_validator_1.ValidateIf)((o) => o.reconciliationReason !== undefined),
|
|
84
|
+
(0, Trim_1.Trim)(),
|
|
85
|
+
(0, class_validator_1.IsString)(),
|
|
86
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'reconciledBy es obligatorio en un cierre de reconciliación' }),
|
|
87
|
+
(0, class_validator_1.MaxLength)(FREE_TEXT_MAX_LENGTH),
|
|
88
|
+
__metadata("design:type", String)
|
|
89
|
+
], WelcomeAccreditationResultRequest.prototype, "reconciledBy", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
(0, class_transformer_1.Expose)(),
|
|
92
|
+
(0, class_validator_1.ValidateIf)((o) => o.reconciledBy !== undefined),
|
|
93
|
+
(0, Trim_1.Trim)(),
|
|
94
|
+
(0, class_validator_1.IsString)(),
|
|
95
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'reconciliationReason es obligatorio en un cierre de reconciliación' }),
|
|
96
|
+
(0, class_validator_1.MaxLength)(FREE_TEXT_MAX_LENGTH),
|
|
97
|
+
__metadata("design:type", String)
|
|
98
|
+
], WelcomeAccreditationResultRequest.prototype, "reconciliationReason", void 0);
|
|
@@ -31,6 +31,10 @@ export interface WelcomeBonusResponse {
|
|
|
31
31
|
failReason: string | null;
|
|
32
32
|
requestedAt: string;
|
|
33
33
|
resolvedAt: string | null;
|
|
34
|
+
/** Instante del cierre de reconciliación. No nulo = el asiento se cerró a mano, no por el flujo. */
|
|
35
|
+
reconciledAt: string | null;
|
|
36
|
+
reconciledBy: string | null;
|
|
37
|
+
reconciliationReason: string | null;
|
|
34
38
|
processorTransactionId: string | null;
|
|
35
39
|
idempotencyKey: string | null;
|
|
36
40
|
providerName: string | null;
|
|
@@ -22,10 +22,15 @@ export interface WizardBlocked {
|
|
|
22
22
|
since: string;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
|
-
* Lo
|
|
26
|
-
* fuera `code` y `detail`, que son de soporte y admin.
|
|
25
|
+
* Lo del bloqueo que puede viajar al navegador del vendedor: qué pantalla toca, la etiqueta y el
|
|
26
|
+
* «hace N días». Deja fuera `code` y `detail`, que son de soporte y admin.
|
|
27
27
|
*/
|
|
28
28
|
export interface WizardBlockedSummary {
|
|
29
|
+
/**
|
|
30
|
+
* Cuál de las dos pantallas del paso 02 toca: la espera, o «no se pudo abrir». Opcional: la ficha
|
|
31
|
+
* de Prospectos no lo manda, y un consumidor que no lo conoce sigue leyendo `category`.
|
|
32
|
+
*/
|
|
33
|
+
reason?: BlockedReasonEnum;
|
|
29
34
|
category: BlockedCategoryEnum | null;
|
|
30
35
|
/** ISO 8601, copiado tal cual de `WizardBlocked.since`. */
|
|
31
36
|
since: string;
|
|
@@ -4,7 +4,7 @@ import type { FiadoPhoneStatusEnum } from '../enums/FiadoPhoneStatusEnum';
|
|
|
4
4
|
import type { PaymentMethodEnum } from '../enums/PaymentMethodEnum';
|
|
5
5
|
import type { ExternalProviderEnum } from '../enums/ExternalProviderEnum';
|
|
6
6
|
import type { OccupationEnum } from '../enums/OccupationEnum';
|
|
7
|
-
import type {
|
|
7
|
+
import type { WizardBlockedSummary } from './WizardBlocked';
|
|
8
8
|
import type { WizardConsents } from './WizardConsents';
|
|
9
9
|
import type { WizardLoan } from './WizardLoan';
|
|
10
10
|
import type { WizardPayment } from './WizardPayment';
|
|
@@ -94,12 +94,11 @@ export interface WizardSession {
|
|
|
94
94
|
accountOpened: boolean;
|
|
95
95
|
accountStatus: AccountStatus | null;
|
|
96
96
|
/**
|
|
97
|
-
* La venta está detenida esperando la cuenta.
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
* Opcional por lo mismo que `resumeOtpRequired`. Ausente o `null` = la venta va bien.
|
|
97
|
+
* La venta está detenida esperando la cuenta. Resumen y no el bloqueo entero: el motivo crudo del
|
|
98
|
+
* emisor puede nombrar una coincidencia en listas de PLD, y avisarlo es delito — se sirve por su
|
|
99
|
+
* propio endpoint con permiso. Ausente o `null` = la venta va bien.
|
|
101
100
|
*/
|
|
102
|
-
blocked?:
|
|
101
|
+
blocked?: WizardBlockedSummary | null;
|
|
103
102
|
reservedSku: string | null;
|
|
104
103
|
reservedImei: string | null;
|
|
105
104
|
/**
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CancelFundingReferenceRequest = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class CancelFundingReferenceRequest {
|
|
15
|
+
}
|
|
16
|
+
exports.CancelFundingReferenceRequest = CancelFundingReferenceRequest;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.IsString)(),
|
|
19
|
+
(0, class_validator_1.MaxLength)(64),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], CancelFundingReferenceRequest.prototype, "reference", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_validator_1.IsString)(),
|
|
24
|
+
(0, class_validator_1.MaxLength)(64),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], CancelFundingReferenceRequest.prototype, "directoryId", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, class_validator_1.IsString)(),
|
|
29
|
+
(0, class_validator_1.MaxLength)(64),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], CancelFundingReferenceRequest.prototype, "idempotencyKey", void 0);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BenefitPaymentStatusEnum } from "../../benefitCenter/enums/BenefitPaymentStatusEnum";
|
|
2
|
+
import { WalletFundingErrorCodeEnum } from "../enums/WalletFundingErrorCodeEnum";
|
|
3
|
+
export declare class CancelFundingReferenceResponse {
|
|
4
|
+
reference: string;
|
|
5
|
+
status: BenefitPaymentStatusEnum;
|
|
6
|
+
errorCode?: WalletFundingErrorCodeEnum;
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Request del cancel via Centro de Beneficios (spec 13 v2.0).
|
|
3
|
+
* `reference` viaja en el path, `directoryId` se resuelve del JWT.
|
|
4
|
+
* `providerModuleName` permite al marketplace rutear al publisher correcto
|
|
5
|
+
* sin tener que persistir el mapping (el wallet-app sabe el moduleName
|
|
6
|
+
* porque vino en la respuesta del authorize).
|
|
7
|
+
*/
|
|
8
|
+
export declare class CancelFundingRequest {
|
|
9
|
+
idempotencyKey: string;
|
|
10
|
+
providerModuleName: string;
|
|
11
|
+
}
|