@fiado/type-kit 3.534.0 → 3.536.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/retailWizard/otherStoreSale.test.ts +54 -0
- package/_test_/unit/retailWizard/sessionFinanciersShapes.test.ts +26 -0
- package/bin/retailWizard/dtos/WizardSession.d.ts +5 -0
- package/bin/retailWizard/dtos/requests/CancelOtherStoreSaleRequest.d.ts +9 -0
- package/bin/retailWizard/dtos/requests/CancelOtherStoreSaleRequest.js +34 -0
- package/bin/retailWizard/dtos/responses/ActiveSessionByPhoneResponse.d.ts +5 -0
- package/bin/retailWizard/dtos/responses/CancelOtherStoreSaleResponse.d.ts +7 -0
- package/bin/retailWizard/dtos/responses/CancelOtherStoreSaleResponse.js +2 -0
- package/bin/retailWizard/dtos/responses/SessionFinanciersResponse.d.ts +4 -1
- package/bin/retailWizard/enums/FinancierIneligibleReasonEnum.d.ts +5 -0
- package/bin/retailWizard/enums/FinancierIneligibleReasonEnum.js +9 -0
- package/bin/retailWizard/enums/MoneyAtStakeKindEnum.d.ts +9 -0
- package/bin/retailWizard/enums/MoneyAtStakeKindEnum.js +13 -0
- package/bin/retailWizard/enums/SystemCancelReasonEnum.d.ts +7 -2
- package/bin/retailWizard/enums/SystemCancelReasonEnum.js +6 -1
- package/bin/retailWizard/index.d.ts +4 -0
- package/bin/retailWizard/index.js +4 -0
- package/package.json +1 -1
- package/src/retailWizard/dtos/WizardSession.ts +5 -0
- package/src/retailWizard/dtos/requests/CancelOtherStoreSaleRequest.ts +20 -0
- package/src/retailWizard/dtos/responses/ActiveSessionByPhoneResponse.ts +5 -0
- package/src/retailWizard/dtos/responses/CancelOtherStoreSaleResponse.ts +7 -0
- package/src/retailWizard/dtos/responses/SessionFinanciersResponse.ts +4 -1
- package/src/retailWizard/enums/FinancierIneligibleReasonEnum.ts +5 -0
- package/src/retailWizard/enums/MoneyAtStakeKindEnum.ts +9 -0
- package/src/retailWizard/enums/SystemCancelReasonEnum.ts +6 -1
- package/src/retailWizard/index.ts +4 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { plainToInstance } from 'class-transformer';
|
|
3
|
+
import { validate } from 'class-validator';
|
|
4
|
+
import {
|
|
5
|
+
CancelOtherStoreSaleRequest,
|
|
6
|
+
SystemCancelReasonEnum,
|
|
7
|
+
type ActiveSessionByPhoneResponse,
|
|
8
|
+
type CancelOtherStoreSaleResponse,
|
|
9
|
+
type WizardSession,
|
|
10
|
+
} from '../../../src/retailWizard';
|
|
11
|
+
|
|
12
|
+
async function errorsOf(body: Record<string, unknown>): Promise<string[]> {
|
|
13
|
+
const errors = await validate(plainToInstance(CancelOtherStoreSaleRequest, body));
|
|
14
|
+
return errors.map((e) => e.property);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
describe('SystemCancelReasonEnum', () => {
|
|
18
|
+
it('names the cancel when another store takes the customer over', () => {
|
|
19
|
+
expect(SystemCancelReasonEnum.TAKEN_OVER_BY_OTHER_STORE).toBe('TAKEN_OVER_BY_OTHER_STORE');
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
describe('CancelOtherStoreSaleRequest', () => {
|
|
24
|
+
it('accepts a phone and a reason of at least 10 characters', async () => {
|
|
25
|
+
expect(await errorsOf({ phone: '5512345678', reason: 'El cliente compra aquí' })).toEqual([]);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('the reason is mandatory and meaningful', async () => {
|
|
29
|
+
expect(await errorsOf({ phone: '5512345678' })).toContain('reason');
|
|
30
|
+
expect(await errorsOf({ phone: '5512345678', reason: 'corto' })).toContain('reason');
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('the phone is mandatory', async () => {
|
|
34
|
+
expect(await errorsOf({ reason: 'El cliente compra aquí' })).toContain('phone');
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
describe('cash-only sale', () => {
|
|
39
|
+
it('WizardSession and the sale by phone carry the cash-only mark', () => {
|
|
40
|
+
const session: Pick<WizardSession, 'cashOnly'> = { cashOnly: true };
|
|
41
|
+
const byPhone: Pick<ActiveSessionByPhoneResponse, 'cashOnly'> = { cashOnly: true };
|
|
42
|
+
const cancelled: CancelOtherStoreSaleResponse = { sessionId: 'S1', refundPendingCents: null };
|
|
43
|
+
expect([session.cashOnly, byPhone.cashOnly, cancelled.sessionId]).toEqual([true, true, 'S1']);
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
describe('MoneyAtStakeKindEnum', () => {
|
|
48
|
+
it('distinguishes a charged or closed sale from a quoted credit', async () => {
|
|
49
|
+
const { MoneyAtStakeKindEnum } = await import('../../../src/retailWizard');
|
|
50
|
+
expect(Object.values(MoneyAtStakeKindEnum)).toEqual(['SALE', 'CREDIT_QUOTED']);
|
|
51
|
+
const byPhone: Pick<ActiveSessionByPhoneResponse, 'moneyAtStakeKind'> = { moneyAtStakeKind: MoneyAtStakeKindEnum.CREDIT_QUOTED };
|
|
52
|
+
expect(byPhone.moneyAtStakeKind).toBe('CREDIT_QUOTED');
|
|
53
|
+
});
|
|
54
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { FinancierTypeEnum } from '../../../src/loanOfferings/enums/FinancierTypeEnum';
|
|
3
|
+
import {
|
|
4
|
+
FinancierIneligibleReasonEnum,
|
|
5
|
+
type SessionFinanciersResponse,
|
|
6
|
+
} from '../../../src/retailWizard';
|
|
7
|
+
|
|
8
|
+
describe('SessionFinanciersResponse', () => {
|
|
9
|
+
it('declara el motivo tipado de una financiera no elegible', () => {
|
|
10
|
+
const response: SessionFinanciersResponse = {
|
|
11
|
+
financiers: [
|
|
12
|
+
{
|
|
13
|
+
code: 'SUREKEEP',
|
|
14
|
+
name: 'SureKeep',
|
|
15
|
+
label: 'Nuestra financiera',
|
|
16
|
+
type: FinancierTypeEnum.INTERNAL,
|
|
17
|
+
displayOrder: 1,
|
|
18
|
+
externalRedirectUrl: null,
|
|
19
|
+
eligible: false,
|
|
20
|
+
ineligibleReason: FinancierIneligibleReasonEnum.ACTIVE_CREDIT,
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
};
|
|
24
|
+
expect(response.financiers[0].ineligibleReason).toBe('ACTIVE_CREDIT');
|
|
25
|
+
});
|
|
26
|
+
});
|
|
@@ -151,6 +151,11 @@ export interface WizardSession {
|
|
|
151
151
|
/** Prospecto vinculado (si la sesión se reanudó desde un prospecto): se cierra al cerrar la venta (D-prospecto). */
|
|
152
152
|
prospectId: string | null;
|
|
153
153
|
cancelReason: string | null;
|
|
154
|
+
/**
|
|
155
|
+
* Venta solo de contado: el cliente tiene una venta con dinero en juego en otra sucursal.
|
|
156
|
+
* Crédito y derivación se rechazan con `CREDIT_IN_PROGRESS_OTHER_STORE`. Ausente = venta completa.
|
|
157
|
+
*/
|
|
158
|
+
cashOnly?: boolean;
|
|
154
159
|
/** TTL DDB ~24h de inactividad (D14). */
|
|
155
160
|
ttlEpoch: number;
|
|
156
161
|
createdBy: string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* POST /wizard/phone-holder/cancel y /backoffice/phone-holder/cancel — el encargado de tienda o el
|
|
3
|
+
* Admin VL cancela la venta viva de otra sucursal que retiene al cliente. SureKeep — pista Retail.
|
|
4
|
+
*/
|
|
5
|
+
export declare class CancelOtherStoreSaleRequest {
|
|
6
|
+
/** Teléfono del cliente: la venta ajena no se expone, así que es la única llave. */
|
|
7
|
+
phone: string;
|
|
8
|
+
reason: string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
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.CancelOtherStoreSaleRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
/**
|
|
16
|
+
* POST /wizard/phone-holder/cancel y /backoffice/phone-holder/cancel — el encargado de tienda o el
|
|
17
|
+
* Admin VL cancela la venta viva de otra sucursal que retiene al cliente. SureKeep — pista Retail.
|
|
18
|
+
*/
|
|
19
|
+
class CancelOtherStoreSaleRequest {
|
|
20
|
+
}
|
|
21
|
+
exports.CancelOtherStoreSaleRequest = CancelOtherStoreSaleRequest;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_transformer_1.Expose)(),
|
|
24
|
+
(0, class_validator_1.IsString)(),
|
|
25
|
+
(0, class_validator_1.MaxLength)(20),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], CancelOtherStoreSaleRequest.prototype, "phone", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, class_transformer_1.Expose)(),
|
|
30
|
+
(0, class_validator_1.IsString)(),
|
|
31
|
+
(0, class_validator_1.MinLength)(10),
|
|
32
|
+
(0, class_validator_1.MaxLength)(200),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], CancelOtherStoreSaleRequest.prototype, "reason", void 0);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { MoneyAtStakeKindEnum } from '../../enums/MoneyAtStakeKindEnum';
|
|
1
2
|
import type { WizardStateEnum } from '../../enums/WizardStateEnum';
|
|
2
3
|
import type { WizardStepEnum } from '../../enums/WizardStepEnum';
|
|
3
4
|
import type { WizardBlockedSummary } from '../WizardBlocked';
|
|
@@ -32,4 +33,8 @@ export interface ActiveSessionByPhoneResponse {
|
|
|
32
33
|
exactUntil?: string | null;
|
|
33
34
|
/** La venta movió dinero u originó crédito: siempre se retoma la misma. */
|
|
34
35
|
moneyAtStake?: boolean;
|
|
36
|
+
/** Qué dinero retiene: SALE (folio, cobro o venta) o CREDIT_QUOTED (solo crédito cotizado); `null` = ninguno. */
|
|
37
|
+
moneyAtStakeKind?: MoneyAtStakeKindEnum | null;
|
|
38
|
+
/** Venta solo de contado (el cliente tiene una venta con dinero en otra sucursal). */
|
|
39
|
+
cashOnly?: boolean;
|
|
35
40
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Resultado de cancelar la venta de otra sucursal que retenía al cliente. SureKeep — pista Retail. */
|
|
2
|
+
export interface CancelOtherStoreSaleResponse {
|
|
3
|
+
/** Venta cancelada. */
|
|
4
|
+
sessionId: string;
|
|
5
|
+
/** Enganche cobrado que queda por reembolsar; `null` si no hubo cobro. */
|
|
6
|
+
refundPendingCents: number | null;
|
|
7
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FinancierTypeEnum } from '../../../loanOfferings/enums/FinancierTypeEnum';
|
|
2
|
+
import type { FinancierIneligibleReasonEnum } from '../../enums/FinancierIneligibleReasonEnum';
|
|
2
3
|
/**
|
|
3
4
|
* Una opción de financiamiento del paso 04 (pantalla forma de pago): la unión de las financieras
|
|
4
5
|
* ACTIVE del catálogo SOFOM (`loan-offerings GET /private/financiers/active` — display + orden)
|
|
@@ -14,8 +15,10 @@ export interface SessionFinancierOption {
|
|
|
14
15
|
displayOrder: number;
|
|
15
16
|
/** Solo EXTERNAL: URL de derivación. */
|
|
16
17
|
externalRedirectUrl: string | null;
|
|
17
|
-
/**
|
|
18
|
+
/** Se puede elegir: el producto la admite y, en INTERNAL, el cliente no tiene crédito vivo. */
|
|
18
19
|
eligible: boolean;
|
|
20
|
+
/** Por qué no se puede elegir; ausente cuando `eligible` es `true` o el motivo es el producto. */
|
|
21
|
+
ineligibleReason?: FinancierIneligibleReasonEnum;
|
|
19
22
|
}
|
|
20
23
|
/**
|
|
21
24
|
* GET /wizard/sessions/:id/financiers — las opciones de financiamiento del paso 04 para la sesión
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Por qué una financiera del paso «¿Cómo va a pagar?» no se puede elegir en esta venta. */
|
|
2
|
+
export declare enum FinancierIneligibleReasonEnum {
|
|
3
|
+
/** El cliente ya tiene un crédito vivo (por activar, al corriente o en mora): no se origina otro. */
|
|
4
|
+
ACTIVE_CREDIT = "ACTIVE_CREDIT"
|
|
5
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FinancierIneligibleReasonEnum = void 0;
|
|
4
|
+
/** Por qué una financiera del paso «¿Cómo va a pagar?» no se puede elegir en esta venta. */
|
|
5
|
+
var FinancierIneligibleReasonEnum;
|
|
6
|
+
(function (FinancierIneligibleReasonEnum) {
|
|
7
|
+
/** El cliente ya tiene un crédito vivo (por activar, al corriente o en mora): no se origina otro. */
|
|
8
|
+
FinancierIneligibleReasonEnum["ACTIVE_CREDIT"] = "ACTIVE_CREDIT";
|
|
9
|
+
})(FinancierIneligibleReasonEnum || (exports.FinancierIneligibleReasonEnum = FinancierIneligibleReasonEnum = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Qué dinero retiene la venta, para el texto de la ficha.
|
|
3
|
+
* SALE: hay folio, cobro o venta cerrada.
|
|
4
|
+
* CREDIT_QUOTED: solo hay un crédito cotizado (sin cobro).
|
|
5
|
+
*/
|
|
6
|
+
export declare enum MoneyAtStakeKindEnum {
|
|
7
|
+
SALE = "SALE",
|
|
8
|
+
CREDIT_QUOTED = "CREDIT_QUOTED"
|
|
9
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MoneyAtStakeKindEnum = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Qué dinero retiene la venta, para el texto de la ficha.
|
|
6
|
+
* SALE: hay folio, cobro o venta cerrada.
|
|
7
|
+
* CREDIT_QUOTED: solo hay un crédito cotizado (sin cobro).
|
|
8
|
+
*/
|
|
9
|
+
var MoneyAtStakeKindEnum;
|
|
10
|
+
(function (MoneyAtStakeKindEnum) {
|
|
11
|
+
MoneyAtStakeKindEnum["SALE"] = "SALE";
|
|
12
|
+
MoneyAtStakeKindEnum["CREDIT_QUOTED"] = "CREDIT_QUOTED";
|
|
13
|
+
})(MoneyAtStakeKindEnum || (exports.MoneyAtStakeKindEnum = MoneyAtStakeKindEnum = {}));
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* `cancelReason` que escribe el sistema (no el vendedor).
|
|
3
|
+
* SWEEP_CREDIT_DISCARDED: la saga cierra la venta cuyo crédito se descartó.
|
|
4
|
+
* TAKEN_OVER_BY_OTHER_STORE: otra tienda tomó al cliente y la venta no tenía dinero en juego.
|
|
5
|
+
*/
|
|
2
6
|
export declare enum SystemCancelReasonEnum {
|
|
3
|
-
SWEEP_CREDIT_DISCARDED = "SWEEP_CREDIT_DISCARDED"
|
|
7
|
+
SWEEP_CREDIT_DISCARDED = "SWEEP_CREDIT_DISCARDED",
|
|
8
|
+
TAKEN_OVER_BY_OTHER_STORE = "TAKEN_OVER_BY_OTHER_STORE"
|
|
4
9
|
}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SystemCancelReasonEnum = void 0;
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* `cancelReason` que escribe el sistema (no el vendedor).
|
|
6
|
+
* SWEEP_CREDIT_DISCARDED: la saga cierra la venta cuyo crédito se descartó.
|
|
7
|
+
* TAKEN_OVER_BY_OTHER_STORE: otra tienda tomó al cliente y la venta no tenía dinero en juego.
|
|
8
|
+
*/
|
|
5
9
|
var SystemCancelReasonEnum;
|
|
6
10
|
(function (SystemCancelReasonEnum) {
|
|
7
11
|
SystemCancelReasonEnum["SWEEP_CREDIT_DISCARDED"] = "SWEEP_CREDIT_DISCARDED";
|
|
12
|
+
SystemCancelReasonEnum["TAKEN_OVER_BY_OTHER_STORE"] = "TAKEN_OVER_BY_OTHER_STORE";
|
|
8
13
|
})(SystemCancelReasonEnum || (exports.SystemCancelReasonEnum = SystemCancelReasonEnum = {}));
|
|
@@ -19,9 +19,11 @@ export * from './enums/AccountStepStatusEnum';
|
|
|
19
19
|
export * from './enums/ResumeReasonEnum';
|
|
20
20
|
export * from './enums/ProspectResumeModeEnum';
|
|
21
21
|
export * from './enums/SystemCancelReasonEnum';
|
|
22
|
+
export * from './enums/MoneyAtStakeKindEnum';
|
|
22
23
|
export * from './enums/AppOnboardingStepEnum';
|
|
23
24
|
export * from './enums/AppOnboardingStepStatusEnum';
|
|
24
25
|
export * from './enums/BlockedReasonEnum';
|
|
26
|
+
export * from './enums/FinancierIneligibleReasonEnum';
|
|
25
27
|
export * from './enums/BlockedCategoryEnum';
|
|
26
28
|
export * from './enums/WizardLineStatusEnum';
|
|
27
29
|
export * from './enums/LinePaymentTypeEnum';
|
|
@@ -57,6 +59,7 @@ export * from './dtos/Prospect';
|
|
|
57
59
|
export * from './dtos/PaginatedResult';
|
|
58
60
|
export * from './dtos/requests/StartSessionRequest';
|
|
59
61
|
export * from './dtos/requests/CancelSessionRequest';
|
|
62
|
+
export * from './dtos/requests/CancelOtherStoreSaleRequest';
|
|
60
63
|
export * from './dtos/requests/VerifyOtpRequest';
|
|
61
64
|
export * from './dtos/requests/ResendOtpRequest';
|
|
62
65
|
export * from './dtos/requests/SkipOtpRequest';
|
|
@@ -108,6 +111,7 @@ export * from './dtos/responses/RegisterDeviceResponse';
|
|
|
108
111
|
export * from './dtos/responses/AccountStatusResponse';
|
|
109
112
|
export * from './dtos/responses/ActiveSessionByPhoneResponse';
|
|
110
113
|
export * from './dtos/responses/ProspectResumeResponse';
|
|
114
|
+
export * from './dtos/responses/CancelOtherStoreSaleResponse';
|
|
111
115
|
export * from './dtos/responses/ProspectByPhoneResponse';
|
|
112
116
|
export * from './dtos/responses/AppOnboardingResponse';
|
|
113
117
|
export * from './enums/SaleFinancierEnum';
|
|
@@ -38,9 +38,11 @@ __exportStar(require("./enums/AccountStepStatusEnum"), exports);
|
|
|
38
38
|
__exportStar(require("./enums/ResumeReasonEnum"), exports);
|
|
39
39
|
__exportStar(require("./enums/ProspectResumeModeEnum"), exports);
|
|
40
40
|
__exportStar(require("./enums/SystemCancelReasonEnum"), exports);
|
|
41
|
+
__exportStar(require("./enums/MoneyAtStakeKindEnum"), exports);
|
|
41
42
|
__exportStar(require("./enums/AppOnboardingStepEnum"), exports);
|
|
42
43
|
__exportStar(require("./enums/AppOnboardingStepStatusEnum"), exports);
|
|
43
44
|
__exportStar(require("./enums/BlockedReasonEnum"), exports);
|
|
45
|
+
__exportStar(require("./enums/FinancierIneligibleReasonEnum"), exports);
|
|
44
46
|
__exportStar(require("./enums/BlockedCategoryEnum"), exports);
|
|
45
47
|
__exportStar(require("./enums/WizardLineStatusEnum"), exports);
|
|
46
48
|
__exportStar(require("./enums/LinePaymentTypeEnum"), exports);
|
|
@@ -82,6 +84,7 @@ __exportStar(require("./dtos/PaginatedResult"), exports);
|
|
|
82
84
|
// Request DTOs (input validado por endpoint)
|
|
83
85
|
__exportStar(require("./dtos/requests/StartSessionRequest"), exports);
|
|
84
86
|
__exportStar(require("./dtos/requests/CancelSessionRequest"), exports);
|
|
87
|
+
__exportStar(require("./dtos/requests/CancelOtherStoreSaleRequest"), exports);
|
|
85
88
|
__exportStar(require("./dtos/requests/VerifyOtpRequest"), exports);
|
|
86
89
|
__exportStar(require("./dtos/requests/ResendOtpRequest"), exports);
|
|
87
90
|
__exportStar(require("./dtos/requests/SkipOtpRequest"), exports);
|
|
@@ -134,6 +137,7 @@ __exportStar(require("./dtos/responses/RegisterDeviceResponse"), exports);
|
|
|
134
137
|
__exportStar(require("./dtos/responses/AccountStatusResponse"), exports);
|
|
135
138
|
__exportStar(require("./dtos/responses/ActiveSessionByPhoneResponse"), exports);
|
|
136
139
|
__exportStar(require("./dtos/responses/ProspectResumeResponse"), exports);
|
|
140
|
+
__exportStar(require("./dtos/responses/CancelOtherStoreSaleResponse"), exports);
|
|
137
141
|
__exportStar(require("./dtos/responses/ProspectByPhoneResponse"), exports);
|
|
138
142
|
__exportStar(require("./dtos/responses/AppOnboardingResponse"), exports);
|
|
139
143
|
// ── F3 · Backoffice VentasLuga ────────────────────────────────────────────────
|
package/package.json
CHANGED
|
@@ -155,6 +155,11 @@ export interface WizardSession {
|
|
|
155
155
|
/** Prospecto vinculado (si la sesión se reanudó desde un prospecto): se cierra al cerrar la venta (D-prospecto). */
|
|
156
156
|
prospectId: string | null;
|
|
157
157
|
cancelReason: string | null;
|
|
158
|
+
/**
|
|
159
|
+
* Venta solo de contado: el cliente tiene una venta con dinero en juego en otra sucursal.
|
|
160
|
+
* Crédito y derivación se rechazan con `CREDIT_IN_PROGRESS_OTHER_STORE`. Ausente = venta completa.
|
|
161
|
+
*/
|
|
162
|
+
cashOnly?: boolean;
|
|
158
163
|
/** TTL DDB ~24h de inactividad (D14). */
|
|
159
164
|
ttlEpoch: number;
|
|
160
165
|
createdBy: string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsString, MaxLength, MinLength } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* POST /wizard/phone-holder/cancel y /backoffice/phone-holder/cancel — el encargado de tienda o el
|
|
6
|
+
* Admin VL cancela la venta viva de otra sucursal que retiene al cliente. SureKeep — pista Retail.
|
|
7
|
+
*/
|
|
8
|
+
export class CancelOtherStoreSaleRequest {
|
|
9
|
+
/** Teléfono del cliente: la venta ajena no se expone, así que es la única llave. */
|
|
10
|
+
@Expose()
|
|
11
|
+
@IsString()
|
|
12
|
+
@MaxLength(20)
|
|
13
|
+
phone!: string;
|
|
14
|
+
|
|
15
|
+
@Expose()
|
|
16
|
+
@IsString()
|
|
17
|
+
@MinLength(10)
|
|
18
|
+
@MaxLength(200)
|
|
19
|
+
reason!: string;
|
|
20
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { MoneyAtStakeKindEnum } from '../../enums/MoneyAtStakeKindEnum';
|
|
1
2
|
import type { WizardStateEnum } from '../../enums/WizardStateEnum';
|
|
2
3
|
import type { WizardStepEnum } from '../../enums/WizardStepEnum';
|
|
3
4
|
import type { WizardBlockedSummary } from '../WizardBlocked';
|
|
@@ -33,4 +34,8 @@ export interface ActiveSessionByPhoneResponse {
|
|
|
33
34
|
exactUntil?: string | null;
|
|
34
35
|
/** La venta movió dinero u originó crédito: siempre se retoma la misma. */
|
|
35
36
|
moneyAtStake?: boolean;
|
|
37
|
+
/** Qué dinero retiene: SALE (folio, cobro o venta) o CREDIT_QUOTED (solo crédito cotizado); `null` = ninguno. */
|
|
38
|
+
moneyAtStakeKind?: MoneyAtStakeKindEnum | null;
|
|
39
|
+
/** Venta solo de contado (el cliente tiene una venta con dinero en otra sucursal). */
|
|
40
|
+
cashOnly?: boolean;
|
|
36
41
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Resultado de cancelar la venta de otra sucursal que retenía al cliente. SureKeep — pista Retail. */
|
|
2
|
+
export interface CancelOtherStoreSaleResponse {
|
|
3
|
+
/** Venta cancelada. */
|
|
4
|
+
sessionId: string;
|
|
5
|
+
/** Enganche cobrado que queda por reembolsar; `null` si no hubo cobro. */
|
|
6
|
+
refundPendingCents: number | null;
|
|
7
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FinancierTypeEnum } from '../../../loanOfferings/enums/FinancierTypeEnum';
|
|
2
|
+
import type { FinancierIneligibleReasonEnum } from '../../enums/FinancierIneligibleReasonEnum';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Una opción de financiamiento del paso 04 (pantalla forma de pago): la unión de las financieras
|
|
@@ -15,8 +16,10 @@ export interface SessionFinancierOption {
|
|
|
15
16
|
displayOrder: number;
|
|
16
17
|
/** Solo EXTERNAL: URL de derivación. */
|
|
17
18
|
externalRedirectUrl: string | null;
|
|
18
|
-
/**
|
|
19
|
+
/** Se puede elegir: el producto la admite y, en INTERNAL, el cliente no tiene crédito vivo. */
|
|
19
20
|
eligible: boolean;
|
|
21
|
+
/** Por qué no se puede elegir; ausente cuando `eligible` es `true` o el motivo es el producto. */
|
|
22
|
+
ineligibleReason?: FinancierIneligibleReasonEnum;
|
|
20
23
|
}
|
|
21
24
|
|
|
22
25
|
/**
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Por qué una financiera del paso «¿Cómo va a pagar?» no se puede elegir en esta venta. */
|
|
2
|
+
export enum FinancierIneligibleReasonEnum {
|
|
3
|
+
/** El cliente ya tiene un crédito vivo (por activar, al corriente o en mora): no se origina otro. */
|
|
4
|
+
ACTIVE_CREDIT = 'ACTIVE_CREDIT',
|
|
5
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Qué dinero retiene la venta, para el texto de la ficha.
|
|
3
|
+
* SALE: hay folio, cobro o venta cerrada.
|
|
4
|
+
* CREDIT_QUOTED: solo hay un crédito cotizado (sin cobro).
|
|
5
|
+
*/
|
|
6
|
+
export enum MoneyAtStakeKindEnum {
|
|
7
|
+
SALE = 'SALE',
|
|
8
|
+
CREDIT_QUOTED = 'CREDIT_QUOTED',
|
|
9
|
+
}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* `cancelReason` que escribe el sistema (no el vendedor).
|
|
3
|
+
* SWEEP_CREDIT_DISCARDED: la saga cierra la venta cuyo crédito se descartó.
|
|
4
|
+
* TAKEN_OVER_BY_OTHER_STORE: otra tienda tomó al cliente y la venta no tenía dinero en juego.
|
|
5
|
+
*/
|
|
2
6
|
export enum SystemCancelReasonEnum {
|
|
3
7
|
SWEEP_CREDIT_DISCARDED = 'SWEEP_CREDIT_DISCARDED',
|
|
8
|
+
TAKEN_OVER_BY_OTHER_STORE = 'TAKEN_OVER_BY_OTHER_STORE',
|
|
4
9
|
}
|
|
@@ -22,9 +22,11 @@ export * from './enums/AccountStepStatusEnum';
|
|
|
22
22
|
export * from './enums/ResumeReasonEnum';
|
|
23
23
|
export * from './enums/ProspectResumeModeEnum';
|
|
24
24
|
export * from './enums/SystemCancelReasonEnum';
|
|
25
|
+
export * from './enums/MoneyAtStakeKindEnum';
|
|
25
26
|
export * from './enums/AppOnboardingStepEnum';
|
|
26
27
|
export * from './enums/AppOnboardingStepStatusEnum';
|
|
27
28
|
export * from './enums/BlockedReasonEnum';
|
|
29
|
+
export * from './enums/FinancierIneligibleReasonEnum';
|
|
28
30
|
export * from './enums/BlockedCategoryEnum';
|
|
29
31
|
export * from './enums/WizardLineStatusEnum';
|
|
30
32
|
export * from './enums/LinePaymentTypeEnum';
|
|
@@ -68,6 +70,7 @@ export * from './dtos/PaginatedResult';
|
|
|
68
70
|
// Request DTOs (input validado por endpoint)
|
|
69
71
|
export * from './dtos/requests/StartSessionRequest';
|
|
70
72
|
export * from './dtos/requests/CancelSessionRequest';
|
|
73
|
+
export * from './dtos/requests/CancelOtherStoreSaleRequest';
|
|
71
74
|
export * from './dtos/requests/VerifyOtpRequest';
|
|
72
75
|
export * from './dtos/requests/ResendOtpRequest';
|
|
73
76
|
export * from './dtos/requests/SkipOtpRequest';
|
|
@@ -121,6 +124,7 @@ export * from './dtos/responses/RegisterDeviceResponse';
|
|
|
121
124
|
export * from './dtos/responses/AccountStatusResponse';
|
|
122
125
|
export * from './dtos/responses/ActiveSessionByPhoneResponse';
|
|
123
126
|
export * from './dtos/responses/ProspectResumeResponse';
|
|
127
|
+
export * from './dtos/responses/CancelOtherStoreSaleResponse';
|
|
124
128
|
export * from './dtos/responses/ProspectByPhoneResponse';
|
|
125
129
|
export * from './dtos/responses/AppOnboardingResponse';
|
|
126
130
|
|