@fiado/type-kit 3.186.0 → 3.187.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/index.d.ts +1 -0
- package/bin/index.js +4 -1
- package/bin/loanCollectorAssignment/dtos/PriorityWeights.d.ts +10 -0
- package/bin/loanCollectorAssignment/dtos/PriorityWeights.js +43 -0
- package/bin/loanCollectorAssignment/dtos/requests/AutoAssignRequest.d.ts +9 -0
- package/bin/loanCollectorAssignment/dtos/requests/AutoAssignRequest.js +39 -0
- package/bin/loanCollectorAssignment/dtos/requests/CreateAssignmentRuleRequest.d.ts +12 -0
- package/bin/loanCollectorAssignment/dtos/requests/CreateAssignmentRuleRequest.js +46 -0
- package/bin/loanCollectorAssignment/dtos/requests/ReassignRequest.d.ts +7 -0
- package/bin/loanCollectorAssignment/dtos/requests/ReassignRequest.js +27 -0
- package/bin/loanCollectorAssignment/dtos/requests/RedistributeRequest.d.ts +7 -0
- package/bin/loanCollectorAssignment/dtos/requests/RedistributeRequest.js +27 -0
- package/bin/loanCollectorAssignment/dtos/requests/UpdateAssignmentRuleRequest.d.ts +12 -0
- package/bin/loanCollectorAssignment/dtos/requests/UpdateAssignmentRuleRequest.js +49 -0
- package/bin/loanCollectorAssignment/dtos/responses/AssignmentRuleResponse.d.ts +15 -0
- package/bin/loanCollectorAssignment/dtos/responses/AssignmentRuleResponse.js +2 -0
- package/bin/loanCollectorAssignment/dtos/responses/CollectorAssignmentResponse.d.ts +16 -0
- package/bin/loanCollectorAssignment/dtos/responses/CollectorAssignmentResponse.js +2 -0
- package/bin/loanCollectorAssignment/dtos/responses/CollectorLoadResponse.d.ts +11 -0
- package/bin/loanCollectorAssignment/dtos/responses/CollectorLoadResponse.js +2 -0
- package/bin/loanCollectorAssignment/dtos/responses/RedistributeSummaryResponse.d.ts +9 -0
- package/bin/loanCollectorAssignment/dtos/responses/RedistributeSummaryResponse.js +2 -0
- package/bin/loanCollectorAssignment/enums/AssignmentStatusEnum.d.ts +10 -0
- package/bin/loanCollectorAssignment/enums/AssignmentStatusEnum.js +14 -0
- package/bin/loanCollectorAssignment/enums/AssignmentStrategyEnum.d.ts +12 -0
- package/bin/loanCollectorAssignment/enums/AssignmentStrategyEnum.js +16 -0
- package/bin/loanCollectorAssignment/index.d.ts +12 -0
- package/bin/loanCollectorAssignment/index.js +32 -0
- package/package.json +1 -1
- package/src/index.ts +3 -0
- package/src/loanCollectorAssignment/dtos/PriorityWeights.ts +27 -0
- package/src/loanCollectorAssignment/dtos/requests/AutoAssignRequest.ts +23 -0
- package/src/loanCollectorAssignment/dtos/requests/CreateAssignmentRuleRequest.ts +29 -0
- package/src/loanCollectorAssignment/dtos/requests/ReassignRequest.ts +13 -0
- package/src/loanCollectorAssignment/dtos/requests/RedistributeRequest.ts +13 -0
- package/src/loanCollectorAssignment/dtos/requests/UpdateAssignmentRuleRequest.ts +32 -0
- package/src/loanCollectorAssignment/dtos/responses/AssignmentRuleResponse.ts +16 -0
- package/src/loanCollectorAssignment/dtos/responses/CollectorAssignmentResponse.ts +17 -0
- package/src/loanCollectorAssignment/dtos/responses/CollectorLoadResponse.ts +11 -0
- package/src/loanCollectorAssignment/dtos/responses/RedistributeSummaryResponse.ts +10 -0
- package/src/loanCollectorAssignment/enums/AssignmentStatusEnum.ts +10 -0
- package/src/loanCollectorAssignment/enums/AssignmentStrategyEnum.ts +12 -0
- package/src/loanCollectorAssignment/index.ts +19 -0
package/bin/index.d.ts
CHANGED
|
@@ -91,5 +91,6 @@ export * as EmailVerification from './emailVerification';
|
|
|
91
91
|
export * as RetailOrg from './retailOrg';
|
|
92
92
|
export * as LoanConfig from './loanConfig';
|
|
93
93
|
export * as LoanOfferings from './loanOfferings';
|
|
94
|
+
export * as LoanCollectorAssignment from './loanCollectorAssignment';
|
|
94
95
|
export * from './messaging';
|
|
95
96
|
export * from './complaint';
|
package/bin/index.js
CHANGED
|
@@ -37,7 +37,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.Device = exports.Observations = exports.IssuanceBusiness = exports.Blacklist = exports.CentralPayments = exports.Helpdesk = exports.FiadoApiResponse = exports.Auth = exports.LegalDocumentsBusiness = exports.Role = exports.STPAccount = exports.RiskProfile = exports.FraudPreventionEngine = exports.BBVARst = exports.Stp = exports.BenefitCenter = exports.BankAccount = exports.P2pContact = exports.CreditContract = exports.Contract = exports.ProductCatalog = exports.ContactInfo = exports.TransactionAnalytics = exports.Transaction = exports.TransactionProcessor = exports.GenericMessage = exports.EventBridgeMessage = exports.SessionActivity = exports.NotificationMessages = exports.ServicePayment = exports.Header = exports.Identity = exports.UserTags = exports.Group = exports.File = exports.ExchangeRate = exports.Directory = exports.Currency = exports.Country = exports.Card = exports.Authentication = exports.AppContent = exports.App = exports.Offices = exports.Places = exports.Address = exports.Beneficiary = exports.Activity = exports.Account = exports.Crypto = void 0;
|
|
40
|
-
exports.LoanOfferings = exports.LoanConfig = exports.RetailOrg = exports.EmailVerification = exports.NetworkConnector = exports.Modelias = exports.TotpSecurity = exports.Passport = exports.WalletFunding = exports.Remittance = exports.PlatformRbac = exports.CognitoBackofficeConnector = exports.TwilioConnector = exports.MessagesConnector = exports.Mdm = exports.MilestoneBusiness = exports.CirculoCredito = exports.CreditStatements = exports.Sentry = exports.AiEngine = exports.Funnel = exports.TeamsConnector = exports.PlatformErrorEvents = exports.CustomerFile = exports.CreditBackoffice = exports.CreditDashboard = exports.CreditEngine = exports.Credit = exports.ComissionBusiness = exports.ReferralBusiness = exports.ZendeskMessaging = exports.NotificationWS = exports.Event = exports.PayrollBusiness = exports.Cnbv = exports.DirectorySetting = exports.InvoiceCollector = exports.Collector = exports.Pricelist = exports.Company = exports.Services = exports.AccountIssuanceBusiness = exports.AppSelectionData = void 0;
|
|
40
|
+
exports.LoanCollectorAssignment = exports.LoanOfferings = exports.LoanConfig = exports.RetailOrg = exports.EmailVerification = exports.NetworkConnector = exports.Modelias = exports.TotpSecurity = exports.Passport = exports.WalletFunding = exports.Remittance = exports.PlatformRbac = exports.CognitoBackofficeConnector = exports.TwilioConnector = exports.MessagesConnector = exports.Mdm = exports.MilestoneBusiness = exports.CirculoCredito = exports.CreditStatements = exports.Sentry = exports.AiEngine = exports.Funnel = exports.TeamsConnector = exports.PlatformErrorEvents = exports.CustomerFile = exports.CreditBackoffice = exports.CreditDashboard = exports.CreditEngine = exports.Credit = exports.ComissionBusiness = exports.ReferralBusiness = exports.ZendeskMessaging = exports.NotificationWS = exports.Event = exports.PayrollBusiness = exports.Cnbv = exports.DirectorySetting = exports.InvoiceCollector = exports.Collector = exports.Pricelist = exports.Company = exports.Services = exports.AccountIssuanceBusiness = exports.AppSelectionData = void 0;
|
|
41
41
|
exports.Crypto = __importStar(require("./crypto"));
|
|
42
42
|
exports.Account = __importStar(require("./account"));
|
|
43
43
|
exports.Activity = __importStar(require("./activity"));
|
|
@@ -148,5 +148,8 @@ exports.LoanConfig = __importStar(require("./loanConfig"));
|
|
|
148
148
|
// LoanOfferings: DTOs/enums del lambda loan-offerings-business (comp 07 — planes de crédito,
|
|
149
149
|
// financieras, M:N retailer↔plan y simulador de cuota; SureKeep Fase 1 — pista Loan).
|
|
150
150
|
exports.LoanOfferings = __importStar(require("./loanOfferings"));
|
|
151
|
+
// LoanCollectorAssignment: DTOs/enums del lambda loan-collector-assignment-business (comp 08 — reglas de
|
|
152
|
+
// asignación de cartera de cobranza + asignaciones crédito↔cobrador; SureKeep Fase 1 — pista Loan).
|
|
153
|
+
exports.LoanCollectorAssignment = __importStar(require("./loanCollectorAssignment"));
|
|
151
154
|
__exportStar(require("./messaging"), exports);
|
|
152
155
|
__exportStar(require("./complaint"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pesos del ranking ponderado del algoritmo (modelo-datos §7.1). Cada peso es 0..100; la regla
|
|
3
|
+
* cross-campo `storeMatch + loadAvailable + seniority === 100` la valida el manager del lambda
|
|
4
|
+
* (WeightsSumInvalidError) — class-validator no cubre validaciones entre campos.
|
|
5
|
+
*/
|
|
6
|
+
export declare class PriorityWeights {
|
|
7
|
+
storeMatch: number;
|
|
8
|
+
loadAvailable: number;
|
|
9
|
+
seniority: number;
|
|
10
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
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.PriorityWeights = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
/**
|
|
16
|
+
* Pesos del ranking ponderado del algoritmo (modelo-datos §7.1). Cada peso es 0..100; la regla
|
|
17
|
+
* cross-campo `storeMatch + loadAvailable + seniority === 100` la valida el manager del lambda
|
|
18
|
+
* (WeightsSumInvalidError) — class-validator no cubre validaciones entre campos.
|
|
19
|
+
*/
|
|
20
|
+
class PriorityWeights {
|
|
21
|
+
}
|
|
22
|
+
exports.PriorityWeights = PriorityWeights;
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, class_transformer_1.Expose)(),
|
|
25
|
+
(0, class_validator_1.IsInt)(),
|
|
26
|
+
(0, class_validator_1.Min)(0),
|
|
27
|
+
(0, class_validator_1.Max)(100),
|
|
28
|
+
__metadata("design:type", Number)
|
|
29
|
+
], PriorityWeights.prototype, "storeMatch", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, class_transformer_1.Expose)(),
|
|
32
|
+
(0, class_validator_1.IsInt)(),
|
|
33
|
+
(0, class_validator_1.Min)(0),
|
|
34
|
+
(0, class_validator_1.Max)(100),
|
|
35
|
+
__metadata("design:type", Number)
|
|
36
|
+
], PriorityWeights.prototype, "loadAvailable", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, class_transformer_1.Expose)(),
|
|
39
|
+
(0, class_validator_1.IsInt)(),
|
|
40
|
+
(0, class_validator_1.Min)(0),
|
|
41
|
+
(0, class_validator_1.Max)(100),
|
|
42
|
+
__metadata("design:type", Number)
|
|
43
|
+
], PriorityWeights.prototype, "seniority", void 0);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Body de POST /private/collector-assignments/auto-assign (hot path). Lo invoca loan-credit-business
|
|
3
|
+
* al crearse un crédito (F3+); en F1 se prueba con `creditId` dummy. Elige cobrador y persiste ACTIVE.
|
|
4
|
+
*/
|
|
5
|
+
export declare class AutoAssignRequest {
|
|
6
|
+
retailerId: string;
|
|
7
|
+
creditId: string;
|
|
8
|
+
storeId: string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
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.AutoAssignRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
/**
|
|
16
|
+
* Body de POST /private/collector-assignments/auto-assign (hot path). Lo invoca loan-credit-business
|
|
17
|
+
* al crearse un crédito (F3+); en F1 se prueba con `creditId` dummy. Elige cobrador y persiste ACTIVE.
|
|
18
|
+
*/
|
|
19
|
+
class AutoAssignRequest {
|
|
20
|
+
}
|
|
21
|
+
exports.AutoAssignRequest = AutoAssignRequest;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_transformer_1.Expose)(),
|
|
24
|
+
(0, class_validator_1.IsString)(),
|
|
25
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], AutoAssignRequest.prototype, "retailerId", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, class_transformer_1.Expose)(),
|
|
30
|
+
(0, class_validator_1.IsString)(),
|
|
31
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], AutoAssignRequest.prototype, "creditId", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, class_transformer_1.Expose)(),
|
|
36
|
+
(0, class_validator_1.IsString)(),
|
|
37
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], AutoAssignRequest.prototype, "storeId", void 0);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AssignmentStrategyEnum } from '../../enums/AssignmentStrategyEnum';
|
|
2
|
+
import { PriorityWeights } from '../PriorityWeights';
|
|
3
|
+
/**
|
|
4
|
+
* Body de POST /retailers/:retailerId/assignment-rules. Crea una regla de asignación.
|
|
5
|
+
* Los pesos deben sumar 100 (lo valida el manager). `active: true` desactiva la regla activa anterior.
|
|
6
|
+
*/
|
|
7
|
+
export declare class CreateAssignmentRuleRequest {
|
|
8
|
+
strategy: AssignmentStrategyEnum;
|
|
9
|
+
maxLoadPerCollector?: number | null;
|
|
10
|
+
priorityWeights: PriorityWeights;
|
|
11
|
+
active: boolean;
|
|
12
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CreateAssignmentRuleRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const AssignmentStrategyEnum_1 = require("../../enums/AssignmentStrategyEnum");
|
|
16
|
+
const PriorityWeights_1 = require("../PriorityWeights");
|
|
17
|
+
/**
|
|
18
|
+
* Body de POST /retailers/:retailerId/assignment-rules. Crea una regla de asignación.
|
|
19
|
+
* Los pesos deben sumar 100 (lo valida el manager). `active: true` desactiva la regla activa anterior.
|
|
20
|
+
*/
|
|
21
|
+
class CreateAssignmentRuleRequest {
|
|
22
|
+
}
|
|
23
|
+
exports.CreateAssignmentRuleRequest = CreateAssignmentRuleRequest;
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_transformer_1.Expose)(),
|
|
26
|
+
(0, class_validator_1.IsEnum)(AssignmentStrategyEnum_1.AssignmentStrategyEnum),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], CreateAssignmentRuleRequest.prototype, "strategy", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, class_transformer_1.Expose)(),
|
|
31
|
+
(0, class_validator_1.IsOptional)(),
|
|
32
|
+
(0, class_validator_1.IsInt)(),
|
|
33
|
+
(0, class_validator_1.Min)(1),
|
|
34
|
+
__metadata("design:type", Number)
|
|
35
|
+
], CreateAssignmentRuleRequest.prototype, "maxLoadPerCollector", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, class_transformer_1.Expose)(),
|
|
38
|
+
(0, class_validator_1.ValidateNested)(),
|
|
39
|
+
(0, class_transformer_1.Type)(() => PriorityWeights_1.PriorityWeights),
|
|
40
|
+
__metadata("design:type", PriorityWeights_1.PriorityWeights)
|
|
41
|
+
], CreateAssignmentRuleRequest.prototype, "priorityWeights", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, class_transformer_1.Expose)(),
|
|
44
|
+
(0, class_validator_1.IsBoolean)(),
|
|
45
|
+
__metadata("design:type", Boolean)
|
|
46
|
+
], CreateAssignmentRuleRequest.prototype, "active", void 0);
|
|
@@ -0,0 +1,27 @@
|
|
|
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.ReassignRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
/**
|
|
16
|
+
* Body de POST /retailers/:retailerId/collector-assignments/:assignmentId/reassign (reasignación manual).
|
|
17
|
+
* `reason` obligatorio (auditoría de acción crítica — modelo-datos §10).
|
|
18
|
+
*/
|
|
19
|
+
class ReassignRequest {
|
|
20
|
+
}
|
|
21
|
+
exports.ReassignRequest = ReassignRequest;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_transformer_1.Expose)(),
|
|
24
|
+
(0, class_validator_1.IsString)(),
|
|
25
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], ReassignRequest.prototype, "reason", void 0);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Body de POST /retailers/:retailerId/collectors/:userId/redistribute. Redistribuye la cartera activa de
|
|
3
|
+
* un cobrador (ej. al desactivarlo). `reason` obligatorio (ej. `USER_INACTIVATED`) — auditoría §10.
|
|
4
|
+
*/
|
|
5
|
+
export declare class RedistributeRequest {
|
|
6
|
+
reason: string;
|
|
7
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
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.RedistributeRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
/**
|
|
16
|
+
* Body de POST /retailers/:retailerId/collectors/:userId/redistribute. Redistribuye la cartera activa de
|
|
17
|
+
* un cobrador (ej. al desactivarlo). `reason` obligatorio (ej. `USER_INACTIVATED`) — auditoría §10.
|
|
18
|
+
*/
|
|
19
|
+
class RedistributeRequest {
|
|
20
|
+
}
|
|
21
|
+
exports.RedistributeRequest = RedistributeRequest;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_transformer_1.Expose)(),
|
|
24
|
+
(0, class_validator_1.IsString)(),
|
|
25
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], RedistributeRequest.prototype, "reason", void 0);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AssignmentStrategyEnum } from '../../enums/AssignmentStrategyEnum';
|
|
2
|
+
import { PriorityWeights } from '../PriorityWeights';
|
|
3
|
+
/**
|
|
4
|
+
* Body de PUT /retailers/:retailerId/assignment-rules/:ruleId. Update parcial: todos los campos opcionales.
|
|
5
|
+
* Si se envían `priorityWeights`, deben sumar 100 (lo valida el manager).
|
|
6
|
+
*/
|
|
7
|
+
export declare class UpdateAssignmentRuleRequest {
|
|
8
|
+
strategy?: AssignmentStrategyEnum;
|
|
9
|
+
maxLoadPerCollector?: number | null;
|
|
10
|
+
priorityWeights?: PriorityWeights;
|
|
11
|
+
active?: boolean;
|
|
12
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
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.UpdateAssignmentRuleRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const AssignmentStrategyEnum_1 = require("../../enums/AssignmentStrategyEnum");
|
|
16
|
+
const PriorityWeights_1 = require("../PriorityWeights");
|
|
17
|
+
/**
|
|
18
|
+
* Body de PUT /retailers/:retailerId/assignment-rules/:ruleId. Update parcial: todos los campos opcionales.
|
|
19
|
+
* Si se envían `priorityWeights`, deben sumar 100 (lo valida el manager).
|
|
20
|
+
*/
|
|
21
|
+
class UpdateAssignmentRuleRequest {
|
|
22
|
+
}
|
|
23
|
+
exports.UpdateAssignmentRuleRequest = UpdateAssignmentRuleRequest;
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_transformer_1.Expose)(),
|
|
26
|
+
(0, class_validator_1.IsOptional)(),
|
|
27
|
+
(0, class_validator_1.IsEnum)(AssignmentStrategyEnum_1.AssignmentStrategyEnum),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], UpdateAssignmentRuleRequest.prototype, "strategy", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, class_transformer_1.Expose)(),
|
|
32
|
+
(0, class_validator_1.IsOptional)(),
|
|
33
|
+
(0, class_validator_1.IsInt)(),
|
|
34
|
+
(0, class_validator_1.Min)(1),
|
|
35
|
+
__metadata("design:type", Number)
|
|
36
|
+
], UpdateAssignmentRuleRequest.prototype, "maxLoadPerCollector", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, class_transformer_1.Expose)(),
|
|
39
|
+
(0, class_validator_1.IsOptional)(),
|
|
40
|
+
(0, class_validator_1.ValidateNested)(),
|
|
41
|
+
(0, class_transformer_1.Type)(() => PriorityWeights_1.PriorityWeights),
|
|
42
|
+
__metadata("design:type", PriorityWeights_1.PriorityWeights)
|
|
43
|
+
], UpdateAssignmentRuleRequest.prototype, "priorityWeights", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, class_transformer_1.Expose)(),
|
|
46
|
+
(0, class_validator_1.IsOptional)(),
|
|
47
|
+
(0, class_validator_1.IsBoolean)(),
|
|
48
|
+
__metadata("design:type", Boolean)
|
|
49
|
+
], UpdateAssignmentRuleRequest.prototype, "active", void 0);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AssignmentStrategyEnum } from '../../enums/AssignmentStrategyEnum';
|
|
2
|
+
import { PriorityWeights } from '../PriorityWeights';
|
|
3
|
+
/** Shape de salida de una regla de asignación (modelo-datos §7.1). */
|
|
4
|
+
export interface AssignmentRuleResponse {
|
|
5
|
+
ruleId: string;
|
|
6
|
+
retailerId: string;
|
|
7
|
+
strategy: AssignmentStrategyEnum;
|
|
8
|
+
maxLoadPerCollector: number | null;
|
|
9
|
+
priorityWeights: PriorityWeights;
|
|
10
|
+
active: boolean;
|
|
11
|
+
createdBy: string;
|
|
12
|
+
updatedBy: string;
|
|
13
|
+
createdAt: string;
|
|
14
|
+
updatedAt: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AssignmentStatusEnum } from '../../enums/AssignmentStatusEnum';
|
|
2
|
+
/** Shape de salida de una asignación crédito↔cobrador (modelo-datos §7.2). */
|
|
3
|
+
export interface CollectorAssignmentResponse {
|
|
4
|
+
assignmentId: string;
|
|
5
|
+
retailerId: string;
|
|
6
|
+
creditId: string;
|
|
7
|
+
storeId: string;
|
|
8
|
+
collectorUserId: string;
|
|
9
|
+
assignedAt: string;
|
|
10
|
+
status: AssignmentStatusEnum;
|
|
11
|
+
reassignedFromUserId: string | null;
|
|
12
|
+
createdBy: string;
|
|
13
|
+
updatedBy: string;
|
|
14
|
+
createdAt: string;
|
|
15
|
+
updatedAt: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Carga actual de un cobrador (flow 07.2 / GET /retailers/:retailerId/collector-loads).
|
|
3
|
+
* `activeAssignments` = COUNT de asignaciones ACTIVE (GSI collectorUserId-assignedAt-index).
|
|
4
|
+
* `threshold` = maxLoadPerCollector de la regla activa (null si no hay tope).
|
|
5
|
+
*/
|
|
6
|
+
export interface CollectorLoadResponse {
|
|
7
|
+
collectorUserId: string;
|
|
8
|
+
activeAssignments: number;
|
|
9
|
+
threshold: number | null;
|
|
10
|
+
storeIds: string[];
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Resultado de redistribuir la cartera activa de un cobrador (flow 07.4). */
|
|
2
|
+
export interface RedistributeSummaryResponse {
|
|
3
|
+
reassignedCount: number;
|
|
4
|
+
errors: RedistributeError[];
|
|
5
|
+
}
|
|
6
|
+
export interface RedistributeError {
|
|
7
|
+
creditId: string;
|
|
8
|
+
reason: string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Estado de una asignación crédito↔cobrador (modelo-datos §7.2). Historial append-only:
|
|
3
|
+
* 1 crédito = 1 `ACTIVE`; reasignación → row vieja `REASSIGNED`; release/liquidado → `INACTIVE`.
|
|
4
|
+
* @enum {string}
|
|
5
|
+
*/
|
|
6
|
+
export declare enum AssignmentStatusEnum {
|
|
7
|
+
ACTIVE = "ACTIVE",
|
|
8
|
+
INACTIVE = "INACTIVE",
|
|
9
|
+
REASSIGNED = "REASSIGNED"
|
|
10
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AssignmentStatusEnum = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Estado de una asignación crédito↔cobrador (modelo-datos §7.2). Historial append-only:
|
|
6
|
+
* 1 crédito = 1 `ACTIVE`; reasignación → row vieja `REASSIGNED`; release/liquidado → `INACTIVE`.
|
|
7
|
+
* @enum {string}
|
|
8
|
+
*/
|
|
9
|
+
var AssignmentStatusEnum;
|
|
10
|
+
(function (AssignmentStatusEnum) {
|
|
11
|
+
AssignmentStatusEnum["ACTIVE"] = "ACTIVE";
|
|
12
|
+
AssignmentStatusEnum["INACTIVE"] = "INACTIVE";
|
|
13
|
+
AssignmentStatusEnum["REASSIGNED"] = "REASSIGNED";
|
|
14
|
+
})(AssignmentStatusEnum || (exports.AssignmentStatusEnum = AssignmentStatusEnum = {}));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Estrategia de asignación de cartera de cobranza (modelo-datos §7.1 / M6 §7.5).
|
|
3
|
+
* DEC-008 (loan-collector-assignment): se soportan las 4 + ranking híbrido (strategy + priorityWeights).
|
|
4
|
+
* A RATIFICAR con Jaime/senior: M6 §7.5 solo respalda 3 — `ROUND_ROBIN` es adición del spec 08.
|
|
5
|
+
* @enum {string}
|
|
6
|
+
*/
|
|
7
|
+
export declare enum AssignmentStrategyEnum {
|
|
8
|
+
BY_STORE = "BY_STORE",
|
|
9
|
+
BY_LOAD = "BY_LOAD",
|
|
10
|
+
BY_SENIORITY = "BY_SENIORITY",
|
|
11
|
+
ROUND_ROBIN = "ROUND_ROBIN"
|
|
12
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AssignmentStrategyEnum = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Estrategia de asignación de cartera de cobranza (modelo-datos §7.1 / M6 §7.5).
|
|
6
|
+
* DEC-008 (loan-collector-assignment): se soportan las 4 + ranking híbrido (strategy + priorityWeights).
|
|
7
|
+
* A RATIFICAR con Jaime/senior: M6 §7.5 solo respalda 3 — `ROUND_ROBIN` es adición del spec 08.
|
|
8
|
+
* @enum {string}
|
|
9
|
+
*/
|
|
10
|
+
var AssignmentStrategyEnum;
|
|
11
|
+
(function (AssignmentStrategyEnum) {
|
|
12
|
+
AssignmentStrategyEnum["BY_STORE"] = "BY_STORE";
|
|
13
|
+
AssignmentStrategyEnum["BY_LOAD"] = "BY_LOAD";
|
|
14
|
+
AssignmentStrategyEnum["BY_SENIORITY"] = "BY_SENIORITY";
|
|
15
|
+
AssignmentStrategyEnum["ROUND_ROBIN"] = "ROUND_ROBIN";
|
|
16
|
+
})(AssignmentStrategyEnum || (exports.AssignmentStrategyEnum = AssignmentStrategyEnum = {}));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './enums/AssignmentStrategyEnum';
|
|
2
|
+
export * from './enums/AssignmentStatusEnum';
|
|
3
|
+
export * from './dtos/PriorityWeights';
|
|
4
|
+
export * from './dtos/requests/CreateAssignmentRuleRequest';
|
|
5
|
+
export * from './dtos/requests/UpdateAssignmentRuleRequest';
|
|
6
|
+
export * from './dtos/requests/AutoAssignRequest';
|
|
7
|
+
export * from './dtos/requests/ReassignRequest';
|
|
8
|
+
export * from './dtos/requests/RedistributeRequest';
|
|
9
|
+
export * from './dtos/responses/AssignmentRuleResponse';
|
|
10
|
+
export * from './dtos/responses/CollectorAssignmentResponse';
|
|
11
|
+
export * from './dtos/responses/CollectorLoadResponse';
|
|
12
|
+
export * from './dtos/responses/RedistributeSummaryResponse';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
// Enums
|
|
18
|
+
__exportStar(require("./enums/AssignmentStrategyEnum"), exports);
|
|
19
|
+
__exportStar(require("./enums/AssignmentStatusEnum"), exports);
|
|
20
|
+
// Shared DTOs
|
|
21
|
+
__exportStar(require("./dtos/PriorityWeights"), exports);
|
|
22
|
+
// Request DTOs
|
|
23
|
+
__exportStar(require("./dtos/requests/CreateAssignmentRuleRequest"), exports);
|
|
24
|
+
__exportStar(require("./dtos/requests/UpdateAssignmentRuleRequest"), exports);
|
|
25
|
+
__exportStar(require("./dtos/requests/AutoAssignRequest"), exports);
|
|
26
|
+
__exportStar(require("./dtos/requests/ReassignRequest"), exports);
|
|
27
|
+
__exportStar(require("./dtos/requests/RedistributeRequest"), exports);
|
|
28
|
+
// Response DTOs
|
|
29
|
+
__exportStar(require("./dtos/responses/AssignmentRuleResponse"), exports);
|
|
30
|
+
__exportStar(require("./dtos/responses/CollectorAssignmentResponse"), exports);
|
|
31
|
+
__exportStar(require("./dtos/responses/CollectorLoadResponse"), exports);
|
|
32
|
+
__exportStar(require("./dtos/responses/RedistributeSummaryResponse"), exports);
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -108,5 +108,8 @@ export * as LoanConfig from './loanConfig';
|
|
|
108
108
|
// LoanOfferings: DTOs/enums del lambda loan-offerings-business (comp 07 — planes de crédito,
|
|
109
109
|
// financieras, M:N retailer↔plan y simulador de cuota; SureKeep Fase 1 — pista Loan).
|
|
110
110
|
export * as LoanOfferings from './loanOfferings';
|
|
111
|
+
// LoanCollectorAssignment: DTOs/enums del lambda loan-collector-assignment-business (comp 08 — reglas de
|
|
112
|
+
// asignación de cartera de cobranza + asignaciones crédito↔cobrador; SureKeep Fase 1 — pista Loan).
|
|
113
|
+
export * as LoanCollectorAssignment from './loanCollectorAssignment';
|
|
111
114
|
export * from './messaging';
|
|
112
115
|
export * from './complaint';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsInt, Max, Min } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Pesos del ranking ponderado del algoritmo (modelo-datos §7.1). Cada peso es 0..100; la regla
|
|
6
|
+
* cross-campo `storeMatch + loadAvailable + seniority === 100` la valida el manager del lambda
|
|
7
|
+
* (WeightsSumInvalidError) — class-validator no cubre validaciones entre campos.
|
|
8
|
+
*/
|
|
9
|
+
export class PriorityWeights {
|
|
10
|
+
@Expose()
|
|
11
|
+
@IsInt()
|
|
12
|
+
@Min(0)
|
|
13
|
+
@Max(100)
|
|
14
|
+
storeMatch!: number;
|
|
15
|
+
|
|
16
|
+
@Expose()
|
|
17
|
+
@IsInt()
|
|
18
|
+
@Min(0)
|
|
19
|
+
@Max(100)
|
|
20
|
+
loadAvailable!: number;
|
|
21
|
+
|
|
22
|
+
@Expose()
|
|
23
|
+
@IsInt()
|
|
24
|
+
@Min(0)
|
|
25
|
+
@Max(100)
|
|
26
|
+
seniority!: number;
|
|
27
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsNotEmpty, IsString } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Body de POST /private/collector-assignments/auto-assign (hot path). Lo invoca loan-credit-business
|
|
6
|
+
* al crearse un crédito (F3+); en F1 se prueba con `creditId` dummy. Elige cobrador y persiste ACTIVE.
|
|
7
|
+
*/
|
|
8
|
+
export class AutoAssignRequest {
|
|
9
|
+
@Expose()
|
|
10
|
+
@IsString()
|
|
11
|
+
@IsNotEmpty()
|
|
12
|
+
retailerId!: string;
|
|
13
|
+
|
|
14
|
+
@Expose()
|
|
15
|
+
@IsString()
|
|
16
|
+
@IsNotEmpty()
|
|
17
|
+
creditId!: string;
|
|
18
|
+
|
|
19
|
+
@Expose()
|
|
20
|
+
@IsString()
|
|
21
|
+
@IsNotEmpty()
|
|
22
|
+
storeId!: string;
|
|
23
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Expose, Type } from 'class-transformer';
|
|
2
|
+
import { IsBoolean, IsEnum, IsInt, IsOptional, Min, ValidateNested } from 'class-validator';
|
|
3
|
+
import { AssignmentStrategyEnum } from '../../enums/AssignmentStrategyEnum';
|
|
4
|
+
import { PriorityWeights } from '../PriorityWeights';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Body de POST /retailers/:retailerId/assignment-rules. Crea una regla de asignación.
|
|
8
|
+
* Los pesos deben sumar 100 (lo valida el manager). `active: true` desactiva la regla activa anterior.
|
|
9
|
+
*/
|
|
10
|
+
export class CreateAssignmentRuleRequest {
|
|
11
|
+
@Expose()
|
|
12
|
+
@IsEnum(AssignmentStrategyEnum)
|
|
13
|
+
strategy!: AssignmentStrategyEnum;
|
|
14
|
+
|
|
15
|
+
@Expose()
|
|
16
|
+
@IsOptional()
|
|
17
|
+
@IsInt()
|
|
18
|
+
@Min(1)
|
|
19
|
+
maxLoadPerCollector?: number | null;
|
|
20
|
+
|
|
21
|
+
@Expose()
|
|
22
|
+
@ValidateNested()
|
|
23
|
+
@Type(() => PriorityWeights)
|
|
24
|
+
priorityWeights!: PriorityWeights;
|
|
25
|
+
|
|
26
|
+
@Expose()
|
|
27
|
+
@IsBoolean()
|
|
28
|
+
active!: boolean;
|
|
29
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsNotEmpty, IsString } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Body de POST /retailers/:retailerId/collector-assignments/:assignmentId/reassign (reasignación manual).
|
|
6
|
+
* `reason` obligatorio (auditoría de acción crítica — modelo-datos §10).
|
|
7
|
+
*/
|
|
8
|
+
export class ReassignRequest {
|
|
9
|
+
@Expose()
|
|
10
|
+
@IsString()
|
|
11
|
+
@IsNotEmpty()
|
|
12
|
+
reason!: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsNotEmpty, IsString } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Body de POST /retailers/:retailerId/collectors/:userId/redistribute. Redistribuye la cartera activa de
|
|
6
|
+
* un cobrador (ej. al desactivarlo). `reason` obligatorio (ej. `USER_INACTIVATED`) — auditoría §10.
|
|
7
|
+
*/
|
|
8
|
+
export class RedistributeRequest {
|
|
9
|
+
@Expose()
|
|
10
|
+
@IsString()
|
|
11
|
+
@IsNotEmpty()
|
|
12
|
+
reason!: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Expose, Type } from 'class-transformer';
|
|
2
|
+
import { IsBoolean, IsEnum, IsInt, IsOptional, Min, ValidateNested } from 'class-validator';
|
|
3
|
+
import { AssignmentStrategyEnum } from '../../enums/AssignmentStrategyEnum';
|
|
4
|
+
import { PriorityWeights } from '../PriorityWeights';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Body de PUT /retailers/:retailerId/assignment-rules/:ruleId. Update parcial: todos los campos opcionales.
|
|
8
|
+
* Si se envían `priorityWeights`, deben sumar 100 (lo valida el manager).
|
|
9
|
+
*/
|
|
10
|
+
export class UpdateAssignmentRuleRequest {
|
|
11
|
+
@Expose()
|
|
12
|
+
@IsOptional()
|
|
13
|
+
@IsEnum(AssignmentStrategyEnum)
|
|
14
|
+
strategy?: AssignmentStrategyEnum;
|
|
15
|
+
|
|
16
|
+
@Expose()
|
|
17
|
+
@IsOptional()
|
|
18
|
+
@IsInt()
|
|
19
|
+
@Min(1)
|
|
20
|
+
maxLoadPerCollector?: number | null;
|
|
21
|
+
|
|
22
|
+
@Expose()
|
|
23
|
+
@IsOptional()
|
|
24
|
+
@ValidateNested()
|
|
25
|
+
@Type(() => PriorityWeights)
|
|
26
|
+
priorityWeights?: PriorityWeights;
|
|
27
|
+
|
|
28
|
+
@Expose()
|
|
29
|
+
@IsOptional()
|
|
30
|
+
@IsBoolean()
|
|
31
|
+
active?: boolean;
|
|
32
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AssignmentStrategyEnum } from '../../enums/AssignmentStrategyEnum';
|
|
2
|
+
import { PriorityWeights } from '../PriorityWeights';
|
|
3
|
+
|
|
4
|
+
/** Shape de salida de una regla de asignación (modelo-datos §7.1). */
|
|
5
|
+
export interface AssignmentRuleResponse {
|
|
6
|
+
ruleId: string;
|
|
7
|
+
retailerId: string;
|
|
8
|
+
strategy: AssignmentStrategyEnum;
|
|
9
|
+
maxLoadPerCollector: number | null;
|
|
10
|
+
priorityWeights: PriorityWeights;
|
|
11
|
+
active: boolean;
|
|
12
|
+
createdBy: string;
|
|
13
|
+
updatedBy: string;
|
|
14
|
+
createdAt: string;
|
|
15
|
+
updatedAt: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AssignmentStatusEnum } from '../../enums/AssignmentStatusEnum';
|
|
2
|
+
|
|
3
|
+
/** Shape de salida de una asignación crédito↔cobrador (modelo-datos §7.2). */
|
|
4
|
+
export interface CollectorAssignmentResponse {
|
|
5
|
+
assignmentId: string;
|
|
6
|
+
retailerId: string;
|
|
7
|
+
creditId: string;
|
|
8
|
+
storeId: string;
|
|
9
|
+
collectorUserId: string;
|
|
10
|
+
assignedAt: string;
|
|
11
|
+
status: AssignmentStatusEnum;
|
|
12
|
+
reassignedFromUserId: string | null;
|
|
13
|
+
createdBy: string;
|
|
14
|
+
updatedBy: string;
|
|
15
|
+
createdAt: string;
|
|
16
|
+
updatedAt: string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Carga actual de un cobrador (flow 07.2 / GET /retailers/:retailerId/collector-loads).
|
|
3
|
+
* `activeAssignments` = COUNT de asignaciones ACTIVE (GSI collectorUserId-assignedAt-index).
|
|
4
|
+
* `threshold` = maxLoadPerCollector de la regla activa (null si no hay tope).
|
|
5
|
+
*/
|
|
6
|
+
export interface CollectorLoadResponse {
|
|
7
|
+
collectorUserId: string;
|
|
8
|
+
activeAssignments: number;
|
|
9
|
+
threshold: number | null;
|
|
10
|
+
storeIds: string[];
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Resultado de redistribuir la cartera activa de un cobrador (flow 07.4). */
|
|
2
|
+
export interface RedistributeSummaryResponse {
|
|
3
|
+
reassignedCount: number;
|
|
4
|
+
errors: RedistributeError[];
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface RedistributeError {
|
|
8
|
+
creditId: string;
|
|
9
|
+
reason: string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Estado de una asignación crédito↔cobrador (modelo-datos §7.2). Historial append-only:
|
|
3
|
+
* 1 crédito = 1 `ACTIVE`; reasignación → row vieja `REASSIGNED`; release/liquidado → `INACTIVE`.
|
|
4
|
+
* @enum {string}
|
|
5
|
+
*/
|
|
6
|
+
export enum AssignmentStatusEnum {
|
|
7
|
+
ACTIVE = 'ACTIVE',
|
|
8
|
+
INACTIVE = 'INACTIVE',
|
|
9
|
+
REASSIGNED = 'REASSIGNED',
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Estrategia de asignación de cartera de cobranza (modelo-datos §7.1 / M6 §7.5).
|
|
3
|
+
* DEC-008 (loan-collector-assignment): se soportan las 4 + ranking híbrido (strategy + priorityWeights).
|
|
4
|
+
* A RATIFICAR con Jaime/senior: M6 §7.5 solo respalda 3 — `ROUND_ROBIN` es adición del spec 08.
|
|
5
|
+
* @enum {string}
|
|
6
|
+
*/
|
|
7
|
+
export enum AssignmentStrategyEnum {
|
|
8
|
+
BY_STORE = 'BY_STORE',
|
|
9
|
+
BY_LOAD = 'BY_LOAD',
|
|
10
|
+
BY_SENIORITY = 'BY_SENIORITY',
|
|
11
|
+
ROUND_ROBIN = 'ROUND_ROBIN',
|
|
12
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Enums
|
|
2
|
+
export * from './enums/AssignmentStrategyEnum';
|
|
3
|
+
export * from './enums/AssignmentStatusEnum';
|
|
4
|
+
|
|
5
|
+
// Shared DTOs
|
|
6
|
+
export * from './dtos/PriorityWeights';
|
|
7
|
+
|
|
8
|
+
// Request DTOs
|
|
9
|
+
export * from './dtos/requests/CreateAssignmentRuleRequest';
|
|
10
|
+
export * from './dtos/requests/UpdateAssignmentRuleRequest';
|
|
11
|
+
export * from './dtos/requests/AutoAssignRequest';
|
|
12
|
+
export * from './dtos/requests/ReassignRequest';
|
|
13
|
+
export * from './dtos/requests/RedistributeRequest';
|
|
14
|
+
|
|
15
|
+
// Response DTOs
|
|
16
|
+
export * from './dtos/responses/AssignmentRuleResponse';
|
|
17
|
+
export * from './dtos/responses/CollectorAssignmentResponse';
|
|
18
|
+
export * from './dtos/responses/CollectorLoadResponse';
|
|
19
|
+
export * from './dtos/responses/RedistributeSummaryResponse';
|