@fiado/type-kit 3.612.0 → 3.614.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 (134) hide show
  1. package/_test_/unit/loanCredit/segmentFactsDtos.test.ts +80 -0
  2. package/_test_/unit/loanOfferings/segmentCatalog.test.ts +4 -2
  3. package/_test_/unit/loanOfferings/segmentCohorts.test.ts +333 -0
  4. package/bin/loanCredit/dtos/requests/SegmentFactsBatchRequest.d.ts +4 -0
  5. package/bin/loanCredit/dtos/requests/SegmentFactsBatchRequest.js +27 -0
  6. package/bin/loanCredit/dtos/requests/SegmentFactsPageRequest.d.ts +7 -0
  7. package/bin/loanCredit/dtos/requests/SegmentFactsPageRequest.js +32 -0
  8. package/bin/loanCredit/dtos/responses/BorrowerSegmentFacts.d.ts +22 -0
  9. package/bin/loanCredit/dtos/responses/BorrowerSegmentFacts.js +2 -0
  10. package/bin/loanCredit/dtos/responses/SegmentFactsBatchResponse.d.ts +5 -0
  11. package/bin/loanCredit/dtos/responses/SegmentFactsBatchResponse.js +2 -0
  12. package/bin/loanCredit/dtos/responses/SegmentFactsPageResponse.d.ts +7 -0
  13. package/bin/loanCredit/dtos/responses/SegmentFactsPageResponse.js +2 -0
  14. package/bin/loanCredit/index.d.ts +5 -0
  15. package/bin/loanCredit/index.js +6 -0
  16. package/bin/loanOfferings/dtos/requests/ChangeCohortStatusRequest.d.ts +9 -0
  17. package/bin/loanOfferings/dtos/requests/ChangeCohortStatusRequest.js +34 -0
  18. package/bin/loanOfferings/dtos/requests/CohortCondition.d.ts +15 -0
  19. package/bin/loanOfferings/dtos/requests/CohortCondition.js +48 -0
  20. package/bin/loanOfferings/dtos/requests/CreateCohortRequest.d.ts +11 -0
  21. package/bin/loanOfferings/dtos/requests/CreateCohortRequest.js +44 -0
  22. package/bin/loanOfferings/dtos/requests/CreateSegmentRequest.d.ts +7 -8
  23. package/bin/loanOfferings/dtos/requests/CreateSegmentRequest.js +5 -3
  24. package/bin/loanOfferings/dtos/requests/CustomerSegmentFacts.d.ts +30 -0
  25. package/bin/loanOfferings/dtos/requests/CustomerSegmentFacts.js +92 -0
  26. package/bin/loanOfferings/dtos/requests/ListCohortsQuery.d.ts +5 -0
  27. package/bin/loanOfferings/dtos/requests/ListCohortsQuery.js +25 -0
  28. package/bin/loanOfferings/dtos/requests/ResolveCustomerSegmentsRequest.d.ts +4 -20
  29. package/bin/loanOfferings/dtos/requests/ResolveCustomerSegmentsRequest.js +4 -48
  30. package/bin/loanOfferings/dtos/requests/ResolveSegmentMembersRequest.d.ts +8 -0
  31. package/bin/loanOfferings/dtos/requests/ResolveSegmentMembersRequest.js +31 -0
  32. package/bin/loanOfferings/dtos/requests/TestCohortRequest.d.ts +9 -0
  33. package/bin/loanOfferings/dtos/requests/TestCohortRequest.js +36 -0
  34. package/bin/loanOfferings/dtos/requests/TestCustomerSegmentsRequest.d.ts +4 -0
  35. package/bin/loanOfferings/dtos/requests/TestCustomerSegmentsRequest.js +23 -0
  36. package/bin/loanOfferings/dtos/requests/UpdateCohortRequest.d.ts +12 -0
  37. package/bin/loanOfferings/dtos/requests/UpdateCohortRequest.js +53 -0
  38. package/bin/loanOfferings/dtos/requests/UpdateSegmentRequest.d.ts +2 -2
  39. package/bin/loanOfferings/dtos/requests/UpdateSegmentRequest.js +3 -1
  40. package/bin/loanOfferings/dtos/responses/CohortCatalogResponse.d.ts +33 -0
  41. package/bin/loanOfferings/dtos/responses/CohortCatalogResponse.js +2 -0
  42. package/bin/loanOfferings/dtos/responses/CohortLogEntryResponse.d.ts +11 -0
  43. package/bin/loanOfferings/dtos/responses/CohortLogEntryResponse.js +2 -0
  44. package/bin/loanOfferings/dtos/responses/CohortResponse.d.ts +43 -0
  45. package/bin/loanOfferings/dtos/responses/CohortResponse.js +2 -0
  46. package/bin/loanOfferings/dtos/responses/SegmentCatalogResponse.d.ts +5 -2
  47. package/bin/loanOfferings/dtos/responses/SegmentLogEntryResponse.d.ts +11 -0
  48. package/bin/loanOfferings/dtos/responses/SegmentLogEntryResponse.js +2 -0
  49. package/bin/loanOfferings/dtos/responses/SegmentMembersResponse.d.ts +19 -0
  50. package/bin/loanOfferings/dtos/responses/SegmentMembersResponse.js +2 -0
  51. package/bin/loanOfferings/dtos/responses/SegmentResponse.d.ts +12 -6
  52. package/bin/loanOfferings/dtos/responses/SegmentUsageResponse.d.ts +18 -0
  53. package/bin/loanOfferings/dtos/responses/SegmentUsageResponse.js +2 -0
  54. package/bin/loanOfferings/dtos/responses/SegmentationRecountRunResponse.d.ts +23 -0
  55. package/bin/loanOfferings/dtos/responses/SegmentationRecountRunResponse.js +2 -0
  56. package/bin/loanOfferings/dtos/responses/SegmentationRecountStartResponse.d.ts +6 -0
  57. package/bin/loanOfferings/dtos/responses/SegmentationRecountStartResponse.js +2 -0
  58. package/bin/loanOfferings/dtos/responses/TestCohortResponse.d.ts +17 -0
  59. package/bin/loanOfferings/dtos/responses/TestCohortResponse.js +2 -0
  60. package/bin/loanOfferings/dtos/responses/TestCustomerSegmentsResponse.d.ts +23 -0
  61. package/bin/loanOfferings/dtos/responses/TestCustomerSegmentsResponse.js +2 -0
  62. package/bin/loanOfferings/enums/CohortConditionOutcomeEnum.d.ts +10 -0
  63. package/bin/loanOfferings/enums/CohortConditionOutcomeEnum.js +14 -0
  64. package/bin/loanOfferings/enums/CohortFactKeyEnum.d.ts +17 -0
  65. package/bin/loanOfferings/enums/CohortFactKeyEnum.js +21 -0
  66. package/bin/loanOfferings/enums/CohortFactTypeEnum.d.ts +9 -0
  67. package/bin/loanOfferings/enums/CohortFactTypeEnum.js +13 -0
  68. package/bin/loanOfferings/enums/CohortLogEventEnum.d.ts +10 -0
  69. package/bin/loanOfferings/enums/CohortLogEventEnum.js +14 -0
  70. package/bin/loanOfferings/enums/CohortOperatorEnum.d.ts +15 -0
  71. package/bin/loanOfferings/enums/CohortOperatorEnum.js +19 -0
  72. package/bin/loanOfferings/enums/CohortStatusEnum.d.ts +9 -0
  73. package/bin/loanOfferings/enums/CohortStatusEnum.js +13 -0
  74. package/bin/loanOfferings/enums/SegmentFilterIdEnum.d.ts +2 -0
  75. package/bin/loanOfferings/enums/SegmentFilterIdEnum.js +2 -0
  76. package/bin/loanOfferings/enums/SegmentLogEventEnum.d.ts +10 -0
  77. package/bin/loanOfferings/enums/SegmentLogEventEnum.js +14 -0
  78. package/bin/loanOfferings/enums/SegmentMembershipReasonEnum.d.ts +9 -0
  79. package/bin/loanOfferings/enums/SegmentMembershipReasonEnum.js +13 -0
  80. package/bin/loanOfferings/enums/SegmentationRecountStatusEnum.d.ts +9 -0
  81. package/bin/loanOfferings/enums/SegmentationRecountStatusEnum.js +13 -0
  82. package/bin/loanOfferings/enums/SegmentationRecountTriggerEnum.d.ts +8 -0
  83. package/bin/loanOfferings/enums/SegmentationRecountTriggerEnum.js +12 -0
  84. package/bin/loanOfferings/index.d.ts +29 -0
  85. package/bin/loanOfferings/index.js +29 -0
  86. package/bin/onboarding/events/SponsorChangedEventDetail.d.ts +16 -0
  87. package/bin/onboarding/events/SponsorChangedEventDetail.js +14 -0
  88. package/bin/onboarding/index.d.ts +1 -0
  89. package/bin/onboarding/index.js +2 -0
  90. package/package.json +1 -1
  91. package/src/loanCredit/dtos/requests/SegmentFactsBatchRequest.ts +13 -0
  92. package/src/loanCredit/dtos/requests/SegmentFactsPageRequest.ts +19 -0
  93. package/src/loanCredit/dtos/responses/BorrowerSegmentFacts.ts +24 -0
  94. package/src/loanCredit/dtos/responses/SegmentFactsBatchResponse.ts +6 -0
  95. package/src/loanCredit/dtos/responses/SegmentFactsPageResponse.ts +8 -0
  96. package/src/loanCredit/index.ts +7 -0
  97. package/src/loanOfferings/dtos/requests/ChangeCohortStatusRequest.ts +19 -0
  98. package/src/loanOfferings/dtos/requests/CohortCondition.ts +33 -0
  99. package/src/loanOfferings/dtos/requests/CreateCohortRequest.ts +29 -0
  100. package/src/loanOfferings/dtos/requests/CreateSegmentRequest.ts +10 -9
  101. package/src/loanOfferings/dtos/requests/CustomerSegmentFacts.ts +79 -0
  102. package/src/loanOfferings/dtos/requests/ListCohortsQuery.ts +11 -0
  103. package/src/loanOfferings/dtos/requests/ResolveCustomerSegmentsRequest.ts +5 -49
  104. package/src/loanOfferings/dtos/requests/ResolveSegmentMembersRequest.ts +17 -0
  105. package/src/loanOfferings/dtos/requests/TestCohortRequest.ts +21 -0
  106. package/src/loanOfferings/dtos/requests/TestCustomerSegmentsRequest.ts +9 -0
  107. package/src/loanOfferings/dtos/requests/UpdateCohortRequest.ts +37 -0
  108. package/src/loanOfferings/dtos/requests/UpdateSegmentRequest.ts +5 -3
  109. package/src/loanOfferings/dtos/responses/CohortCatalogResponse.ts +36 -0
  110. package/src/loanOfferings/dtos/responses/CohortLogEntryResponse.ts +12 -0
  111. package/src/loanOfferings/dtos/responses/CohortResponse.ts +47 -0
  112. package/src/loanOfferings/dtos/responses/SegmentCatalogResponse.ts +5 -2
  113. package/src/loanOfferings/dtos/responses/SegmentLogEntryResponse.ts +12 -0
  114. package/src/loanOfferings/dtos/responses/SegmentMembersResponse.ts +21 -0
  115. package/src/loanOfferings/dtos/responses/SegmentResponse.ts +12 -6
  116. package/src/loanOfferings/dtos/responses/SegmentUsageResponse.ts +20 -0
  117. package/src/loanOfferings/dtos/responses/SegmentationRecountRunResponse.ts +25 -0
  118. package/src/loanOfferings/dtos/responses/SegmentationRecountStartResponse.ts +7 -0
  119. package/src/loanOfferings/dtos/responses/TestCohortResponse.ts +19 -0
  120. package/src/loanOfferings/dtos/responses/TestCustomerSegmentsResponse.ts +25 -0
  121. package/src/loanOfferings/enums/CohortConditionOutcomeEnum.ts +10 -0
  122. package/src/loanOfferings/enums/CohortFactKeyEnum.ts +17 -0
  123. package/src/loanOfferings/enums/CohortFactTypeEnum.ts +9 -0
  124. package/src/loanOfferings/enums/CohortLogEventEnum.ts +10 -0
  125. package/src/loanOfferings/enums/CohortOperatorEnum.ts +15 -0
  126. package/src/loanOfferings/enums/CohortStatusEnum.ts +9 -0
  127. package/src/loanOfferings/enums/SegmentFilterIdEnum.ts +2 -0
  128. package/src/loanOfferings/enums/SegmentLogEventEnum.ts +10 -0
  129. package/src/loanOfferings/enums/SegmentMembershipReasonEnum.ts +9 -0
  130. package/src/loanOfferings/enums/SegmentationRecountStatusEnum.ts +9 -0
  131. package/src/loanOfferings/enums/SegmentationRecountTriggerEnum.ts +8 -0
  132. package/src/loanOfferings/index.ts +29 -0
  133. package/src/onboarding/events/SponsorChangedEventDetail.ts +20 -0
  134. package/src/onboarding/index.ts +3 -0
@@ -0,0 +1,33 @@
1
+ import { CohortFactKeyEnum } from '../../enums/CohortFactKeyEnum';
2
+ import { CohortFactTypeEnum } from '../../enums/CohortFactTypeEnum';
3
+ import { CohortOperatorEnum } from '../../enums/CohortOperatorEnum';
4
+ /** Una opción de un dato de tipo `SELECT`. */
5
+ export interface CohortFactOption {
6
+ value: string;
7
+ label: string;
8
+ }
9
+ /**
10
+ * Un dato del cliente tal como lo pinta el armador de cohorts. El front lo toma de acá en vez de
11
+ * duplicar la lista.
12
+ */
13
+ export interface CohortFactFieldResponse {
14
+ key: CohortFactKeyEnum;
15
+ type: CohortFactTypeEnum;
16
+ label: string;
17
+ unit: string | null;
18
+ /** Solo en `SELECT`. */
19
+ options: CohortFactOption[] | null;
20
+ /** Operadores que admite su tipo. */
21
+ operators: CohortOperatorEnum[];
22
+ /**
23
+ * `false` cuando ningún sistema produce el dato: el armador lo muestra deshabilitado y el lambda
24
+ * rechaza guardar un cohort que lo use (422).
25
+ */
26
+ hasSource: boolean;
27
+ /** Por qué no tiene fuente. `null` cuando `hasSource` es `true`. */
28
+ missingSourceReason: string | null;
29
+ }
30
+ /** Respuesta de GET /cohorts/catalog. */
31
+ export interface CohortCatalogResponse {
32
+ fields: CohortFactFieldResponse[];
33
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ import { CohortLogEventEnum } from '../../enums/CohortLogEventEnum';
2
+ /** Un evento de la bitácora de un cohort. */
3
+ export interface CohortLogEntryResponse {
4
+ cohortId: string;
5
+ cohortName: string;
6
+ event: CohortLogEventEnum;
7
+ occurredAt: string;
8
+ performedBy: string;
9
+ reason: string | null;
10
+ version: number;
11
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,43 @@
1
+ import { CohortFactKeyEnum } from '../../enums/CohortFactKeyEnum';
2
+ import { CohortOperatorEnum } from '../../enums/CohortOperatorEnum';
3
+ import { CohortStatusEnum } from '../../enums/CohortStatusEnum';
4
+ /** Una condición guardada. `value` y `values` van en `null` cuando el operador no los usa. */
5
+ export interface CohortConditionResponse {
6
+ field: CohortFactKeyEnum;
7
+ op: CohortOperatorEnum;
8
+ value: number | boolean | string | null;
9
+ values: string[] | null;
10
+ }
11
+ /** Un segmento que usa el cohort, con lo mínimo para enlazarlo. */
12
+ export interface CohortSegmentRef {
13
+ segmentId: string;
14
+ name: string;
15
+ }
16
+ /**
17
+ * Shape de salida de un cohort (GET / POST / PUT de /cohorts). Sus condiciones se unen con Y.
18
+ * Los conteos salen del último recálculo; `null` = sin calcular.
19
+ */
20
+ export interface CohortResponse {
21
+ cohortId: string;
22
+ name: string;
23
+ description: string | null;
24
+ conditions: CohortConditionResponse[];
25
+ status: CohortStatusEnum;
26
+ version: number;
27
+ memberCount: number | null;
28
+ /** Porcentaje de los acreditados del tenant, de 0 a 100 con un decimal. `null` = sin calcular. */
29
+ pctTotal: number | null;
30
+ countedAt: string | null;
31
+ /** `true` si nunca se contó o se editó después del último recálculo. */
32
+ countPending: boolean;
33
+ /** Segmentos ACTIVE que lo referencian. */
34
+ usedBySegments: CohortSegmentRef[];
35
+ createdAt: string;
36
+ updatedAt: string;
37
+ createdBy: string;
38
+ updatedBy: string;
39
+ }
40
+ /** Respuesta de GET /cohorts. */
41
+ export interface CohortListResponse {
42
+ cohorts: CohortResponse[];
43
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,11 +1,14 @@
1
- import { SegmentFilterIdEnum } from '../../enums/SegmentFilterIdEnum';
2
1
  import { SegmentStatusEnum } from '../../enums/SegmentStatusEnum';
3
2
  /** Un segmento como lo necesita un selector: sin miembros ni metadatos de edición. */
4
3
  export interface SegmentCatalogItem {
5
4
  segmentId: string;
6
5
  name: string;
7
6
  status: SegmentStatusEnum;
8
- filterIds: SegmentFilterIdEnum[];
7
+ cohortIds: string[];
8
+ /** `true` si el segmento tiene cohorts: su pertenencia depende de los datos del cliente. */
9
+ dependsOnFacts: boolean;
10
+ /** @deprecated Mismo contenido que `cohortIds`; usar `cohortIds` o `dependsOnFacts`. */
11
+ filterIds: string[];
9
12
  /** `true` solo en el catch-all, que el resolve nunca devuelve. */
10
13
  isDefault: boolean;
11
14
  }
@@ -0,0 +1,11 @@
1
+ import { SegmentLogEventEnum } from '../../enums/SegmentLogEventEnum';
2
+ /** Un evento de la bitácora de un segmento. */
3
+ export interface SegmentLogEntryResponse {
4
+ segmentId: string;
5
+ segmentName: string;
6
+ event: SegmentLogEventEnum;
7
+ occurredAt: string;
8
+ performedBy: string;
9
+ reason: string | null;
10
+ version: number;
11
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,19 @@
1
+ /** Un segmento como lo pinta una celda de la tabla de clientes. */
2
+ export interface CustomerSegmentRef {
3
+ segmentId: string;
4
+ name: string;
5
+ /** `true` solo en el catch-all: el cliente no pertenece a ningún otro segmento. */
6
+ isDefault: boolean;
7
+ }
8
+ /** Un cliente pedido y sus segmentos. */
9
+ export interface CustomerSegmentsItem {
10
+ retailCustomerId: string;
11
+ segments: CustomerSegmentRef[];
12
+ }
13
+ /**
14
+ * Respuesta de la pertenencia a segmentos en lote: una fila por id pedido, en el orden en que
15
+ * llegaron, así el llamador distingue «ninguno» de «no vino».
16
+ */
17
+ export interface SegmentMembersResponse {
18
+ items: CustomerSegmentsItem[];
19
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,10 +1,9 @@
1
1
  import { SegmentColorSlotEnum } from '../../enums/SegmentColorSlotEnum';
2
- import { SegmentFilterIdEnum } from '../../enums/SegmentFilterIdEnum';
3
2
  import { SegmentStatusEnum } from '../../enums/SegmentStatusEnum';
4
3
  /**
5
4
  * Shape de salida de un segmento (GET / POST / PUT de /segments).
6
5
  *
7
- * Un cliente pertenece si cumple AL MENOS UNO de los `filterIds` (OR) **o** está en `memberIds`.
6
+ * Un cliente pertenece si cumple AL MENOS UNO de los `cohortIds` (OR) **o** está en `memberIds`.
8
7
  * No hay prioridad ni desempate: el cliente puede estar en varios segmentos a la vez.
9
8
  */
10
9
  export interface SegmentResponse {
@@ -12,14 +11,21 @@ export interface SegmentResponse {
12
11
  name: string;
13
12
  description: string | null;
14
13
  colorSlot: SegmentColorSlotEnum;
15
- /** Ids del catálogo cerrado. Vacío = no alcanza a nadie por regla. */
16
- filterIds: SegmentFilterIdEnum[];
17
- /** `retailCustomerId` agregados a mano. Ganan aunque el cliente no cumpla ningún filtro. */
14
+ /** Cohorts del segmento. Vacío = no alcanza a nadie por regla. */
15
+ cohortIds: string[];
16
+ /** `retailCustomerId` agregados a mano. Ganan aunque el cliente no cumpla ningún cohort. */
18
17
  memberIds: string[];
19
- /** El catch-all implícito. No acepta filtros ni individuos, no se archiva y solo se renombra. */
18
+ /** El catch-all implícito. No acepta cohorts ni individuos, no se archiva y solo se renombra. */
20
19
  isDefault: boolean;
21
20
  status: SegmentStatusEnum;
22
21
  version: number;
22
+ /** Clientes del último recálculo. En el catch-all, los que no cayeron en ningún segmento. `null` = sin calcular. */
23
+ clientCount: number | null;
24
+ /** Porcentaje de los acreditados del tenant, de 0 a 100 con un decimal. `null` = sin calcular. */
25
+ pctTotal: number | null;
26
+ countedAt: string | null;
27
+ /** `true` si nunca se contó o se editó después del último recálculo. */
28
+ countPending: boolean;
23
29
  createdAt: string;
24
30
  updatedAt: string;
25
31
  createdBy: string;
@@ -0,0 +1,18 @@
1
+ /** Una política de tienda que apunta al segmento. */
2
+ export interface SegmentUsagePolicyRef {
3
+ policyId: string;
4
+ name: string;
5
+ status: string;
6
+ }
7
+ /** Una promoción que apunta al segmento. */
8
+ export interface SegmentUsagePromotionRef {
9
+ promotionId: string;
10
+ name: string;
11
+ status: string;
12
+ }
13
+ /** Respuesta de GET /segments/:segmentId/usage: dónde se aplica el segmento, con su estado. */
14
+ export interface SegmentUsageResponse {
15
+ segmentId: string;
16
+ policies: SegmentUsagePolicyRef[];
17
+ promotions: SegmentUsagePromotionRef[];
18
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,23 @@
1
+ import { SegmentationRecountStatusEnum } from '../../enums/SegmentationRecountStatusEnum';
2
+ import { SegmentationRecountTriggerEnum } from '../../enums/SegmentationRecountTriggerEnum';
3
+ /**
4
+ * Una corrida del recálculo de conteos de cohorts y segmentos. Los campos de cierre van en `null`
5
+ * mientras corre.
6
+ */
7
+ export interface SegmentationRecountRunResponse {
8
+ runId: string;
9
+ trigger: SegmentationRecountTriggerEnum;
10
+ status: SegmentationRecountStatusEnum;
11
+ /** Quién la disparó. */
12
+ actor: string;
13
+ startedAt: string;
14
+ finishedAt: string | null;
15
+ /** Acreditados evaluados. */
16
+ evaluated: number | null;
17
+ durationMs: number | null;
18
+ error: string | null;
19
+ }
20
+ /** Respuesta de GET /segmentation/recount/runs: la más reciente primero, máximo 50. */
21
+ export interface SegmentationRecountRunsResponse {
22
+ runs: SegmentationRecountRunResponse[];
23
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ import { SegmentationRecountStatusEnum } from '../../enums/SegmentationRecountStatusEnum';
2
+ /** Respuesta de POST /segmentation/recount: la corrida arranca en segundo plano. */
3
+ export interface SegmentationRecountStartResponse {
4
+ runId: string;
5
+ status: SegmentationRecountStatusEnum;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,17 @@
1
+ import { CohortConditionOutcomeEnum } from '../../enums/CohortConditionOutcomeEnum';
2
+ import { CohortFactKeyEnum } from '../../enums/CohortFactKeyEnum';
3
+ import { CohortConditionResponse } from './CohortResponse';
4
+ /** Una condición probada con un cliente: el valor real que tiene y si la cumple. */
5
+ export interface CohortConditionTrace extends CohortConditionResponse {
6
+ /** Valor del cliente. `null` = no tiene el dato. */
7
+ actual: number | boolean | string | null;
8
+ outcome: CohortConditionOutcomeEnum;
9
+ }
10
+ /** Respuesta de POST /cohorts/test. `matched` es `true` si el cliente cumple todas las condiciones. */
11
+ export interface TestCohortResponse {
12
+ retailCustomerId: string;
13
+ matched: boolean;
14
+ /** Datos del cliente que se evaluaron. Un dato ausente no viene. */
15
+ facts: Partial<Record<CohortFactKeyEnum, number | boolean | string>>;
16
+ conditions: CohortConditionTrace[];
17
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,23 @@
1
+ import { CohortFactKeyEnum } from '../../enums/CohortFactKeyEnum';
2
+ import { SegmentMembershipReasonEnum } from '../../enums/SegmentMembershipReasonEnum';
3
+ /** Un segmento evaluado para un cliente: si entra, por qué, y qué cohorts cumplió. */
4
+ export interface CustomerSegmentTrace {
5
+ segmentId: string;
6
+ name: string;
7
+ matched: boolean;
8
+ /** `null` cuando no entra. */
9
+ reason: SegmentMembershipReasonEnum | null;
10
+ matchedCohortIds: string[];
11
+ }
12
+ /** Respuesta de POST /segments/test. */
13
+ export interface TestCustomerSegmentsResponse {
14
+ retailCustomerId: string;
15
+ /** Datos del cliente que se evaluaron. Un dato ausente no viene. */
16
+ facts: Partial<Record<CohortFactKeyEnum, number | boolean | string>>;
17
+ /** Todos los segmentos ACTIVE que no son el catch-all. */
18
+ segments: CustomerSegmentTrace[];
19
+ /** `true` si no cayó en ningún segmento: le aplica el catch-all. */
20
+ defaultApplies: boolean;
21
+ /** `false` si el evaluador de cohorts falló: solo cuenta la lista manual. */
22
+ evaluatorAvailable: boolean;
23
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Resultado de una condición al probar un cohort con un cliente. `MISSING` = el cliente no tiene
3
+ * ese dato, así que la condición no se cumple.
4
+ * @enum {string}
5
+ */
6
+ export declare enum CohortConditionOutcomeEnum {
7
+ MATCH = "MATCH",
8
+ NO_MATCH = "NO_MATCH",
9
+ MISSING = "MISSING"
10
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CohortConditionOutcomeEnum = void 0;
4
+ /**
5
+ * Resultado de una condición al probar un cohort con un cliente. `MISSING` = el cliente no tiene
6
+ * ese dato, así que la condición no se cumple.
7
+ * @enum {string}
8
+ */
9
+ var CohortConditionOutcomeEnum;
10
+ (function (CohortConditionOutcomeEnum) {
11
+ CohortConditionOutcomeEnum["MATCH"] = "MATCH";
12
+ CohortConditionOutcomeEnum["NO_MATCH"] = "NO_MATCH";
13
+ CohortConditionOutcomeEnum["MISSING"] = "MISSING";
14
+ })(CohortConditionOutcomeEnum || (exports.CohortConditionOutcomeEnum = CohortConditionOutcomeEnum = {}));
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Datos del cliente sobre los que se arma una condición de cohort. Catálogo cerrado: un dato
3
+ * nuevo es un cambio de código en quien lo calcula y en quien lo evalúa.
4
+ * @enum {string}
5
+ */
6
+ export declare enum CohortFactKeyEnum {
7
+ SCI_LEVEL = "sciLevel",
8
+ TOTAL_CREDITS = "totalCredits",
9
+ ACTIVE_CREDITS = "activeCredits",
10
+ COMPLETED_CREDITS = "completedCredits",
11
+ LIFETIME_WRITE_OFFS = "lifetimeWriteOffs",
12
+ CURRENT_ARREARS_DAYS = "currentArrearsDays",
13
+ DELINQUENCY_DAYS_LAST_6M = "delinquencyDaysLast6M",
14
+ LIFETIME_RESTRUCTURES = "lifetimeRestructures",
15
+ IS_EMPLOYEE = "isEmployee",
16
+ HAS_PCF_ACCOUNT = "hasPcfAccount"
17
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CohortFactKeyEnum = void 0;
4
+ /**
5
+ * Datos del cliente sobre los que se arma una condición de cohort. Catálogo cerrado: un dato
6
+ * nuevo es un cambio de código en quien lo calcula y en quien lo evalúa.
7
+ * @enum {string}
8
+ */
9
+ var CohortFactKeyEnum;
10
+ (function (CohortFactKeyEnum) {
11
+ CohortFactKeyEnum["SCI_LEVEL"] = "sciLevel";
12
+ CohortFactKeyEnum["TOTAL_CREDITS"] = "totalCredits";
13
+ CohortFactKeyEnum["ACTIVE_CREDITS"] = "activeCredits";
14
+ CohortFactKeyEnum["COMPLETED_CREDITS"] = "completedCredits";
15
+ CohortFactKeyEnum["LIFETIME_WRITE_OFFS"] = "lifetimeWriteOffs";
16
+ CohortFactKeyEnum["CURRENT_ARREARS_DAYS"] = "currentArrearsDays";
17
+ CohortFactKeyEnum["DELINQUENCY_DAYS_LAST_6M"] = "delinquencyDaysLast6M";
18
+ CohortFactKeyEnum["LIFETIME_RESTRUCTURES"] = "lifetimeRestructures";
19
+ CohortFactKeyEnum["IS_EMPLOYEE"] = "isEmployee";
20
+ CohortFactKeyEnum["HAS_PCF_ACCOUNT"] = "hasPcfAccount";
21
+ })(CohortFactKeyEnum || (exports.CohortFactKeyEnum = CohortFactKeyEnum = {}));
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Tipo de un dato del catálogo de cohorts. Define qué operadores admite y cómo se pinta el valor.
3
+ * @enum {string}
4
+ */
5
+ export declare enum CohortFactTypeEnum {
6
+ NUMBER = "NUMBER",
7
+ SELECT = "SELECT",
8
+ BOOLEAN = "BOOLEAN"
9
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CohortFactTypeEnum = void 0;
4
+ /**
5
+ * Tipo de un dato del catálogo de cohorts. Define qué operadores admite y cómo se pinta el valor.
6
+ * @enum {string}
7
+ */
8
+ var CohortFactTypeEnum;
9
+ (function (CohortFactTypeEnum) {
10
+ CohortFactTypeEnum["NUMBER"] = "NUMBER";
11
+ CohortFactTypeEnum["SELECT"] = "SELECT";
12
+ CohortFactTypeEnum["BOOLEAN"] = "BOOLEAN";
13
+ })(CohortFactTypeEnum || (exports.CohortFactTypeEnum = CohortFactTypeEnum = {}));
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Evento de la bitácora de un cohort.
3
+ * @enum {string}
4
+ */
5
+ export declare enum CohortLogEventEnum {
6
+ CREATED = "CREATED",
7
+ UPDATED = "UPDATED",
8
+ ARCHIVED = "ARCHIVED",
9
+ REACTIVATED = "REACTIVATED"
10
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CohortLogEventEnum = void 0;
4
+ /**
5
+ * Evento de la bitácora de un cohort.
6
+ * @enum {string}
7
+ */
8
+ var CohortLogEventEnum;
9
+ (function (CohortLogEventEnum) {
10
+ CohortLogEventEnum["CREATED"] = "CREATED";
11
+ CohortLogEventEnum["UPDATED"] = "UPDATED";
12
+ CohortLogEventEnum["ARCHIVED"] = "ARCHIVED";
13
+ CohortLogEventEnum["REACTIVATED"] = "REACTIVATED";
14
+ })(CohortLogEventEnum || (exports.CohortLogEventEnum = CohortLogEventEnum = {}));
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Operador de una condición de cohort. `IN` y `NOT_IN` comparan contra una lista (`values`); el
3
+ * resto, contra un solo valor (`value`).
4
+ * @enum {string}
5
+ */
6
+ export declare enum CohortOperatorEnum {
7
+ EQUALS = "EQUALS",
8
+ NOT_EQUALS = "NOT_EQUALS",
9
+ GT = "GT",
10
+ GTE = "GTE",
11
+ LT = "LT",
12
+ LTE = "LTE",
13
+ IN = "IN",
14
+ NOT_IN = "NOT_IN"
15
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CohortOperatorEnum = void 0;
4
+ /**
5
+ * Operador de una condición de cohort. `IN` y `NOT_IN` comparan contra una lista (`values`); el
6
+ * resto, contra un solo valor (`value`).
7
+ * @enum {string}
8
+ */
9
+ var CohortOperatorEnum;
10
+ (function (CohortOperatorEnum) {
11
+ CohortOperatorEnum["EQUALS"] = "EQUALS";
12
+ CohortOperatorEnum["NOT_EQUALS"] = "NOT_EQUALS";
13
+ CohortOperatorEnum["GT"] = "GT";
14
+ CohortOperatorEnum["GTE"] = "GTE";
15
+ CohortOperatorEnum["LT"] = "LT";
16
+ CohortOperatorEnum["LTE"] = "LTE";
17
+ CohortOperatorEnum["IN"] = "IN";
18
+ CohortOperatorEnum["NOT_IN"] = "NOT_IN";
19
+ })(CohortOperatorEnum || (exports.CohortOperatorEnum = CohortOperatorEnum = {}));
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Estado persistido de un cohort. No hay borrado: `ARCHIVED` lo saca de la evaluación y de los
3
+ * selectores, y los segmentos que lo usaban siguen resolviendo su nombre.
4
+ * @enum {string}
5
+ */
6
+ export declare enum CohortStatusEnum {
7
+ ACTIVE = "ACTIVE",
8
+ ARCHIVED = "ARCHIVED"
9
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CohortStatusEnum = void 0;
4
+ /**
5
+ * Estado persistido de un cohort. No hay borrado: `ARCHIVED` lo saca de la evaluación y de los
6
+ * selectores, y los segmentos que lo usaban siguen resolviendo su nombre.
7
+ * @enum {string}
8
+ */
9
+ var CohortStatusEnum;
10
+ (function (CohortStatusEnum) {
11
+ CohortStatusEnum["ACTIVE"] = "ACTIVE";
12
+ CohortStatusEnum["ARCHIVED"] = "ARCHIVED";
13
+ })(CohortStatusEnum || (exports.CohortStatusEnum = CohortStatusEnum = {}));
@@ -4,6 +4,8 @@
4
4
  *
5
5
  * El nombre y la descripción que ve el operador NO viven acá: los sirve
6
6
  * `GET /segments/filters`, junto con la marca de si el filtro tiene fuente de datos hoy.
7
+ * @deprecated El segmento se arma con cohorts (`cohortIds`). Se conserva para migrar los filtros
8
+ * viejos y para los consumidores que todavía lo importan.
7
9
  * @enum {string}
8
10
  */
9
11
  export declare enum SegmentFilterIdEnum {
@@ -7,6 +7,8 @@ exports.SegmentFilterIdEnum = void 0;
7
7
  *
8
8
  * El nombre y la descripción que ve el operador NO viven acá: los sirve
9
9
  * `GET /segments/filters`, junto con la marca de si el filtro tiene fuente de datos hoy.
10
+ * @deprecated El segmento se arma con cohorts (`cohortIds`). Se conserva para migrar los filtros
11
+ * viejos y para los consumidores que todavía lo importan.
10
12
  * @enum {string}
11
13
  */
12
14
  var SegmentFilterIdEnum;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Evento de la bitácora de un segmento.
3
+ * @enum {string}
4
+ */
5
+ export declare enum SegmentLogEventEnum {
6
+ CREATED = "CREATED",
7
+ UPDATED = "UPDATED",
8
+ ARCHIVED = "ARCHIVED",
9
+ REACTIVATED = "REACTIVATED"
10
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SegmentLogEventEnum = void 0;
4
+ /**
5
+ * Evento de la bitácora de un segmento.
6
+ * @enum {string}
7
+ */
8
+ var SegmentLogEventEnum;
9
+ (function (SegmentLogEventEnum) {
10
+ SegmentLogEventEnum["CREATED"] = "CREATED";
11
+ SegmentLogEventEnum["UPDATED"] = "UPDATED";
12
+ SegmentLogEventEnum["ARCHIVED"] = "ARCHIVED";
13
+ SegmentLogEventEnum["REACTIVATED"] = "REACTIVATED";
14
+ })(SegmentLogEventEnum || (exports.SegmentLogEventEnum = SegmentLogEventEnum = {}));
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Por qué un cliente entra a un segmento: está en la lista manual (`MEMBER`) o cumple al menos
3
+ * uno de sus cohorts (`COHORT`). Si cumple las dos, gana la lista manual.
4
+ * @enum {string}
5
+ */
6
+ export declare enum SegmentMembershipReasonEnum {
7
+ MEMBER = "MEMBER",
8
+ COHORT = "COHORT"
9
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SegmentMembershipReasonEnum = void 0;
4
+ /**
5
+ * Por qué un cliente entra a un segmento: está en la lista manual (`MEMBER`) o cumple al menos
6
+ * uno de sus cohorts (`COHORT`). Si cumple las dos, gana la lista manual.
7
+ * @enum {string}
8
+ */
9
+ var SegmentMembershipReasonEnum;
10
+ (function (SegmentMembershipReasonEnum) {
11
+ SegmentMembershipReasonEnum["MEMBER"] = "MEMBER";
12
+ SegmentMembershipReasonEnum["COHORT"] = "COHORT";
13
+ })(SegmentMembershipReasonEnum || (exports.SegmentMembershipReasonEnum = SegmentMembershipReasonEnum = {}));
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Estado de una corrida de recálculo de conteos de cohorts y segmentos.
3
+ * @enum {string}
4
+ */
5
+ export declare enum SegmentationRecountStatusEnum {
6
+ RUNNING = "RUNNING",
7
+ FINISHED = "FINISHED",
8
+ FAILED = "FAILED"
9
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SegmentationRecountStatusEnum = void 0;
4
+ /**
5
+ * Estado de una corrida de recálculo de conteos de cohorts y segmentos.
6
+ * @enum {string}
7
+ */
8
+ var SegmentationRecountStatusEnum;
9
+ (function (SegmentationRecountStatusEnum) {
10
+ SegmentationRecountStatusEnum["RUNNING"] = "RUNNING";
11
+ SegmentationRecountStatusEnum["FINISHED"] = "FINISHED";
12
+ SegmentationRecountStatusEnum["FAILED"] = "FAILED";
13
+ })(SegmentationRecountStatusEnum || (exports.SegmentationRecountStatusEnum = SegmentationRecountStatusEnum = {}));
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Qué disparó un recálculo de conteos: la corrida nocturna o el botón del backoffice.
3
+ * @enum {string}
4
+ */
5
+ export declare enum SegmentationRecountTriggerEnum {
6
+ NIGHTLY = "NIGHTLY",
7
+ MANUAL = "MANUAL"
8
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SegmentationRecountTriggerEnum = void 0;
4
+ /**
5
+ * Qué disparó un recálculo de conteos: la corrida nocturna o el botón del backoffice.
6
+ * @enum {string}
7
+ */
8
+ var SegmentationRecountTriggerEnum;
9
+ (function (SegmentationRecountTriggerEnum) {
10
+ SegmentationRecountTriggerEnum["NIGHTLY"] = "NIGHTLY";
11
+ SegmentationRecountTriggerEnum["MANUAL"] = "MANUAL";
12
+ })(SegmentationRecountTriggerEnum || (exports.SegmentationRecountTriggerEnum = SegmentationRecountTriggerEnum = {}));