@fiado/type-kit 3.466.0 → 3.468.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.
Files changed (58) hide show
  1. package/_test_/unit/directory/directoryAgentsBySponsorDtos.test.ts +69 -0
  2. package/_test_/unit/group/groupMemberHubItem.test.ts +87 -0
  3. package/_test_/unit/platformRbac/dtos/tenantUsersBySubsDtos.test.ts +61 -0
  4. package/_test_/unit/referral-business/agentsByDirectoryIdsDtos.test.ts +65 -0
  5. package/bin/credit/dtos/BannerStateResponse.d.ts +6 -0
  6. package/bin/credit/dtos/CreditOfferOptionItem.d.ts +6 -0
  7. package/bin/creditEngine/dtos/AnticipatedPaymentQuote.d.ts +7 -0
  8. package/bin/creditEngine/dtos/CreditDetailResponse.d.ts +13 -0
  9. package/bin/creditEngine/dtos/FxQuote.d.ts +33 -0
  10. package/bin/creditEngine/dtos/FxQuote.js +22 -0
  11. package/bin/creditEngine/dtos/OfferResult.d.ts +3 -0
  12. package/bin/creditEngine/dtos/PaymentScheduleItemResponse.d.ts +4 -0
  13. package/bin/creditEngine/dtos/SettlementQuote.d.ts +3 -0
  14. package/bin/creditEngine/index.d.ts +1 -0
  15. package/bin/creditEngine/index.js +1 -0
  16. package/bin/directory/dtos/DirectoryAgentsBySponsorRequest.d.ts +4 -0
  17. package/bin/directory/dtos/DirectoryAgentsBySponsorRequest.js +25 -0
  18. package/bin/directory/dtos/DirectoryAgentsBySponsorResponse.d.ts +9 -0
  19. package/bin/directory/dtos/DirectoryAgentsBySponsorResponse.js +2 -0
  20. package/bin/directory/index.d.ts +2 -0
  21. package/bin/directory/index.js +2 -0
  22. package/bin/group/dtos/GroupMemberHubItem.d.ts +36 -0
  23. package/bin/group/dtos/GroupMemberHubItem.js +2 -0
  24. package/bin/group/index.d.ts +1 -0
  25. package/bin/group/index.js +1 -0
  26. package/bin/platformRbac/dtos/TenantUsersBySubsRequest.d.ts +4 -0
  27. package/bin/platformRbac/dtos/TenantUsersBySubsRequest.js +25 -0
  28. package/bin/platformRbac/dtos/TenantUsersBySubsResponse.d.ts +8 -0
  29. package/bin/platformRbac/dtos/TenantUsersBySubsResponse.js +2 -0
  30. package/bin/platformRbac/index.d.ts +2 -0
  31. package/bin/platformRbac/index.js +2 -0
  32. package/bin/referral-business/dtos/AgentsByDirectoryIdsRequest.d.ts +4 -0
  33. package/bin/referral-business/dtos/AgentsByDirectoryIdsRequest.js +25 -0
  34. package/bin/referral-business/dtos/AgentsByDirectoryIdsResponse.d.ts +11 -0
  35. package/bin/referral-business/dtos/AgentsByDirectoryIdsResponse.js +2 -0
  36. package/bin/referral-business/index.d.ts +2 -0
  37. package/bin/referral-business/index.js +3 -0
  38. package/package.json +1 -1
  39. package/src/credit/dtos/BannerStateResponse.ts +6 -0
  40. package/src/credit/dtos/CreditOfferOptionItem.ts +6 -0
  41. package/src/creditEngine/dtos/AnticipatedPaymentQuote.ts +9 -0
  42. package/src/creditEngine/dtos/CreditDetailResponse.ts +13 -0
  43. package/src/creditEngine/dtos/FxQuote.ts +34 -0
  44. package/src/creditEngine/dtos/OfferResult.ts +4 -0
  45. package/src/creditEngine/dtos/PaymentScheduleItemResponse.ts +4 -0
  46. package/src/creditEngine/dtos/SettlementQuote.ts +4 -0
  47. package/src/creditEngine/index.ts +1 -0
  48. package/src/directory/dtos/DirectoryAgentsBySponsorRequest.ts +12 -0
  49. package/src/directory/dtos/DirectoryAgentsBySponsorResponse.ts +12 -0
  50. package/src/directory/index.ts +2 -0
  51. package/src/group/dtos/GroupMemberHubItem.ts +40 -0
  52. package/src/group/index.ts +1 -0
  53. package/src/platformRbac/dtos/TenantUsersBySubsRequest.ts +12 -0
  54. package/src/platformRbac/dtos/TenantUsersBySubsResponse.ts +12 -0
  55. package/src/platformRbac/index.ts +4 -0
  56. package/src/referral-business/dtos/AgentsByDirectoryIdsRequest.ts +12 -0
  57. package/src/referral-business/dtos/AgentsByDirectoryIdsResponse.ts +14 -0
  58. package/src/referral-business/index.ts +5 -1
@@ -0,0 +1,69 @@
1
+ import 'reflect-metadata';
2
+ import { plainToInstance } from 'class-transformer';
3
+ import { validate } from 'class-validator';
4
+ import {
5
+ DirectoryAgentsBySponsorRequest,
6
+ DIRECTORY_AGENTS_BY_SPONSOR_MAX_BATCH,
7
+ } from '../../../src/directory';
8
+ import type {
9
+ DirectoryAgentBySponsorItem,
10
+ DirectoryAgentsBySponsorResponse,
11
+ } from '../../../src/directory';
12
+
13
+ describe('DirectoryAgentsBySponsorRequest', () => {
14
+ it('el tope del lote es 100', () => {
15
+ expect(DIRECTORY_AGENTS_BY_SPONSOR_MAX_BATCH).toBe(100);
16
+ });
17
+
18
+ it('acepta una lista de ids', async () => {
19
+ const dto = plainToInstance(DirectoryAgentsBySponsorRequest, { sponsorDirectoryIds: ['d1', 'd2'] });
20
+ expect(await validate(dto)).toEqual([]);
21
+ });
22
+
23
+ it('acepta la lista vacía', async () => {
24
+ const dto = plainToInstance(DirectoryAgentsBySponsorRequest, { sponsorDirectoryIds: [] });
25
+ expect(await validate(dto)).toEqual([]);
26
+ });
27
+
28
+ it('acepta exactamente 100 ids', async () => {
29
+ const ids = Array.from({ length: 100 }, (_, i) => `d${i}`);
30
+ const dto = plainToInstance(DirectoryAgentsBySponsorRequest, { sponsorDirectoryIds: ids });
31
+ expect(await validate(dto)).toEqual([]);
32
+ });
33
+
34
+ it('rechaza 101 ids con la constraint arrayMaxSize', async () => {
35
+ const ids = Array.from({ length: 101 }, (_, i) => `d${i}`);
36
+ const dto = plainToInstance(DirectoryAgentsBySponsorRequest, { sponsorDirectoryIds: ids });
37
+ const errors = await validate(dto);
38
+ expect(errors).toHaveLength(1);
39
+ expect(errors[0].property).toBe('sponsorDirectoryIds');
40
+ expect(errors[0].constraints?.arrayMaxSize).toBeDefined();
41
+ });
42
+
43
+ it('rechaza si falta el campo', async () => {
44
+ const dto = plainToInstance(DirectoryAgentsBySponsorRequest, {});
45
+ const errors = await validate(dto);
46
+ expect(errors[0].constraints?.isArray).toBeDefined();
47
+ });
48
+
49
+ it('rechaza un id que no es string', async () => {
50
+ const dto = plainToInstance(DirectoryAgentsBySponsorRequest, { sponsorDirectoryIds: ['d1', 7] });
51
+ const errors = await validate(dto);
52
+ expect(errors[0].constraints?.isString).toBeDefined();
53
+ });
54
+ });
55
+
56
+ describe('DirectoryAgentsBySponsorResponse', () => {
57
+ it('es un mapa sponsorDirectoryId -> directorio AGENT', () => {
58
+ const item: DirectoryAgentBySponsorItem = {
59
+ id: 'agent-dir-1',
60
+ sponsorDirectoryId: 'd1',
61
+ identityId: null,
62
+ email: null,
63
+ status: 'ACTIVE',
64
+ updatedAt: null,
65
+ };
66
+ const response: DirectoryAgentsBySponsorResponse = { d1: item };
67
+ expect(response.d1.sponsorDirectoryId).toBe('d1');
68
+ });
69
+ });
@@ -0,0 +1,87 @@
1
+ import 'reflect-metadata';
2
+ import type { GroupMemberHubItem } from '../../../src/group';
3
+ import { RelationStatus, RelationType } from '../../../src/group';
4
+ import { CPStatusEnum } from '../../../src/identity/enums/CPStatusEnum';
5
+
6
+ const [anyRelationType] = Object.values(RelationType) as RelationType[];
7
+ const [anyRelationStatus] = Object.values(RelationStatus) as RelationStatus[];
8
+ const [anyCpStatus] = Object.values(CPStatusEnum) as CPStatusEnum[];
9
+
10
+ describe('GroupMemberHubItem', () => {
11
+ it('un miembro que no es agente lleva las columnas de agente en null', () => {
12
+ const row: GroupMemberHubItem = {
13
+ PK: 'GROUP#g1',
14
+ SK: 'DIRECTORY#d1',
15
+ directoryId: 'd1',
16
+ groupId: 'g1',
17
+ relationType: anyRelationType,
18
+ status: anyRelationStatus,
19
+ agent: null,
20
+ createdAt: '2026-09-24T00:00:00.000Z',
21
+ updatedAt: '2026-09-24T00:00:00.000Z',
22
+ phoneNumber: null,
23
+ indexName: null,
24
+ peopleId: null,
25
+ referralCode: null,
26
+ myReferralCode: null,
27
+ CP_Status: null,
28
+ parentGroupId: null,
29
+ operationId: null,
30
+ referralDirectoryId: null,
31
+ promotedToDirectory: null,
32
+ isAgent: false,
33
+ agentId: null,
34
+ agentRole: null,
35
+ agentStatus: null,
36
+ position: null,
37
+ reportsToDirectoryId: null,
38
+ reportsToName: null,
39
+ agentDirectoryStatus: null,
40
+ loginEmail: null,
41
+ hasRbac: false,
42
+ rbacStatus: null,
43
+ };
44
+ expect(row.isAgent).toBe(false);
45
+ });
46
+
47
+ it('hasRbac admite null cuando la fuente RBAC no respondió', () => {
48
+ const unknownRbac: GroupMemberHubItem['hasRbac'] = null;
49
+ expect(unknownRbac).toBeNull();
50
+ });
51
+
52
+ it('un agente con RBAC llena las columnas nuevas', () => {
53
+ const row: GroupMemberHubItem = {
54
+ PK: 'GROUP#g1',
55
+ SK: 'DIRECTORY#d2',
56
+ directoryId: 'd2',
57
+ groupId: 'g1',
58
+ relationType: anyRelationType,
59
+ status: anyRelationStatus,
60
+ agent: 'agent-1',
61
+ createdAt: '2026-09-24T00:00:00.000Z',
62
+ updatedAt: '2026-09-24T00:00:00.000Z',
63
+ phoneNumber: '+525500000000',
64
+ indexName: 'ANA PEREZ',
65
+ peopleId: 'p2',
66
+ referralCode: 'SPONSOR1',
67
+ myReferralCode: 'MINE1',
68
+ CP_Status: anyCpStatus,
69
+ parentGroupId: null,
70
+ operationId: 'op-1',
71
+ referralDirectoryId: 'd9',
72
+ promotedToDirectory: false,
73
+ isAgent: true,
74
+ agentId: 'agent-1',
75
+ agentRole: 'AGENT',
76
+ agentStatus: 'ACTIVE',
77
+ position: 'Supervisora',
78
+ reportsToDirectoryId: 'd1',
79
+ reportsToName: 'JUAN LOPEZ',
80
+ agentDirectoryStatus: 'ACTIVE',
81
+ loginEmail: 'ana@somosfiado.com',
82
+ hasRbac: true,
83
+ rbacStatus: 'ACTIVE',
84
+ };
85
+ expect(row.rbacStatus).toBe('ACTIVE');
86
+ });
87
+ });
@@ -0,0 +1,61 @@
1
+ import 'reflect-metadata';
2
+ import { plainToInstance } from 'class-transformer';
3
+ import { validate } from 'class-validator';
4
+ import {
5
+ TenantUsersBySubsRequest,
6
+ TENANT_USERS_BY_SUBS_MAX_BATCH,
7
+ } from '../../../../src/platformRbac';
8
+ import type {
9
+ TenantUserBySubItem,
10
+ TenantUsersBySubsResponse,
11
+ } from '../../../../src/platformRbac';
12
+
13
+ describe('TenantUsersBySubsRequest', () => {
14
+ it('el tope del lote es 100', () => {
15
+ expect(TENANT_USERS_BY_SUBS_MAX_BATCH).toBe(100);
16
+ });
17
+
18
+ it('acepta una lista de cognitoSubs', async () => {
19
+ const dto = plainToInstance(TenantUsersBySubsRequest, { cognitoSubs: ['sub-1', 'sub-2'] });
20
+ expect(await validate(dto)).toEqual([]);
21
+ });
22
+
23
+ it('acepta la lista vacía', async () => {
24
+ const dto = plainToInstance(TenantUsersBySubsRequest, { cognitoSubs: [] });
25
+ expect(await validate(dto)).toEqual([]);
26
+ });
27
+
28
+ it('rechaza 101 subs con la constraint arrayMaxSize', async () => {
29
+ const subs = Array.from({ length: 101 }, (_, i) => `sub-${i}`);
30
+ const dto = plainToInstance(TenantUsersBySubsRequest, { cognitoSubs: subs });
31
+ const errors = await validate(dto);
32
+ expect(errors).toHaveLength(1);
33
+ expect(errors[0].property).toBe('cognitoSubs');
34
+ expect(errors[0].constraints?.arrayMaxSize).toBeDefined();
35
+ });
36
+
37
+ it('rechaza si falta el campo', async () => {
38
+ const dto = plainToInstance(TenantUsersBySubsRequest, {});
39
+ const errors = await validate(dto);
40
+ expect(errors[0].constraints?.isArray).toBeDefined();
41
+ });
42
+
43
+ it('rechaza un sub que no es string', async () => {
44
+ const dto = plainToInstance(TenantUsersBySubsRequest, { cognitoSubs: [null] });
45
+ const errors = await validate(dto);
46
+ expect(errors[0].constraints?.isString).toBeDefined();
47
+ });
48
+ });
49
+
50
+ describe('TenantUsersBySubsResponse', () => {
51
+ it('es un mapa cognitoSub -> usuario, con email nullable', () => {
52
+ const item: TenantUserBySubItem = {
53
+ cognitoSub: 'sub-1',
54
+ email: null,
55
+ status: 'ACTIVE',
56
+ displayName: null,
57
+ };
58
+ const response: TenantUsersBySubsResponse = { 'sub-1': item };
59
+ expect(response['sub-1'].status).toBe('ACTIVE');
60
+ });
61
+ });
@@ -0,0 +1,65 @@
1
+ import 'reflect-metadata';
2
+ import { plainToInstance } from 'class-transformer';
3
+ import { validate } from 'class-validator';
4
+ import {
5
+ AgentsByDirectoryIdsRequest,
6
+ AGENTS_BY_DIRECTORY_IDS_MAX_BATCH,
7
+ } from '../../../src/referral-business';
8
+ import type {
9
+ AgentByDirectoryIdItem,
10
+ AgentsByDirectoryIdsResponse,
11
+ } from '../../../src/referral-business';
12
+
13
+ describe('AgentsByDirectoryIdsRequest', () => {
14
+ it('el tope del lote es 100', () => {
15
+ expect(AGENTS_BY_DIRECTORY_IDS_MAX_BATCH).toBe(100);
16
+ });
17
+
18
+ it('acepta una lista de ids', async () => {
19
+ const dto = plainToInstance(AgentsByDirectoryIdsRequest, { directoryIds: ['d1', 'd2'] });
20
+ expect(await validate(dto)).toEqual([]);
21
+ });
22
+
23
+ it('acepta la lista vacía', async () => {
24
+ const dto = plainToInstance(AgentsByDirectoryIdsRequest, { directoryIds: [] });
25
+ expect(await validate(dto)).toEqual([]);
26
+ });
27
+
28
+ it('rechaza 101 ids con la constraint arrayMaxSize', async () => {
29
+ const ids = Array.from({ length: 101 }, (_, i) => `d${i}`);
30
+ const dto = plainToInstance(AgentsByDirectoryIdsRequest, { directoryIds: ids });
31
+ const errors = await validate(dto);
32
+ expect(errors).toHaveLength(1);
33
+ expect(errors[0].property).toBe('directoryIds');
34
+ expect(errors[0].constraints?.arrayMaxSize).toBeDefined();
35
+ });
36
+
37
+ it('rechaza si directoryIds no es arreglo', async () => {
38
+ const dto = plainToInstance(AgentsByDirectoryIdsRequest, { directoryIds: 'd1' });
39
+ const errors = await validate(dto);
40
+ expect(errors[0].constraints?.isArray).toBeDefined();
41
+ });
42
+
43
+ it('rechaza un id que no es string', async () => {
44
+ const dto = plainToInstance(AgentsByDirectoryIdsRequest, { directoryIds: [1] });
45
+ const errors = await validate(dto);
46
+ expect(errors[0].constraints?.isString).toBeDefined();
47
+ });
48
+ });
49
+
50
+ describe('AgentsByDirectoryIdsResponse', () => {
51
+ it('es un mapa directoryId -> agente', () => {
52
+ const item: AgentByDirectoryIdItem = {
53
+ id: 'agent-1',
54
+ directoryId: 'd1',
55
+ groupId: null,
56
+ agentRole: 'AGENT',
57
+ notes: null,
58
+ parentDirectoryId: null,
59
+ status: 'ACTIVE',
60
+ updatedAt: 1727222400000,
61
+ };
62
+ const response: AgentsByDirectoryIdsResponse = { d1: item };
63
+ expect(response.d1.id).toBe('agent-1');
64
+ });
65
+ });
@@ -24,13 +24,19 @@ export declare class BannerStateResponse {
24
24
  credit_id?: string | null;
25
25
  /** Pago del proximo cupon pendiente. */
26
26
  next_payment_amount_mxn?: number | null;
27
+ /** USD real que cobrará el collector por next_payment_amount_mxn (comisión + IVA + TC ajustado). Ausente si el collector no estuvo disponible. */
28
+ next_payment_amount_usd_charge?: number;
27
29
  next_payment_date?: string | null;
28
30
  next_coupon_number?: number | null;
29
31
  /** Montos de cupones vencidos (solo DELINQUENT). */
30
32
  overdue_amount_mxn?: number | null;
33
+ /** USD real que cobrará el collector por overdue_amount_mxn (comisión + IVA + TC ajustado). Ausente si el collector no estuvo disponible. */
34
+ overdue_amount_usd_charge?: number;
31
35
  overdue_count?: number | null;
32
36
  /** Saldo insoluto del credito activo. */
33
37
  outstanding_balance_mxn?: number | null;
38
+ /** USD real que cobrará el collector por outstanding_balance_mxn (comisión + IVA + TC ajustado). Ausente si el collector no estuvo disponible. */
39
+ outstanding_balance_usd_charge?: number;
34
40
  /**
35
41
  * Cantidad total de creditos que el directoryId ha tenido en Credits_GT
36
42
  * (incluye ACTIVE, PAID_OFF, DEFAULTED — todos los estados historicos).
@@ -5,7 +5,11 @@ export declare class CreditOfferOptionItem {
5
5
  term_weeks: number;
6
6
  annual_rate: number;
7
7
  weekly_payment_mxn: number;
8
+ /** USD real que cobrará el collector por weekly_payment_mxn (comisión + IVA + TC ajustado). Ausente si el collector no estuvo disponible. */
9
+ weekly_payment_usd_charge?: number;
8
10
  total_to_pay_mxn: number;
11
+ /** USD real que cobrará el collector por total_to_pay_mxn (comisión + IVA + TC ajustado). Ausente si el collector no estuvo disponible. */
12
+ total_to_pay_usd_charge?: number;
9
13
  total_interest_mxn: number;
10
14
  savings_vs_longest: number;
11
15
  is_recommended: boolean;
@@ -17,6 +21,8 @@ export declare class CreditOfferOptionItem {
17
21
  first_payment_date?: string;
18
22
  /** Monto solicitado por el cliente (lo que recibe). */
19
23
  requested_amount_mxn?: number;
24
+ /** USD real que cobrará el collector por requested_amount_mxn (comisión + IVA + TC ajustado). Ausente si el collector no estuvo disponible. */
25
+ requested_amount_usd_charge?: number;
20
26
  /** Principal financiado (amount + fee + fee_iva si financed). */
21
27
  financed_amount_mxn?: number;
22
28
  /** Comision por apertura como fraccion (ej. 0.05 = 5%). */
@@ -1,4 +1,5 @@
1
1
  import { PaymentScheduleItemResponse } from "./PaymentScheduleItemResponse";
2
+ import { FxQuote } from "./FxQuote";
2
3
  /**
3
4
  * Preview / cotizacion de un abono a capital (ANTICIPATED) antes de ejecutarlo.
4
5
  *
@@ -13,6 +14,8 @@ export declare class AnticipatedPaymentQuote {
13
14
  creditId: string;
14
15
  /** Monto que el usuario propuso, capeado al outstanding real del credito. */
15
16
  amountMxn: number;
17
+ /** USD real que cobrará el collector por amountMxn (comisión + IVA + TC ajustado). Ausente si el collector no estuvo disponible. */
18
+ amountUsdCharge?: number;
16
19
  /** Estado actual (as-is) del credito, antes de aplicar el abono. */
17
20
  current: AnticipatedPaymentSummary;
18
21
  /** Estado proyectado (as-if) despues de aplicar el abono. */
@@ -28,10 +31,14 @@ export declare class AnticipatedPaymentQuote {
28
31
  newSchedule: PaymentScheduleItemResponse[];
29
32
  /** ISO timestamp de la cotizacion. */
30
33
  quoteDate: string;
34
+ /** Cotizacion FX usada para los campos `*UsdCharge` (incluye los de `newSchedule`). Ausente si el collector no estuvo disponible. */
35
+ fxQuote?: FxQuote;
31
36
  }
32
37
  export declare class AnticipatedPaymentSummary {
33
38
  /** Cuota semanal vigente. */
34
39
  weeklyPaymentMxn: number;
40
+ /** USD real que cobrará el collector por weeklyPaymentMxn (comisión + IVA + TC ajustado). Ausente si el collector no estuvo disponible. */
41
+ weeklyPaymentUsdCharge?: number;
35
42
  /** Saldo insoluto (capital pendiente). */
36
43
  outstandingMxn: number;
37
44
  /** Cupones que aun no estan PAID (incluye PARTIAL). */
@@ -1,3 +1,4 @@
1
+ import { FxQuote } from "./FxQuote";
1
2
  /**
2
3
  * Response con el detalle completo de un credito LOAN.
3
4
  */
@@ -9,11 +10,15 @@ export declare class CreditDetailResponse {
9
10
  termWeeks?: number;
10
11
  annualRate?: number;
11
12
  weeklyPaymentMxn?: number;
13
+ /** USD real que cobrará el collector por weeklyPaymentMxn (comisión + IVA + TC ajustado). Ausente si el collector no estuvo disponible. */
14
+ weeklyPaymentUsdCharge?: number;
12
15
  status?: string;
13
16
  nextPaymentDate?: string;
14
17
  paidCoupons?: number;
15
18
  totalCoupons?: number;
16
19
  remainingBalanceMxn?: number;
20
+ /** USD real que cobrará el collector por remainingBalanceMxn (comisión + IVA + TC ajustado). Ausente si el collector no estuvo disponible. */
21
+ remainingBalanceUsdCharge?: number;
17
22
  cat?: number | null;
18
23
  totalInterestMxn?: number;
19
24
  totalIvaMxn?: number;
@@ -24,8 +29,16 @@ export declare class CreditDetailResponse {
24
29
  firstPaymentDate?: string | null;
25
30
  lastPaymentDate?: string | null;
26
31
  nextPaymentAmountMxn?: number | null;
32
+ /** USD real que cobrará el collector por nextPaymentAmountMxn (comisión + IVA + TC ajustado). Ausente si el collector no estuvo disponible. */
33
+ nextPaymentAmountUsdCharge?: number;
27
34
  nextCouponNumber?: number | null;
28
35
  totalPaidMxn?: number;
36
+ /** USD real que cobrará el collector por totalPaidMxn (comisión + IVA + TC ajustado). Ausente si el collector no estuvo disponible. */
37
+ totalPaidUsdCharge?: number;
29
38
  overdueCount?: number;
30
39
  overdueAmountMxn?: number;
40
+ /** USD real que cobrará el collector por overdueAmountMxn (comisión + IVA + TC ajustado). Ausente si el collector no estuvo disponible. */
41
+ overdueAmountUsdCharge?: number;
42
+ /** Cotizacion FX usada para los campos `*UsdCharge`. Ausente si el collector no estuvo disponible. */
43
+ fxQuote?: FxQuote;
31
44
  }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Tipo de cambio y factor que el collector aplicara al cobro en USD.
3
+ *
4
+ * Es la cotizacion vigente al momento de armar la respuesta: con ella el
5
+ * collector convierte cada monto MXN al USD real que descuenta del pocket
6
+ * (comision + IVA + TC ajustado). Viaja junto a los campos `<x>UsdCharge`
7
+ * para que el frontend pueda explicar el numero, no para recalcularlo.
8
+ * Ausente si el collector no estuvo disponible.
9
+ */
10
+ export declare class FxQuote {
11
+ /** TC MXN por USD publicado, sin ajuste. */
12
+ exchangeRate: number;
13
+ /** TC MXN por USD ajustado con el colchon del collector; es el divisor real del cobro. */
14
+ adjustmentRate: number;
15
+ /** Factor multiplicativo sobre el MXN nocional (comision + IVA). */
16
+ totalFactor: number;
17
+ /** Momento de la cotizacion, ISO 8601. */
18
+ quotedAt: string;
19
+ }
20
+ /**
21
+ * Gemelo snake_case de `FxQuote` para los DTOs contenedores que ya son
22
+ * snake_case (`SettlementQuote`, `OfferResult`). Misma semantica campo a campo.
23
+ */
24
+ export declare class FxQuoteSnake {
25
+ /** TC MXN por USD publicado, sin ajuste. */
26
+ exchange_rate: number;
27
+ /** TC MXN por USD ajustado con el colchon del collector; es el divisor real del cobro. */
28
+ adjustment_rate: number;
29
+ /** Factor multiplicativo sobre el MXN nocional (comision + IVA). */
30
+ total_factor: number;
31
+ /** Momento de la cotizacion, ISO 8601. */
32
+ quoted_at: string;
33
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FxQuoteSnake = exports.FxQuote = void 0;
4
+ /**
5
+ * Tipo de cambio y factor que el collector aplicara al cobro en USD.
6
+ *
7
+ * Es la cotizacion vigente al momento de armar la respuesta: con ella el
8
+ * collector convierte cada monto MXN al USD real que descuenta del pocket
9
+ * (comision + IVA + TC ajustado). Viaja junto a los campos `<x>UsdCharge`
10
+ * para que el frontend pueda explicar el numero, no para recalcularlo.
11
+ * Ausente si el collector no estuvo disponible.
12
+ */
13
+ class FxQuote {
14
+ }
15
+ exports.FxQuote = FxQuote;
16
+ /**
17
+ * Gemelo snake_case de `FxQuote` para los DTOs contenedores que ya son
18
+ * snake_case (`SettlementQuote`, `OfferResult`). Misma semantica campo a campo.
19
+ */
20
+ class FxQuoteSnake {
21
+ }
22
+ exports.FxQuoteSnake = FxQuoteSnake;
@@ -1,3 +1,4 @@
1
+ import { FxQuoteSnake } from "./FxQuote";
1
2
  /**
2
3
  * Respuesta del endpoint de generación de oferta: lista de tasas disponibles
3
4
  * para el usuario, plus los parámetros de la comisión por apertura.
@@ -18,4 +19,6 @@ export declare class OfferResult {
18
19
  opening_fee_pct?: number;
19
20
  /** True si la comisión se financia (se suma al principal y se amortiza); false si se cobra al desembolso. */
20
21
  opening_fee_financed?: boolean;
22
+ /** Cotizacion FX vigente al generar la oferta, para los `*_usd_charge` que el frontend proyecte sobre ella. Ausente si el collector no estuvo disponible. */
23
+ fx_quote?: FxQuoteSnake;
21
24
  }
@@ -8,6 +8,10 @@ export declare class PaymentScheduleItemResponse {
8
8
  interestMxn?: number;
9
9
  ivaMxn?: number;
10
10
  totalMxn?: number;
11
+ /** USD real que cobrará el collector por totalMxn (comisión + IVA + TC ajustado). Ausente si el collector no estuvo disponible. */
12
+ totalUsdCharge?: number;
13
+ /** True si totalUsdCharge queda por debajo del minimo cobrable del collector. Solo viene cuando aplica. */
14
+ totalBelowMinimum?: boolean;
11
15
  status?: string;
12
16
  paidAmountMxn: number;
13
17
  remainingBalanceMxn?: number;
@@ -1,3 +1,4 @@
1
+ import { FxQuoteSnake } from "./FxQuote";
1
2
  /**
2
3
  * Cotizacion para liquidacion anticipada de un credito.
3
4
  *
@@ -22,4 +23,6 @@ export declare class SettlementQuote {
22
23
  * omite el campo y la UI debe caer a "solo MXN".
23
24
  */
24
25
  total_settlement_usd_charge?: number;
26
+ /** Cotizacion FX usada para `total_settlement_usd_charge`. Ausente si el collector no estuvo disponible. */
27
+ fx_quote?: FxQuoteSnake;
25
28
  }
@@ -17,3 +17,4 @@ export * from './dtos/EarlyPaymentResult';
17
17
  export * from './dtos/OfferResult';
18
18
  export * from './dtos/SettlementQuote';
19
19
  export * from './dtos/AnticipatedPaymentQuote';
20
+ export * from './dtos/FxQuote';
@@ -33,3 +33,4 @@ __exportStar(require("./dtos/EarlyPaymentResult"), exports);
33
33
  __exportStar(require("./dtos/OfferResult"), exports);
34
34
  __exportStar(require("./dtos/SettlementQuote"), exports);
35
35
  __exportStar(require("./dtos/AnticipatedPaymentQuote"), exports);
36
+ __exportStar(require("./dtos/FxQuote"), exports);
@@ -0,0 +1,4 @@
1
+ export declare const DIRECTORY_AGENTS_BY_SPONSOR_MAX_BATCH = 100;
2
+ export declare class DirectoryAgentsBySponsorRequest {
3
+ sponsorDirectoryIds: string[];
4
+ }
@@ -0,0 +1,25 @@
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.DirectoryAgentsBySponsorRequest = exports.DIRECTORY_AGENTS_BY_SPONSOR_MAX_BATCH = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ // Tope de sponsorDirectoryIds por request del endpoint batch de directorios AGENT por sponsor.
15
+ exports.DIRECTORY_AGENTS_BY_SPONSOR_MAX_BATCH = 100;
16
+ // Body de POST /directories/search/by-sponsor-directory-ids; la lista vacía es válida y responde {}.
17
+ class DirectoryAgentsBySponsorRequest {
18
+ }
19
+ exports.DirectoryAgentsBySponsorRequest = DirectoryAgentsBySponsorRequest;
20
+ __decorate([
21
+ (0, class_validator_1.IsArray)(),
22
+ (0, class_validator_1.ArrayMaxSize)(exports.DIRECTORY_AGENTS_BY_SPONSOR_MAX_BATCH),
23
+ (0, class_validator_1.IsString)({ each: true }),
24
+ __metadata("design:type", Array)
25
+ ], DirectoryAgentsBySponsorRequest.prototype, "sponsorDirectoryIds", void 0);
@@ -0,0 +1,9 @@
1
+ export interface DirectoryAgentBySponsorItem {
2
+ id: string;
3
+ sponsorDirectoryId: string;
4
+ identityId: string | null;
5
+ email: string | null;
6
+ status: string;
7
+ updatedAt: number | null;
8
+ }
9
+ export type DirectoryAgentsBySponsorResponse = Record<string, DirectoryAgentBySponsorItem>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -6,6 +6,8 @@ export * from './dtos/DirectoryBackofficeUpdateRequest';
6
6
  export * from './dtos/CreateDirectoryUserEventRequest';
7
7
  export * from './dtos/CreateDirectoryUserEventResponse';
8
8
  export * from './dtos/DeleteByDirectoryResponse';
9
+ export * from './dtos/DirectoryAgentsBySponsorRequest';
10
+ export * from './dtos/DirectoryAgentsBySponsorResponse';
9
11
  export * from './dtos/External';
10
12
  export * from './enums/TypeOfDirectoryId';
11
13
  export * from './enums/DirectoryBackofficeStatusEnum';
@@ -23,6 +23,8 @@ __exportStar(require("./dtos/DirectoryBackofficeUpdateRequest"), exports);
23
23
  __exportStar(require("./dtos/CreateDirectoryUserEventRequest"), exports);
24
24
  __exportStar(require("./dtos/CreateDirectoryUserEventResponse"), exports);
25
25
  __exportStar(require("./dtos/DeleteByDirectoryResponse"), exports);
26
+ __exportStar(require("./dtos/DirectoryAgentsBySponsorRequest"), exports);
27
+ __exportStar(require("./dtos/DirectoryAgentsBySponsorResponse"), exports);
26
28
  __exportStar(require("./dtos/External"), exports);
27
29
  //enums
28
30
  __exportStar(require("./enums/TypeOfDirectoryId"), exports);
@@ -0,0 +1,36 @@
1
+ import { RelationStatus } from "../enums/RelationStatus";
2
+ import { RelationType } from "../enums/RelationType";
3
+ import { CPStatusEnum } from "../../identity/enums/CPStatusEnum";
4
+ import type { TenantUserStatusValue } from "../../platformRbac/dtos/TenantUserResponse";
5
+ export interface GroupMemberHubItem {
6
+ PK: string;
7
+ SK: string;
8
+ directoryId: string;
9
+ groupId: string;
10
+ relationType: RelationType;
11
+ status: RelationStatus;
12
+ agent: string | null;
13
+ createdAt: string;
14
+ updatedAt: string;
15
+ phoneNumber: string | null;
16
+ indexName: string | null;
17
+ peopleId: string | null;
18
+ referralCode: string | null;
19
+ myReferralCode: string | null;
20
+ CP_Status: CPStatusEnum | null;
21
+ parentGroupId: string | null;
22
+ operationId: string | null;
23
+ referralDirectoryId: string | null;
24
+ promotedToDirectory: boolean | null;
25
+ isAgent: boolean;
26
+ agentId: string | null;
27
+ agentRole: string | null;
28
+ agentStatus: string | null;
29
+ position: string | null;
30
+ reportsToDirectoryId: string | null;
31
+ reportsToName: string | null;
32
+ agentDirectoryStatus: string | null;
33
+ loginEmail: string | null;
34
+ hasRbac: boolean | null;
35
+ rbacStatus: TenantUserStatusValue | null;
36
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -9,3 +9,4 @@ export * from './enums/RelationType';
9
9
  export * from './enums/RelationStatus';
10
10
  export * from './enums/GroupAction';
11
11
  export * from './dtos/GroupCountsResponse';
12
+ export * from './dtos/GroupMemberHubItem';
@@ -28,3 +28,4 @@ __exportStar(require("./enums/RelationStatus"), exports);
28
28
  __exportStar(require("./enums/GroupAction"), exports);
29
29
  //dtos
30
30
  __exportStar(require("./dtos/GroupCountsResponse"), exports);
31
+ __exportStar(require("./dtos/GroupMemberHubItem"), exports);
@@ -0,0 +1,4 @@
1
+ export declare const TENANT_USERS_BY_SUBS_MAX_BATCH = 100;
2
+ export declare class TenantUsersBySubsRequest {
3
+ cognitoSubs: string[];
4
+ }
@@ -0,0 +1,25 @@
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.TenantUsersBySubsRequest = exports.TENANT_USERS_BY_SUBS_MAX_BATCH = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ // Tope de cognitoSubs por request del endpoint batch de usuarios del tenant.
15
+ exports.TENANT_USERS_BY_SUBS_MAX_BATCH = 100;
16
+ // Body de POST /internal/tenants/{tenantId}/users/by-subs; la lista vacía es válida y responde {}.
17
+ class TenantUsersBySubsRequest {
18
+ }
19
+ exports.TenantUsersBySubsRequest = TenantUsersBySubsRequest;
20
+ __decorate([
21
+ (0, class_validator_1.IsArray)(),
22
+ (0, class_validator_1.ArrayMaxSize)(exports.TENANT_USERS_BY_SUBS_MAX_BATCH),
23
+ (0, class_validator_1.IsString)({ each: true }),
24
+ __metadata("design:type", Array)
25
+ ], TenantUsersBySubsRequest.prototype, "cognitoSubs", void 0);
@@ -0,0 +1,8 @@
1
+ import type { TenantUserStatusValue } from './TenantUserResponse';
2
+ export interface TenantUserBySubItem {
3
+ cognitoSub: string;
4
+ email: string | null;
5
+ status: TenantUserStatusValue;
6
+ displayName: string | null;
7
+ }
8
+ export type TenantUsersBySubsResponse = Record<string, TenantUserBySubItem>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -84,3 +84,5 @@ export * from './dtos/AssignTenantRoleRequest';
84
84
  export type { AssignTenantRoleResponse } from './dtos/AssignTenantRoleResponse';
85
85
  export * from './dtos/RevokeTenantRoleRequest';
86
86
  export type { RevokeTenantRoleResponse } from './dtos/RevokeTenantRoleResponse';
87
+ export * from './dtos/TenantUsersBySubsRequest';
88
+ export type { TenantUserBySubItem, TenantUsersBySubsResponse } from './dtos/TenantUsersBySubsResponse';
@@ -125,3 +125,5 @@ __exportStar(require("./dtos/ResetTenantUserPasswordRequest"), exports);
125
125
  __exportStar(require("./dtos/ResetTenantUserMfaRequest"), exports);
126
126
  __exportStar(require("./dtos/AssignTenantRoleRequest"), exports);
127
127
  __exportStar(require("./dtos/RevokeTenantRoleRequest"), exports);
128
+ // Batch privado de usuarios del tenant por cognitoSub (hub de miembros de group-business).
129
+ __exportStar(require("./dtos/TenantUsersBySubsRequest"), exports);
@@ -0,0 +1,4 @@
1
+ export declare const AGENTS_BY_DIRECTORY_IDS_MAX_BATCH = 100;
2
+ export declare class AgentsByDirectoryIdsRequest {
3
+ directoryIds: string[];
4
+ }
@@ -0,0 +1,25 @@
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.AgentsByDirectoryIdsRequest = exports.AGENTS_BY_DIRECTORY_IDS_MAX_BATCH = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ // Tope de directoryIds por request del endpoint batch de agentes por directorio.
15
+ exports.AGENTS_BY_DIRECTORY_IDS_MAX_BATCH = 100;
16
+ // Body de POST /private/agents/by-directory-ids; la lista vacía es válida y responde {}.
17
+ class AgentsByDirectoryIdsRequest {
18
+ }
19
+ exports.AgentsByDirectoryIdsRequest = AgentsByDirectoryIdsRequest;
20
+ __decorate([
21
+ (0, class_validator_1.IsArray)(),
22
+ (0, class_validator_1.ArrayMaxSize)(exports.AGENTS_BY_DIRECTORY_IDS_MAX_BATCH),
23
+ (0, class_validator_1.IsString)({ each: true }),
24
+ __metadata("design:type", Array)
25
+ ], AgentsByDirectoryIdsRequest.prototype, "directoryIds", void 0);
@@ -0,0 +1,11 @@
1
+ export interface AgentByDirectoryIdItem {
2
+ id: string;
3
+ directoryId: string;
4
+ groupId: string | null;
5
+ agentRole: string | null;
6
+ notes: string | null;
7
+ parentDirectoryId: string | null;
8
+ status: string;
9
+ updatedAt: number | null;
10
+ }
11
+ export type AgentsByDirectoryIdsResponse = Record<string, AgentByDirectoryIdItem>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +1,3 @@
1
1
  export * from './enums/AgentRoleEnum';
2
+ export * from './dtos/AgentsByDirectoryIdsRequest';
3
+ export * from './dtos/AgentsByDirectoryIdsResponse';
@@ -16,3 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  //Enums
18
18
  __exportStar(require("./enums/AgentRoleEnum"), exports);
19
+ //dtos
20
+ __exportStar(require("./dtos/AgentsByDirectoryIdsRequest"), exports);
21
+ __exportStar(require("./dtos/AgentsByDirectoryIdsResponse"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "3.466.0",
3
+ "version": "3.468.0",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -25,13 +25,19 @@ export class BannerStateResponse {
25
25
  credit_id?: string | null;
26
26
  /** Pago del proximo cupon pendiente. */
27
27
  next_payment_amount_mxn?: number | null;
28
+ /** USD real que cobrará el collector por next_payment_amount_mxn (comisión + IVA + TC ajustado). Ausente si el collector no estuvo disponible. */
29
+ next_payment_amount_usd_charge?: number;
28
30
  next_payment_date?: string | null;
29
31
  next_coupon_number?: number | null;
30
32
  /** Montos de cupones vencidos (solo DELINQUENT). */
31
33
  overdue_amount_mxn?: number | null;
34
+ /** USD real que cobrará el collector por overdue_amount_mxn (comisión + IVA + TC ajustado). Ausente si el collector no estuvo disponible. */
35
+ overdue_amount_usd_charge?: number;
32
36
  overdue_count?: number | null;
33
37
  /** Saldo insoluto del credito activo. */
34
38
  outstanding_balance_mxn?: number | null;
39
+ /** USD real que cobrará el collector por outstanding_balance_mxn (comisión + IVA + TC ajustado). Ausente si el collector no estuvo disponible. */
40
+ outstanding_balance_usd_charge?: number;
35
41
  /**
36
42
  * Cantidad total de creditos que el directoryId ha tenido en Credits_GT
37
43
  * (incluye ACTIVE, PAID_OFF, DEFAULTED — todos los estados historicos).
@@ -5,7 +5,11 @@ export class CreditOfferOptionItem {
5
5
  term_weeks: number;
6
6
  annual_rate: number;
7
7
  weekly_payment_mxn: number;
8
+ /** USD real que cobrará el collector por weekly_payment_mxn (comisión + IVA + TC ajustado). Ausente si el collector no estuvo disponible. */
9
+ weekly_payment_usd_charge?: number;
8
10
  total_to_pay_mxn: number;
11
+ /** USD real que cobrará el collector por total_to_pay_mxn (comisión + IVA + TC ajustado). Ausente si el collector no estuvo disponible. */
12
+ total_to_pay_usd_charge?: number;
9
13
  total_interest_mxn: number;
10
14
  savings_vs_longest: number;
11
15
  is_recommended: boolean;
@@ -17,6 +21,8 @@ export class CreditOfferOptionItem {
17
21
  first_payment_date?: string;
18
22
  /** Monto solicitado por el cliente (lo que recibe). */
19
23
  requested_amount_mxn?: number;
24
+ /** USD real que cobrará el collector por requested_amount_mxn (comisión + IVA + TC ajustado). Ausente si el collector no estuvo disponible. */
25
+ requested_amount_usd_charge?: number;
20
26
  /** Principal financiado (amount + fee + fee_iva si financed). */
21
27
  financed_amount_mxn?: number;
22
28
  /** Comision por apertura como fraccion (ej. 0.05 = 5%). */
@@ -1,4 +1,5 @@
1
1
  import { PaymentScheduleItemResponse } from "./PaymentScheduleItemResponse";
2
+ import { FxQuote } from "./FxQuote";
2
3
 
3
4
  /**
4
5
  * Preview / cotizacion de un abono a capital (ANTICIPATED) antes de ejecutarlo.
@@ -16,6 +17,9 @@ export class AnticipatedPaymentQuote {
16
17
  /** Monto que el usuario propuso, capeado al outstanding real del credito. */
17
18
  amountMxn!: number;
18
19
 
20
+ /** USD real que cobrará el collector por amountMxn (comisión + IVA + TC ajustado). Ausente si el collector no estuvo disponible. */
21
+ amountUsdCharge?: number;
22
+
19
23
  /** Estado actual (as-is) del credito, antes de aplicar el abono. */
20
24
  current!: AnticipatedPaymentSummary;
21
25
 
@@ -35,11 +39,16 @@ export class AnticipatedPaymentQuote {
35
39
 
36
40
  /** ISO timestamp de la cotizacion. */
37
41
  quoteDate!: string;
42
+
43
+ /** Cotizacion FX usada para los campos `*UsdCharge` (incluye los de `newSchedule`). Ausente si el collector no estuvo disponible. */
44
+ fxQuote?: FxQuote;
38
45
  }
39
46
 
40
47
  export class AnticipatedPaymentSummary {
41
48
  /** Cuota semanal vigente. */
42
49
  weeklyPaymentMxn!: number;
50
+ /** USD real que cobrará el collector por weeklyPaymentMxn (comisión + IVA + TC ajustado). Ausente si el collector no estuvo disponible. */
51
+ weeklyPaymentUsdCharge?: number;
43
52
  /** Saldo insoluto (capital pendiente). */
44
53
  outstandingMxn!: number;
45
54
  /** Cupones que aun no estan PAID (incluye PARTIAL). */
@@ -1,3 +1,4 @@
1
+ import { FxQuote } from "./FxQuote";
1
2
 
2
3
  /**
3
4
  * Response con el detalle completo de un credito LOAN.
@@ -10,11 +11,15 @@ export class CreditDetailResponse {
10
11
  termWeeks?: number;
11
12
  annualRate?: number;
12
13
  weeklyPaymentMxn?: number;
14
+ /** USD real que cobrará el collector por weeklyPaymentMxn (comisión + IVA + TC ajustado). Ausente si el collector no estuvo disponible. */
15
+ weeklyPaymentUsdCharge?: number;
13
16
  status?: string;
14
17
  nextPaymentDate?: string;
15
18
  paidCoupons?: number;
16
19
  totalCoupons?: number;
17
20
  remainingBalanceMxn?: number;
21
+ /** USD real que cobrará el collector por remainingBalanceMxn (comisión + IVA + TC ajustado). Ausente si el collector no estuvo disponible. */
22
+ remainingBalanceUsdCharge?: number;
18
23
  cat?: number | null;
19
24
  totalInterestMxn?: number;
20
25
  totalIvaMxn?: number;
@@ -25,8 +30,16 @@ export class CreditDetailResponse {
25
30
  firstPaymentDate?: string | null;
26
31
  lastPaymentDate?: string | null;
27
32
  nextPaymentAmountMxn?: number | null;
33
+ /** USD real que cobrará el collector por nextPaymentAmountMxn (comisión + IVA + TC ajustado). Ausente si el collector no estuvo disponible. */
34
+ nextPaymentAmountUsdCharge?: number;
28
35
  nextCouponNumber?: number | null;
29
36
  totalPaidMxn?: number;
37
+ /** USD real que cobrará el collector por totalPaidMxn (comisión + IVA + TC ajustado). Ausente si el collector no estuvo disponible. */
38
+ totalPaidUsdCharge?: number;
30
39
  overdueCount?: number;
31
40
  overdueAmountMxn?: number;
41
+ /** USD real que cobrará el collector por overdueAmountMxn (comisión + IVA + TC ajustado). Ausente si el collector no estuvo disponible. */
42
+ overdueAmountUsdCharge?: number;
43
+ /** Cotizacion FX usada para los campos `*UsdCharge`. Ausente si el collector no estuvo disponible. */
44
+ fxQuote?: FxQuote;
32
45
  }
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Tipo de cambio y factor que el collector aplicara al cobro en USD.
3
+ *
4
+ * Es la cotizacion vigente al momento de armar la respuesta: con ella el
5
+ * collector convierte cada monto MXN al USD real que descuenta del pocket
6
+ * (comision + IVA + TC ajustado). Viaja junto a los campos `<x>UsdCharge`
7
+ * para que el frontend pueda explicar el numero, no para recalcularlo.
8
+ * Ausente si el collector no estuvo disponible.
9
+ */
10
+ export class FxQuote {
11
+ /** TC MXN por USD publicado, sin ajuste. */
12
+ exchangeRate!: number;
13
+ /** TC MXN por USD ajustado con el colchon del collector; es el divisor real del cobro. */
14
+ adjustmentRate!: number;
15
+ /** Factor multiplicativo sobre el MXN nocional (comision + IVA). */
16
+ totalFactor!: number;
17
+ /** Momento de la cotizacion, ISO 8601. */
18
+ quotedAt!: string;
19
+ }
20
+
21
+ /**
22
+ * Gemelo snake_case de `FxQuote` para los DTOs contenedores que ya son
23
+ * snake_case (`SettlementQuote`, `OfferResult`). Misma semantica campo a campo.
24
+ */
25
+ export class FxQuoteSnake {
26
+ /** TC MXN por USD publicado, sin ajuste. */
27
+ exchange_rate!: number;
28
+ /** TC MXN por USD ajustado con el colchon del collector; es el divisor real del cobro. */
29
+ adjustment_rate!: number;
30
+ /** Factor multiplicativo sobre el MXN nocional (comision + IVA). */
31
+ total_factor!: number;
32
+ /** Momento de la cotizacion, ISO 8601. */
33
+ quoted_at!: string;
34
+ }
@@ -1,3 +1,5 @@
1
+ import { FxQuoteSnake } from "./FxQuote";
2
+
1
3
  /**
2
4
  * Respuesta del endpoint de generación de oferta: lista de tasas disponibles
3
5
  * para el usuario, plus los parámetros de la comisión por apertura.
@@ -19,4 +21,6 @@ export class OfferResult {
19
21
  opening_fee_pct?: number;
20
22
  /** True si la comisión se financia (se suma al principal y se amortiza); false si se cobra al desembolso. */
21
23
  opening_fee_financed?: boolean;
24
+ /** Cotizacion FX vigente al generar la oferta, para los `*_usd_charge` que el frontend proyecte sobre ella. Ausente si el collector no estuvo disponible. */
25
+ fx_quote?: FxQuoteSnake;
22
26
  }
@@ -9,6 +9,10 @@ export class PaymentScheduleItemResponse {
9
9
  interestMxn?: number;
10
10
  ivaMxn?: number;
11
11
  totalMxn?: number;
12
+ /** USD real que cobrará el collector por totalMxn (comisión + IVA + TC ajustado). Ausente si el collector no estuvo disponible. */
13
+ totalUsdCharge?: number;
14
+ /** True si totalUsdCharge queda por debajo del minimo cobrable del collector. Solo viene cuando aplica. */
15
+ totalBelowMinimum?: boolean;
12
16
  status?: string;
13
17
  paidAmountMxn!: number;
14
18
  remainingBalanceMxn?: number;
@@ -1,3 +1,5 @@
1
+ import { FxQuoteSnake } from "./FxQuote";
2
+
1
3
  /**
2
4
  * Cotizacion para liquidacion anticipada de un credito.
3
5
  *
@@ -22,4 +24,6 @@ export class SettlementQuote {
22
24
  * omite el campo y la UI debe caer a "solo MXN".
23
25
  */
24
26
  total_settlement_usd_charge?: number;
27
+ /** Cotizacion FX usada para `total_settlement_usd_charge`. Ausente si el collector no estuvo disponible. */
28
+ fx_quote?: FxQuoteSnake;
25
29
  }
@@ -19,3 +19,4 @@ export * from './dtos/EarlyPaymentResult';
19
19
  export * from './dtos/OfferResult';
20
20
  export * from './dtos/SettlementQuote';
21
21
  export * from './dtos/AnticipatedPaymentQuote';
22
+ export * from './dtos/FxQuote';
@@ -0,0 +1,12 @@
1
+ import { ArrayMaxSize, IsArray, IsString } from "class-validator";
2
+
3
+ // Tope de sponsorDirectoryIds por request del endpoint batch de directorios AGENT por sponsor.
4
+ export const DIRECTORY_AGENTS_BY_SPONSOR_MAX_BATCH = 100;
5
+
6
+ // Body de POST /directories/search/by-sponsor-directory-ids; la lista vacía es válida y responde {}.
7
+ export class DirectoryAgentsBySponsorRequest {
8
+ @IsArray()
9
+ @ArrayMaxSize(DIRECTORY_AGENTS_BY_SPONSOR_MAX_BATCH)
10
+ @IsString({ each: true })
11
+ sponsorDirectoryIds!: string[];
12
+ }
@@ -0,0 +1,12 @@
1
+ // Directorio AGENT ganador de un sponsor: excluye DELETE, ACTIVE gana y luego el updatedAt más reciente.
2
+ export interface DirectoryAgentBySponsorItem {
3
+ id: string;
4
+ sponsorDirectoryId: string;
5
+ identityId: string | null;
6
+ email: string | null;
7
+ status: string;
8
+ updatedAt: number | null;
9
+ }
10
+
11
+ // Respuesta de POST /directories/search/by-sponsor-directory-ids; un sponsor sin agente no aparece.
12
+ export type DirectoryAgentsBySponsorResponse = Record<string, DirectoryAgentBySponsorItem>;
@@ -8,6 +8,8 @@ export * from './dtos/DirectoryBackofficeUpdateRequest';
8
8
  export * from './dtos/CreateDirectoryUserEventRequest';
9
9
  export * from './dtos/CreateDirectoryUserEventResponse';
10
10
  export * from './dtos/DeleteByDirectoryResponse';
11
+ export * from './dtos/DirectoryAgentsBySponsorRequest';
12
+ export * from './dtos/DirectoryAgentsBySponsorResponse';
11
13
 
12
14
  export * from './dtos/External';
13
15
 
@@ -0,0 +1,40 @@
1
+ import { RelationStatus } from "../enums/RelationStatus";
2
+ import { RelationType } from "../enums/RelationType";
3
+ import { CPStatusEnum } from "../../identity/enums/CPStatusEnum";
4
+ import type { TenantUserStatusValue } from "../../platformRbac/dtos/TenantUserResponse";
5
+
6
+ // Fila de GET /backoffice/members por groupIds: membresía + directorio, people, onboarding, agente y RBAC.
7
+ // Las columnas de una fuente que falló o no aplica salen en null (enriquecimiento best-effort).
8
+ export interface GroupMemberHubItem {
9
+ PK: string;
10
+ SK: string;
11
+ directoryId: string;
12
+ groupId: string;
13
+ relationType: RelationType;
14
+ status: RelationStatus;
15
+ agent: string | null;
16
+ createdAt: string;
17
+ updatedAt: string;
18
+ phoneNumber: string | null;
19
+ indexName: string | null;
20
+ peopleId: string | null;
21
+ referralCode: string | null;
22
+ myReferralCode: string | null;
23
+ CP_Status: CPStatusEnum | null;
24
+ parentGroupId: string | null;
25
+ operationId: string | null;
26
+ referralDirectoryId: string | null;
27
+ promotedToDirectory: boolean | null;
28
+ isAgent: boolean;
29
+ agentId: string | null;
30
+ agentRole: string | null;
31
+ agentStatus: string | null;
32
+ position: string | null;
33
+ reportsToDirectoryId: string | null;
34
+ reportsToName: string | null;
35
+ agentDirectoryStatus: string | null;
36
+ loginEmail: string | null;
37
+ // null = la fuente RBAC o la de directorios AGENT falló; false = respondió y no hay usuario.
38
+ hasRbac: boolean | null;
39
+ rbacStatus: TenantUserStatusValue | null;
40
+ }
@@ -19,3 +19,4 @@ export * from './enums/GroupAction';
19
19
 
20
20
  //dtos
21
21
  export * from './dtos/GroupCountsResponse';
22
+ export * from './dtos/GroupMemberHubItem';
@@ -0,0 +1,12 @@
1
+ import { ArrayMaxSize, IsArray, IsString } from "class-validator";
2
+
3
+ // Tope de cognitoSubs por request del endpoint batch de usuarios del tenant.
4
+ export const TENANT_USERS_BY_SUBS_MAX_BATCH = 100;
5
+
6
+ // Body de POST /internal/tenants/{tenantId}/users/by-subs; la lista vacía es válida y responde {}.
7
+ export class TenantUsersBySubsRequest {
8
+ @IsArray()
9
+ @ArrayMaxSize(TENANT_USERS_BY_SUBS_MAX_BATCH)
10
+ @IsString({ each: true })
11
+ cognitoSubs!: string[];
12
+ }
@@ -0,0 +1,12 @@
1
+ import type { TenantUserStatusValue } from './TenantUserResponse';
2
+
3
+ // Usuario del tenant (SharedUser) sin roles; email nulo en tenants phone-primary sin correo.
4
+ export interface TenantUserBySubItem {
5
+ cognitoSub: string;
6
+ email: string | null;
7
+ status: TenantUserStatusValue;
8
+ displayName: string | null;
9
+ }
10
+
11
+ // Respuesta de POST /internal/tenants/{tenantId}/users/by-subs; un sub inexistente o de otro tenant no aparece.
12
+ export type TenantUsersBySubsResponse = Record<string, TenantUserBySubItem>;
@@ -178,3 +178,7 @@ export * from './dtos/AssignTenantRoleRequest';
178
178
  export type { AssignTenantRoleResponse } from './dtos/AssignTenantRoleResponse';
179
179
  export * from './dtos/RevokeTenantRoleRequest';
180
180
  export type { RevokeTenantRoleResponse } from './dtos/RevokeTenantRoleResponse';
181
+
182
+ // Batch privado de usuarios del tenant por cognitoSub (hub de miembros de group-business).
183
+ export * from './dtos/TenantUsersBySubsRequest';
184
+ export type { TenantUserBySubItem, TenantUsersBySubsResponse } from './dtos/TenantUsersBySubsResponse';
@@ -0,0 +1,12 @@
1
+ import { ArrayMaxSize, IsArray, IsString } from "class-validator";
2
+
3
+ // Tope de directoryIds por request del endpoint batch de agentes por directorio.
4
+ export const AGENTS_BY_DIRECTORY_IDS_MAX_BATCH = 100;
5
+
6
+ // Body de POST /private/agents/by-directory-ids; la lista vacía es válida y responde {}.
7
+ export class AgentsByDirectoryIdsRequest {
8
+ @IsArray()
9
+ @ArrayMaxSize(AGENTS_BY_DIRECTORY_IDS_MAX_BATCH)
10
+ @IsString({ each: true })
11
+ directoryIds!: string[];
12
+ }
@@ -0,0 +1,14 @@
1
+ // Fila ganadora de Agents_GT de un directorio: excluye DELETE, ACTIVE gana y luego el updatedAt más reciente.
2
+ export interface AgentByDirectoryIdItem {
3
+ id: string;
4
+ directoryId: string;
5
+ groupId: string | null;
6
+ agentRole: string | null;
7
+ notes: string | null;
8
+ parentDirectoryId: string | null;
9
+ status: string;
10
+ updatedAt: number | null;
11
+ }
12
+
13
+ // Respuesta de POST /private/agents/by-directory-ids; un directorio sin agente no aparece.
14
+ export type AgentsByDirectoryIdsResponse = Record<string, AgentByDirectoryIdItem>;
@@ -1,2 +1,6 @@
1
1
  //Enums
2
- export * from './enums/AgentRoleEnum';
2
+ export * from './enums/AgentRoleEnum';
3
+
4
+ //dtos
5
+ export * from './dtos/AgentsByDirectoryIdsRequest';
6
+ export * from './dtos/AgentsByDirectoryIdsResponse';