@fiado/type-kit 3.183.0 → 3.184.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/retailOrg/dtos/RetailUser.test.ts +30 -0
- package/_test_/unit/retailOrg/dtos/Retailer.test.ts +1 -1
- package/_test_/unit/retailOrg/dtos/Store.test.ts +2 -2
- package/_test_/unit/retailOrg/dtos/requests/retailUserRequests.test.ts +34 -0
- package/_test_/unit/retailOrg/dtos/requests/retailerRequests.test.ts +9 -9
- package/_test_/unit/retailOrg/dtos/requests/storeRequests.test.ts +2 -2
- package/_test_/unit/retailOrg/dtos/responses/RetailerHierarchyResponse.test.ts +1 -1
- package/_test_/unit/retailOrg/dtos/validation/validationDtos.test.ts +2 -2
- package/_test_/unit/retailOrg/enums/CollectorSeniorityEnum.test.ts +12 -0
- package/_test_/unit/retailOrg/enums/RetailerTypeEnum.test.ts +5 -5
- package/bin/benefitCenter/enums/BenefitFlowEnum.d.ts +11 -0
- package/bin/benefitCenter/enums/BenefitFlowEnum.js +15 -0
- package/bin/places/dtos/CashInFeeDto.d.ts +17 -0
- package/bin/places/dtos/CashInFeeDto.js +12 -0
- package/bin/platformRbac/dtos/ResendOtpRequest.d.ts +22 -0
- package/bin/platformRbac/dtos/ResendOtpRequest.js +36 -0
- package/bin/platformRbac/dtos/ResendSelfRegisterOtpRequest.d.ts +11 -0
- package/bin/platformRbac/dtos/ResendSelfRegisterOtpRequest.js +36 -0
- package/bin/retailOrg/dtos/RetailUser.d.ts +7 -0
- package/bin/retailOrg/dtos/RetailUser.js +20 -0
- package/bin/retailOrg/dtos/Store.d.ts +6 -2
- package/bin/retailOrg/dtos/Store.js +1 -1
- package/bin/retailOrg/dtos/requests/CreateRetailUserRequest.d.ts +7 -0
- package/bin/retailOrg/dtos/requests/CreateRetailUserRequest.js +20 -0
- package/bin/retailOrg/dtos/requests/CreateStoreRequest.d.ts +6 -2
- package/bin/retailOrg/dtos/requests/CreateStoreRequest.js +1 -1
- package/bin/retailOrg/dtos/requests/CreateSubdistributorRequest.d.ts +3 -3
- package/bin/retailOrg/dtos/requests/CreateSubdistributorRequest.js +3 -3
- package/bin/retailOrg/dtos/requests/UpdateRetailUserRequest.d.ts +7 -0
- package/bin/retailOrg/dtos/requests/UpdateRetailUserRequest.js +20 -0
- package/bin/retailOrg/dtos/requests/UpdateStoreRequest.d.ts +2 -1
- package/bin/retailOrg/dtos/requests/UpdateStoreRequest.js +1 -1
- package/bin/retailOrg/enums/CollectorSeniorityEnum.d.ts +12 -0
- package/bin/retailOrg/enums/CollectorSeniorityEnum.js +16 -0
- package/bin/retailOrg/enums/RetailerTypeEnum.d.ts +6 -6
- package/bin/retailOrg/enums/RetailerTypeEnum.js +6 -6
- package/bin/retailOrg/index.d.ts +1 -0
- package/bin/retailOrg/index.js +1 -0
- package/package.json +1 -1
- package/src/retailOrg/dtos/RetailUser.ts +21 -1
- package/src/retailOrg/dtos/Store.ts +6 -2
- package/src/retailOrg/dtos/requests/CreateRetailUserRequest.ts +21 -1
- package/src/retailOrg/dtos/requests/CreateStoreRequest.ts +6 -2
- package/src/retailOrg/dtos/requests/CreateSubdistributorRequest.ts +4 -4
- package/src/retailOrg/dtos/requests/UpdateRetailUserRequest.ts +21 -1
- package/src/retailOrg/dtos/requests/UpdateStoreRequest.ts +2 -1
- package/src/retailOrg/enums/CollectorSeniorityEnum.ts +12 -0
- package/src/retailOrg/enums/RetailerTypeEnum.ts +6 -6
- package/src/retailOrg/index.ts +1 -0
|
@@ -4,6 +4,7 @@ import { validate } from 'class-validator';
|
|
|
4
4
|
import { RetailUser } from '../../../../src/retailOrg/dtos/RetailUser';
|
|
5
5
|
import { EmploymentTypeEnum } from '../../../../src/retailOrg/enums/EmploymentTypeEnum';
|
|
6
6
|
import { RetailUserStatusEnum } from '../../../../src/retailOrg/enums/RetailUserStatusEnum';
|
|
7
|
+
import { CollectorSeniorityEnum } from '../../../../src/retailOrg/enums/CollectorSeniorityEnum';
|
|
7
8
|
|
|
8
9
|
const valid = {
|
|
9
10
|
retailUserId: 'ru_001',
|
|
@@ -33,6 +34,35 @@ describe('RetailUser', () => {
|
|
|
33
34
|
expect(errors).toEqual([]);
|
|
34
35
|
});
|
|
35
36
|
|
|
37
|
+
it('valida sin los campos de cobrador (phone/collectorSeniority/coverageStoreIds ausentes)', async () => {
|
|
38
|
+
const dto = plainToInstance(RetailUser, valid);
|
|
39
|
+
const errors = await validate(dto);
|
|
40
|
+
expect(errors).toEqual([]);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('valida con los campos de cobrador presentes', async () => {
|
|
44
|
+
const dto = plainToInstance(RetailUser, {
|
|
45
|
+
...valid,
|
|
46
|
+
phone: '+528112345678',
|
|
47
|
+
collectorSeniority: CollectorSeniorityEnum.SENIOR,
|
|
48
|
+
coverageStoreIds: ['store_001', 'store_002'],
|
|
49
|
+
});
|
|
50
|
+
const errors = await validate(dto);
|
|
51
|
+
expect(errors).toEqual([]);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('falla si collectorSeniority está fuera del enum', async () => {
|
|
55
|
+
const dto = plainToInstance(RetailUser, { ...valid, collectorSeniority: 'MASTER' });
|
|
56
|
+
const errors = await validate(dto);
|
|
57
|
+
expect(errors.some(e => e.property === 'collectorSeniority')).toBe(true);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it('falla si coverageStoreIds no es un array de strings', async () => {
|
|
61
|
+
const dto = plainToInstance(RetailUser, { ...valid, coverageStoreIds: [1, 2] });
|
|
62
|
+
const errors = await validate(dto);
|
|
63
|
+
expect(errors.some(e => e.property === 'coverageStoreIds')).toBe(true);
|
|
64
|
+
});
|
|
65
|
+
|
|
36
66
|
it('falla si employmentType está fuera del enum', async () => {
|
|
37
67
|
const dto = plainToInstance(RetailUser, { ...valid, employmentType: 'INTERN' });
|
|
38
68
|
const errors = await validate(dto);
|
|
@@ -8,7 +8,7 @@ import { RetailerStatusEnum } from '../../../../src/retailOrg/enums/RetailerStat
|
|
|
8
8
|
const valid = {
|
|
9
9
|
retailerId: 'ret_001',
|
|
10
10
|
parentId: 'ROOT',
|
|
11
|
-
type: RetailerTypeEnum.
|
|
11
|
+
type: RetailerTypeEnum.CHAIN,
|
|
12
12
|
name: 'Tiendas del Centro',
|
|
13
13
|
legalName: 'Tiendas del Centro SA de CV',
|
|
14
14
|
rfc: 'VEN123456ABC',
|
|
@@ -15,7 +15,7 @@ const valid = {
|
|
|
15
15
|
phone: '+528112345678',
|
|
16
16
|
managerRetailUserId: 'ru_010',
|
|
17
17
|
schedule: 'L-V 9:00-18:00',
|
|
18
|
-
|
|
18
|
+
dailyAvgCollectionsCount: 12,
|
|
19
19
|
status: StoreStatusEnum.ACTIVE,
|
|
20
20
|
createdAt: '2026-07-14T10:00:00.000Z',
|
|
21
21
|
updatedAt: '2026-07-14T10:00:00.000Z',
|
|
@@ -36,7 +36,7 @@ describe('Store', () => {
|
|
|
36
36
|
zoneId: null,
|
|
37
37
|
managerRetailUserId: null,
|
|
38
38
|
schedule: null,
|
|
39
|
-
|
|
39
|
+
dailyAvgCollectionsCount: null,
|
|
40
40
|
});
|
|
41
41
|
const errors = await validate(dto);
|
|
42
42
|
expect(errors).toEqual([]);
|
|
@@ -7,6 +7,7 @@ import { ChangeRetailUserStatusRequest } from '../../../../../src/retailOrg/dtos
|
|
|
7
7
|
import { TransferRetailUserRequest } from '../../../../../src/retailOrg/dtos/requests/TransferRetailUserRequest';
|
|
8
8
|
import { EmploymentTypeEnum } from '../../../../../src/retailOrg/enums/EmploymentTypeEnum';
|
|
9
9
|
import { RetailUserStatusEnum } from '../../../../../src/retailOrg/enums/RetailUserStatusEnum';
|
|
10
|
+
import { CollectorSeniorityEnum } from '../../../../../src/retailOrg/enums/CollectorSeniorityEnum';
|
|
10
11
|
|
|
11
12
|
const validCreate = {
|
|
12
13
|
cognitoSub: '5f7c8a90-1234-4abc-9def-0123456789ab',
|
|
@@ -29,6 +30,23 @@ describe('CreateRetailUserRequest', () => {
|
|
|
29
30
|
expect(errors).toEqual([]);
|
|
30
31
|
});
|
|
31
32
|
|
|
33
|
+
it('valida con los campos de cobrador presentes', async () => {
|
|
34
|
+
const dto = plainToInstance(CreateRetailUserRequest, {
|
|
35
|
+
...validCreate,
|
|
36
|
+
phone: '+528112345678',
|
|
37
|
+
collectorSeniority: CollectorSeniorityEnum.JUNIOR,
|
|
38
|
+
coverageStoreIds: ['store_001', 'store_002'],
|
|
39
|
+
});
|
|
40
|
+
const errors = await validate(dto);
|
|
41
|
+
expect(errors).toEqual([]);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('falla si collectorSeniority está fuera del enum', async () => {
|
|
45
|
+
const dto = plainToInstance(CreateRetailUserRequest, { ...validCreate, collectorSeniority: 'MASTER' });
|
|
46
|
+
const errors = await validate(dto);
|
|
47
|
+
expect(errors.some(e => e.property === 'collectorSeniority')).toBe(true);
|
|
48
|
+
});
|
|
49
|
+
|
|
32
50
|
it('falla si employmentType está fuera del enum', async () => {
|
|
33
51
|
const dto = plainToInstance(CreateRetailUserRequest, { ...validCreate, employmentType: 'INTERN' });
|
|
34
52
|
const errors = await validate(dto);
|
|
@@ -55,6 +73,22 @@ describe('UpdateRetailUserRequest', () => {
|
|
|
55
73
|
const errors = await validate(dto);
|
|
56
74
|
expect(errors.some(e => e.property === 'employmentType')).toBe(true);
|
|
57
75
|
});
|
|
76
|
+
|
|
77
|
+
it('valida con los campos de cobrador presentes', async () => {
|
|
78
|
+
const dto = plainToInstance(UpdateRetailUserRequest, {
|
|
79
|
+
phone: '+528112345678',
|
|
80
|
+
collectorSeniority: CollectorSeniorityEnum.SENIOR,
|
|
81
|
+
coverageStoreIds: ['store_003'],
|
|
82
|
+
});
|
|
83
|
+
const errors = await validate(dto);
|
|
84
|
+
expect(errors).toEqual([]);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it('falla si collectorSeniority enviado está fuera del enum', async () => {
|
|
88
|
+
const dto = plainToInstance(UpdateRetailUserRequest, { collectorSeniority: 'MASTER' });
|
|
89
|
+
const errors = await validate(dto);
|
|
90
|
+
expect(errors.some(e => e.property === 'collectorSeniority')).toBe(true);
|
|
91
|
+
});
|
|
58
92
|
});
|
|
59
93
|
|
|
60
94
|
describe('ChangeRetailUserStatusRequest', () => {
|
|
@@ -18,7 +18,7 @@ const address = {
|
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
const validCreate = {
|
|
21
|
-
type: RetailerTypeEnum.
|
|
21
|
+
type: RetailerTypeEnum.CHAIN,
|
|
22
22
|
name: 'Tiendas del Centro',
|
|
23
23
|
legalName: 'Tiendas del Centro SA de CV',
|
|
24
24
|
rfc: 'VEN123456ABC',
|
|
@@ -91,7 +91,7 @@ describe('UpdateRetailerRequest', () => {
|
|
|
91
91
|
it('NO permite editar rfc/type/status (no están en el shape)', () => {
|
|
92
92
|
const dto = plainToInstance(
|
|
93
93
|
UpdateRetailerRequest,
|
|
94
|
-
{ rfc: 'X', type: '
|
|
94
|
+
{ rfc: 'X', type: 'CHAIN', status: 'ACTIVE' } as object,
|
|
95
95
|
{ excludeExtraneousValues: true },
|
|
96
96
|
);
|
|
97
97
|
expect((dto as unknown as Record<string, unknown>).rfc).toBeUndefined();
|
|
@@ -115,28 +115,28 @@ describe('ChangeRetailerStatusRequest', () => {
|
|
|
115
115
|
});
|
|
116
116
|
|
|
117
117
|
describe('CreateSubdistributorRequest', () => {
|
|
118
|
-
it('valida
|
|
118
|
+
it('valida SUBDISTRIBUTOR', async () => {
|
|
119
119
|
const dto = plainToInstance(CreateSubdistributorRequest, {
|
|
120
120
|
...validCreate,
|
|
121
|
-
type: RetailerTypeEnum.
|
|
121
|
+
type: RetailerTypeEnum.SUBDISTRIBUTOR,
|
|
122
122
|
});
|
|
123
123
|
const errors = await validate(dto);
|
|
124
124
|
expect(errors).toEqual([]);
|
|
125
125
|
});
|
|
126
126
|
|
|
127
|
-
it('valida
|
|
127
|
+
it('valida FRANCHISE', async () => {
|
|
128
128
|
const dto = plainToInstance(CreateSubdistributorRequest, {
|
|
129
129
|
...validCreate,
|
|
130
|
-
type: RetailerTypeEnum.
|
|
130
|
+
type: RetailerTypeEnum.FRANCHISE,
|
|
131
131
|
});
|
|
132
132
|
const errors = await validate(dto);
|
|
133
133
|
expect(errors).toEqual([]);
|
|
134
134
|
});
|
|
135
135
|
|
|
136
|
-
it('falla si type es
|
|
136
|
+
it('falla si type es CHAIN (un subdistribuidor no puede ser cadena raíz)', async () => {
|
|
137
137
|
const dto = plainToInstance(CreateSubdistributorRequest, {
|
|
138
138
|
...validCreate,
|
|
139
|
-
type: RetailerTypeEnum.
|
|
139
|
+
type: RetailerTypeEnum.CHAIN,
|
|
140
140
|
});
|
|
141
141
|
const errors = await validate(dto);
|
|
142
142
|
expect(errors.some(e => e.property === 'type')).toBe(true);
|
|
@@ -145,7 +145,7 @@ describe('CreateSubdistributorRequest', () => {
|
|
|
145
145
|
it('NO expone parentId (viene del path param)', () => {
|
|
146
146
|
const dto = plainToInstance(
|
|
147
147
|
CreateSubdistributorRequest,
|
|
148
|
-
{ ...validCreate, type: RetailerTypeEnum.
|
|
148
|
+
{ ...validCreate, type: RetailerTypeEnum.SUBDISTRIBUTOR, parentId: 'ret_root' } as object,
|
|
149
149
|
{ excludeExtraneousValues: true },
|
|
150
150
|
);
|
|
151
151
|
expect((dto as unknown as Record<string, unknown>).parentId).toBeUndefined();
|
|
@@ -24,7 +24,7 @@ const validCreate = {
|
|
|
24
24
|
phone: '+528112345678',
|
|
25
25
|
managerRetailUserId: 'ru_010',
|
|
26
26
|
schedule: 'L-V 9:00-18:00',
|
|
27
|
-
|
|
27
|
+
dailyAvgCollectionsCount: 12,
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
describe('CreateStoreRequest', () => {
|
|
@@ -40,7 +40,7 @@ describe('CreateStoreRequest', () => {
|
|
|
40
40
|
zoneId: null,
|
|
41
41
|
managerRetailUserId: null,
|
|
42
42
|
schedule: null,
|
|
43
|
-
|
|
43
|
+
dailyAvgCollectionsCount: null,
|
|
44
44
|
});
|
|
45
45
|
const errors = await validate(dto);
|
|
46
46
|
expect(errors).toEqual([]);
|
|
@@ -12,12 +12,12 @@ describe('ValidationDtos (shapes mínimos de endpoints privados)', () => {
|
|
|
12
12
|
const dto: RetailerValidationDto = {
|
|
13
13
|
retailerId: 'ret_001',
|
|
14
14
|
name: 'Tiendas del Centro',
|
|
15
|
-
type: RetailerTypeEnum.
|
|
15
|
+
type: RetailerTypeEnum.CHAIN,
|
|
16
16
|
status: RetailerStatusEnum.ACTIVE,
|
|
17
17
|
parentId: 'ROOT',
|
|
18
18
|
};
|
|
19
19
|
expect(dto.retailerId).toBe('ret_001');
|
|
20
|
-
expect(dto.type).toBe(RetailerTypeEnum.
|
|
20
|
+
expect(dto.type).toBe(RetailerTypeEnum.CHAIN);
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
it('StoreValidationDto acepta el shape mínimo (zoneId nullable)', () => {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CollectorSeniorityEnum } from '../../../../src/retailOrg/enums/CollectorSeniorityEnum';
|
|
2
|
+
|
|
3
|
+
describe('CollectorSeniorityEnum', () => {
|
|
4
|
+
it('contiene exactamente los niveles del contrato con value === key', () => {
|
|
5
|
+
expect(CollectorSeniorityEnum.JUNIOR).toBe('JUNIOR');
|
|
6
|
+
expect(CollectorSeniorityEnum.SENIOR).toBe('SENIOR');
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
it('no tiene valores de más', () => {
|
|
10
|
+
expect(Object.values(CollectorSeniorityEnum).sort()).toEqual(['JUNIOR', 'SENIOR']);
|
|
11
|
+
});
|
|
12
|
+
});
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { RetailerTypeEnum } from '../../../../src/retailOrg/enums/RetailerTypeEnum';
|
|
2
2
|
|
|
3
3
|
describe('RetailerTypeEnum', () => {
|
|
4
|
-
it('contiene exactamente los tipos del contrato con value === key', () => {
|
|
5
|
-
expect(RetailerTypeEnum.
|
|
6
|
-
expect(RetailerTypeEnum.
|
|
7
|
-
expect(RetailerTypeEnum.
|
|
4
|
+
it('contiene exactamente los tipos del contrato con value === key (en inglés)', () => {
|
|
5
|
+
expect(RetailerTypeEnum.CHAIN).toBe('CHAIN');
|
|
6
|
+
expect(RetailerTypeEnum.SUBDISTRIBUTOR).toBe('SUBDISTRIBUTOR');
|
|
7
|
+
expect(RetailerTypeEnum.FRANCHISE).toBe('FRANCHISE');
|
|
8
8
|
});
|
|
9
9
|
|
|
10
10
|
it('no tiene valores de más', () => {
|
|
11
11
|
expect(Object.values(RetailerTypeEnum).sort()).toEqual(
|
|
12
|
-
['
|
|
12
|
+
['CHAIN', 'FRANCHISE', 'SUBDISTRIBUTOR'],
|
|
13
13
|
);
|
|
14
14
|
});
|
|
15
15
|
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare enum BenefitFlowEnum {
|
|
2
|
+
TOPUPS = "TOPUPS",
|
|
3
|
+
BILL_PAYMENT = "BILL_PAYMENT",
|
|
4
|
+
CREDIT = "CREDIT",
|
|
5
|
+
INSURANCE = "INSURANCE",
|
|
6
|
+
DONATION = "DONATION",
|
|
7
|
+
PHARMACY = "PHARMACY",
|
|
8
|
+
REMITTANCE = "REMITTANCE",
|
|
9
|
+
/** Fondeo de wallet PCF con efectivo via provider externo (Equality/Passport, OpenPay, …) — spec 13. */
|
|
10
|
+
WALLET_FUNDING = "WALLET_FUNDING"
|
|
11
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BenefitFlowEnum = void 0;
|
|
4
|
+
var BenefitFlowEnum;
|
|
5
|
+
(function (BenefitFlowEnum) {
|
|
6
|
+
BenefitFlowEnum["TOPUPS"] = "TOPUPS";
|
|
7
|
+
BenefitFlowEnum["BILL_PAYMENT"] = "BILL_PAYMENT";
|
|
8
|
+
BenefitFlowEnum["CREDIT"] = "CREDIT";
|
|
9
|
+
BenefitFlowEnum["INSURANCE"] = "INSURANCE";
|
|
10
|
+
BenefitFlowEnum["DONATION"] = "DONATION";
|
|
11
|
+
BenefitFlowEnum["PHARMACY"] = "PHARMACY";
|
|
12
|
+
BenefitFlowEnum["REMITTANCE"] = "REMITTANCE";
|
|
13
|
+
/** Fondeo de wallet PCF con efectivo via provider externo (Equality/Passport, OpenPay, …) — spec 13. */
|
|
14
|
+
BenefitFlowEnum["WALLET_FUNDING"] = "WALLET_FUNDING";
|
|
15
|
+
})(BenefitFlowEnum || (exports.BenefitFlowEnum = BenefitFlowEnum = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CurrencyId } from '../../currency/enums/CurrencyId';
|
|
2
|
+
/**
|
|
3
|
+
* Comisión que cobra un punto de cash-in (lo que el lambda MUESTRA, no cobra).
|
|
4
|
+
* - GreenDot (US): representativo por cadena → `fixed` + `cap` (cada tienda cobra hasta el tope).
|
|
5
|
+
* - Passport (MX): por red → `fixed` + `percentage`.
|
|
6
|
+
* Response DTO — sin decoradores de validación.
|
|
7
|
+
*/
|
|
8
|
+
export declare class CashInFeeDto {
|
|
9
|
+
/** Comisión fija, en la moneda del país. */
|
|
10
|
+
fixed?: number;
|
|
11
|
+
/** Porcentaje del monto depositado (0–100). */
|
|
12
|
+
percentage?: number;
|
|
13
|
+
/** Tope máximo de comisión (GreenDot: el asociado cobra hasta este cap). */
|
|
14
|
+
cap?: number;
|
|
15
|
+
/** Moneda del fee: USD (GreenDot) | MXN (Passport). */
|
|
16
|
+
currency: CurrencyId;
|
|
17
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CashInFeeDto = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Comisión que cobra un punto de cash-in (lo que el lambda MUESTRA, no cobra).
|
|
6
|
+
* - GreenDot (US): representativo por cadena → `fixed` + `cap` (cada tienda cobra hasta el tope).
|
|
7
|
+
* - Passport (MX): por red → `fixed` + `percentage`.
|
|
8
|
+
* Response DTO — sin decoradores de validación.
|
|
9
|
+
*/
|
|
10
|
+
class CashInFeeDto {
|
|
11
|
+
}
|
|
12
|
+
exports.CashInFeeDto = CashInFeeDto;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { MfaMethodEnum } from '../enums/MfaMethodEnum';
|
|
2
|
+
/**
|
|
3
|
+
* Body del POST /auth/resend-otp (público, anónimo). DEC-RBAC-054.
|
|
4
|
+
* Reenvía el OTP del login re-disparando el challenge real CUSTOM_AUTH (EMAIL_OTP) para la
|
|
5
|
+
* identidad SIN password. `tenantId` obligatorio (DEC-064 — el picker ya lo resolvió, NO "solo email").
|
|
6
|
+
* El email se normaliza lowercase server-side. Postura anti-enumeración: respuesta 200 genérica
|
|
7
|
+
* siempre, sin filtrar existencia (ver AuthLoginManager.resendChallengeOtp).
|
|
8
|
+
*/
|
|
9
|
+
export declare class ResendOtpRequest {
|
|
10
|
+
email: string;
|
|
11
|
+
tenantId: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Respuesta del resend-otp. `session`/`mfaMethod` frescos del nuevo challenge CUSTOM_AUTH.
|
|
15
|
+
* Plain sin validators (no validamos lo que mandamos al cliente — fiado-validation-and-dtos § 7).
|
|
16
|
+
* Ambos opcionales: en los caminos de rechazo silencioso (anti-enumeración) o ramas sin CUSTOM_AUTH
|
|
17
|
+
* el server responde 200 genérico sin session ni método.
|
|
18
|
+
*/
|
|
19
|
+
export interface ResendOtpResponse {
|
|
20
|
+
session?: string;
|
|
21
|
+
mfaMethod?: MfaMethodEnum;
|
|
22
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
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.ResendOtpRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
/**
|
|
16
|
+
* Body del POST /auth/resend-otp (público, anónimo). DEC-RBAC-054.
|
|
17
|
+
* Reenvía el OTP del login re-disparando el challenge real CUSTOM_AUTH (EMAIL_OTP) para la
|
|
18
|
+
* identidad SIN password. `tenantId` obligatorio (DEC-064 — el picker ya lo resolvió, NO "solo email").
|
|
19
|
+
* El email se normaliza lowercase server-side. Postura anti-enumeración: respuesta 200 genérica
|
|
20
|
+
* siempre, sin filtrar existencia (ver AuthLoginManager.resendChallengeOtp).
|
|
21
|
+
*/
|
|
22
|
+
class ResendOtpRequest {
|
|
23
|
+
}
|
|
24
|
+
exports.ResendOtpRequest = ResendOtpRequest;
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_transformer_1.Expose)(),
|
|
27
|
+
(0, class_validator_1.IsEmail)(),
|
|
28
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], ResendOtpRequest.prototype, "email", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, class_transformer_1.Expose)(),
|
|
33
|
+
(0, class_validator_1.IsString)(),
|
|
34
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], ResendOtpRequest.prototype, "tenantId", void 0);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Body del POST /self-register/resend-otp (público, anónimo). DEC-RBAC-054.
|
|
3
|
+
* Re-envía el OTP del autoregistro (mecanismo messages-business, NO Cognito) tras validar un
|
|
4
|
+
* `pending` existente. Misma postura anti-enumeración del start. El email se normaliza lowercase
|
|
5
|
+
* server-side. DTO propio por endpoint (NO reusa SelfRegisterStartRequest, que exige roleId/scope/
|
|
6
|
+
* scopeRef, ni SelfRegisterVerifyOtpRequest, que exige otp).
|
|
7
|
+
*/
|
|
8
|
+
export declare class ResendSelfRegisterOtpRequest {
|
|
9
|
+
tenantId: string;
|
|
10
|
+
email: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
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.ResendSelfRegisterOtpRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
/**
|
|
16
|
+
* Body del POST /self-register/resend-otp (público, anónimo). DEC-RBAC-054.
|
|
17
|
+
* Re-envía el OTP del autoregistro (mecanismo messages-business, NO Cognito) tras validar un
|
|
18
|
+
* `pending` existente. Misma postura anti-enumeración del start. El email se normaliza lowercase
|
|
19
|
+
* server-side. DTO propio por endpoint (NO reusa SelfRegisterStartRequest, que exige roleId/scope/
|
|
20
|
+
* scopeRef, ni SelfRegisterVerifyOtpRequest, que exige otp).
|
|
21
|
+
*/
|
|
22
|
+
class ResendSelfRegisterOtpRequest {
|
|
23
|
+
}
|
|
24
|
+
exports.ResendSelfRegisterOtpRequest = ResendSelfRegisterOtpRequest;
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_transformer_1.Expose)(),
|
|
27
|
+
(0, class_validator_1.IsString)(),
|
|
28
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], ResendSelfRegisterOtpRequest.prototype, "tenantId", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, class_transformer_1.Expose)(),
|
|
33
|
+
(0, class_validator_1.IsEmail)(),
|
|
34
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], ResendSelfRegisterOtpRequest.prototype, "email", void 0);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CollectorSeniorityEnum } from '../enums/CollectorSeniorityEnum';
|
|
1
2
|
import { EmploymentTypeEnum } from '../enums/EmploymentTypeEnum';
|
|
2
3
|
import { RetailUserStatusEnum } from '../enums/RetailUserStatusEnum';
|
|
3
4
|
/**
|
|
@@ -13,6 +14,12 @@ export declare class RetailUser {
|
|
|
13
14
|
zoneId: string | null;
|
|
14
15
|
employmentType: EmploymentTypeEnum;
|
|
15
16
|
commissionTier: string;
|
|
17
|
+
/** Teléfono de contacto del usuario retail; opcional. */
|
|
18
|
+
phone?: string;
|
|
19
|
+
/** Seniority del cobrador; solo aplica a usuarios retail con rol de cobrador. */
|
|
20
|
+
collectorSeniority?: CollectorSeniorityEnum;
|
|
21
|
+
/** Tiendas que cubre el cobrador (zona de cobranza); opcional. */
|
|
22
|
+
coverageStoreIds?: string[];
|
|
16
23
|
status: RetailUserStatusEnum;
|
|
17
24
|
createdAt: string;
|
|
18
25
|
updatedAt: string;
|
|
@@ -13,6 +13,7 @@ exports.RetailUser = void 0;
|
|
|
13
13
|
const class_transformer_1 = require("class-transformer");
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
15
|
const regex_1 = require("../../helpers/constans/regex");
|
|
16
|
+
const CollectorSeniorityEnum_1 = require("../enums/CollectorSeniorityEnum");
|
|
16
17
|
const EmploymentTypeEnum_1 = require("../enums/EmploymentTypeEnum");
|
|
17
18
|
const RetailUserStatusEnum_1 = require("../enums/RetailUserStatusEnum");
|
|
18
19
|
/**
|
|
@@ -58,6 +59,25 @@ __decorate([
|
|
|
58
59
|
(0, class_validator_1.IsString)(),
|
|
59
60
|
__metadata("design:type", String)
|
|
60
61
|
], RetailUser.prototype, "commissionTier", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, class_transformer_1.Expose)(),
|
|
64
|
+
(0, class_validator_1.IsOptional)(),
|
|
65
|
+
(0, class_validator_1.IsString)(),
|
|
66
|
+
__metadata("design:type", String)
|
|
67
|
+
], RetailUser.prototype, "phone", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, class_transformer_1.Expose)(),
|
|
70
|
+
(0, class_validator_1.IsOptional)(),
|
|
71
|
+
(0, class_validator_1.IsEnum)(CollectorSeniorityEnum_1.CollectorSeniorityEnum),
|
|
72
|
+
__metadata("design:type", String)
|
|
73
|
+
], RetailUser.prototype, "collectorSeniority", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, class_transformer_1.Expose)(),
|
|
76
|
+
(0, class_validator_1.IsOptional)(),
|
|
77
|
+
(0, class_validator_1.IsArray)(),
|
|
78
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
79
|
+
__metadata("design:type", Array)
|
|
80
|
+
], RetailUser.prototype, "coverageStoreIds", void 0);
|
|
61
81
|
__decorate([
|
|
62
82
|
(0, class_transformer_1.Expose)(),
|
|
63
83
|
(0, class_validator_1.IsEnum)(RetailUserStatusEnum_1.RetailUserStatusEnum),
|
|
@@ -22,8 +22,12 @@ export declare class Store {
|
|
|
22
22
|
managerRetailUserId: string | null;
|
|
23
23
|
/** Horario operativo (texto libre); `null` si no está definido. */
|
|
24
24
|
schedule: string | null;
|
|
25
|
-
/**
|
|
26
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Conteo promedio de transacciones de cobro por día (NO es un monto de dinero).
|
|
27
|
+
* `null` si no está registrado. El factor 2× que amplifica este conteo es global
|
|
28
|
+
* y vive en loan-config, no acá.
|
|
29
|
+
*/
|
|
30
|
+
dailyAvgCollectionsCount: number | null;
|
|
27
31
|
status: StoreStatusEnum;
|
|
28
32
|
createdAt: string;
|
|
29
33
|
updatedAt: string;
|
|
@@ -87,7 +87,7 @@ __decorate([
|
|
|
87
87
|
(0, class_validator_1.IsOptional)(),
|
|
88
88
|
(0, class_validator_1.IsNumber)(),
|
|
89
89
|
__metadata("design:type", Number)
|
|
90
|
-
], Store.prototype, "
|
|
90
|
+
], Store.prototype, "dailyAvgCollectionsCount", void 0);
|
|
91
91
|
__decorate([
|
|
92
92
|
(0, class_transformer_1.Expose)(),
|
|
93
93
|
(0, class_validator_1.IsEnum)(StoreStatusEnum_1.StoreStatusEnum),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CollectorSeniorityEnum } from '../../enums/CollectorSeniorityEnum';
|
|
1
2
|
import { EmploymentTypeEnum } from '../../enums/EmploymentTypeEnum';
|
|
2
3
|
/**
|
|
3
4
|
* Body de POST /retailers/:retailerId/users — alta de usuario retail (el `retailerId` sale del path;
|
|
@@ -10,4 +11,10 @@ export declare class CreateRetailUserRequest {
|
|
|
10
11
|
commissionTier: string;
|
|
11
12
|
/** Zona de operación del usuario; `null` si no está acotado a una zona. */
|
|
12
13
|
zoneId: string | null;
|
|
14
|
+
/** Teléfono de contacto del usuario retail; opcional. */
|
|
15
|
+
phone?: string;
|
|
16
|
+
/** Seniority del cobrador; solo aplica a usuarios retail con rol de cobrador. */
|
|
17
|
+
collectorSeniority?: CollectorSeniorityEnum;
|
|
18
|
+
/** Tiendas que cubre el cobrador (zona de cobranza); opcional. */
|
|
19
|
+
coverageStoreIds?: string[];
|
|
13
20
|
}
|
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.CreateRetailUserRequest = void 0;
|
|
13
13
|
const class_transformer_1 = require("class-transformer");
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
|
+
const CollectorSeniorityEnum_1 = require("../../enums/CollectorSeniorityEnum");
|
|
15
16
|
const EmploymentTypeEnum_1 = require("../../enums/EmploymentTypeEnum");
|
|
16
17
|
/**
|
|
17
18
|
* Body de POST /retailers/:retailerId/users — alta de usuario retail (el `retailerId` sale del path;
|
|
@@ -46,3 +47,22 @@ __decorate([
|
|
|
46
47
|
(0, class_validator_1.IsString)(),
|
|
47
48
|
__metadata("design:type", String)
|
|
48
49
|
], CreateRetailUserRequest.prototype, "zoneId", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, class_transformer_1.Expose)(),
|
|
52
|
+
(0, class_validator_1.IsOptional)(),
|
|
53
|
+
(0, class_validator_1.IsString)(),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], CreateRetailUserRequest.prototype, "phone", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, class_transformer_1.Expose)(),
|
|
58
|
+
(0, class_validator_1.IsOptional)(),
|
|
59
|
+
(0, class_validator_1.IsEnum)(CollectorSeniorityEnum_1.CollectorSeniorityEnum),
|
|
60
|
+
__metadata("design:type", String)
|
|
61
|
+
], CreateRetailUserRequest.prototype, "collectorSeniority", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, class_transformer_1.Expose)(),
|
|
64
|
+
(0, class_validator_1.IsOptional)(),
|
|
65
|
+
(0, class_validator_1.IsArray)(),
|
|
66
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
67
|
+
__metadata("design:type", Array)
|
|
68
|
+
], CreateRetailUserRequest.prototype, "coverageStoreIds", void 0);
|
|
@@ -17,6 +17,10 @@ export declare class CreateStoreRequest {
|
|
|
17
17
|
managerRetailUserId: string | null;
|
|
18
18
|
/** Horario operativo (texto libre); `null` si no está definido. */
|
|
19
19
|
schedule: string | null;
|
|
20
|
-
/**
|
|
21
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Conteo promedio de transacciones de cobro por día (NO es un monto de dinero).
|
|
22
|
+
* `null` si no está registrado. El factor 2× que amplifica este conteo es global
|
|
23
|
+
* y vive en loan-config, no acá.
|
|
24
|
+
*/
|
|
25
|
+
dailyAvgCollectionsCount: number | null;
|
|
22
26
|
}
|
|
@@ -4,11 +4,11 @@ import { RetailAddressInput } from './RetailAddressInput';
|
|
|
4
4
|
* Body de POST /retailers/:retailerId/subdistributors — alta de un retailer hijo colgando de
|
|
5
5
|
* `:retailerId` (el `parentId` sale del path param, NO del body).
|
|
6
6
|
*
|
|
7
|
-
* `type` se restringe a
|
|
8
|
-
*
|
|
7
|
+
* `type` se restringe a SUBDISTRIBUTOR | FRANCHISE con `@IsIn`: un nodo hijo no puede ser una
|
|
8
|
+
* CHAIN raíz (esa se crea con `CreateRetailerRequest`).
|
|
9
9
|
*/
|
|
10
10
|
export declare class CreateSubdistributorRequest {
|
|
11
|
-
type: RetailerTypeEnum.
|
|
11
|
+
type: RetailerTypeEnum.SUBDISTRIBUTOR | RetailerTypeEnum.FRANCHISE;
|
|
12
12
|
name: string;
|
|
13
13
|
legalName: string;
|
|
14
14
|
/** RFC mexicano — 12 (persona moral / empresa) o 13 (persona física). */
|
|
@@ -18,15 +18,15 @@ const RetailAddressInput_1 = require("./RetailAddressInput");
|
|
|
18
18
|
* Body de POST /retailers/:retailerId/subdistributors — alta de un retailer hijo colgando de
|
|
19
19
|
* `:retailerId` (el `parentId` sale del path param, NO del body).
|
|
20
20
|
*
|
|
21
|
-
* `type` se restringe a
|
|
22
|
-
*
|
|
21
|
+
* `type` se restringe a SUBDISTRIBUTOR | FRANCHISE con `@IsIn`: un nodo hijo no puede ser una
|
|
22
|
+
* CHAIN raíz (esa se crea con `CreateRetailerRequest`).
|
|
23
23
|
*/
|
|
24
24
|
class CreateSubdistributorRequest {
|
|
25
25
|
}
|
|
26
26
|
exports.CreateSubdistributorRequest = CreateSubdistributorRequest;
|
|
27
27
|
__decorate([
|
|
28
28
|
(0, class_transformer_1.Expose)(),
|
|
29
|
-
(0, class_validator_1.IsIn)([RetailerTypeEnum_1.RetailerTypeEnum.
|
|
29
|
+
(0, class_validator_1.IsIn)([RetailerTypeEnum_1.RetailerTypeEnum.SUBDISTRIBUTOR, RetailerTypeEnum_1.RetailerTypeEnum.FRANCHISE]),
|
|
30
30
|
__metadata("design:type", String)
|
|
31
31
|
], CreateSubdistributorRequest.prototype, "type", void 0);
|
|
32
32
|
__decorate([
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CollectorSeniorityEnum } from '../../enums/CollectorSeniorityEnum';
|
|
1
2
|
import { EmploymentTypeEnum } from '../../enums/EmploymentTypeEnum';
|
|
2
3
|
/**
|
|
3
4
|
* Body de PUT /users/:retailUserId — edición de usuario retail (campos editables opcionales).
|
|
@@ -8,4 +9,10 @@ export declare class UpdateRetailUserRequest {
|
|
|
8
9
|
employmentType?: EmploymentTypeEnum;
|
|
9
10
|
commissionTier?: string;
|
|
10
11
|
zoneId?: string | null;
|
|
12
|
+
/** Teléfono de contacto del usuario retail; opcional. */
|
|
13
|
+
phone?: string;
|
|
14
|
+
/** Seniority del cobrador; solo aplica a usuarios retail con rol de cobrador. */
|
|
15
|
+
collectorSeniority?: CollectorSeniorityEnum;
|
|
16
|
+
/** Tiendas que cubre el cobrador (zona de cobranza); opcional. */
|
|
17
|
+
coverageStoreIds?: string[];
|
|
11
18
|
}
|
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.UpdateRetailUserRequest = void 0;
|
|
13
13
|
const class_transformer_1 = require("class-transformer");
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
|
+
const CollectorSeniorityEnum_1 = require("../../enums/CollectorSeniorityEnum");
|
|
15
16
|
const EmploymentTypeEnum_1 = require("../../enums/EmploymentTypeEnum");
|
|
16
17
|
/**
|
|
17
18
|
* Body de PUT /users/:retailUserId — edición de usuario retail (campos editables opcionales).
|
|
@@ -39,3 +40,22 @@ __decorate([
|
|
|
39
40
|
(0, class_validator_1.IsString)(),
|
|
40
41
|
__metadata("design:type", String)
|
|
41
42
|
], UpdateRetailUserRequest.prototype, "zoneId", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, class_transformer_1.Expose)(),
|
|
45
|
+
(0, class_validator_1.IsOptional)(),
|
|
46
|
+
(0, class_validator_1.IsString)(),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], UpdateRetailUserRequest.prototype, "phone", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, class_transformer_1.Expose)(),
|
|
51
|
+
(0, class_validator_1.IsOptional)(),
|
|
52
|
+
(0, class_validator_1.IsEnum)(CollectorSeniorityEnum_1.CollectorSeniorityEnum),
|
|
53
|
+
__metadata("design:type", String)
|
|
54
|
+
], UpdateRetailUserRequest.prototype, "collectorSeniority", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, class_transformer_1.Expose)(),
|
|
57
|
+
(0, class_validator_1.IsOptional)(),
|
|
58
|
+
(0, class_validator_1.IsArray)(),
|
|
59
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
60
|
+
__metadata("design:type", Array)
|
|
61
|
+
], UpdateRetailUserRequest.prototype, "coverageStoreIds", void 0);
|
|
@@ -14,5 +14,6 @@ export declare class UpdateStoreRequest {
|
|
|
14
14
|
phone?: string;
|
|
15
15
|
managerRetailUserId?: string | null;
|
|
16
16
|
schedule?: string | null;
|
|
17
|
-
|
|
17
|
+
/** Conteo promedio de transacciones de cobro por día (NO es un monto de dinero). */
|
|
18
|
+
dailyAvgCollectionsCount?: number | null;
|
|
18
19
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Antigüedad / seniority de un cobrador retail en SureKeep.
|
|
3
|
+
* Solo aplica a usuarios retail que cumplen rol de cobrador.
|
|
4
|
+
* @enum {string}
|
|
5
|
+
*
|
|
6
|
+
* @property {string} JUNIOR - Cobrador de menor antigüedad / experiencia.
|
|
7
|
+
* @property {string} SENIOR - Cobrador de mayor antigüedad / experiencia.
|
|
8
|
+
*/
|
|
9
|
+
export declare enum CollectorSeniorityEnum {
|
|
10
|
+
JUNIOR = "JUNIOR",
|
|
11
|
+
SENIOR = "SENIOR"
|
|
12
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CollectorSeniorityEnum = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Antigüedad / seniority de un cobrador retail en SureKeep.
|
|
6
|
+
* Solo aplica a usuarios retail que cumplen rol de cobrador.
|
|
7
|
+
* @enum {string}
|
|
8
|
+
*
|
|
9
|
+
* @property {string} JUNIOR - Cobrador de menor antigüedad / experiencia.
|
|
10
|
+
* @property {string} SENIOR - Cobrador de mayor antigüedad / experiencia.
|
|
11
|
+
*/
|
|
12
|
+
var CollectorSeniorityEnum;
|
|
13
|
+
(function (CollectorSeniorityEnum) {
|
|
14
|
+
CollectorSeniorityEnum["JUNIOR"] = "JUNIOR";
|
|
15
|
+
CollectorSeniorityEnum["SENIOR"] = "SENIOR";
|
|
16
|
+
})(CollectorSeniorityEnum || (exports.CollectorSeniorityEnum = CollectorSeniorityEnum = {}));
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* Tipo de retailer en la organización comercial de SureKeep.
|
|
3
3
|
* @enum {string}
|
|
4
4
|
*
|
|
5
|
-
* @property {string}
|
|
6
|
-
* @property {string}
|
|
7
|
-
* @property {string}
|
|
5
|
+
* @property {string} CHAIN - Cadena comercial con múltiples tiendas propias.
|
|
6
|
+
* @property {string} SUBDISTRIBUTOR - Subdistribuidor que opera bajo un distribuidor mayor.
|
|
7
|
+
* @property {string} FRANCHISE - Franquicia operada por un tercero bajo la marca.
|
|
8
8
|
*/
|
|
9
9
|
export declare enum RetailerTypeEnum {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
CHAIN = "CHAIN",
|
|
11
|
+
SUBDISTRIBUTOR = "SUBDISTRIBUTOR",
|
|
12
|
+
FRANCHISE = "FRANCHISE"
|
|
13
13
|
}
|
|
@@ -5,13 +5,13 @@ exports.RetailerTypeEnum = void 0;
|
|
|
5
5
|
* Tipo de retailer en la organización comercial de SureKeep.
|
|
6
6
|
* @enum {string}
|
|
7
7
|
*
|
|
8
|
-
* @property {string}
|
|
9
|
-
* @property {string}
|
|
10
|
-
* @property {string}
|
|
8
|
+
* @property {string} CHAIN - Cadena comercial con múltiples tiendas propias.
|
|
9
|
+
* @property {string} SUBDISTRIBUTOR - Subdistribuidor que opera bajo un distribuidor mayor.
|
|
10
|
+
* @property {string} FRANCHISE - Franquicia operada por un tercero bajo la marca.
|
|
11
11
|
*/
|
|
12
12
|
var RetailerTypeEnum;
|
|
13
13
|
(function (RetailerTypeEnum) {
|
|
14
|
-
RetailerTypeEnum["
|
|
15
|
-
RetailerTypeEnum["
|
|
16
|
-
RetailerTypeEnum["
|
|
14
|
+
RetailerTypeEnum["CHAIN"] = "CHAIN";
|
|
15
|
+
RetailerTypeEnum["SUBDISTRIBUTOR"] = "SUBDISTRIBUTOR";
|
|
16
|
+
RetailerTypeEnum["FRANCHISE"] = "FRANCHISE";
|
|
17
17
|
})(RetailerTypeEnum || (exports.RetailerTypeEnum = RetailerTypeEnum = {}));
|
package/bin/retailOrg/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './enums/ZoneStatusEnum';
|
|
|
4
4
|
export * from './enums/StoreStatusEnum';
|
|
5
5
|
export * from './enums/RetailUserStatusEnum';
|
|
6
6
|
export * from './enums/EmploymentTypeEnum';
|
|
7
|
+
export * from './enums/CollectorSeniorityEnum';
|
|
7
8
|
export * from './dtos/GeoLocation';
|
|
8
9
|
export * from './dtos/Retailer';
|
|
9
10
|
export * from './dtos/Zone';
|
package/bin/retailOrg/index.js
CHANGED
|
@@ -20,6 +20,7 @@ __exportStar(require("./enums/ZoneStatusEnum"), exports);
|
|
|
20
20
|
__exportStar(require("./enums/StoreStatusEnum"), exports);
|
|
21
21
|
__exportStar(require("./enums/RetailUserStatusEnum"), exports);
|
|
22
22
|
__exportStar(require("./enums/EmploymentTypeEnum"), exports);
|
|
23
|
+
__exportStar(require("./enums/CollectorSeniorityEnum"), exports);
|
|
23
24
|
// Entity DTOs
|
|
24
25
|
__exportStar(require("./dtos/GeoLocation"), exports);
|
|
25
26
|
__exportStar(require("./dtos/Retailer"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Expose } from 'class-transformer';
|
|
2
|
-
import { IsEnum, IsOptional, IsString, Matches } from 'class-validator';
|
|
2
|
+
import { IsArray, IsEnum, IsOptional, IsString, Matches } from 'class-validator';
|
|
3
3
|
import { regexIso8601 } from '../../helpers/constans/regex';
|
|
4
|
+
import { CollectorSeniorityEnum } from '../enums/CollectorSeniorityEnum';
|
|
4
5
|
import { EmploymentTypeEnum } from '../enums/EmploymentTypeEnum';
|
|
5
6
|
import { RetailUserStatusEnum } from '../enums/RetailUserStatusEnum';
|
|
6
7
|
|
|
@@ -39,6 +40,25 @@ export class RetailUser {
|
|
|
39
40
|
@IsString()
|
|
40
41
|
commissionTier!: string;
|
|
41
42
|
|
|
43
|
+
/** Teléfono de contacto del usuario retail; opcional. */
|
|
44
|
+
@Expose()
|
|
45
|
+
@IsOptional()
|
|
46
|
+
@IsString()
|
|
47
|
+
phone?: string;
|
|
48
|
+
|
|
49
|
+
/** Seniority del cobrador; solo aplica a usuarios retail con rol de cobrador. */
|
|
50
|
+
@Expose()
|
|
51
|
+
@IsOptional()
|
|
52
|
+
@IsEnum(CollectorSeniorityEnum)
|
|
53
|
+
collectorSeniority?: CollectorSeniorityEnum;
|
|
54
|
+
|
|
55
|
+
/** Tiendas que cubre el cobrador (zona de cobranza); opcional. */
|
|
56
|
+
@Expose()
|
|
57
|
+
@IsOptional()
|
|
58
|
+
@IsArray()
|
|
59
|
+
@IsString({ each: true })
|
|
60
|
+
coverageStoreIds?: string[];
|
|
61
|
+
|
|
42
62
|
@Expose()
|
|
43
63
|
@IsEnum(RetailUserStatusEnum)
|
|
44
64
|
status!: RetailUserStatusEnum;
|
|
@@ -75,11 +75,15 @@ export class Store {
|
|
|
75
75
|
@IsString()
|
|
76
76
|
schedule!: string | null;
|
|
77
77
|
|
|
78
|
-
/**
|
|
78
|
+
/**
|
|
79
|
+
* Conteo promedio de transacciones de cobro por día (NO es un monto de dinero).
|
|
80
|
+
* `null` si no está registrado. El factor 2× que amplifica este conteo es global
|
|
81
|
+
* y vive en loan-config, no acá.
|
|
82
|
+
*/
|
|
79
83
|
@Expose()
|
|
80
84
|
@IsOptional()
|
|
81
85
|
@IsNumber()
|
|
82
|
-
|
|
86
|
+
dailyAvgCollectionsCount!: number | null;
|
|
83
87
|
|
|
84
88
|
@Expose()
|
|
85
89
|
@IsEnum(StoreStatusEnum)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Expose } from 'class-transformer';
|
|
2
|
-
import { IsEnum, IsOptional, IsString } from 'class-validator';
|
|
2
|
+
import { IsArray, IsEnum, IsOptional, IsString } from 'class-validator';
|
|
3
|
+
import { CollectorSeniorityEnum } from '../../enums/CollectorSeniorityEnum';
|
|
3
4
|
import { EmploymentTypeEnum } from '../../enums/EmploymentTypeEnum';
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -28,4 +29,23 @@ export class CreateRetailUserRequest {
|
|
|
28
29
|
@IsOptional()
|
|
29
30
|
@IsString()
|
|
30
31
|
zoneId!: string | null;
|
|
32
|
+
|
|
33
|
+
/** Teléfono de contacto del usuario retail; opcional. */
|
|
34
|
+
@Expose()
|
|
35
|
+
@IsOptional()
|
|
36
|
+
@IsString()
|
|
37
|
+
phone?: string;
|
|
38
|
+
|
|
39
|
+
/** Seniority del cobrador; solo aplica a usuarios retail con rol de cobrador. */
|
|
40
|
+
@Expose()
|
|
41
|
+
@IsOptional()
|
|
42
|
+
@IsEnum(CollectorSeniorityEnum)
|
|
43
|
+
collectorSeniority?: CollectorSeniorityEnum;
|
|
44
|
+
|
|
45
|
+
/** Tiendas que cubre el cobrador (zona de cobranza); opcional. */
|
|
46
|
+
@Expose()
|
|
47
|
+
@IsOptional()
|
|
48
|
+
@IsArray()
|
|
49
|
+
@IsString({ each: true })
|
|
50
|
+
coverageStoreIds?: string[];
|
|
31
51
|
}
|
|
@@ -59,9 +59,13 @@ export class CreateStoreRequest {
|
|
|
59
59
|
@IsString()
|
|
60
60
|
schedule!: string | null;
|
|
61
61
|
|
|
62
|
-
/**
|
|
62
|
+
/**
|
|
63
|
+
* Conteo promedio de transacciones de cobro por día (NO es un monto de dinero).
|
|
64
|
+
* `null` si no está registrado. El factor 2× que amplifica este conteo es global
|
|
65
|
+
* y vive en loan-config, no acá.
|
|
66
|
+
*/
|
|
63
67
|
@Expose()
|
|
64
68
|
@IsOptional()
|
|
65
69
|
@IsNumber()
|
|
66
|
-
|
|
70
|
+
dailyAvgCollectionsCount!: number | null;
|
|
67
71
|
}
|
|
@@ -7,13 +7,13 @@ import { RetailAddressInput } from './RetailAddressInput';
|
|
|
7
7
|
* Body de POST /retailers/:retailerId/subdistributors — alta de un retailer hijo colgando de
|
|
8
8
|
* `:retailerId` (el `parentId` sale del path param, NO del body).
|
|
9
9
|
*
|
|
10
|
-
* `type` se restringe a
|
|
11
|
-
*
|
|
10
|
+
* `type` se restringe a SUBDISTRIBUTOR | FRANCHISE con `@IsIn`: un nodo hijo no puede ser una
|
|
11
|
+
* CHAIN raíz (esa se crea con `CreateRetailerRequest`).
|
|
12
12
|
*/
|
|
13
13
|
export class CreateSubdistributorRequest {
|
|
14
14
|
@Expose()
|
|
15
|
-
@IsIn([RetailerTypeEnum.
|
|
16
|
-
type!: RetailerTypeEnum.
|
|
15
|
+
@IsIn([RetailerTypeEnum.SUBDISTRIBUTOR, RetailerTypeEnum.FRANCHISE])
|
|
16
|
+
type!: RetailerTypeEnum.SUBDISTRIBUTOR | RetailerTypeEnum.FRANCHISE;
|
|
17
17
|
|
|
18
18
|
@Expose()
|
|
19
19
|
@IsString()
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Expose } from 'class-transformer';
|
|
2
|
-
import { IsEnum, IsOptional, IsString } from 'class-validator';
|
|
2
|
+
import { IsArray, IsEnum, IsOptional, IsString } from 'class-validator';
|
|
3
|
+
import { CollectorSeniorityEnum } from '../../enums/CollectorSeniorityEnum';
|
|
3
4
|
import { EmploymentTypeEnum } from '../../enums/EmploymentTypeEnum';
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -22,4 +23,23 @@ export class UpdateRetailUserRequest {
|
|
|
22
23
|
@IsOptional()
|
|
23
24
|
@IsString()
|
|
24
25
|
zoneId?: string | null;
|
|
26
|
+
|
|
27
|
+
/** Teléfono de contacto del usuario retail; opcional. */
|
|
28
|
+
@Expose()
|
|
29
|
+
@IsOptional()
|
|
30
|
+
@IsString()
|
|
31
|
+
phone?: string;
|
|
32
|
+
|
|
33
|
+
/** Seniority del cobrador; solo aplica a usuarios retail con rol de cobrador. */
|
|
34
|
+
@Expose()
|
|
35
|
+
@IsOptional()
|
|
36
|
+
@IsEnum(CollectorSeniorityEnum)
|
|
37
|
+
collectorSeniority?: CollectorSeniorityEnum;
|
|
38
|
+
|
|
39
|
+
/** Tiendas que cubre el cobrador (zona de cobranza); opcional. */
|
|
40
|
+
@Expose()
|
|
41
|
+
@IsOptional()
|
|
42
|
+
@IsArray()
|
|
43
|
+
@IsString({ each: true })
|
|
44
|
+
coverageStoreIds?: string[];
|
|
25
45
|
}
|
|
@@ -52,8 +52,9 @@ export class UpdateStoreRequest {
|
|
|
52
52
|
@IsString()
|
|
53
53
|
schedule?: string | null;
|
|
54
54
|
|
|
55
|
+
/** Conteo promedio de transacciones de cobro por día (NO es un monto de dinero). */
|
|
55
56
|
@Expose()
|
|
56
57
|
@IsOptional()
|
|
57
58
|
@IsNumber()
|
|
58
|
-
|
|
59
|
+
dailyAvgCollectionsCount?: number | null;
|
|
59
60
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Antigüedad / seniority de un cobrador retail en SureKeep.
|
|
3
|
+
* Solo aplica a usuarios retail que cumplen rol de cobrador.
|
|
4
|
+
* @enum {string}
|
|
5
|
+
*
|
|
6
|
+
* @property {string} JUNIOR - Cobrador de menor antigüedad / experiencia.
|
|
7
|
+
* @property {string} SENIOR - Cobrador de mayor antigüedad / experiencia.
|
|
8
|
+
*/
|
|
9
|
+
export enum CollectorSeniorityEnum {
|
|
10
|
+
JUNIOR = 'JUNIOR',
|
|
11
|
+
SENIOR = 'SENIOR',
|
|
12
|
+
}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* Tipo de retailer en la organización comercial de SureKeep.
|
|
3
3
|
* @enum {string}
|
|
4
4
|
*
|
|
5
|
-
* @property {string}
|
|
6
|
-
* @property {string}
|
|
7
|
-
* @property {string}
|
|
5
|
+
* @property {string} CHAIN - Cadena comercial con múltiples tiendas propias.
|
|
6
|
+
* @property {string} SUBDISTRIBUTOR - Subdistribuidor que opera bajo un distribuidor mayor.
|
|
7
|
+
* @property {string} FRANCHISE - Franquicia operada por un tercero bajo la marca.
|
|
8
8
|
*/
|
|
9
9
|
export enum RetailerTypeEnum {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
CHAIN = 'CHAIN',
|
|
11
|
+
SUBDISTRIBUTOR = 'SUBDISTRIBUTOR',
|
|
12
|
+
FRANCHISE = 'FRANCHISE',
|
|
13
13
|
}
|
package/src/retailOrg/index.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './enums/ZoneStatusEnum';
|
|
|
4
4
|
export * from './enums/StoreStatusEnum';
|
|
5
5
|
export * from './enums/RetailUserStatusEnum';
|
|
6
6
|
export * from './enums/EmploymentTypeEnum';
|
|
7
|
+
export * from './enums/CollectorSeniorityEnum';
|
|
7
8
|
|
|
8
9
|
// Entity DTOs
|
|
9
10
|
export * from './dtos/GeoLocation';
|