@fiado/type-kit 3.490.0 → 3.492.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/loanCredit/customerPaymentDtos.test.ts +2 -0
- package/_test_/unit/loanCredit/dtos/createCustomerPaymentRequest.test.ts +18 -4
- package/_test_/unit/loanCredit/installmentPaidEvent.test.ts +17 -0
- package/_test_/unit/retailCommission/commissionPayout.test.ts +104 -0
- package/_test_/unit/retailCommission/commissionRent.test.ts +33 -0
- package/_test_/unit/retailCommission/commissionRules.test.ts +249 -0
- package/_test_/unit/retailCommission/commissionSimulation.test.ts +43 -0
- package/_test_/unit/retailCommission/myCommissions.test.ts +29 -0
- package/_test_/unit/retailLoan/paymentContract.test.ts +3 -1
- package/_test_/unit/retailWizard/ventaSagaMessages.test.ts +108 -11
- package/bin/loanCredit/dtos/InstallmentPaidEvent.d.ts +18 -0
- package/bin/loanCredit/dtos/InstallmentPaidEvent.js +5 -0
- package/bin/loanCredit/dtos/requests/CreateCustomerPaymentRequest.d.ts +3 -1
- package/bin/loanCredit/dtos/requests/CreateCustomerPaymentRequest.js +7 -0
- package/bin/loanCredit/dtos/responses/LoanCustomerPaymentOptions.d.ts +21 -2
- package/bin/loanCredit/dtos/responses/LoanCustomerPaymentResult.d.ts +2 -0
- package/bin/loanCredit/enums/LoanCustomerPaymentTypeEnum.d.ts +5 -1
- package/bin/loanCredit/enums/LoanCustomerPaymentTypeEnum.js +4 -0
- package/bin/loanCredit/index.d.ts +1 -0
- package/bin/loanCredit/index.js +1 -0
- package/bin/retailCommission/dtos/CommissionAccrual.d.ts +36 -0
- package/bin/retailCommission/dtos/CommissionApi.d.ts +241 -2
- package/bin/retailCommission/dtos/CommissionCalcTrace.d.ts +10 -0
- package/bin/retailCommission/dtos/CommissionCouponAccrual.d.ts +31 -0
- package/bin/retailCommission/dtos/CommissionCouponAccrual.js +2 -0
- package/bin/retailCommission/dtos/CommissionPayout.d.ts +84 -0
- package/bin/retailCommission/dtos/CommissionRule.d.ts +119 -0
- package/bin/retailCommission/dtos/CommissionRule.js +2 -0
- package/bin/retailCommission/enums/CommissionAggregateByEnum.d.ts +14 -0
- package/bin/retailCommission/enums/CommissionAggregateByEnum.js +18 -0
- package/bin/retailCommission/enums/CommissionBonusModeEnum.d.ts +10 -0
- package/bin/retailCommission/enums/CommissionBonusModeEnum.js +14 -0
- package/bin/retailCommission/enums/CommissionCalcStepEnum.d.ts +3 -1
- package/bin/retailCommission/enums/CommissionCalcStepEnum.js +2 -0
- package/bin/retailCommission/enums/CommissionMetricEnum.d.ts +14 -0
- package/bin/retailCommission/enums/CommissionMetricEnum.js +18 -0
- package/bin/retailCommission/enums/CommissionOperatorEnum.d.ts +15 -0
- package/bin/retailCommission/enums/CommissionOperatorEnum.js +19 -0
- package/bin/retailCommission/enums/CommissionRuleStatusEnum.d.ts +16 -0
- package/bin/retailCommission/enums/CommissionRuleStatusEnum.js +20 -0
- package/bin/retailCommission/enums/CommissionSeriesByEnum.d.ts +14 -0
- package/bin/retailCommission/enums/CommissionSeriesByEnum.js +18 -0
- package/bin/retailCommission/enums/CommissionSimulationSkipEnum.d.ts +14 -0
- package/bin/retailCommission/enums/CommissionSimulationSkipEnum.js +18 -0
- package/bin/retailCommission/enums/CommissionWindowEnum.d.ts +12 -0
- package/bin/retailCommission/enums/CommissionWindowEnum.js +16 -0
- package/bin/retailCommission/index.d.ts +10 -0
- package/bin/retailCommission/index.js +10 -0
- package/bin/retailLoan/dtos/CreateMyPaymentRequest.d.ts +3 -1
- package/bin/retailLoan/dtos/CreateMyPaymentRequest.js +7 -0
- package/bin/retailLoan/dtos/CreateMyPaymentResponse.d.ts +2 -0
- package/bin/retailLoan/dtos/MyPaymentOptions.d.ts +21 -1
- package/bin/retailLoan/enums/MyPaymentTypeEnum.d.ts +3 -2
- package/bin/retailLoan/enums/MyPaymentTypeEnum.js +2 -1
- package/bin/retailWizard/enums/RetailCommissionInboundMessageTypeEnum.d.ts +5 -0
- package/bin/retailWizard/enums/RetailCommissionInboundMessageTypeEnum.js +9 -0
- package/bin/retailWizard/events/RetailCommissionInboundMessage.d.ts +27 -1
- package/bin/retailWizard/events/RetailCommissionInboundMessage.js +70 -1
- package/bin/retailWizard/index.d.ts +1 -0
- package/bin/retailWizard/index.js +1 -0
- package/package.json +1 -1
- package/src/loanCredit/dtos/InstallmentPaidEvent.ts +20 -0
- package/src/loanCredit/dtos/requests/CreateCustomerPaymentRequest.ts +9 -2
- package/src/loanCredit/dtos/responses/LoanCustomerPaymentOptions.ts +26 -3
- package/src/loanCredit/dtos/responses/LoanCustomerPaymentResult.ts +2 -0
- package/src/loanCredit/enums/LoanCustomerPaymentTypeEnum.ts +4 -0
- package/src/loanCredit/index.ts +1 -0
- package/src/retailCommission/dtos/CommissionAccrual.ts +38 -0
- package/src/retailCommission/dtos/CommissionApi.ts +276 -2
- package/src/retailCommission/dtos/CommissionCalcTrace.ts +7 -0
- package/src/retailCommission/dtos/CommissionCouponAccrual.ts +33 -0
- package/src/retailCommission/dtos/CommissionPayout.ts +91 -0
- package/src/retailCommission/dtos/CommissionRule.ts +132 -0
- package/src/retailCommission/enums/CommissionAggregateByEnum.ts +14 -0
- package/src/retailCommission/enums/CommissionBonusModeEnum.ts +10 -0
- package/src/retailCommission/enums/CommissionCalcStepEnum.ts +2 -0
- package/src/retailCommission/enums/CommissionMetricEnum.ts +14 -0
- package/src/retailCommission/enums/CommissionOperatorEnum.ts +15 -0
- package/src/retailCommission/enums/CommissionRuleStatusEnum.ts +16 -0
- package/src/retailCommission/enums/CommissionSeriesByEnum.ts +14 -0
- package/src/retailCommission/enums/CommissionSimulationSkipEnum.ts +14 -0
- package/src/retailCommission/enums/CommissionWindowEnum.ts +12 -0
- package/src/retailCommission/index.ts +10 -0
- package/src/retailLoan/dtos/CreateMyPaymentRequest.ts +9 -2
- package/src/retailLoan/dtos/CreateMyPaymentResponse.ts +2 -0
- package/src/retailLoan/dtos/MyPaymentOptions.ts +26 -2
- package/src/retailLoan/enums/MyPaymentTypeEnum.ts +2 -1
- package/src/retailWizard/enums/RetailCommissionInboundMessageTypeEnum.ts +5 -0
- package/src/retailWizard/events/RetailCommissionInboundMessage.ts +75 -2
- package/src/retailWizard/index.ts +1 -0
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MyPaymentTypeEnum = void 0;
|
|
4
|
-
/** Pago que el cliente pide desde la app. `ADVANCE` = varias cuotas. */
|
|
4
|
+
/** Pago que el cliente pide desde la app. `ADVANCE` = varias cuotas; `PREPAYMENT` = abono a capital. */
|
|
5
5
|
var MyPaymentTypeEnum;
|
|
6
6
|
(function (MyPaymentTypeEnum) {
|
|
7
7
|
MyPaymentTypeEnum["NEXT_INSTALLMENT"] = "NEXT_INSTALLMENT";
|
|
8
8
|
MyPaymentTypeEnum["ADVANCE"] = "ADVANCE";
|
|
9
9
|
MyPaymentTypeEnum["SETTLEMENT"] = "SETTLEMENT";
|
|
10
|
+
MyPaymentTypeEnum["PREPAYMENT"] = "PREPAYMENT";
|
|
10
11
|
})(MyPaymentTypeEnum || (exports.MyPaymentTypeEnum = MyPaymentTypeEnum = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RetailCommissionInboundMessageTypeEnum = void 0;
|
|
4
|
+
/** Tipo de mensaje que el wizard publica en la cola de Comisiones. */
|
|
5
|
+
var RetailCommissionInboundMessageTypeEnum;
|
|
6
|
+
(function (RetailCommissionInboundMessageTypeEnum) {
|
|
7
|
+
RetailCommissionInboundMessageTypeEnum["SALE_COMPLETED"] = "SALE_COMPLETED";
|
|
8
|
+
RetailCommissionInboundMessageTypeEnum["SALE_CANCELLED"] = "SALE_CANCELLED";
|
|
9
|
+
})(RetailCommissionInboundMessageTypeEnum || (exports.RetailCommissionInboundMessageTypeEnum = RetailCommissionInboundMessageTypeEnum = {}));
|
|
@@ -1,19 +1,45 @@
|
|
|
1
1
|
import { ItemTypeEnum } from '../../retailCatalog/enums/ItemTypeEnum';
|
|
2
|
+
import { ProductCategoryEnum } from '../../retailCatalog/enums/ProductCategoryEnum';
|
|
3
|
+
import { ProductTierEnum } from '../../retailCatalog/enums/ProductTierEnum';
|
|
4
|
+
import { ExternalProviderEnum } from '../enums/ExternalProviderEnum';
|
|
5
|
+
import { LinePaymentTypeEnum } from '../enums/LinePaymentTypeEnum';
|
|
6
|
+
import { RetailCommissionInboundMessageTypeEnum } from '../enums/RetailCommissionInboundMessageTypeEnum';
|
|
7
|
+
import { SaleTypeEnum } from '../enums/SaleTypeEnum';
|
|
8
|
+
import { WizardLineRoleEnum } from '../enums/WizardLineRoleEnum';
|
|
2
9
|
/** Línea vendida en el mensaje de comisiones. */
|
|
3
10
|
export declare class RetailCommissionInboundLine {
|
|
11
|
+
lineId: string;
|
|
4
12
|
sku: string;
|
|
5
13
|
qty: number;
|
|
6
14
|
/** Precio neto de la línea (precio − descuento). */
|
|
7
15
|
netCents: number;
|
|
8
16
|
itemType: ItemTypeEnum;
|
|
17
|
+
/** `null` si la línea no trae la ficha del producto. */
|
|
18
|
+
category: ProductCategoryEnum | null;
|
|
19
|
+
/** `null` = sin gama. */
|
|
20
|
+
tier: ProductTierEnum | null;
|
|
21
|
+
brand: string | null;
|
|
22
|
+
paymentType: LinePaymentTypeEnum;
|
|
23
|
+
role?: WizardLineRoleEnum;
|
|
9
24
|
}
|
|
10
|
-
/** Venta
|
|
25
|
+
/** Venta cerrada o cancelada que el wizard publica en RetailCommissionInboundQueue. */
|
|
11
26
|
export declare class RetailCommissionInboundMessage {
|
|
27
|
+
type: RetailCommissionInboundMessageTypeEnum;
|
|
12
28
|
tenantId: string;
|
|
13
29
|
retailerId: string;
|
|
14
30
|
storeId: string;
|
|
15
31
|
saleId: string;
|
|
16
32
|
sessionId: string;
|
|
33
|
+
/** Quién vendió. */
|
|
34
|
+
sellerRetailUserId: string;
|
|
35
|
+
saleType: SaleTypeEnum;
|
|
36
|
+
/** Solo en EXTERNAL_REFERRAL. */
|
|
37
|
+
externalProvider: ExternalProviderEnum | null;
|
|
38
|
+
creditId: string | null;
|
|
17
39
|
soldAt: string;
|
|
40
|
+
/** soldAt en la venta; cancelledAt en la cancelación. */
|
|
41
|
+
occurredAt: string;
|
|
42
|
+
/** Motivo de la cancelación; puede venir vacío. */
|
|
43
|
+
cancelReason?: string;
|
|
18
44
|
lines: RetailCommissionInboundLine[];
|
|
19
45
|
}
|
|
@@ -13,10 +13,22 @@ exports.RetailCommissionInboundMessage = exports.RetailCommissionInboundLine = v
|
|
|
13
13
|
const class_transformer_1 = require("class-transformer");
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
15
|
const ItemTypeEnum_1 = require("../../retailCatalog/enums/ItemTypeEnum");
|
|
16
|
+
const ProductCategoryEnum_1 = require("../../retailCatalog/enums/ProductCategoryEnum");
|
|
17
|
+
const ProductTierEnum_1 = require("../../retailCatalog/enums/ProductTierEnum");
|
|
18
|
+
const ExternalProviderEnum_1 = require("../enums/ExternalProviderEnum");
|
|
19
|
+
const LinePaymentTypeEnum_1 = require("../enums/LinePaymentTypeEnum");
|
|
20
|
+
const RetailCommissionInboundMessageTypeEnum_1 = require("../enums/RetailCommissionInboundMessageTypeEnum");
|
|
21
|
+
const SaleTypeEnum_1 = require("../enums/SaleTypeEnum");
|
|
22
|
+
const WizardLineRoleEnum_1 = require("../enums/WizardLineRoleEnum");
|
|
16
23
|
/** Línea vendida en el mensaje de comisiones. */
|
|
17
24
|
class RetailCommissionInboundLine {
|
|
18
25
|
}
|
|
19
26
|
exports.RetailCommissionInboundLine = RetailCommissionInboundLine;
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, class_validator_1.IsString)(),
|
|
29
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], RetailCommissionInboundLine.prototype, "lineId", void 0);
|
|
20
32
|
__decorate([
|
|
21
33
|
(0, class_validator_1.IsString)(),
|
|
22
34
|
(0, class_validator_1.IsNotEmpty)(),
|
|
@@ -36,10 +48,38 @@ __decorate([
|
|
|
36
48
|
(0, class_validator_1.IsEnum)(ItemTypeEnum_1.ItemTypeEnum),
|
|
37
49
|
__metadata("design:type", String)
|
|
38
50
|
], RetailCommissionInboundLine.prototype, "itemType", void 0);
|
|
39
|
-
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, class_validator_1.IsOptional)(),
|
|
53
|
+
(0, class_validator_1.IsEnum)(ProductCategoryEnum_1.ProductCategoryEnum),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], RetailCommissionInboundLine.prototype, "category", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, class_validator_1.IsOptional)(),
|
|
58
|
+
(0, class_validator_1.IsEnum)(ProductTierEnum_1.ProductTierEnum),
|
|
59
|
+
__metadata("design:type", String)
|
|
60
|
+
], RetailCommissionInboundLine.prototype, "tier", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, class_validator_1.IsOptional)(),
|
|
63
|
+
(0, class_validator_1.IsString)(),
|
|
64
|
+
__metadata("design:type", String)
|
|
65
|
+
], RetailCommissionInboundLine.prototype, "brand", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, class_validator_1.IsEnum)(LinePaymentTypeEnum_1.LinePaymentTypeEnum),
|
|
68
|
+
__metadata("design:type", String)
|
|
69
|
+
], RetailCommissionInboundLine.prototype, "paymentType", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, class_validator_1.IsOptional)(),
|
|
72
|
+
(0, class_validator_1.IsEnum)(WizardLineRoleEnum_1.WizardLineRoleEnum),
|
|
73
|
+
__metadata("design:type", String)
|
|
74
|
+
], RetailCommissionInboundLine.prototype, "role", void 0);
|
|
75
|
+
/** Venta cerrada o cancelada que el wizard publica en RetailCommissionInboundQueue. */
|
|
40
76
|
class RetailCommissionInboundMessage {
|
|
41
77
|
}
|
|
42
78
|
exports.RetailCommissionInboundMessage = RetailCommissionInboundMessage;
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, class_validator_1.IsEnum)(RetailCommissionInboundMessageTypeEnum_1.RetailCommissionInboundMessageTypeEnum),
|
|
81
|
+
__metadata("design:type", String)
|
|
82
|
+
], RetailCommissionInboundMessage.prototype, "type", void 0);
|
|
43
83
|
__decorate([
|
|
44
84
|
(0, class_validator_1.IsString)(),
|
|
45
85
|
(0, class_validator_1.IsNotEmpty)(),
|
|
@@ -65,10 +105,39 @@ __decorate([
|
|
|
65
105
|
(0, class_validator_1.IsNotEmpty)(),
|
|
66
106
|
__metadata("design:type", String)
|
|
67
107
|
], RetailCommissionInboundMessage.prototype, "sessionId", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, class_validator_1.IsString)(),
|
|
110
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
111
|
+
__metadata("design:type", String)
|
|
112
|
+
], RetailCommissionInboundMessage.prototype, "sellerRetailUserId", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
(0, class_validator_1.IsEnum)(SaleTypeEnum_1.SaleTypeEnum),
|
|
115
|
+
__metadata("design:type", String)
|
|
116
|
+
], RetailCommissionInboundMessage.prototype, "saleType", void 0);
|
|
117
|
+
__decorate([
|
|
118
|
+
(0, class_validator_1.IsOptional)(),
|
|
119
|
+
(0, class_validator_1.IsEnum)(ExternalProviderEnum_1.ExternalProviderEnum),
|
|
120
|
+
__metadata("design:type", String)
|
|
121
|
+
], RetailCommissionInboundMessage.prototype, "externalProvider", void 0);
|
|
122
|
+
__decorate([
|
|
123
|
+
(0, class_validator_1.IsOptional)(),
|
|
124
|
+
(0, class_validator_1.IsString)(),
|
|
125
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
126
|
+
__metadata("design:type", String)
|
|
127
|
+
], RetailCommissionInboundMessage.prototype, "creditId", void 0);
|
|
68
128
|
__decorate([
|
|
69
129
|
(0, class_validator_1.IsISO8601)(),
|
|
70
130
|
__metadata("design:type", String)
|
|
71
131
|
], RetailCommissionInboundMessage.prototype, "soldAt", void 0);
|
|
132
|
+
__decorate([
|
|
133
|
+
(0, class_validator_1.IsISO8601)(),
|
|
134
|
+
__metadata("design:type", String)
|
|
135
|
+
], RetailCommissionInboundMessage.prototype, "occurredAt", void 0);
|
|
136
|
+
__decorate([
|
|
137
|
+
(0, class_validator_1.IsOptional)(),
|
|
138
|
+
(0, class_validator_1.IsString)(),
|
|
139
|
+
__metadata("design:type", String)
|
|
140
|
+
], RetailCommissionInboundMessage.prototype, "cancelReason", void 0);
|
|
72
141
|
__decorate([
|
|
73
142
|
(0, class_validator_1.IsArray)(),
|
|
74
143
|
(0, class_validator_1.ArrayMinSize)(1),
|
|
@@ -139,6 +139,7 @@ export * from './events/SaleCompletedV2';
|
|
|
139
139
|
export * from './events/SaleCancelledV2';
|
|
140
140
|
export * from './events/SessionExpiredV1';
|
|
141
141
|
export * from './enums/RetailPromotionInboundMessageTypeEnum';
|
|
142
|
+
export * from './enums/RetailCommissionInboundMessageTypeEnum';
|
|
142
143
|
export * from './events/RetailPromotionInboundMessage';
|
|
143
144
|
export * from './events/RetailCommissionInboundMessage';
|
|
144
145
|
export * from './enums/WizardSessionLookupStatusEnum';
|
|
@@ -170,6 +170,7 @@ __exportStar(require("./events/SaleCompletedV2"), exports);
|
|
|
170
170
|
__exportStar(require("./events/SaleCancelledV2"), exports);
|
|
171
171
|
__exportStar(require("./events/SessionExpiredV1"), exports);
|
|
172
172
|
__exportStar(require("./enums/RetailPromotionInboundMessageTypeEnum"), exports);
|
|
173
|
+
__exportStar(require("./enums/RetailCommissionInboundMessageTypeEnum"), exports);
|
|
173
174
|
__exportStar(require("./events/RetailPromotionInboundMessage"), exports);
|
|
174
175
|
__exportStar(require("./events/RetailCommissionInboundMessage"), exports);
|
|
175
176
|
// Lookup privado por lote (GET /private/wizard-sessions/batch)
|
package/package.json
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { LoanInstallmentStatusEnum } from '../enums/LoanInstallmentStatusEnum';
|
|
2
|
+
|
|
3
|
+
/** `eventType` del outbox cuando una cuota queda pagada. */
|
|
4
|
+
export const INSTALLMENT_PAID_EVENT_TYPE = 'InstallmentPaidV1';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Payload de `InstallmentPaidV1`: una cuota que pasó a `PAID` o `PAID_IN_ADVANCE` por cualquier
|
|
8
|
+
* camino (cargo de la cuota, revisión, adelanto, liquidación o recuperación). Se escribe al outbox en
|
|
9
|
+
* la misma transacción que la cuota. Sin PII.
|
|
10
|
+
*/
|
|
11
|
+
export interface InstallmentPaidV1Payload {
|
|
12
|
+
creditId: string;
|
|
13
|
+
installmentNumber: number;
|
|
14
|
+
/** Lo pagado de la cuota en total (capital + interés + IVA), en centavos. */
|
|
15
|
+
paidCents: number;
|
|
16
|
+
/** Instante del pago (ISO): decide el corte de la renta. */
|
|
17
|
+
paidAt: string;
|
|
18
|
+
installmentStatus: LoanInstallmentStatusEnum;
|
|
19
|
+
paymentId: string;
|
|
20
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Expose } from 'class-transformer';
|
|
2
|
-
import { IsEnum, IsInt, IsUUID, Min } from 'class-validator';
|
|
2
|
+
import { IsEnum, IsInt, IsOptional, IsUUID, Min } from 'class-validator';
|
|
3
3
|
import { LoanCustomerPaymentTypeEnum } from '../../enums/LoanCustomerPaymentTypeEnum';
|
|
4
4
|
|
|
5
5
|
/** Body de `POST /private/customers/:directoryId/credits/:creditId/payments` (loan-credit-business). */
|
|
@@ -8,7 +8,7 @@ export class CreateCustomerPaymentRequest {
|
|
|
8
8
|
@IsEnum(LoanCustomerPaymentTypeEnum)
|
|
9
9
|
type!: LoanCustomerPaymentTypeEnum;
|
|
10
10
|
|
|
11
|
-
/** Monto que vio el cliente; si ya no coincide, responde 409 CUSTOMER_PAYMENT_AMOUNT_CHANGED. */
|
|
11
|
+
/** Monto que vio el cliente (en PREPAYMENT, el que eligió); si ya no coincide, responde 409 CUSTOMER_PAYMENT_AMOUNT_CHANGED. */
|
|
12
12
|
@Expose()
|
|
13
13
|
@IsInt()
|
|
14
14
|
@Min(1)
|
|
@@ -18,4 +18,11 @@ export class CreateCustomerPaymentRequest {
|
|
|
18
18
|
@Expose()
|
|
19
19
|
@IsUUID()
|
|
20
20
|
idempotencyKey!: string;
|
|
21
|
+
|
|
22
|
+
/** Solo ADVANCE: cuántas cuotas adelanta. */
|
|
23
|
+
@Expose()
|
|
24
|
+
@IsOptional()
|
|
25
|
+
@IsInt()
|
|
26
|
+
@Min(2)
|
|
27
|
+
installmentCount?: number;
|
|
21
28
|
}
|
|
@@ -10,19 +10,42 @@ export interface LoanCustomerPaymentOption {
|
|
|
10
10
|
amountCents?: number;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
/** Una cuota que se puede adelantar. */
|
|
14
|
+
export interface LoanCustomerAdvanceInstallment {
|
|
15
|
+
installmentNumber: number;
|
|
16
|
+
/** `YYYY-MM-DD`. */
|
|
17
|
+
dueDate: string;
|
|
18
|
+
amountCents: number;
|
|
19
|
+
}
|
|
20
|
+
|
|
13
21
|
/** Response de `GET /private/customers/:directoryId/credits/:creditId/payment-options`. Montos en cents. */
|
|
14
22
|
export interface LoanCustomerPaymentOptions {
|
|
15
23
|
creditId: string;
|
|
16
24
|
/** Cargo ad hoc en curso; mientras exista, ninguna opción está disponible. */
|
|
17
|
-
pendingCharge?: {
|
|
25
|
+
pendingCharge?: {
|
|
26
|
+
kind: LoanAdHocChargeKindEnum;
|
|
27
|
+
amountCents: number;
|
|
28
|
+
/** Solo en un adelanto: las cuotas que cubre. */
|
|
29
|
+
installmentNumbers?: number[];
|
|
30
|
+
};
|
|
18
31
|
nextInstallment: LoanCustomerPaymentOption & {
|
|
19
32
|
mode?: LoanNextInstallmentModeEnum;
|
|
20
33
|
installmentNumber?: number;
|
|
21
34
|
/** `YYYY-MM-DD`. */
|
|
22
35
|
dueDate?: string;
|
|
23
36
|
};
|
|
24
|
-
/** Varias cuotas
|
|
25
|
-
advance: LoanCustomerPaymentOption
|
|
37
|
+
/** Varias cuotas. `installments` trae las `maxInstallments` que se pueden adelantar, en orden. */
|
|
38
|
+
advance: LoanCustomerPaymentOption & {
|
|
39
|
+
minInstallments?: number;
|
|
40
|
+
maxInstallments?: number;
|
|
41
|
+
installments?: LoanCustomerAdvanceInstallment[];
|
|
42
|
+
};
|
|
43
|
+
/** Abono a capital: monto libre entre `minAmountCents` y `maxAmountCents`. */
|
|
44
|
+
prepayment: LoanCustomerPaymentOption & {
|
|
45
|
+
minAmountCents?: number;
|
|
46
|
+
maxAmountCents?: number;
|
|
47
|
+
outstandingCapitalCents?: number;
|
|
48
|
+
};
|
|
26
49
|
settlement: LoanCustomerPaymentOption & {
|
|
27
50
|
/** La cotización de hoy; su `settlementAmountCents` es el `amountCents`. */
|
|
28
51
|
quote?: LoanSettlementQuote;
|
|
@@ -9,4 +9,6 @@ export interface LoanCustomerPaymentResult {
|
|
|
9
9
|
amountCents: number;
|
|
10
10
|
/** Respuesta síncrona del motor; ausente si no contestó a tiempo. */
|
|
11
11
|
collection?: { status: CollectionResultStatus; amountCollectedCents: number };
|
|
12
|
+
/** Solo ADVANCE: cuántas cuotas cubre. */
|
|
13
|
+
installmentCount?: number;
|
|
12
14
|
}
|
|
@@ -2,4 +2,8 @@
|
|
|
2
2
|
export enum LoanCustomerPaymentTypeEnum {
|
|
3
3
|
NEXT_INSTALLMENT = 'NEXT_INSTALLMENT',
|
|
4
4
|
SETTLEMENT = 'SETTLEMENT',
|
|
5
|
+
/** Varias cuotas: las siguientes N tal como están, sin cambiar la tabla. */
|
|
6
|
+
ADVANCE = 'ADVANCE',
|
|
7
|
+
/** Abono a capital: va completo a capital y baja las cuotas siguientes. */
|
|
8
|
+
PREPAYMENT = 'PREPAYMENT',
|
|
5
9
|
}
|
package/src/loanCredit/index.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from './dtos/LoanBorrower';
|
|
|
10
10
|
export * from './dtos/LoanBeneficiary';
|
|
11
11
|
export * from './dtos/LoanCredit';
|
|
12
12
|
export * from './dtos/LoanInstallment';
|
|
13
|
+
export * from './dtos/InstallmentPaidEvent';
|
|
13
14
|
export * from './dtos/LoanContract';
|
|
14
15
|
export * from './dtos/ActivationChecklist';
|
|
15
16
|
export * from './dtos/AppliedPromotionSnapshot';
|
|
@@ -2,6 +2,11 @@ import type { CommissionAccrualStatusEnum } from '../enums/CommissionAccrualStat
|
|
|
2
2
|
import type { CommissionPayeeTypeEnum } from '../enums/CommissionPayeeTypeEnum';
|
|
3
3
|
import type { SaleFinancierEnum } from '../../retailWizard/enums/SaleFinancierEnum';
|
|
4
4
|
import type { CommissionCalcTrace } from './CommissionCalcTrace';
|
|
5
|
+
import type { CommissionBonusModeEnum } from '../enums/CommissionBonusModeEnum';
|
|
6
|
+
import type { ProductCategoryEnum } from '../../retailCatalog/enums/ProductCategoryEnum';
|
|
7
|
+
import type { ProductTierEnum } from '../../retailCatalog/enums/ProductTierEnum';
|
|
8
|
+
import type { LinePaymentTypeEnum } from '../../retailWizard/enums/LinePaymentTypeEnum';
|
|
9
|
+
import type { WizardLineRoleEnum } from '../../retailWizard/enums/WizardLineRoleEnum';
|
|
5
10
|
|
|
6
11
|
/**
|
|
7
12
|
* El devengo: lo que se le debe a un vendedor por UNA venta.
|
|
@@ -52,6 +57,10 @@ export interface CommissionAccrual {
|
|
|
52
57
|
payoutId: string | null;
|
|
53
58
|
reversalReason: string | null;
|
|
54
59
|
calcTrace: CommissionCalcTrace;
|
|
60
|
+
/** Los bonos por venta que sumaron, uno por regla y por pieza. Solo en devengos calculados con reglas. */
|
|
61
|
+
appliedBonuses?: CommissionAppliedBonus[];
|
|
62
|
+
/** Suma de `appliedBonuses`. Solo en devengos calculados con reglas. */
|
|
63
|
+
subtotalBonusCents?: number;
|
|
55
64
|
}
|
|
56
65
|
|
|
57
66
|
/**
|
|
@@ -78,4 +87,33 @@ export interface CommissionSaleInput {
|
|
|
78
87
|
/** `CASH` | `CREDIT`, para `PERCENT_BY_PAYMENT`. */
|
|
79
88
|
paymentType: string;
|
|
80
89
|
soldAt: string;
|
|
90
|
+
/** Las líneas de la venta. Las ventas que se calculan con reglas siempre las traen. */
|
|
91
|
+
lines?: CommissionSaleLine[];
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** Una línea de la venta, congelada en el devengo. */
|
|
95
|
+
export interface CommissionSaleLine {
|
|
96
|
+
lineId: string;
|
|
97
|
+
sku: string;
|
|
98
|
+
qty: number;
|
|
99
|
+
/** Precio neto de la línea completa (todas sus piezas). */
|
|
100
|
+
netCents: number;
|
|
101
|
+
category: ProductCategoryEnum | null;
|
|
102
|
+
tier: ProductTierEnum | null;
|
|
103
|
+
brand: string | null;
|
|
104
|
+
paymentType: LinePaymentTypeEnum;
|
|
105
|
+
/** `GIFT` = regalo: no comisiona ni cuenta en la posición. */
|
|
106
|
+
role?: WizardLineRoleEnum;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** Un bono por venta que sumó en el devengo. */
|
|
110
|
+
export interface CommissionAppliedBonus {
|
|
111
|
+
ruleId: string;
|
|
112
|
+
name: string;
|
|
113
|
+
lineId: string;
|
|
114
|
+
sku: string;
|
|
115
|
+
/** Posición de la pieza en el contador de la regla dentro del periodo. */
|
|
116
|
+
position: number;
|
|
117
|
+
mode: CommissionBonusModeEnum;
|
|
118
|
+
amountCents: number;
|
|
81
119
|
}
|