@fiado/type-kit 3.637.0 → 3.639.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/bin/retailCommission/dtos/CommissionAccrual.d.ts +2 -0
- package/bin/retailCommission/dtos/CommissionApi.d.ts +63 -0
- package/bin/retailWizard/dtos/Sale.d.ts +4 -0
- package/bin/retailWizard/events/RetailCommissionInboundMessage.d.ts +5 -0
- package/bin/retailWizard/events/RetailCommissionInboundMessage.js +5 -0
- package/package.json +1 -1
- package/src/retailCommission/dtos/CommissionAccrual.ts +2 -0
- package/src/retailCommission/dtos/CommissionApi.ts +25 -0
- package/src/retailWizard/dtos/Sale.ts +4 -0
- package/src/retailWizard/events/RetailCommissionInboundMessage.ts +8 -0
|
@@ -85,6 +85,8 @@ export interface CommissionSaleInput {
|
|
|
85
85
|
/** `CASH` | `CREDIT`, para `PERCENT_BY_PAYMENT`. */
|
|
86
86
|
paymentType: string;
|
|
87
87
|
soldAt: string;
|
|
88
|
+
/** Cuándo se ganó la comisión: ubica la venta en su corte. Los devengos viejos no lo traen o lo traen en `null` (usar `soldAt`). */
|
|
89
|
+
earnedAt?: string | null;
|
|
88
90
|
/** Las líneas de la venta. Las ventas que se calculan con reglas siempre las traen. */
|
|
89
91
|
lines?: CommissionSaleLine[];
|
|
90
92
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CommissionPlanStatusEnum } from '../enums/CommissionPlanStatusEnum';
|
|
2
|
+
import type { CommissionRuleStatusEnum } from '../enums/CommissionRuleStatusEnum';
|
|
2
3
|
import type { CommissionPayoutStatusEnum } from '../enums/CommissionPayoutStatusEnum';
|
|
3
4
|
import type { CommissionAddOn, CommissionCategory, CommissionPlanSnapshot, CommissionQuota } from './CommissionPlan';
|
|
4
5
|
import type { CommissionAccrual, CommissionAppliedBonus, CommissionSaleInput, CommissionSaleLine } from './CommissionAccrual';
|
|
@@ -227,12 +228,74 @@ export interface RuleActionResponse {
|
|
|
227
228
|
rule: CommissionRule;
|
|
228
229
|
snapshotId: string;
|
|
229
230
|
}
|
|
231
|
+
/** Un campo de la regla que cambió de una versión a la siguiente, con su valor antes y después. */
|
|
232
|
+
export type CommissionRuleChange = {
|
|
233
|
+
field: 'name';
|
|
234
|
+
before: string;
|
|
235
|
+
after: string;
|
|
236
|
+
} | {
|
|
237
|
+
field: 'description';
|
|
238
|
+
before: string | null;
|
|
239
|
+
after: string | null;
|
|
240
|
+
} | {
|
|
241
|
+
field: 'levers';
|
|
242
|
+
before: CommissionRuleLevers;
|
|
243
|
+
after: CommissionRuleLevers;
|
|
244
|
+
} | {
|
|
245
|
+
field: 'scope';
|
|
246
|
+
before: CommissionRuleScope;
|
|
247
|
+
after: CommissionRuleScope;
|
|
248
|
+
} | {
|
|
249
|
+
field: 'condition';
|
|
250
|
+
before: CommissionRuleCondition | null;
|
|
251
|
+
after: CommissionRuleCondition | null;
|
|
252
|
+
} | {
|
|
253
|
+
field: 'effectiveFrom';
|
|
254
|
+
before: string;
|
|
255
|
+
after: string;
|
|
256
|
+
} | {
|
|
257
|
+
field: 'effectiveTo';
|
|
258
|
+
before: string | null;
|
|
259
|
+
after: string | null;
|
|
260
|
+
} | {
|
|
261
|
+
field: 'priority';
|
|
262
|
+
before: number;
|
|
263
|
+
after: number;
|
|
264
|
+
} | {
|
|
265
|
+
field: 'replacesOthers';
|
|
266
|
+
before: boolean;
|
|
267
|
+
after: boolean;
|
|
268
|
+
} | {
|
|
269
|
+
field: 'countBy';
|
|
270
|
+
before: CommissionCountByEnum;
|
|
271
|
+
after: CommissionCountByEnum;
|
|
272
|
+
} | {
|
|
273
|
+
field: 'payTiming';
|
|
274
|
+
before: CommissionPayTimingEnum;
|
|
275
|
+
after: CommissionPayTimingEnum;
|
|
276
|
+
} | {
|
|
277
|
+
field: 'onSaleAdvanceBps';
|
|
278
|
+
before: number | null;
|
|
279
|
+
after: number | null;
|
|
280
|
+
};
|
|
230
281
|
/** Un evento del historial de una regla. */
|
|
231
282
|
export interface CommissionRuleEvent {
|
|
232
283
|
at: string;
|
|
233
284
|
action: string;
|
|
234
285
|
performedBy: string;
|
|
235
286
|
version: number | null;
|
|
287
|
+
/**
|
|
288
|
+
* Solo en ediciones: lo que cambió respecto a la versión anterior; vacío si no cambió ningún campo.
|
|
289
|
+
* Ausente si no hay versión anterior con qué comparar, y en motores anteriores.
|
|
290
|
+
*/
|
|
291
|
+
changes?: CommissionRuleChange[];
|
|
292
|
+
/** Junto a `changes`: si la versión editada cuenta piezas o ventas, para leer sus palancas y su condición. */
|
|
293
|
+
countBy?: CommissionCountByEnum;
|
|
294
|
+
/** El estado que tenía la regla y el que le dejó el evento; `null` si no lo cambió o no se sabe. Ausente en motores anteriores. */
|
|
295
|
+
statusChange?: {
|
|
296
|
+
from: CommissionRuleStatusEnum;
|
|
297
|
+
to: CommissionRuleStatusEnum;
|
|
298
|
+
} | null;
|
|
236
299
|
}
|
|
237
300
|
/** `GET /backoffice/commissions/rules/{ruleId}/history` — del más nuevo al más viejo. */
|
|
238
301
|
export interface RuleHistoryResponse {
|
|
@@ -97,6 +97,10 @@ export interface Sale {
|
|
|
97
97
|
cancelledAt: string | null;
|
|
98
98
|
/** Reason OBLIGATORIO en cancelación (AuditTrail) — flujo C. */
|
|
99
99
|
cancelReason: string | null;
|
|
100
|
+
/** La comisión espera a que el cliente active su app: contraseña, contrato y número secreto. Ausente si no espera. */
|
|
101
|
+
commissionAwaitingApp?: boolean;
|
|
102
|
+
/** ISO; cuándo se ganó la comisión, si el cliente activó su app después de cerrar. Ausente: al cerrar o en espera. */
|
|
103
|
+
commissionEarnedAt?: string;
|
|
100
104
|
/** Si la venta se puede cancelar hoy y, si no, por qué; solo lo trae el detalle del backoffice. */
|
|
101
105
|
cancellation?: SaleCancellation;
|
|
102
106
|
/**
|
|
@@ -46,6 +46,11 @@ export declare class RetailCommissionInboundMessage {
|
|
|
46
46
|
soldAt: string;
|
|
47
47
|
/** soldAt en la venta; cancelledAt en la cancelación. */
|
|
48
48
|
occurredAt: string;
|
|
49
|
+
/**
|
|
50
|
+
* Cuándo se ganó la comisión, si el cliente activó su app después de cerrar la venta. Ubica la venta en
|
|
51
|
+
* su corte. Ausente: se ganó al cerrar (`soldAt`).
|
|
52
|
+
*/
|
|
53
|
+
earnedAt?: string;
|
|
49
54
|
/** Motivo de la cancelación; puede venir vacío. */
|
|
50
55
|
cancelReason?: string;
|
|
51
56
|
lines: RetailCommissionInboundLine[];
|
|
@@ -153,6 +153,11 @@ __decorate([
|
|
|
153
153
|
(0, class_validator_1.IsISO8601)(),
|
|
154
154
|
__metadata("design:type", String)
|
|
155
155
|
], RetailCommissionInboundMessage.prototype, "occurredAt", void 0);
|
|
156
|
+
__decorate([
|
|
157
|
+
(0, class_validator_1.IsOptional)(),
|
|
158
|
+
(0, class_validator_1.IsISO8601)(),
|
|
159
|
+
__metadata("design:type", String)
|
|
160
|
+
], RetailCommissionInboundMessage.prototype, "earnedAt", void 0);
|
|
156
161
|
__decorate([
|
|
157
162
|
(0, class_validator_1.IsOptional)(),
|
|
158
163
|
(0, class_validator_1.IsString)(),
|
package/package.json
CHANGED
|
@@ -88,6 +88,8 @@ export interface CommissionSaleInput {
|
|
|
88
88
|
/** `CASH` | `CREDIT`, para `PERCENT_BY_PAYMENT`. */
|
|
89
89
|
paymentType: string;
|
|
90
90
|
soldAt: string;
|
|
91
|
+
/** Cuándo se ganó la comisión: ubica la venta en su corte. Los devengos viejos no lo traen o lo traen en `null` (usar `soldAt`). */
|
|
92
|
+
earnedAt?: string | null;
|
|
91
93
|
/** Las líneas de la venta. Las ventas que se calculan con reglas siempre las traen. */
|
|
92
94
|
lines?: CommissionSaleLine[];
|
|
93
95
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CommissionPlanStatusEnum } from '../enums/CommissionPlanStatusEnum';
|
|
2
|
+
import type { CommissionRuleStatusEnum } from '../enums/CommissionRuleStatusEnum';
|
|
2
3
|
import type { CommissionPayoutStatusEnum } from '../enums/CommissionPayoutStatusEnum';
|
|
3
4
|
import type {
|
|
4
5
|
CommissionAddOn,
|
|
@@ -295,12 +296,36 @@ export interface RuleActionResponse {
|
|
|
295
296
|
snapshotId: string;
|
|
296
297
|
}
|
|
297
298
|
|
|
299
|
+
/** Un campo de la regla que cambió de una versión a la siguiente, con su valor antes y después. */
|
|
300
|
+
export type CommissionRuleChange =
|
|
301
|
+
| { field: 'name'; before: string; after: string }
|
|
302
|
+
| { field: 'description'; before: string | null; after: string | null }
|
|
303
|
+
| { field: 'levers'; before: CommissionRuleLevers; after: CommissionRuleLevers }
|
|
304
|
+
| { field: 'scope'; before: CommissionRuleScope; after: CommissionRuleScope }
|
|
305
|
+
| { field: 'condition'; before: CommissionRuleCondition | null; after: CommissionRuleCondition | null }
|
|
306
|
+
| { field: 'effectiveFrom'; before: string; after: string }
|
|
307
|
+
| { field: 'effectiveTo'; before: string | null; after: string | null }
|
|
308
|
+
| { field: 'priority'; before: number; after: number }
|
|
309
|
+
| { field: 'replacesOthers'; before: boolean; after: boolean }
|
|
310
|
+
| { field: 'countBy'; before: CommissionCountByEnum; after: CommissionCountByEnum }
|
|
311
|
+
| { field: 'payTiming'; before: CommissionPayTimingEnum; after: CommissionPayTimingEnum }
|
|
312
|
+
| { field: 'onSaleAdvanceBps'; before: number | null; after: number | null };
|
|
313
|
+
|
|
298
314
|
/** Un evento del historial de una regla. */
|
|
299
315
|
export interface CommissionRuleEvent {
|
|
300
316
|
at: string;
|
|
301
317
|
action: string;
|
|
302
318
|
performedBy: string;
|
|
303
319
|
version: number | null;
|
|
320
|
+
/**
|
|
321
|
+
* Solo en ediciones: lo que cambió respecto a la versión anterior; vacío si no cambió ningún campo.
|
|
322
|
+
* Ausente si no hay versión anterior con qué comparar, y en motores anteriores.
|
|
323
|
+
*/
|
|
324
|
+
changes?: CommissionRuleChange[];
|
|
325
|
+
/** Junto a `changes`: si la versión editada cuenta piezas o ventas, para leer sus palancas y su condición. */
|
|
326
|
+
countBy?: CommissionCountByEnum;
|
|
327
|
+
/** El estado que tenía la regla y el que le dejó el evento; `null` si no lo cambió o no se sabe. Ausente en motores anteriores. */
|
|
328
|
+
statusChange?: { from: CommissionRuleStatusEnum; to: CommissionRuleStatusEnum } | null;
|
|
304
329
|
}
|
|
305
330
|
|
|
306
331
|
/** `GET /backoffice/commissions/rules/{ruleId}/history` — del más nuevo al más viejo. */
|
|
@@ -98,6 +98,10 @@ export interface Sale {
|
|
|
98
98
|
cancelledAt: string | null;
|
|
99
99
|
/** Reason OBLIGATORIO en cancelación (AuditTrail) — flujo C. */
|
|
100
100
|
cancelReason: string | null;
|
|
101
|
+
/** La comisión espera a que el cliente active su app: contraseña, contrato y número secreto. Ausente si no espera. */
|
|
102
|
+
commissionAwaitingApp?: boolean;
|
|
103
|
+
/** ISO; cuándo se ganó la comisión, si el cliente activó su app después de cerrar. Ausente: al cerrar o en espera. */
|
|
104
|
+
commissionEarnedAt?: string;
|
|
101
105
|
/** Si la venta se puede cancelar hoy y, si no, por qué; solo lo trae el detalle del backoffice. */
|
|
102
106
|
cancellation?: SaleCancellation;
|
|
103
107
|
/**
|
|
@@ -131,6 +131,14 @@ export class RetailCommissionInboundMessage {
|
|
|
131
131
|
@IsISO8601()
|
|
132
132
|
occurredAt!: string;
|
|
133
133
|
|
|
134
|
+
/**
|
|
135
|
+
* Cuándo se ganó la comisión, si el cliente activó su app después de cerrar la venta. Ubica la venta en
|
|
136
|
+
* su corte. Ausente: se ganó al cerrar (`soldAt`).
|
|
137
|
+
*/
|
|
138
|
+
@IsOptional()
|
|
139
|
+
@IsISO8601()
|
|
140
|
+
earnedAt?: string;
|
|
141
|
+
|
|
134
142
|
/** Motivo de la cancelación; puede venir vacío. */
|
|
135
143
|
@IsOptional()
|
|
136
144
|
@IsString()
|