@fiado/type-kit 3.320.0 → 3.321.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/retailCustomer/welcomeBonusRequests.test.ts +0 -71
- package/bin/common/index.d.ts +0 -1
- package/bin/common/index.js +0 -2
- package/bin/identity/enums/SelfieSourceEnum.d.ts +10 -0
- package/bin/identity/enums/SelfieSourceEnum.js +14 -0
- package/bin/networkConnector/dtos/CreateProfileRequest.d.ts +4 -1
- package/bin/networkConnector/dtos/CreateProfileRequest.js +1 -1
- package/bin/networkConnector/dtos/ProfileResponse.d.ts +3 -0
- package/bin/networkConnector/dtos/UpdateProfileRequest.d.ts +0 -1
- package/bin/networkConnector/dtos/UpdateProfileRequest.js +0 -6
- package/bin/retailCards/dtos/requests/AssignCardRequest.d.ts +6 -0
- package/bin/retailCards/dtos/requests/AssignCardRequest.js +30 -0
- package/bin/retailCards/dtos/requests/CancelCardRequest.d.ts +5 -0
- package/bin/retailCards/dtos/requests/CancelCardRequest.js +22 -0
- package/bin/retailCards/dtos/responses/RetailCardResponse.d.ts +12 -0
- package/bin/retailCards/dtos/responses/RetailCardResponse.js +2 -0
- package/bin/retailCards/enums/CardBatchStatusEnum.d.ts +17 -0
- package/bin/retailCards/enums/CardBatchStatusEnum.js +21 -0
- package/bin/retailCards/enums/CardCancelReasonEnum.d.ts +13 -0
- package/bin/retailCards/enums/CardCancelReasonEnum.js +17 -0
- package/bin/retailCards/enums/RetailCardStatusEnum.d.ts +13 -0
- package/bin/retailCards/enums/RetailCardStatusEnum.js +17 -0
- package/bin/retailCards/events/RetailCardAssignedV1.d.ts +10 -0
- package/bin/retailCards/events/RetailCardAssignedV1.js +2 -0
- package/bin/retailCards/events/RetailCardCancelledV1.d.ts +9 -0
- package/bin/retailCards/events/RetailCardCancelledV1.js +2 -0
- package/bin/retailCards/events/RetailCardReleasedV1.d.ts +7 -0
- package/bin/retailCards/events/RetailCardReleasedV1.js +2 -0
- package/bin/retailCustomer/dtos/requests/WelcomeAccreditationRequest.d.ts +3 -1
- package/bin/retailCustomer/dtos/requests/WelcomeAccreditationRequest.js +14 -11
- package/bin/retailCustomer/dtos/requests/WelcomeAccreditationResultRequest.d.ts +0 -8
- package/bin/retailCustomer/dtos/requests/WelcomeAccreditationResultRequest.js +6 -29
- package/bin/retailCustomer/dtos/responses/WelcomeBonusResponse.d.ts +0 -4
- package/bin/retailWizard/dtos/WizardBlocked.d.ts +2 -7
- package/bin/retailWizard/dtos/WizardSession.d.ts +6 -5
- package/bin/retailWizard/dtos/requests/CompleteSaleRequest.d.ts +9 -0
- package/bin/retailWizard/dtos/requests/CompleteSaleRequest.js +29 -0
- package/bin/retailWizard/dtos/requests/MarkPcfCardDeliveredRequest.d.ts +4 -0
- package/bin/retailWizard/dtos/requests/MarkPcfCardDeliveredRequest.js +23 -0
- package/package.json +1 -1
- package/src/common/index.ts +0 -3
- package/src/networkConnector/dtos/CreateProfileRequest.ts +5 -2
- package/src/networkConnector/dtos/ProfileResponse.ts +3 -0
- package/src/networkConnector/dtos/UpdateProfileRequest.ts +2 -1
- package/src/retailCustomer/dtos/requests/WelcomeAccreditationRequest.ts +17 -12
- package/src/retailCustomer/dtos/requests/WelcomeAccreditationResultRequest.ts +9 -32
- package/src/retailCustomer/dtos/responses/WelcomeBonusResponse.ts +0 -4
- package/src/retailWizard/dtos/WizardBlocked.ts +2 -7
- package/src/retailWizard/dtos/WizardSession.ts +6 -5
- package/bin/common/decorators/Trim.d.ts +0 -5
- package/bin/common/decorators/Trim.js +0 -10
- package/src/common/decorators/Trim.ts +0 -8
|
@@ -131,77 +131,6 @@ 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
|
-
});
|
|
205
134
|
});
|
|
206
135
|
|
|
207
136
|
describe('enums del bono de bienvenida', () => {
|
package/bin/common/index.d.ts
CHANGED
package/bin/common/index.js
CHANGED
|
@@ -14,8 +14,6 @@ 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);
|
|
19
17
|
//dtos
|
|
20
18
|
__exportStar(require("./dtos/ProcessValidationResultDto"), exports);
|
|
21
19
|
//Enums
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Con qué criterio se resolvió cuál archivo de S3 es la selfie del usuario.
|
|
3
|
+
* Le dice al consumidor qué tan confiable es el match antes de mandarla a un facematch.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum SelfieSourceEnum {
|
|
6
|
+
/** Matcheó el verificationId de la verificación vigente en People. */
|
|
7
|
+
VERIFICATION = "VERIFICATION",
|
|
8
|
+
/** No hubo match por verificación: se tomó el archivo de selfie más reciente del bucket. */
|
|
9
|
+
LATEST = "LATEST"
|
|
10
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SelfieSourceEnum = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Con qué criterio se resolvió cuál archivo de S3 es la selfie del usuario.
|
|
6
|
+
* Le dice al consumidor qué tan confiable es el match antes de mandarla a un facematch.
|
|
7
|
+
*/
|
|
8
|
+
var SelfieSourceEnum;
|
|
9
|
+
(function (SelfieSourceEnum) {
|
|
10
|
+
/** Matcheó el verificationId de la verificación vigente en People. */
|
|
11
|
+
SelfieSourceEnum["VERIFICATION"] = "VERIFICATION";
|
|
12
|
+
/** No hubo match por verificación: se tomó el archivo de selfie más reciente del bucket. */
|
|
13
|
+
SelfieSourceEnum["LATEST"] = "LATEST";
|
|
14
|
+
})(SelfieSourceEnum || (exports.SelfieSourceEnum = SelfieSourceEnum = {}));
|
|
@@ -5,7 +5,10 @@ export declare class CreateProfileRequest {
|
|
|
5
5
|
company?: string;
|
|
6
6
|
slug: string;
|
|
7
7
|
directoryId: string;
|
|
8
|
-
|
|
8
|
+
/** Requerido desde DEC: se usa como llave para resolver el codigo de referido
|
|
9
|
+
* (IOnboardingBusinessApi.getByPhoneNumber) al crear el perfil. Inmutable tras la creacion
|
|
10
|
+
* (UpdateProfileRequest ya no acepta este campo). */
|
|
11
|
+
phone: string;
|
|
9
12
|
email?: string;
|
|
10
13
|
bio?: string;
|
|
11
14
|
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)(),
|
|
61
60
|
(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,6 +12,9 @@ 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;
|
|
15
18
|
status: ProfileStatusEnum;
|
|
16
19
|
directoryId: string;
|
|
17
20
|
createdAt: number;
|
|
@@ -54,12 +54,6 @@ __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);
|
|
63
57
|
__decorate([
|
|
64
58
|
(0, class_transformer_1.Expose)(),
|
|
65
59
|
(0, class_validator_1.IsOptional)(),
|
|
@@ -0,0 +1,30 @@
|
|
|
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.AssignCardRequest = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
/** Body de la asignación de una tarjeta física a un cliente. */
|
|
15
|
+
class AssignCardRequest {
|
|
16
|
+
}
|
|
17
|
+
exports.AssignCardRequest = AssignCardRequest;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, class_validator_1.IsString)(),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], AssignCardRequest.prototype, "assignedToCustomerId", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_validator_1.IsString)(),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], AssignCardRequest.prototype, "assignedByUserId", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, class_validator_1.IsOptional)(),
|
|
28
|
+
(0, class_validator_1.IsString)(),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], AssignCardRequest.prototype, "creditId", void 0);
|
|
@@ -0,0 +1,22 @@
|
|
|
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.CancelCardRequest = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const CardCancelReasonEnum_1 = require("../../enums/CardCancelReasonEnum");
|
|
15
|
+
/** Body de la cancelación (anulación) de una tarjeta física. */
|
|
16
|
+
class CancelCardRequest {
|
|
17
|
+
}
|
|
18
|
+
exports.CancelCardRequest = CancelCardRequest;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, class_validator_1.IsEnum)(CardCancelReasonEnum_1.CardCancelReasonEnum),
|
|
21
|
+
__metadata("design:type", String)
|
|
22
|
+
], CancelCardRequest.prototype, "reason", void 0);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RetailCardStatusEnum } from '../../enums/RetailCardStatusEnum';
|
|
2
|
+
/** Representación de una tarjeta física hacia el cliente. */
|
|
3
|
+
export interface RetailCardResponse {
|
|
4
|
+
cardNumber: string;
|
|
5
|
+
retailerId: string;
|
|
6
|
+
batchId: string;
|
|
7
|
+
storeId: string;
|
|
8
|
+
status: RetailCardStatusEnum;
|
|
9
|
+
assignedToCustomerId: string | null;
|
|
10
|
+
assignedAt: string | null;
|
|
11
|
+
assignedByUserId: string | null;
|
|
12
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Estado de un lote de tarjetas.
|
|
3
|
+
* @enum {string}
|
|
4
|
+
*
|
|
5
|
+
* @property {string} RECEIVING - Transitorio, carga en curso (DEC-004/DEC-008).
|
|
6
|
+
* @property {string} RECEIVED - Carga completada, lote atado a una tienda (happy-path F1).
|
|
7
|
+
* @property {string} FAILED - Terminal, la carga del lote falló (DEC-004/DEC-008).
|
|
8
|
+
* @property {string} DISTRIBUTED - Reservado F1 — lote centralizado repartido a varias tiendas (TD-008).
|
|
9
|
+
* @property {string} CLOSED - Reservado F1 — cierre manual del lote (TD-008).
|
|
10
|
+
*/
|
|
11
|
+
export declare enum CardBatchStatusEnum {
|
|
12
|
+
RECEIVING = "RECEIVING",
|
|
13
|
+
RECEIVED = "RECEIVED",
|
|
14
|
+
FAILED = "FAILED",
|
|
15
|
+
DISTRIBUTED = "DISTRIBUTED",
|
|
16
|
+
CLOSED = "CLOSED"
|
|
17
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CardBatchStatusEnum = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Estado de un lote de tarjetas.
|
|
6
|
+
* @enum {string}
|
|
7
|
+
*
|
|
8
|
+
* @property {string} RECEIVING - Transitorio, carga en curso (DEC-004/DEC-008).
|
|
9
|
+
* @property {string} RECEIVED - Carga completada, lote atado a una tienda (happy-path F1).
|
|
10
|
+
* @property {string} FAILED - Terminal, la carga del lote falló (DEC-004/DEC-008).
|
|
11
|
+
* @property {string} DISTRIBUTED - Reservado F1 — lote centralizado repartido a varias tiendas (TD-008).
|
|
12
|
+
* @property {string} CLOSED - Reservado F1 — cierre manual del lote (TD-008).
|
|
13
|
+
*/
|
|
14
|
+
var CardBatchStatusEnum;
|
|
15
|
+
(function (CardBatchStatusEnum) {
|
|
16
|
+
CardBatchStatusEnum["RECEIVING"] = "RECEIVING";
|
|
17
|
+
CardBatchStatusEnum["RECEIVED"] = "RECEIVED";
|
|
18
|
+
CardBatchStatusEnum["FAILED"] = "FAILED";
|
|
19
|
+
CardBatchStatusEnum["DISTRIBUTED"] = "DISTRIBUTED";
|
|
20
|
+
CardBatchStatusEnum["CLOSED"] = "CLOSED";
|
|
21
|
+
})(CardBatchStatusEnum || (exports.CardBatchStatusEnum = CardBatchStatusEnum = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Motivo de cancelación de una tarjeta física.
|
|
3
|
+
* @enum {string}
|
|
4
|
+
*
|
|
5
|
+
* @property {string} PLASTIC_DAMAGED - Plástico dañado.
|
|
6
|
+
* @property {string} LOST - Tarjeta perdida.
|
|
7
|
+
* @property {string} THEFT_REPORTED - Robo reportado.
|
|
8
|
+
*/
|
|
9
|
+
export declare enum CardCancelReasonEnum {
|
|
10
|
+
PLASTIC_DAMAGED = "PLASTIC_DAMAGED",
|
|
11
|
+
LOST = "LOST",
|
|
12
|
+
THEFT_REPORTED = "THEFT_REPORTED"
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CardCancelReasonEnum = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Motivo de cancelación de una tarjeta física.
|
|
6
|
+
* @enum {string}
|
|
7
|
+
*
|
|
8
|
+
* @property {string} PLASTIC_DAMAGED - Plástico dañado.
|
|
9
|
+
* @property {string} LOST - Tarjeta perdida.
|
|
10
|
+
* @property {string} THEFT_REPORTED - Robo reportado.
|
|
11
|
+
*/
|
|
12
|
+
var CardCancelReasonEnum;
|
|
13
|
+
(function (CardCancelReasonEnum) {
|
|
14
|
+
CardCancelReasonEnum["PLASTIC_DAMAGED"] = "PLASTIC_DAMAGED";
|
|
15
|
+
CardCancelReasonEnum["LOST"] = "LOST";
|
|
16
|
+
CardCancelReasonEnum["THEFT_REPORTED"] = "THEFT_REPORTED";
|
|
17
|
+
})(CardCancelReasonEnum || (exports.CardCancelReasonEnum = CardCancelReasonEnum = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Estado de una tarjeta física individual.
|
|
3
|
+
* @enum {string}
|
|
4
|
+
*
|
|
5
|
+
* @property {string} AVAILABLE - Cargada en stock, disponible para asignar.
|
|
6
|
+
* @property {string} ASSIGNED - Asignada a un cliente.
|
|
7
|
+
* @property {string} CANCELLED - Anulada (plástico dañado, pérdida o robo). Estado terminal.
|
|
8
|
+
*/
|
|
9
|
+
export declare enum RetailCardStatusEnum {
|
|
10
|
+
AVAILABLE = "AVAILABLE",
|
|
11
|
+
ASSIGNED = "ASSIGNED",
|
|
12
|
+
CANCELLED = "CANCELLED"
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RetailCardStatusEnum = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Estado de una tarjeta física individual.
|
|
6
|
+
* @enum {string}
|
|
7
|
+
*
|
|
8
|
+
* @property {string} AVAILABLE - Cargada en stock, disponible para asignar.
|
|
9
|
+
* @property {string} ASSIGNED - Asignada a un cliente.
|
|
10
|
+
* @property {string} CANCELLED - Anulada (plástico dañado, pérdida o robo). Estado terminal.
|
|
11
|
+
*/
|
|
12
|
+
var RetailCardStatusEnum;
|
|
13
|
+
(function (RetailCardStatusEnum) {
|
|
14
|
+
RetailCardStatusEnum["AVAILABLE"] = "AVAILABLE";
|
|
15
|
+
RetailCardStatusEnum["ASSIGNED"] = "ASSIGNED";
|
|
16
|
+
RetailCardStatusEnum["CANCELLED"] = "CANCELLED";
|
|
17
|
+
})(RetailCardStatusEnum || (exports.RetailCardStatusEnum = RetailCardStatusEnum = {}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Emitido cuando una tarjeta se asigna a un cliente. */
|
|
2
|
+
export interface RetailCardAssignedV1 {
|
|
3
|
+
cardNumber: string;
|
|
4
|
+
retailerId: string;
|
|
5
|
+
storeId: string;
|
|
6
|
+
assignedToCustomerId: string;
|
|
7
|
+
assignedByUserId: string;
|
|
8
|
+
creditId?: string;
|
|
9
|
+
occurredAt: string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CardCancelReasonEnum } from '../enums/CardCancelReasonEnum';
|
|
2
|
+
/** Emitido cuando una tarjeta se cancela (anula). */
|
|
3
|
+
export interface RetailCardCancelledV1 {
|
|
4
|
+
cardNumber: string;
|
|
5
|
+
retailerId: string;
|
|
6
|
+
storeId: string;
|
|
7
|
+
reason: CardCancelReasonEnum;
|
|
8
|
+
occurredAt: string;
|
|
9
|
+
}
|
|
@@ -3,7 +3,9 @@ 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
|
-
*
|
|
6
|
+
* **TODOS los campos son opcionales a propósito.** El customer despliega antes que el wizard, así que
|
|
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.
|
|
7
9
|
*/
|
|
8
10
|
export declare class WelcomeAccreditationRequest {
|
|
9
11
|
/** Tienda donde se dio el bono — es la partición del asiento. */
|
|
@@ -12,13 +12,16 @@ 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");
|
|
16
15
|
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));
|
|
17
18
|
/**
|
|
18
19
|
* Datos de la venta que acompañan la reserva del bono de bienvenida (D33):
|
|
19
20
|
* `POST /private/customers/:id/welcome-accreditation`. SureKeep Fase 2 — pista Retail.
|
|
20
21
|
*
|
|
21
|
-
*
|
|
22
|
+
* **TODOS los campos son opcionales a propósito.** El customer despliega antes que el wizard, así que
|
|
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.
|
|
22
25
|
*/
|
|
23
26
|
class WelcomeAccreditationRequest {
|
|
24
27
|
}
|
|
@@ -26,7 +29,7 @@ exports.WelcomeAccreditationRequest = WelcomeAccreditationRequest;
|
|
|
26
29
|
__decorate([
|
|
27
30
|
(0, class_transformer_1.Expose)(),
|
|
28
31
|
(0, class_validator_1.IsOptional)(),
|
|
29
|
-
(
|
|
32
|
+
trim(),
|
|
30
33
|
(0, class_validator_1.IsString)(),
|
|
31
34
|
(0, class_validator_1.IsNotEmpty)(),
|
|
32
35
|
__metadata("design:type", String)
|
|
@@ -34,7 +37,7 @@ __decorate([
|
|
|
34
37
|
__decorate([
|
|
35
38
|
(0, class_transformer_1.Expose)(),
|
|
36
39
|
(0, class_validator_1.IsOptional)(),
|
|
37
|
-
(
|
|
40
|
+
trim(),
|
|
38
41
|
(0, class_validator_1.IsString)(),
|
|
39
42
|
(0, class_validator_1.IsNotEmpty)(),
|
|
40
43
|
__metadata("design:type", String)
|
|
@@ -42,7 +45,7 @@ __decorate([
|
|
|
42
45
|
__decorate([
|
|
43
46
|
(0, class_transformer_1.Expose)(),
|
|
44
47
|
(0, class_validator_1.IsOptional)(),
|
|
45
|
-
(
|
|
48
|
+
trim(),
|
|
46
49
|
(0, class_validator_1.IsString)(),
|
|
47
50
|
(0, class_validator_1.IsNotEmpty)(),
|
|
48
51
|
__metadata("design:type", String)
|
|
@@ -50,7 +53,7 @@ __decorate([
|
|
|
50
53
|
__decorate([
|
|
51
54
|
(0, class_transformer_1.Expose)(),
|
|
52
55
|
(0, class_validator_1.IsOptional)(),
|
|
53
|
-
(
|
|
56
|
+
trim(),
|
|
54
57
|
(0, class_validator_1.IsString)(),
|
|
55
58
|
(0, class_validator_1.IsNotEmpty)(),
|
|
56
59
|
__metadata("design:type", String)
|
|
@@ -58,7 +61,7 @@ __decorate([
|
|
|
58
61
|
__decorate([
|
|
59
62
|
(0, class_transformer_1.Expose)(),
|
|
60
63
|
(0, class_validator_1.IsOptional)(),
|
|
61
|
-
(
|
|
64
|
+
trim(),
|
|
62
65
|
(0, class_validator_1.IsString)(),
|
|
63
66
|
(0, class_validator_1.IsNotEmpty)(),
|
|
64
67
|
__metadata("design:type", String)
|
|
@@ -66,7 +69,7 @@ __decorate([
|
|
|
66
69
|
__decorate([
|
|
67
70
|
(0, class_transformer_1.Expose)(),
|
|
68
71
|
(0, class_validator_1.IsOptional)(),
|
|
69
|
-
(
|
|
72
|
+
trim(),
|
|
70
73
|
(0, class_validator_1.IsString)(),
|
|
71
74
|
(0, class_validator_1.IsNotEmpty)(),
|
|
72
75
|
__metadata("design:type", String)
|
|
@@ -81,7 +84,7 @@ __decorate([
|
|
|
81
84
|
__decorate([
|
|
82
85
|
(0, class_transformer_1.Expose)(),
|
|
83
86
|
(0, class_validator_1.IsOptional)(),
|
|
84
|
-
(
|
|
87
|
+
trim(),
|
|
85
88
|
(0, class_validator_1.IsString)(),
|
|
86
89
|
(0, class_validator_1.IsNotEmpty)(),
|
|
87
90
|
__metadata("design:type", String)
|
|
@@ -95,7 +98,7 @@ __decorate([
|
|
|
95
98
|
__decorate([
|
|
96
99
|
(0, class_transformer_1.Expose)(),
|
|
97
100
|
(0, class_validator_1.IsOptional)(),
|
|
98
|
-
(
|
|
101
|
+
trim(),
|
|
99
102
|
(0, class_validator_1.IsString)(),
|
|
100
103
|
(0, class_validator_1.IsNotEmpty)(),
|
|
101
104
|
__metadata("design:type", String)
|
|
@@ -103,7 +106,7 @@ __decorate([
|
|
|
103
106
|
__decorate([
|
|
104
107
|
(0, class_transformer_1.Expose)(),
|
|
105
108
|
(0, class_validator_1.IsOptional)(),
|
|
106
|
-
(
|
|
109
|
+
trim(),
|
|
107
110
|
(0, class_validator_1.IsString)(),
|
|
108
111
|
(0, class_validator_1.IsNotEmpty)(),
|
|
109
112
|
__metadata("design:type", String)
|
|
@@ -6,20 +6,12 @@ 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.
|
|
12
9
|
*/
|
|
13
10
|
export declare class WelcomeAccreditationResultRequest {
|
|
14
11
|
/** Referencia opaca del asiento, tal como la devolvió la reserva. */
|
|
15
12
|
bonusKey: string;
|
|
16
13
|
status: WelcomeBonusStatusEnum;
|
|
17
14
|
processorTransactionId?: string;
|
|
18
|
-
/** Motivo legible del fallo — un resumen, NO el payload crudo del processor (el libro va sin PII). */
|
|
19
15
|
failReason?: string;
|
|
20
16
|
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;
|
|
25
17
|
}
|
|
@@ -12,10 +12,9 @@ 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");
|
|
16
15
|
const WelcomeBonusStatusEnum_1 = require("../../enums/WelcomeBonusStatusEnum");
|
|
17
|
-
/**
|
|
18
|
-
const
|
|
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));
|
|
19
18
|
/** Resultados que el caller puede asentar. `PENDING` lo escribe el server al reservar, no el caller. */
|
|
20
19
|
const RESULT_STATUSES = [
|
|
21
20
|
WelcomeBonusStatusEnum_1.WelcomeBonusStatusEnum.ACCREDITED,
|
|
@@ -34,16 +33,13 @@ const STATUSES_REQUIRING_REASON = [
|
|
|
34
33
|
* `FAILED` libera el candado `welcomeAccredited` para que la venta se reintente. `UNVERIFIED` lo deja
|
|
35
34
|
* tomado: el `walletFundingCredit` del processor no deduplica, así que liberar tras un timeout podría
|
|
36
35
|
* 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.
|
|
40
36
|
*/
|
|
41
37
|
class WelcomeAccreditationResultRequest {
|
|
42
38
|
}
|
|
43
39
|
exports.WelcomeAccreditationResultRequest = WelcomeAccreditationResultRequest;
|
|
44
40
|
__decorate([
|
|
45
41
|
(0, class_transformer_1.Expose)(),
|
|
46
|
-
(
|
|
42
|
+
trim(),
|
|
47
43
|
(0, class_validator_1.IsString)(),
|
|
48
44
|
(0, class_validator_1.IsNotEmpty)(),
|
|
49
45
|
__metadata("design:type", String)
|
|
@@ -56,7 +52,7 @@ __decorate([
|
|
|
56
52
|
__decorate([
|
|
57
53
|
(0, class_transformer_1.Expose)(),
|
|
58
54
|
(0, class_validator_1.ValidateIf)((o) => o.status === WelcomeBonusStatusEnum_1.WelcomeBonusStatusEnum.ACCREDITED),
|
|
59
|
-
(
|
|
55
|
+
trim(),
|
|
60
56
|
(0, class_validator_1.IsString)(),
|
|
61
57
|
(0, class_validator_1.IsNotEmpty)({ message: 'processorTransactionId es obligatorio cuando status es ACCREDITED' }),
|
|
62
58
|
__metadata("design:type", String)
|
|
@@ -64,35 +60,16 @@ __decorate([
|
|
|
64
60
|
__decorate([
|
|
65
61
|
(0, class_transformer_1.Expose)(),
|
|
66
62
|
(0, class_validator_1.ValidateIf)((o) => STATUSES_REQUIRING_REASON.includes(o.status)),
|
|
67
|
-
(
|
|
63
|
+
trim(),
|
|
68
64
|
(0, class_validator_1.IsString)(),
|
|
69
65
|
(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),
|
|
71
66
|
__metadata("design:type", String)
|
|
72
67
|
], WelcomeAccreditationResultRequest.prototype, "failReason", void 0);
|
|
73
68
|
__decorate([
|
|
74
69
|
(0, class_transformer_1.Expose)(),
|
|
75
70
|
(0, class_validator_1.IsOptional)(),
|
|
76
|
-
(
|
|
71
|
+
trim(),
|
|
77
72
|
(0, class_validator_1.IsString)(),
|
|
78
73
|
(0, class_validator_1.IsNotEmpty)(),
|
|
79
74
|
__metadata("design:type", String)
|
|
80
75
|
], 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,10 +31,6 @@ 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;
|
|
38
34
|
processorTransactionId: string | null;
|
|
39
35
|
idempotencyKey: string | null;
|
|
40
36
|
providerName: string | null;
|
|
@@ -22,15 +22,10 @@ export interface WizardBlocked {
|
|
|
22
22
|
since: string;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
|
-
* Lo del bloqueo que
|
|
26
|
-
*
|
|
25
|
+
* Lo mínimo del bloqueo que necesita la ficha de Prospectos: la etiqueta y el «hace N días». Deja
|
|
26
|
+
* 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;
|
|
34
29
|
category: BlockedCategoryEnum | null;
|
|
35
30
|
/** ISO 8601, copiado tal cual de `WizardBlocked.since`. */
|
|
36
31
|
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 { WizardBlocked } from './WizardBlocked';
|
|
8
8
|
import type { WizardConsents } from './WizardConsents';
|
|
9
9
|
import type { WizardLoan } from './WizardLoan';
|
|
10
10
|
import type { WizardPayment } from './WizardPayment';
|
|
@@ -94,11 +94,12 @@ export interface WizardSession {
|
|
|
94
94
|
accountOpened: boolean;
|
|
95
95
|
accountStatus: AccountStatus | null;
|
|
96
96
|
/**
|
|
97
|
-
* La venta está detenida esperando la cuenta.
|
|
98
|
-
*
|
|
99
|
-
*
|
|
97
|
+
* La venta está detenida esperando la cuenta. Es un campo y no un estado: `state` sigue `ACTIVE`,
|
|
98
|
+
* así el retorno, las mutaciones del paso 10 y los barridos de mantenimiento siguen corriendo.
|
|
99
|
+
*
|
|
100
|
+
* Opcional por lo mismo que `resumeOtpRequired`. Ausente o `null` = la venta va bien.
|
|
100
101
|
*/
|
|
101
|
-
blocked?:
|
|
102
|
+
blocked?: WizardBlocked | null;
|
|
102
103
|
reservedSku: string | null;
|
|
103
104
|
reservedImei: string | null;
|
|
104
105
|
/**
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* POST /wizard/sessions/:id/complete-sale — cierra la venta (saga de 2 pasos, flujo 09). Exige
|
|
3
|
+
* payment registrado (regla dura). Consume el IMEI del silo (SOLD), asigna la tarjeta PCF, persiste
|
|
4
|
+
* la Sale con `UNIQ#FOLIO` y emite el outbox `SaleCompletedV1` en la MISMA tx. Cierra el prospecto
|
|
5
|
+
* vinculado si lo hay. `cardNumber` = tarjeta física entregada en tienda (S7). SureKeep Fase 2 — pista Retail.
|
|
6
|
+
*/
|
|
7
|
+
export declare class CompleteSaleRequest {
|
|
8
|
+
cardNumber?: string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
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.CompleteSaleRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
/**
|
|
16
|
+
* POST /wizard/sessions/:id/complete-sale — cierra la venta (saga de 2 pasos, flujo 09). Exige
|
|
17
|
+
* payment registrado (regla dura). Consume el IMEI del silo (SOLD), asigna la tarjeta PCF, persiste
|
|
18
|
+
* la Sale con `UNIQ#FOLIO` y emite el outbox `SaleCompletedV1` en la MISMA tx. Cierra el prospecto
|
|
19
|
+
* vinculado si lo hay. `cardNumber` = tarjeta física entregada en tienda (S7). SureKeep Fase 2 — pista Retail.
|
|
20
|
+
*/
|
|
21
|
+
class CompleteSaleRequest {
|
|
22
|
+
}
|
|
23
|
+
exports.CompleteSaleRequest = CompleteSaleRequest;
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_transformer_1.Expose)(),
|
|
26
|
+
(0, class_validator_1.IsOptional)(),
|
|
27
|
+
(0, class_validator_1.IsString)(),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], CompleteSaleRequest.prototype, "cardNumber", void 0);
|
|
@@ -0,0 +1,23 @@
|
|
|
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.MarkPcfCardDeliveredRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
/** POST /wizard/sessions/:id/pcf-card/mark-delivered — marca la tarjeta física PCF como entregada (S7). SureKeep Fase 2 — pista Retail. */
|
|
16
|
+
class MarkPcfCardDeliveredRequest {
|
|
17
|
+
}
|
|
18
|
+
exports.MarkPcfCardDeliveredRequest = MarkPcfCardDeliveredRequest;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, class_transformer_1.Expose)(),
|
|
21
|
+
(0, class_validator_1.IsString)(),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], MarkPcfCardDeliveredRequest.prototype, "cardNumber", void 0);
|
package/package.json
CHANGED
package/src/common/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Expose } from 'class-transformer';
|
|
2
|
-
import { IsString, IsOptional, IsObject, MaxLength, MinLength } from 'class-validator';
|
|
2
|
+
import { IsString, IsOptional, IsNotEmpty, IsObject, MaxLength, MinLength } from 'class-validator';
|
|
3
3
|
|
|
4
4
|
export class CreateProfileRequest {
|
|
5
5
|
@Expose() @IsString() @MinLength(1) @MaxLength(100) firstName!: string;
|
|
@@ -8,7 +8,10 @@ export class CreateProfileRequest {
|
|
|
8
8
|
@Expose() @IsOptional() @IsString() @MaxLength(200) company?: string;
|
|
9
9
|
@Expose() @IsString() @MinLength(2) @MaxLength(100) slug!: string;
|
|
10
10
|
@Expose() @IsString() directoryId!: string;
|
|
11
|
-
|
|
11
|
+
/** Requerido desde DEC: se usa como llave para resolver el codigo de referido
|
|
12
|
+
* (IOnboardingBusinessApi.getByPhoneNumber) al crear el perfil. Inmutable tras la creacion
|
|
13
|
+
* (UpdateProfileRequest ya no acepta este campo). */
|
|
14
|
+
@Expose() @IsString() @IsNotEmpty() phone!: string;
|
|
12
15
|
@Expose() @IsOptional() @IsString() email?: string;
|
|
13
16
|
@Expose() @IsOptional() @IsString() @MaxLength(500) bio?: string;
|
|
14
17
|
@Expose() @IsOptional() @IsObject() socialLinks?: Record<string, string>;
|
|
@@ -13,6 +13,9 @@ export interface ProfileResponse {
|
|
|
13
13
|
logoUrl?: string;
|
|
14
14
|
bio?: string;
|
|
15
15
|
socialLinks?: Record<string, string>;
|
|
16
|
+
/** Codigo de referido del promotor (myReferralCode de Onboarding), resuelto por telefono al
|
|
17
|
+
* crear el perfil. null si el telefono no tiene codigo asociado en Onboarding. */
|
|
18
|
+
referralCode?: string | null;
|
|
16
19
|
status: ProfileStatusEnum;
|
|
17
20
|
directoryId: string;
|
|
18
21
|
createdAt: number;
|
|
@@ -8,7 +8,8 @@ export class UpdateProfileRequest {
|
|
|
8
8
|
@Expose() @IsOptional() @IsString() @MaxLength(200) title?: string;
|
|
9
9
|
@Expose() @IsOptional() @IsString() @MaxLength(200) company?: string;
|
|
10
10
|
@Expose() @IsOptional() @IsString() @MinLength(2) @MaxLength(100) slug?: string;
|
|
11
|
-
|
|
11
|
+
// phone es inmutable tras la creacion del perfil (queda asociado al numero con el que se
|
|
12
|
+
// creo la cuenta, usado para resolver el codigo de referido). No se acepta en Update.
|
|
12
13
|
@Expose() @IsOptional() @IsString() email?: string;
|
|
13
14
|
@Expose() @IsOptional() @IsString() @MaxLength(500) bio?: string;
|
|
14
15
|
@Expose() @IsOptional() @IsObject() socialLinks?: Record<string, string>;
|
|
@@ -1,26 +1,31 @@
|
|
|
1
|
-
import { Expose } from 'class-transformer';
|
|
1
|
+
import { Expose, Transform } from 'class-transformer';
|
|
2
2
|
import { IsEnum, IsInt, IsNotEmpty, IsOptional, IsPositive, IsString } from 'class-validator';
|
|
3
|
-
import { Trim } from '../../../common/decorators/Trim';
|
|
4
3
|
import { WelcomeBonusAmountSourceEnum } from '../../enums/WelcomeBonusAmountSourceEnum';
|
|
5
4
|
|
|
5
|
+
/** Recorta los strings del borde: un valor con espacios ensucia claves y cortes de conciliación. */
|
|
6
|
+
const trim = (): PropertyDecorator =>
|
|
7
|
+
Transform(({ value }) => (typeof value === 'string' ? value.trim() : value));
|
|
8
|
+
|
|
6
9
|
/**
|
|
7
10
|
* Datos de la venta que acompañan la reserva del bono de bienvenida (D33):
|
|
8
11
|
* `POST /private/customers/:id/welcome-accreditation`. SureKeep Fase 2 — pista Retail.
|
|
9
12
|
*
|
|
10
|
-
*
|
|
13
|
+
* **TODOS los campos son opcionales a propósito.** El customer despliega antes que el wizard, así que
|
|
14
|
+
* durante la ventana el wizard viejo sigue llamando sin body: el asiento nace incompleto y se acredita
|
|
15
|
+
* igual. Exigirlos convertiría esa ventana en un 400 que deja al cliente sin bono.
|
|
11
16
|
*/
|
|
12
17
|
export class WelcomeAccreditationRequest {
|
|
13
18
|
/** Tienda donde se dio el bono — es la partición del asiento. */
|
|
14
19
|
@Expose()
|
|
15
20
|
@IsOptional()
|
|
16
|
-
@
|
|
21
|
+
@trim()
|
|
17
22
|
@IsString()
|
|
18
23
|
@IsNotEmpty()
|
|
19
24
|
storeId?: string;
|
|
20
25
|
|
|
21
26
|
@Expose()
|
|
22
27
|
@IsOptional()
|
|
23
|
-
@
|
|
28
|
+
@trim()
|
|
24
29
|
@IsString()
|
|
25
30
|
@IsNotEmpty()
|
|
26
31
|
retailerId?: string;
|
|
@@ -28,14 +33,14 @@ export class WelcomeAccreditationRequest {
|
|
|
28
33
|
/** Vendedor que cerró la venta. */
|
|
29
34
|
@Expose()
|
|
30
35
|
@IsOptional()
|
|
31
|
-
@
|
|
36
|
+
@trim()
|
|
32
37
|
@IsString()
|
|
33
38
|
@IsNotEmpty()
|
|
34
39
|
sellerRetailUserId?: string;
|
|
35
40
|
|
|
36
41
|
@Expose()
|
|
37
42
|
@IsOptional()
|
|
38
|
-
@
|
|
43
|
+
@trim()
|
|
39
44
|
@IsString()
|
|
40
45
|
@IsNotEmpty()
|
|
41
46
|
saleId?: string;
|
|
@@ -43,14 +48,14 @@ export class WelcomeAccreditationRequest {
|
|
|
43
48
|
/** Folio de la venta, tal como lo ve el vendedor en el ticket. */
|
|
44
49
|
@Expose()
|
|
45
50
|
@IsOptional()
|
|
46
|
-
@
|
|
51
|
+
@trim()
|
|
47
52
|
@IsString()
|
|
48
53
|
@IsNotEmpty()
|
|
49
54
|
folio?: string;
|
|
50
55
|
|
|
51
56
|
@Expose()
|
|
52
57
|
@IsOptional()
|
|
53
|
-
@
|
|
58
|
+
@trim()
|
|
54
59
|
@IsString()
|
|
55
60
|
@IsNotEmpty()
|
|
56
61
|
wizardSessionId?: string;
|
|
@@ -64,7 +69,7 @@ export class WelcomeAccreditationRequest {
|
|
|
64
69
|
/** ISO-4217. Ausente ⇒ el server asienta `MXN`. */
|
|
65
70
|
@Expose()
|
|
66
71
|
@IsOptional()
|
|
67
|
-
@
|
|
72
|
+
@trim()
|
|
68
73
|
@IsString()
|
|
69
74
|
@IsNotEmpty()
|
|
70
75
|
currency?: string;
|
|
@@ -77,14 +82,14 @@ export class WelcomeAccreditationRequest {
|
|
|
77
82
|
/** Clave con la que el caller acredita en el processor — ata el asiento al movimiento de plata. */
|
|
78
83
|
@Expose()
|
|
79
84
|
@IsOptional()
|
|
80
|
-
@
|
|
85
|
+
@trim()
|
|
81
86
|
@IsString()
|
|
82
87
|
@IsNotEmpty()
|
|
83
88
|
idempotencyKey?: string;
|
|
84
89
|
|
|
85
90
|
@Expose()
|
|
86
91
|
@IsOptional()
|
|
87
|
-
@
|
|
92
|
+
@trim()
|
|
88
93
|
@IsString()
|
|
89
94
|
@IsNotEmpty()
|
|
90
95
|
providerName?: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Expose } from 'class-transformer';
|
|
2
|
-
import { IsIn, IsNotEmpty, IsOptional, IsString,
|
|
3
|
-
import { Trim } from '../../../common/decorators/Trim';
|
|
1
|
+
import { Expose, Transform } from 'class-transformer';
|
|
2
|
+
import { IsIn, IsNotEmpty, IsOptional, IsString, ValidateIf } from 'class-validator';
|
|
4
3
|
import { WelcomeBonusStatusEnum } from '../../enums/WelcomeBonusStatusEnum';
|
|
5
4
|
|
|
6
|
-
/**
|
|
7
|
-
const
|
|
5
|
+
/** Recorta los strings del borde: un valor con espacios ensucia claves y cortes de conciliación. */
|
|
6
|
+
const trim = (): PropertyDecorator =>
|
|
7
|
+
Transform(({ value }) => (typeof value === 'string' ? value.trim() : value));
|
|
8
8
|
|
|
9
9
|
/** Resultados que el caller puede asentar. `PENDING` lo escribe el server al reservar, no el caller. */
|
|
10
10
|
const RESULT_STATUSES = [
|
|
@@ -26,14 +26,11 @@ const STATUSES_REQUIRING_REASON: WelcomeBonusStatusEnum[] = [
|
|
|
26
26
|
* `FAILED` libera el candado `welcomeAccredited` para que la venta se reintente. `UNVERIFIED` lo deja
|
|
27
27
|
* tomado: el `walletFundingCredit` del processor no deduplica, así que liberar tras un timeout podría
|
|
28
28
|
* acreditar plata real dos veces.
|
|
29
|
-
*
|
|
30
|
-
* Un asiento `UNVERIFIED` se cierra después con `ACCREDITED` o `FAILED` mandando además `reconciledBy`
|
|
31
|
-
* y `reconciliationReason` — ese par es lo que marca el cierre como reconciliación.
|
|
32
29
|
*/
|
|
33
30
|
export class WelcomeAccreditationResultRequest {
|
|
34
31
|
/** Referencia opaca del asiento, tal como la devolvió la reserva. */
|
|
35
32
|
@Expose()
|
|
36
|
-
@
|
|
33
|
+
@trim()
|
|
37
34
|
@IsString()
|
|
38
35
|
@IsNotEmpty()
|
|
39
36
|
bonusKey!: string;
|
|
@@ -44,42 +41,22 @@ export class WelcomeAccreditationResultRequest {
|
|
|
44
41
|
|
|
45
42
|
@Expose()
|
|
46
43
|
@ValidateIf((o: WelcomeAccreditationResultRequest) => o.status === WelcomeBonusStatusEnum.ACCREDITED)
|
|
47
|
-
@
|
|
44
|
+
@trim()
|
|
48
45
|
@IsString()
|
|
49
46
|
@IsNotEmpty({ message: 'processorTransactionId es obligatorio cuando status es ACCREDITED' })
|
|
50
47
|
processorTransactionId?: string;
|
|
51
48
|
|
|
52
|
-
/** Motivo legible del fallo — un resumen, NO el payload crudo del processor (el libro va sin PII). */
|
|
53
49
|
@Expose()
|
|
54
50
|
@ValidateIf((o: WelcomeAccreditationResultRequest) => STATUSES_REQUIRING_REASON.includes(o.status))
|
|
55
|
-
@
|
|
51
|
+
@trim()
|
|
56
52
|
@IsString()
|
|
57
53
|
@IsNotEmpty({ message: 'failReason es obligatorio cuando status es FAILED o UNVERIFIED' })
|
|
58
|
-
@MaxLength(FREE_TEXT_MAX_LENGTH)
|
|
59
54
|
failReason?: string;
|
|
60
55
|
|
|
61
56
|
@Expose()
|
|
62
57
|
@IsOptional()
|
|
63
|
-
@
|
|
58
|
+
@trim()
|
|
64
59
|
@IsString()
|
|
65
60
|
@IsNotEmpty()
|
|
66
61
|
providerName?: string;
|
|
67
|
-
|
|
68
|
-
/** Quién cierra a mano un asiento `UNVERIFIED`. Va junto con `reconciliationReason`. */
|
|
69
|
-
@Expose()
|
|
70
|
-
@ValidateIf((o: WelcomeAccreditationResultRequest) => o.reconciliationReason !== undefined)
|
|
71
|
-
@Trim()
|
|
72
|
-
@IsString()
|
|
73
|
-
@IsNotEmpty({ message: 'reconciledBy es obligatorio en un cierre de reconciliación' })
|
|
74
|
-
@MaxLength(FREE_TEXT_MAX_LENGTH)
|
|
75
|
-
reconciledBy?: string;
|
|
76
|
-
|
|
77
|
-
/** Por qué se cerró a mano — un resumen, NO el payload crudo del processor. */
|
|
78
|
-
@Expose()
|
|
79
|
-
@ValidateIf((o: WelcomeAccreditationResultRequest) => o.reconciledBy !== undefined)
|
|
80
|
-
@Trim()
|
|
81
|
-
@IsString()
|
|
82
|
-
@IsNotEmpty({ message: 'reconciliationReason es obligatorio en un cierre de reconciliación' })
|
|
83
|
-
@MaxLength(FREE_TEXT_MAX_LENGTH)
|
|
84
|
-
reconciliationReason?: string;
|
|
85
62
|
}
|
|
@@ -32,10 +32,6 @@ export interface WelcomeBonusResponse {
|
|
|
32
32
|
failReason: string | null;
|
|
33
33
|
requestedAt: string;
|
|
34
34
|
resolvedAt: string | null;
|
|
35
|
-
/** Instante del cierre de reconciliación. No nulo = el asiento se cerró a mano, no por el flujo. */
|
|
36
|
-
reconciledAt: string | null;
|
|
37
|
-
reconciledBy: string | null;
|
|
38
|
-
reconciliationReason: string | null;
|
|
39
35
|
processorTransactionId: string | null;
|
|
40
36
|
idempotencyKey: string | null;
|
|
41
37
|
providerName: string | null;
|
|
@@ -24,15 +24,10 @@ export interface WizardBlocked {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
|
-
* Lo del bloqueo que
|
|
28
|
-
*
|
|
27
|
+
* Lo mínimo del bloqueo que necesita la ficha de Prospectos: la etiqueta y el «hace N días». Deja
|
|
28
|
+
* fuera `code` y `detail`, que son de soporte y admin.
|
|
29
29
|
*/
|
|
30
30
|
export interface WizardBlockedSummary {
|
|
31
|
-
/**
|
|
32
|
-
* Cuál de las dos pantallas del paso 02 toca: la espera, o «no se pudo abrir». Opcional: la ficha
|
|
33
|
-
* de Prospectos no lo manda, y un consumidor que no lo conoce sigue leyendo `category`.
|
|
34
|
-
*/
|
|
35
|
-
reason?: BlockedReasonEnum;
|
|
36
31
|
category: BlockedCategoryEnum | null;
|
|
37
32
|
/** ISO 8601, copiado tal cual de `WizardBlocked.since`. */
|
|
38
33
|
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 { WizardBlocked } from './WizardBlocked';
|
|
8
8
|
import type { WizardConsents } from './WizardConsents';
|
|
9
9
|
import type { WizardLoan } from './WizardLoan';
|
|
10
10
|
import type { WizardPayment } from './WizardPayment';
|
|
@@ -98,11 +98,12 @@ export interface WizardSession {
|
|
|
98
98
|
accountOpened: boolean;
|
|
99
99
|
accountStatus: AccountStatus | null;
|
|
100
100
|
/**
|
|
101
|
-
* La venta está detenida esperando la cuenta.
|
|
102
|
-
*
|
|
103
|
-
*
|
|
101
|
+
* La venta está detenida esperando la cuenta. Es un campo y no un estado: `state` sigue `ACTIVE`,
|
|
102
|
+
* así el retorno, las mutaciones del paso 10 y los barridos de mantenimiento siguen corriendo.
|
|
103
|
+
*
|
|
104
|
+
* Opcional por lo mismo que `resumeOtpRequired`. Ausente o `null` = la venta va bien.
|
|
104
105
|
*/
|
|
105
|
-
blocked?:
|
|
106
|
+
blocked?: WizardBlocked | null;
|
|
106
107
|
reservedSku: string | null;
|
|
107
108
|
reservedImei: string | null;
|
|
108
109
|
/**
|
|
@@ -1,10 +0,0 @@
|
|
|
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;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Transform } from 'class-transformer';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Recorta los espacios del borde de un string; deja pasar cualquier otro tipo sin tocarlo.
|
|
5
|
-
* Se aplica antes de los validadores, así que `' '` llega como `''` y `@IsNotEmpty` lo rechaza.
|
|
6
|
-
*/
|
|
7
|
-
export const Trim = (): PropertyDecorator =>
|
|
8
|
-
Transform(({ value }) => (typeof value === 'string' ? value.trim() : value));
|