@fiado/type-kit 3.528.0 → 3.530.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 (162) hide show
  1. package/_test_/unit/emailVerification/dtos/EmailSetTrustedRequest.test.ts +16 -0
  2. package/_test_/unit/retailWizard/emailOtpRequests.test.ts +53 -0
  3. package/_test_/unit/retailWizard/wizardSessionEmail.test.ts +22 -0
  4. package/_test_/unit/rewardsEligibility/backofficeBarrel.test.ts +6 -0
  5. package/_test_/unit/rewardsEligibility/runDtos.test.ts +2 -2
  6. package/_test_/unit/rewardsEligibility/segmentBackofficeDtos.test.ts +29 -0
  7. package/_test_/unit/rewardsEligibility/segmentDefinitionDto.test.ts +46 -0
  8. package/_test_/unit/rewardsEligibility/segmentEnums.test.ts +43 -0
  9. package/_test_/unit/rewardsEligibility/segmentMessagesAndRunDtos.test.ts +52 -0
  10. package/bin/emailVerification/dtos/EmailSetTrustedRequest.d.ts +2 -0
  11. package/bin/emailVerification/dtos/EmailSetTrustedRequest.js +6 -0
  12. package/bin/retailWizard/dtos/WizardSession.d.ts +10 -0
  13. package/bin/retailWizard/dtos/requests/SendEmailOtpRequest.d.ts +6 -0
  14. package/bin/retailWizard/dtos/requests/SendEmailOtpRequest.js +29 -0
  15. package/bin/retailWizard/dtos/requests/VerifyEmailOtpRequest.d.ts +4 -0
  16. package/bin/retailWizard/dtos/requests/VerifyEmailOtpRequest.js +24 -0
  17. package/bin/retailWizard/enums/EmailStateEnum.d.ts +9 -0
  18. package/bin/retailWizard/enums/EmailStateEnum.js +13 -0
  19. package/bin/retailWizard/index.d.ts +3 -0
  20. package/bin/retailWizard/index.js +3 -0
  21. package/bin/rewardsEligibility/constants/BackofficeLimits.d.ts +2 -0
  22. package/bin/rewardsEligibility/constants/BackofficeLimits.js +3 -1
  23. package/bin/rewardsEligibility/constants/SegmentLimits.d.ts +5 -0
  24. package/bin/rewardsEligibility/constants/SegmentLimits.js +8 -0
  25. package/bin/rewardsEligibility/dtos/backoffice/CreateRunRequest.js +4 -2
  26. package/bin/rewardsEligibility/dtos/backoffice/EvaluationRequest.d.ts +4 -0
  27. package/bin/rewardsEligibility/dtos/backoffice/EvaluationRequest.js +14 -0
  28. package/bin/rewardsEligibility/dtos/backoffice/EvaluationResponse.d.ts +2 -0
  29. package/bin/rewardsEligibility/dtos/backoffice/PopulationRunRequest.d.ts +1 -3
  30. package/bin/rewardsEligibility/dtos/backoffice/PopulationRunRequest.js +1 -18
  31. package/bin/rewardsEligibility/dtos/backoffice/RunPopulationProgress.d.ts +9 -0
  32. package/bin/rewardsEligibility/dtos/backoffice/RunPopulationProgress.js +7 -0
  33. package/bin/rewardsEligibility/dtos/backoffice/RunResponse.d.ts +19 -0
  34. package/bin/rewardsEligibility/dtos/backoffice/segments/PopulationSegmentDefinition.d.ts +8 -0
  35. package/bin/rewardsEligibility/dtos/backoffice/segments/PopulationSegmentDefinition.js +40 -0
  36. package/bin/rewardsEligibility/dtos/backoffice/segments/PrivateSegmentResponse.d.ts +11 -0
  37. package/bin/rewardsEligibility/dtos/backoffice/segments/PrivateSegmentResponse.js +7 -0
  38. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentAggregateCondition.d.ts +18 -0
  39. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentAggregateCondition.js +71 -0
  40. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentColumnCondition.d.ts +11 -0
  41. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentColumnCondition.js +46 -0
  42. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentExecutionPageResponse.d.ts +8 -0
  43. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentExecutionPageResponse.js +6 -0
  44. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentExecutionRequest.d.ts +6 -0
  45. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentExecutionRequest.js +31 -0
  46. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentExecutionResponse.d.ts +7 -0
  47. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentExecutionResponse.js +6 -0
  48. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentGroup.d.ts +9 -0
  49. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentGroup.js +44 -0
  50. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentLastTest.d.ts +8 -0
  51. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentLastTest.js +6 -0
  52. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentListResponse.d.ts +9 -0
  53. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentListResponse.js +10 -0
  54. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentParam.d.ts +10 -0
  55. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentParam.js +7 -0
  56. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentSaveRequest.d.ts +13 -0
  57. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentSaveRequest.js +58 -0
  58. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentSchemaResponse.d.ts +10 -0
  59. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentSchemaResponse.js +10 -0
  60. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentStatusRequest.d.ts +6 -0
  61. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentStatusRequest.js +31 -0
  62. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentTableSchemaResponse.d.ts +12 -0
  63. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentTableSchemaResponse.js +9 -0
  64. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentTestRequest.d.ts +4 -0
  65. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentTestRequest.js +25 -0
  66. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentTestResponse.d.ts +26 -0
  67. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentTestResponse.js +12 -0
  68. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentUsedByResponse.d.ts +21 -0
  69. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentUsedByResponse.js +12 -0
  70. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentUsedColumn.d.ts +5 -0
  71. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentUsedColumn.js +6 -0
  72. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentVersionListResponse.d.ts +4 -0
  73. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentVersionListResponse.js +6 -0
  74. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentVersionResponse.d.ts +24 -0
  75. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentVersionResponse.js +6 -0
  76. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentVersionSummaryResponse.d.ts +12 -0
  77. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentVersionSummaryResponse.js +7 -0
  78. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentWindow.d.ts +5 -0
  79. package/bin/rewardsEligibility/dtos/backoffice/segments/SegmentWindow.js +31 -0
  80. package/bin/rewardsEligibility/dtos/messages/EvaluateBatchMessage.d.ts +14 -0
  81. package/bin/rewardsEligibility/dtos/messages/EvaluateBatchMessage.js +61 -0
  82. package/bin/rewardsEligibility/dtos/messages/GrantBatchMessage.d.ts +8 -0
  83. package/bin/rewardsEligibility/dtos/messages/GrantBatchMessage.js +42 -0
  84. package/bin/rewardsEligibility/dtos/messages/PopulationPageMessage.d.ts +6 -0
  85. package/bin/rewardsEligibility/dtos/messages/PopulationPageMessage.js +30 -0
  86. package/bin/rewardsEligibility/dtos/messages/ReleaseTrancheMessage.d.ts +6 -0
  87. package/bin/rewardsEligibility/dtos/messages/ReleaseTrancheMessage.js +30 -0
  88. package/bin/rewardsEligibility/enums/EligibilityMessageTypeEnum.d.ts +6 -0
  89. package/bin/rewardsEligibility/enums/EligibilityMessageTypeEnum.js +11 -0
  90. package/bin/rewardsEligibility/enums/SegmentAggregateFnEnum.d.ts +5 -0
  91. package/bin/rewardsEligibility/enums/SegmentAggregateFnEnum.js +9 -0
  92. package/bin/rewardsEligibility/enums/SegmentConditionKindEnum.d.ts +4 -0
  93. package/bin/rewardsEligibility/enums/SegmentConditionKindEnum.js +8 -0
  94. package/bin/rewardsEligibility/enums/SegmentErrorCodeEnum.d.ts +16 -0
  95. package/bin/rewardsEligibility/enums/SegmentErrorCodeEnum.js +20 -0
  96. package/bin/rewardsEligibility/enums/SegmentMatchEnum.d.ts +4 -0
  97. package/bin/rewardsEligibility/enums/SegmentMatchEnum.js +8 -0
  98. package/bin/rewardsEligibility/enums/SegmentOperatorEnum.d.ts +16 -0
  99. package/bin/rewardsEligibility/enums/SegmentOperatorEnum.js +20 -0
  100. package/bin/rewardsEligibility/enums/SegmentParamSourceEnum.d.ts +5 -0
  101. package/bin/rewardsEligibility/enums/SegmentParamSourceEnum.js +9 -0
  102. package/bin/rewardsEligibility/enums/SegmentParamTypeEnum.d.ts +7 -0
  103. package/bin/rewardsEligibility/enums/SegmentParamTypeEnum.js +11 -0
  104. package/bin/rewardsEligibility/enums/SegmentStatusEnum.d.ts +5 -0
  105. package/bin/rewardsEligibility/enums/SegmentStatusEnum.js +9 -0
  106. package/bin/rewardsEligibility/enums/SegmentTestStatusEnum.d.ts +5 -0
  107. package/bin/rewardsEligibility/enums/SegmentTestStatusEnum.js +9 -0
  108. package/bin/rewardsEligibility/index.d.ts +39 -0
  109. package/bin/rewardsEligibility/index.js +43 -0
  110. package/package.json +1 -1
  111. package/src/emailVerification/dtos/EmailSetTrustedRequest.ts +7 -1
  112. package/src/retailWizard/dtos/WizardSession.ts +10 -0
  113. package/src/retailWizard/dtos/requests/SendEmailOtpRequest.ts +14 -0
  114. package/src/retailWizard/dtos/requests/VerifyEmailOtpRequest.ts +10 -0
  115. package/src/retailWizard/enums/EmailStateEnum.ts +9 -0
  116. package/src/retailWizard/index.ts +3 -0
  117. package/src/rewardsEligibility/constants/BackofficeLimits.ts +2 -0
  118. package/src/rewardsEligibility/constants/SegmentLimits.ts +5 -0
  119. package/src/rewardsEligibility/dtos/backoffice/CreateRunRequest.ts +3 -2
  120. package/src/rewardsEligibility/dtos/backoffice/EvaluationRequest.ts +16 -2
  121. package/src/rewardsEligibility/dtos/backoffice/EvaluationResponse.ts +2 -0
  122. package/src/rewardsEligibility/dtos/backoffice/PopulationRunRequest.ts +2 -11
  123. package/src/rewardsEligibility/dtos/backoffice/RunPopulationProgress.ts +9 -0
  124. package/src/rewardsEligibility/dtos/backoffice/RunResponse.ts +12 -0
  125. package/src/rewardsEligibility/dtos/backoffice/segments/PopulationSegmentDefinition.ts +12 -0
  126. package/src/rewardsEligibility/dtos/backoffice/segments/PrivateSegmentResponse.ts +12 -0
  127. package/src/rewardsEligibility/dtos/backoffice/segments/SegmentAggregateCondition.ts +22 -0
  128. package/src/rewardsEligibility/dtos/backoffice/segments/SegmentColumnCondition.ts +15 -0
  129. package/src/rewardsEligibility/dtos/backoffice/segments/SegmentExecutionPageResponse.ts +8 -0
  130. package/src/rewardsEligibility/dtos/backoffice/segments/SegmentExecutionRequest.ts +17 -0
  131. package/src/rewardsEligibility/dtos/backoffice/segments/SegmentExecutionResponse.ts +7 -0
  132. package/src/rewardsEligibility/dtos/backoffice/segments/SegmentGroup.ts +27 -0
  133. package/src/rewardsEligibility/dtos/backoffice/segments/SegmentLastTest.ts +8 -0
  134. package/src/rewardsEligibility/dtos/backoffice/segments/SegmentListResponse.ts +11 -0
  135. package/src/rewardsEligibility/dtos/backoffice/segments/SegmentParam.ts +11 -0
  136. package/src/rewardsEligibility/dtos/backoffice/segments/SegmentSaveRequest.ts +16 -0
  137. package/src/rewardsEligibility/dtos/backoffice/segments/SegmentSchemaResponse.ts +11 -0
  138. package/src/rewardsEligibility/dtos/backoffice/segments/SegmentStatusRequest.ts +9 -0
  139. package/src/rewardsEligibility/dtos/backoffice/segments/SegmentTableSchemaResponse.ts +14 -0
  140. package/src/rewardsEligibility/dtos/backoffice/segments/SegmentTestRequest.ts +7 -0
  141. package/src/rewardsEligibility/dtos/backoffice/segments/SegmentTestResponse.ts +29 -0
  142. package/src/rewardsEligibility/dtos/backoffice/segments/SegmentUsedByResponse.ts +24 -0
  143. package/src/rewardsEligibility/dtos/backoffice/segments/SegmentUsedColumn.ts +5 -0
  144. package/src/rewardsEligibility/dtos/backoffice/segments/SegmentVersionListResponse.ts +5 -0
  145. package/src/rewardsEligibility/dtos/backoffice/segments/SegmentVersionResponse.ts +25 -0
  146. package/src/rewardsEligibility/dtos/backoffice/segments/SegmentVersionSummaryResponse.ts +13 -0
  147. package/src/rewardsEligibility/dtos/backoffice/segments/SegmentWindow.ts +9 -0
  148. package/src/rewardsEligibility/dtos/messages/EvaluateBatchMessage.ts +42 -0
  149. package/src/rewardsEligibility/dtos/messages/GrantBatchMessage.ts +25 -0
  150. package/src/rewardsEligibility/dtos/messages/PopulationPageMessage.ts +15 -0
  151. package/src/rewardsEligibility/dtos/messages/ReleaseTrancheMessage.ts +15 -0
  152. package/src/rewardsEligibility/enums/EligibilityMessageTypeEnum.ts +7 -0
  153. package/src/rewardsEligibility/enums/SegmentAggregateFnEnum.ts +5 -0
  154. package/src/rewardsEligibility/enums/SegmentConditionKindEnum.ts +4 -0
  155. package/src/rewardsEligibility/enums/SegmentErrorCodeEnum.ts +16 -0
  156. package/src/rewardsEligibility/enums/SegmentMatchEnum.ts +4 -0
  157. package/src/rewardsEligibility/enums/SegmentOperatorEnum.ts +16 -0
  158. package/src/rewardsEligibility/enums/SegmentParamSourceEnum.ts +5 -0
  159. package/src/rewardsEligibility/enums/SegmentParamTypeEnum.ts +7 -0
  160. package/src/rewardsEligibility/enums/SegmentStatusEnum.ts +5 -0
  161. package/src/rewardsEligibility/enums/SegmentTestStatusEnum.ts +5 -0
  162. package/src/rewardsEligibility/index.ts +47 -0
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SegmentStatusEnum = void 0;
4
+ var SegmentStatusEnum;
5
+ (function (SegmentStatusEnum) {
6
+ SegmentStatusEnum["DRAFT"] = "DRAFT";
7
+ SegmentStatusEnum["ACTIVE"] = "ACTIVE";
8
+ SegmentStatusEnum["ARCHIVED"] = "ARCHIVED";
9
+ })(SegmentStatusEnum || (exports.SegmentStatusEnum = SegmentStatusEnum = {}));
@@ -0,0 +1,5 @@
1
+ export declare enum SegmentTestStatusEnum {
2
+ RUNNING = "RUNNING",
3
+ PASSED = "PASSED",
4
+ FAILED = "FAILED"
5
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SegmentTestStatusEnum = void 0;
4
+ var SegmentTestStatusEnum;
5
+ (function (SegmentTestStatusEnum) {
6
+ SegmentTestStatusEnum["RUNNING"] = "RUNNING";
7
+ SegmentTestStatusEnum["PASSED"] = "PASSED";
8
+ SegmentTestStatusEnum["FAILED"] = "FAILED";
9
+ })(SegmentTestStatusEnum || (exports.SegmentTestStatusEnum = SegmentTestStatusEnum = {}));
@@ -68,3 +68,42 @@ export * from './dtos/backoffice/MetricsPointResponse';
68
68
  export * from './dtos/backoffice/FailedConditionStatResponse';
69
69
  export * from './dtos/backoffice/FailedConditionEvaluationResponse';
70
70
  export * from './dtos/backoffice/MetricsQuery';
71
+ export * from './enums/SegmentStatusEnum';
72
+ export * from './enums/SegmentTestStatusEnum';
73
+ export * from './enums/SegmentMatchEnum';
74
+ export * from './enums/SegmentConditionKindEnum';
75
+ export * from './enums/SegmentAggregateFnEnum';
76
+ export * from './enums/SegmentOperatorEnum';
77
+ export * from './enums/SegmentParamTypeEnum';
78
+ export * from './enums/SegmentParamSourceEnum';
79
+ export * from './enums/SegmentErrorCodeEnum';
80
+ export * from './enums/EligibilityMessageTypeEnum';
81
+ export * from './constants/SegmentLimits';
82
+ export * from './dtos/backoffice/segments/SegmentWindow';
83
+ export * from './dtos/backoffice/segments/SegmentColumnCondition';
84
+ export * from './dtos/backoffice/segments/SegmentAggregateCondition';
85
+ export * from './dtos/backoffice/segments/SegmentGroup';
86
+ export * from './dtos/backoffice/segments/PopulationSegmentDefinition';
87
+ export * from './dtos/backoffice/segments/SegmentParam';
88
+ export * from './dtos/backoffice/segments/SegmentUsedColumn';
89
+ export * from './dtos/backoffice/segments/SegmentLastTest';
90
+ export * from './dtos/backoffice/segments/SegmentTestRequest';
91
+ export * from './dtos/backoffice/segments/SegmentTestResponse';
92
+ export * from './dtos/backoffice/segments/SegmentSaveRequest';
93
+ export * from './dtos/backoffice/segments/SegmentStatusRequest';
94
+ export * from './dtos/backoffice/segments/SegmentVersionResponse';
95
+ export * from './dtos/backoffice/segments/SegmentVersionSummaryResponse';
96
+ export * from './dtos/backoffice/segments/SegmentListResponse';
97
+ export * from './dtos/backoffice/segments/SegmentVersionListResponse';
98
+ export * from './dtos/backoffice/segments/SegmentSchemaResponse';
99
+ export * from './dtos/backoffice/segments/SegmentTableSchemaResponse';
100
+ export * from './dtos/backoffice/segments/SegmentUsedByResponse';
101
+ export * from './dtos/messages/PopulationPageMessage';
102
+ export * from './dtos/messages/EvaluateBatchMessage';
103
+ export * from './dtos/messages/GrantBatchMessage';
104
+ export * from './dtos/messages/ReleaseTrancheMessage';
105
+ export * from './dtos/backoffice/segments/PrivateSegmentResponse';
106
+ export * from './dtos/backoffice/segments/SegmentExecutionRequest';
107
+ export * from './dtos/backoffice/segments/SegmentExecutionResponse';
108
+ export * from './dtos/backoffice/segments/SegmentExecutionPageResponse';
109
+ export * from './dtos/backoffice/RunPopulationProgress';
@@ -90,3 +90,46 @@ __exportStar(require("./dtos/backoffice/MetricsPointResponse"), exports);
90
90
  __exportStar(require("./dtos/backoffice/FailedConditionStatResponse"), exports);
91
91
  __exportStar(require("./dtos/backoffice/FailedConditionEvaluationResponse"), exports);
92
92
  __exportStar(require("./dtos/backoffice/MetricsQuery"), exports);
93
+ //Segmentos de poblacion (adenda 2026-10-12)
94
+ __exportStar(require("./enums/SegmentStatusEnum"), exports);
95
+ __exportStar(require("./enums/SegmentTestStatusEnum"), exports);
96
+ __exportStar(require("./enums/SegmentMatchEnum"), exports);
97
+ __exportStar(require("./enums/SegmentConditionKindEnum"), exports);
98
+ __exportStar(require("./enums/SegmentAggregateFnEnum"), exports);
99
+ __exportStar(require("./enums/SegmentOperatorEnum"), exports);
100
+ __exportStar(require("./enums/SegmentParamTypeEnum"), exports);
101
+ __exportStar(require("./enums/SegmentParamSourceEnum"), exports);
102
+ __exportStar(require("./enums/SegmentErrorCodeEnum"), exports);
103
+ __exportStar(require("./enums/EligibilityMessageTypeEnum"), exports);
104
+ __exportStar(require("./constants/SegmentLimits"), exports);
105
+ //Segmentos de poblacion: definicion del constructor (A2)
106
+ __exportStar(require("./dtos/backoffice/segments/SegmentWindow"), exports);
107
+ __exportStar(require("./dtos/backoffice/segments/SegmentColumnCondition"), exports);
108
+ __exportStar(require("./dtos/backoffice/segments/SegmentAggregateCondition"), exports);
109
+ __exportStar(require("./dtos/backoffice/segments/SegmentGroup"), exports);
110
+ __exportStar(require("./dtos/backoffice/segments/PopulationSegmentDefinition"), exports);
111
+ //Segmentos de poblacion: request/response del backoffice (A3)
112
+ __exportStar(require("./dtos/backoffice/segments/SegmentParam"), exports);
113
+ __exportStar(require("./dtos/backoffice/segments/SegmentUsedColumn"), exports);
114
+ __exportStar(require("./dtos/backoffice/segments/SegmentLastTest"), exports);
115
+ __exportStar(require("./dtos/backoffice/segments/SegmentTestRequest"), exports);
116
+ __exportStar(require("./dtos/backoffice/segments/SegmentTestResponse"), exports);
117
+ __exportStar(require("./dtos/backoffice/segments/SegmentSaveRequest"), exports);
118
+ __exportStar(require("./dtos/backoffice/segments/SegmentStatusRequest"), exports);
119
+ __exportStar(require("./dtos/backoffice/segments/SegmentVersionResponse"), exports);
120
+ __exportStar(require("./dtos/backoffice/segments/SegmentVersionSummaryResponse"), exports);
121
+ __exportStar(require("./dtos/backoffice/segments/SegmentListResponse"), exports);
122
+ __exportStar(require("./dtos/backoffice/segments/SegmentVersionListResponse"), exports);
123
+ __exportStar(require("./dtos/backoffice/segments/SegmentSchemaResponse"), exports);
124
+ __exportStar(require("./dtos/backoffice/segments/SegmentTableSchemaResponse"), exports);
125
+ __exportStar(require("./dtos/backoffice/segments/SegmentUsedByResponse"), exports);
126
+ //Segmentos de poblacion: mensajes SQS, endpoint privado y avance de corrida (A4)
127
+ __exportStar(require("./dtos/messages/PopulationPageMessage"), exports);
128
+ __exportStar(require("./dtos/messages/EvaluateBatchMessage"), exports);
129
+ __exportStar(require("./dtos/messages/GrantBatchMessage"), exports);
130
+ __exportStar(require("./dtos/messages/ReleaseTrancheMessage"), exports);
131
+ __exportStar(require("./dtos/backoffice/segments/PrivateSegmentResponse"), exports);
132
+ __exportStar(require("./dtos/backoffice/segments/SegmentExecutionRequest"), exports);
133
+ __exportStar(require("./dtos/backoffice/segments/SegmentExecutionResponse"), exports);
134
+ __exportStar(require("./dtos/backoffice/segments/SegmentExecutionPageResponse"), exports);
135
+ __exportStar(require("./dtos/backoffice/RunPopulationProgress"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "3.528.0",
3
+ "version": "3.530.0",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -1,5 +1,5 @@
1
1
  import { Expose } from 'class-transformer';
2
- import { IsEmail, IsEnum, IsString } from 'class-validator';
2
+ import { IsBoolean, IsEmail, IsEnum, IsOptional, IsString } from 'class-validator';
3
3
  import { EmailTypeEnum } from '../enums/EmailTypeEnum';
4
4
 
5
5
  /**
@@ -18,4 +18,10 @@ export class EmailSetTrustedRequest {
18
18
  @Expose()
19
19
  @IsEnum(EmailTypeEnum)
20
20
  type!: EmailTypeEnum;
21
+
22
+ /** En true, el correo queda como principal del directorio. Sin el campo, no cambia el principal. */
23
+ @Expose()
24
+ @IsOptional()
25
+ @IsBoolean()
26
+ isPrincipal?: boolean;
21
27
  }
@@ -15,6 +15,8 @@ import type { WizardReservedLine } from './WizardReservedLine';
15
15
  import type { WizardResumeTarget } from './WizardResumeTarget';
16
16
  import type { WizardWelcome } from './WizardWelcome';
17
17
  import type { WizardCreditPromotionBonus } from './WizardCreditPromotionBonus';
18
+ import type { EmailStateEnum } from '../enums/EmailStateEnum';
19
+ import type { EmailTypeEnum } from '../../emailVerification/enums/EmailTypeEnum';
18
20
 
19
21
  /** Modalidad de captura del KYC (M1 §213-329). */
20
22
  export type KycModality = 'CUSTOMER_LINK' | 'STORE_DEVICE' | 'MANUAL';
@@ -68,6 +70,14 @@ export interface WizardSession {
68
70
  */
69
71
  resumeTarget?: WizardResumeTarget | null;
70
72
  consents: WizardConsents | null;
73
+ /** Estado del correo del cliente en el paso 01. Ausente en sesiones anteriores al correo. */
74
+ emailState?: EmailStateEnum;
75
+ /** Tipo del correo: personal o corporativo. */
76
+ emailType?: EmailTypeEnum;
77
+ /** Correo enmascarado (`ju•••••@gmail.com`); viaja siempre que la sesión tenga correo. */
78
+ emailMasked?: string;
79
+ /** Correo completo: solo con `emailState` CAPTURED, porque lo tecleó el vendedor. */
80
+ email?: string;
71
81
  /** Espejo del estado KYC (fuente = customer). */
72
82
  kycStatus: string | null;
73
83
  kycModality: KycModality | null;
@@ -0,0 +1,14 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { IsEmail, IsEnum } from 'class-validator';
3
+ import { EmailTypeEnum } from '../../../emailVerification/enums/EmailTypeEnum';
4
+
5
+ /** POST /wizard/sessions/:id/email/otp/send — manda el código al correo que capturó el vendedor. */
6
+ export class SendEmailOtpRequest {
7
+ @Expose()
8
+ @IsEmail()
9
+ email!: string;
10
+
11
+ @Expose()
12
+ @IsEnum(EmailTypeEnum)
13
+ type!: EmailTypeEnum;
14
+ }
@@ -0,0 +1,10 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { IsString, Length } from 'class-validator';
3
+
4
+ /** POST /wizard/sessions/:id/email/otp/verify — verifica el código que llegó al correo. */
5
+ export class VerifyEmailOtpRequest {
6
+ @Expose()
7
+ @IsString()
8
+ @Length(4, 8)
9
+ code!: string;
10
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Correo de la sesión del wizard: EXISTING = ya verificado en contacts; CAPTURED = lo tecleó el
3
+ * vendedor y se verificó con OTP; PENDING = falta capturarlo o verificarlo.
4
+ */
5
+ export enum EmailStateEnum {
6
+ EXISTING = 'EXISTING',
7
+ CAPTURED = 'CAPTURED',
8
+ PENDING = 'PENDING',
9
+ }
@@ -29,6 +29,7 @@ export * from './enums/BlockedCategoryEnum';
29
29
  export * from './enums/WizardLineStatusEnum';
30
30
  export * from './enums/LinePaymentTypeEnum';
31
31
  export * from './enums/WizardLineRoleEnum';
32
+ export * from './enums/EmailStateEnum';
32
33
 
33
34
  // DTOs anidados
34
35
  export * from './dtos/WizardConsents';
@@ -101,6 +102,8 @@ export * from './dtos/requests/SignatureSignRequest';
101
102
  export * from './dtos/requests/RegisterDeviceRequest';
102
103
  export * from './dtos/requests/CompleteSaleRequest';
103
104
  export * from './dtos/requests/SuggestIdentifiersQuery';
105
+ export * from './dtos/requests/SendEmailOtpRequest';
106
+ export * from './dtos/requests/VerifyEmailOtpRequest';
104
107
 
105
108
  // Response DTOs (output tipado por endpoint)
106
109
  export * from './dtos/responses/KycPrepareResponse';
@@ -14,3 +14,5 @@ export const LIST_PAGE_MAX = 100;
14
14
  export const RULES_CHAT_TURN_MAX_LENGTH = 4000;
15
15
  /** Tope de seguridad de turnos que acepta el DTO (el límite funcional, 10, lo aplica el lambda con `AI_CHAT_HISTORY_TOO_LONG`). */
16
16
  export const RULES_CHAT_MAX_TURNS_HARD = 50;
17
+ /** Llave de un input de una evaluacion (ej. `directoryId`). */
18
+ export const INPUT_KEY_PATTERN = /^[a-zA-Z][a-zA-Z0-9_]{0,63}$/;
@@ -0,0 +1,5 @@
1
+ /** Identificador SQL permitido para tabla/columna (A§4.3 paso 1): minusculas, digitos y guion bajo; nunca texto libre. */
2
+ export const SEGMENT_IDENTIFIER_PATTERN = /^[a-z_][a-z0-9_]*$/;
3
+ export const SEGMENT_MAX_DAYS = 365;
4
+ export const SEGMENT_MAX_PARAMS = 40;
5
+ export const SEGMENT_MAX_AGGREGATES = 8;
@@ -1,5 +1,5 @@
1
1
  import { Expose, Type } from 'class-transformer';
2
- import { IsEnum, IsOptional, Matches, Validate, ValidateNested } from 'class-validator';
2
+ import { IsEnum, IsObject, IsOptional, Matches, Validate } from 'class-validator';
3
3
  import { DynamicFormValue } from '../../../dynamicForm/types/DynamicFormValue';
4
4
  import { IsDynamicFormValues } from '../../../dynamicForm/validators/IsDynamicFormValues';
5
5
  import { REQUEST_ID_PATTERN } from '../../constants/BackofficeLimits';
@@ -24,7 +24,8 @@ export class CreateRunRequest {
24
24
 
25
25
  @Expose()
26
26
  @IsOptional()
27
- @ValidateNested()
27
+ // `PopulationRunRequest` no tiene campos: class-validator rechaza validar anidado una clase sin metadatos, por eso `@IsObject()`.
28
+ @IsObject()
28
29
  @Type(() => PopulationRunRequest)
29
30
  population?: PopulationRunRequest;
30
31
  }
@@ -1,8 +1,8 @@
1
1
  import { Expose } from 'class-transformer';
2
- import { ArrayMaxSize, ArrayMinSize, IsArray, IsNotEmpty, IsObject, IsString, Matches, MaxLength } from 'class-validator';
2
+ import { ArrayMaxSize, ArrayMinSize, IsArray, IsNotEmpty, IsObject, IsOptional, IsString, Matches, MaxLength } from 'class-validator';
3
3
  import { JsonValue } from '../../../common';
4
4
  import { InputField } from '../../../dynamicForm/dtos/InputField';
5
- import { ELIGIBILITY_ID_PATTERN } from '../../constants/BackofficeLimits';
5
+ import { ELIGIBILITY_ID_PATTERN, INPUT_KEY_PATTERN } from '../../constants/BackofficeLimits';
6
6
  import { EvaluationReward } from '../EvaluationReward';
7
7
  import { EvaluationTrigger } from '../EvaluationTrigger';
8
8
  import { GrantPolicy } from '../GrantPolicy';
@@ -66,4 +66,18 @@ export class EvaluationRequest {
66
66
  @ArrayMaxSize(10)
67
67
  @IsObject({ each: true })
68
68
  triggers: EvaluationTrigger[];
69
+
70
+ /** Segmento de poblacion (version ACTIVE) que usan las corridas masivas de esta evaluacion. */
71
+ @Expose()
72
+ @IsOptional()
73
+ @IsString()
74
+ @Matches(ELIGIBILITY_ID_PATTERN)
75
+ populationSegmentId?: string;
76
+
77
+ /** Llave del input `DIRECTORY` que recibe el `directoryid` de cada persona del segmento. */
78
+ @Expose()
79
+ @IsOptional()
80
+ @IsString()
81
+ @Matches(INPUT_KEY_PATTERN)
82
+ populationInputKey?: string;
69
83
  }
@@ -19,6 +19,8 @@ export class EvaluationResponse {
19
19
  reward: EvaluationReward;
20
20
  grantPolicy: GrantPolicy;
21
21
  triggers: EvaluationTrigger[];
22
+ populationSegmentId?: string;
23
+ populationInputKey?: string;
22
24
  createdAt: number;
23
25
  updatedAt: number;
24
26
  updatedBy: string;
@@ -1,11 +1,2 @@
1
- import { Expose } from 'class-transformer';
2
- import { Validate } from 'class-validator';
3
- import { DynamicFormValue } from '../../../dynamicForm/types/DynamicFormValue';
4
- import { IsDynamicFormValues } from '../../../dynamicForm/validators/IsDynamicFormValues';
5
-
6
- /** Corrida por población (fase 4): los `params` de la fuente para esta corrida. El lambda de la fase 3 la rechaza con `POPULATION_RUN_NOT_SUPPORTED`. */
7
- export class PopulationRunRequest {
8
- @Expose()
9
- @Validate(IsDynamicFormValues)
10
- params: Record<string, DynamicFormValue>;
11
- }
1
+ /** Sin override de params (A§7.3): cambiar la poblacion = version nueva del segmento. `population: {}` = "usa el segmento de la evaluacion". */
2
+ export class PopulationRunRequest {}
@@ -0,0 +1,9 @@
1
+ /** Avance de la corrida masiva: paginas, lotes y sujetos publicados. */
2
+ export class RunPopulationProgress {
3
+ pagesPublished: number;
4
+ batchesPublished: number;
5
+ subjectsPublished: number;
6
+ exhausted: boolean;
7
+ stoppedReason?: string;
8
+ lastAdvanceAt: number;
9
+ }
@@ -4,6 +4,7 @@ import { RunStatusEnum } from '../../enums/RunStatusEnum';
4
4
  import { TriggerTypeEnum } from '../../enums/TriggerTypeEnum';
5
5
  import { RunCounts } from '../RunCounts';
6
6
  import { QuotaImpactResponse } from './QuotaImpactResponse';
7
+ import { RunPopulationProgress } from './RunPopulationProgress';
7
8
 
8
9
  /** Corrida para el backoffice (spec 10). */
9
10
  export class RunResponse {
@@ -19,6 +20,17 @@ export class RunResponse {
19
20
  counts: RunCounts;
20
21
  /** Solo con `status: AWAITING_APPROVAL`: cuánto consumiría la corrida de cada cupo y cuánto queda. */
21
22
  quotaImpact?: QuotaImpactResponse[];
23
+ /** Corrida masiva: instante fijo (epoch ms) contra el que se resuelven las ventanas relativas del segmento. */
24
+ referenceAt?: number;
25
+ /** Corrida masiva: version del segmento congelada. */
26
+ segment?: { segmentId: string; version: number };
27
+ population?: RunPopulationProgress;
28
+ /** Fallos de entrega (`GRANT_FAILED`) que llegaron tarde, con la corrida ya cerrada. */
29
+ requestFailedLate?: number;
30
+ /** Motivo de una corrida `FAILED` que nunca llego a tener `population`. */
31
+ failureReason?: string;
32
+ /** Avance del drenaje de una aprobacion masiva. */
33
+ approvalDrain?: { action: 'GRANT' | 'RELEASE' | 'CANCEL'; enqueued: number; done: boolean };
22
34
  requestedBy: string;
23
35
  createdAt: number;
24
36
  updatedAt: number;
@@ -0,0 +1,12 @@
1
+ import { Expose, Type } from 'class-transformer';
2
+ import { ArrayMaxSize, ArrayMinSize, IsArray, IsEnum, Matches, ValidateNested } from 'class-validator';
3
+ import { SEGMENT_IDENTIFIER_PATTERN } from '../../../constants/SegmentLimits';
4
+ import { SegmentMatchEnum } from '../../../enums/SegmentMatchEnum';
5
+ import { SegmentGroup } from './SegmentGroup';
6
+
7
+ /** El constructor tal cual (A§4.1): tabla ancla (una fila -> un directoryid), TODAS/ALGUNA global y grupos con su propio TODAS/ALGUNA. */
8
+ export class PopulationSegmentDefinition {
9
+ @Expose() @Matches(SEGMENT_IDENTIFIER_PATTERN) baseTable: string;
10
+ @Expose() @IsEnum(SegmentMatchEnum) match: SegmentMatchEnum;
11
+ @Expose() @IsArray() @ArrayMinSize(1) @ArrayMaxSize(10) @ValidateNested({ each: true }) @Type(() => SegmentGroup) groups: SegmentGroup[];
12
+ }
@@ -0,0 +1,12 @@
1
+ import { PopulationSegmentDefinition } from './PopulationSegmentDefinition';
2
+ import { SegmentParam } from './SegmentParam';
3
+
4
+ /** Version de un segmento tal como la consumen otros servicios (con el SQL compilado). */
5
+ export class PrivateSegmentResponse {
6
+ segmentId: string;
7
+ version: number;
8
+ name: string;
9
+ definition: PopulationSegmentDefinition;
10
+ sql: string;
11
+ params: SegmentParam[];
12
+ }
@@ -0,0 +1,22 @@
1
+ import { Expose, Type } from 'class-transformer';
2
+ import { ArrayMaxSize, Equals, IsArray, IsEnum, IsNumber, IsOptional, Matches, ValidateNested } from 'class-validator';
3
+ import { SEGMENT_IDENTIFIER_PATTERN } from '../../../constants/SegmentLimits';
4
+ import { SegmentAggregateFnEnum } from '../../../enums/SegmentAggregateFnEnum';
5
+ import { SegmentConditionKindEnum } from '../../../enums/SegmentConditionKindEnum';
6
+ import { SegmentOperatorEnum } from '../../../enums/SegmentOperatorEnum';
7
+ import { SegmentColumnCondition } from './SegmentColumnCondition';
8
+ import { SegmentWindow } from './SegmentWindow';
9
+
10
+ /** (b) Agregado con ventana relativa sobre una tabla relacionada (existe / cuenta / suma). `filters` elige QUE cuenta (estados, moneda...). */
11
+ export class SegmentAggregateCondition {
12
+ @Expose() @Equals(SegmentConditionKindEnum.AGGREGATE) kind: SegmentConditionKindEnum.AGGREGATE;
13
+ @Expose() @Matches(SEGMENT_IDENTIFIER_PATTERN) table: string;
14
+ @Expose() @IsEnum(SegmentAggregateFnEnum) fn: SegmentAggregateFnEnum;
15
+ /** Solo SUM. */
16
+ @Expose() @IsOptional() @Matches(SEGMENT_IDENTIFIER_PATTERN) column?: string;
17
+ /** COUNT y SUM; EXISTS no lleva. */
18
+ @Expose() @IsOptional() @IsEnum(SegmentOperatorEnum) op?: SegmentOperatorEnum;
19
+ @Expose() @IsOptional() @IsNumber() value?: number;
20
+ @Expose() @ValidateNested() @Type(() => SegmentWindow) window: SegmentWindow;
21
+ @Expose() @IsArray() @ArrayMaxSize(10) @ValidateNested({ each: true }) @Type(() => SegmentColumnCondition) filters: SegmentColumnCondition[];
22
+ }
@@ -0,0 +1,15 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { Equals, IsEnum, IsOptional, Matches } from 'class-validator';
3
+ import { JsonValue } from '../../../../common';
4
+ import { SEGMENT_IDENTIFIER_PATTERN } from '../../../constants/SegmentLimits';
5
+ import { SegmentConditionKindEnum } from '../../../enums/SegmentConditionKindEnum';
6
+ import { SegmentOperatorEnum } from '../../../enums/SegmentOperatorEnum';
7
+
8
+ /** (a) Columna de una tabla unida por `directoryid`. El tipo de `value` (escalar, lista o `{days}`) lo valida el compilador contra el tipo de Glue. */
9
+ export class SegmentColumnCondition {
10
+ @Expose() @Equals(SegmentConditionKindEnum.COLUMN) kind: SegmentConditionKindEnum.COLUMN;
11
+ @Expose() @Matches(SEGMENT_IDENTIFIER_PATTERN) table: string;
12
+ @Expose() @Matches(SEGMENT_IDENTIFIER_PATTERN) column: string;
13
+ @Expose() @IsEnum(SegmentOperatorEnum) op: SegmentOperatorEnum;
14
+ @Expose() @IsOptional() value?: JsonValue;
15
+ }
@@ -0,0 +1,8 @@
1
+ export class SegmentExecutionPageResponse {
2
+ executionId: string;
3
+ status: string;
4
+ /** Hasta 1000 `directoryid`. */
5
+ ids: string[];
6
+ nextToken?: string;
7
+ reason?: string;
8
+ }
@@ -0,0 +1,17 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { IsInt, IsISO8601, IsOptional, Min } from 'class-validator';
3
+
4
+ /** Ejecucion de un segmento desde otro servicio (endpoint privado). */
5
+ export class SegmentExecutionRequest {
6
+ @Expose()
7
+ @IsOptional()
8
+ @IsInt()
9
+ @Min(1)
10
+ version?: number;
11
+
12
+ /** ISO-8601 UTC; por defecto, ahora. Fija la ventana relativa del segmento. */
13
+ @Expose()
14
+ @IsOptional()
15
+ @IsISO8601({ strict: true })
16
+ referenceAt?: string;
17
+ }
@@ -0,0 +1,7 @@
1
+ export class SegmentExecutionResponse {
2
+ executionId: string;
3
+ segmentId: string;
4
+ version: number;
5
+ referenceAt: string;
6
+ status: string;
7
+ }
@@ -0,0 +1,27 @@
1
+ import { Expose, Type } from 'class-transformer';
2
+ import { ArrayMaxSize, ArrayMinSize, IsArray, IsEnum, ValidateNested } from 'class-validator';
3
+ import { SegmentConditionKindEnum } from '../../../enums/SegmentConditionKindEnum';
4
+ import { SegmentMatchEnum } from '../../../enums/SegmentMatchEnum';
5
+ import { SegmentAggregateCondition } from './SegmentAggregateCondition';
6
+ import { SegmentColumnCondition } from './SegmentColumnCondition';
7
+
8
+ export type SegmentCondition = SegmentColumnCondition | SegmentAggregateCondition;
9
+
10
+ export class SegmentGroup {
11
+ @Expose() @IsEnum(SegmentMatchEnum) match: SegmentMatchEnum;
12
+
13
+ /** `kind` decide la clase; un `kind` desconocido NO se instancia y la validacion lo rechaza (el objeto queda sin `@Equals` valido). */
14
+ @Expose()
15
+ @IsArray() @ArrayMinSize(1) @ArrayMaxSize(20) @ValidateNested({ each: true })
16
+ @Type(() => Object, {
17
+ keepDiscriminatorProperty: true,
18
+ discriminator: {
19
+ property: 'kind',
20
+ subTypes: [
21
+ { value: SegmentColumnCondition, name: SegmentConditionKindEnum.COLUMN },
22
+ { value: SegmentAggregateCondition, name: SegmentConditionKindEnum.AGGREGATE },
23
+ ],
24
+ },
25
+ })
26
+ conditions: SegmentCondition[];
27
+ }
@@ -0,0 +1,8 @@
1
+ export class SegmentLastTest {
2
+ testedAt: string;
3
+ count: number;
4
+ bytesScanned: number;
5
+ durationMs: number;
6
+ referenceAt: string;
7
+ queryExecutionId: string;
8
+ }
@@ -0,0 +1,11 @@
1
+ import { SegmentVersionResponse } from './SegmentVersionResponse';
2
+
3
+ export class SegmentListItemResponse extends SegmentVersionResponse {
4
+ /** Evaluaciones de rewards que lo usan (los consumidores externos del endpoint privado NO cuentan). */
5
+ usedByCount: number;
6
+ }
7
+
8
+ export class SegmentListResponse {
9
+ items: SegmentListItemResponse[];
10
+ nextCursor?: string;
11
+ }
@@ -0,0 +1,11 @@
1
+ import { SegmentParamSourceEnum } from '../../../enums/SegmentParamSourceEnum';
2
+ import { SegmentParamTypeEnum } from '../../../enums/SegmentParamTypeEnum';
3
+
4
+ /** Un `?` del SQL, en orden. LITERAL lleva `value` como texto canonico; REFERENCE_AT_MINUS_DAYS lleva `days`. */
5
+ export class SegmentParam {
6
+ name: string;
7
+ type: SegmentParamTypeEnum;
8
+ source: SegmentParamSourceEnum;
9
+ value?: string;
10
+ days?: number;
11
+ }
@@ -0,0 +1,16 @@
1
+ import { Expose, Type } from 'class-transformer';
2
+ import { IsDefined, IsIn, IsNotEmpty, IsString, Matches, MaxLength, ValidateNested } from 'class-validator';
3
+ import { SegmentStatusEnum } from '../../../enums/SegmentStatusEnum';
4
+ import { PopulationSegmentDefinition } from './PopulationSegmentDefinition';
5
+
6
+ /** POST /population-segments y PUT /population-segments/{segmentId}. */
7
+ export class SegmentSaveRequest {
8
+ @Expose() @IsString() @IsNotEmpty() @MaxLength(160) name: string;
9
+ @Expose() @IsString() @MaxLength(500) description: string;
10
+ /** Responsable del segmento (usuario o equipo, texto). */
11
+ @Expose() @IsString() @IsNotEmpty() @MaxLength(120) owner: string;
12
+ @Expose() @IsDefined() @ValidateNested() @Type(() => PopulationSegmentDefinition) definition: PopulationSegmentDefinition;
13
+ /** `testId` de `POST /population-segments/test`: el servidor exige que sea PASSED, vigente y de ESTA definicion. */
14
+ @Expose() @IsString() @Matches(/^[A-Za-z0-9-]{1,64}$/) testId: string;
15
+ @Expose() @IsIn([SegmentStatusEnum.DRAFT, SegmentStatusEnum.ACTIVE]) status: SegmentStatusEnum.DRAFT | SegmentStatusEnum.ACTIVE;
16
+ }
@@ -0,0 +1,11 @@
1
+ export class SegmentSchemaTableResponse {
2
+ table: string;
3
+ joinKey: string;
4
+ columnCount: number;
5
+ }
6
+
7
+ /** `available: false` = ambiente sin datalake accesible: el constructor muestra "no disponible". */
8
+ export class SegmentSchemaResponse {
9
+ available: boolean;
10
+ tables: SegmentSchemaTableResponse[];
11
+ }
@@ -0,0 +1,9 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { IsEnum, IsInt, IsOptional, Min } from 'class-validator';
3
+ import { SegmentStatusEnum } from '../../../enums/SegmentStatusEnum';
4
+
5
+ /** POST /population-segments/{segmentId}/status: activar un DRAFT (con `version`) o archivar el segmento completo. */
6
+ export class SegmentStatusRequest {
7
+ @Expose() @IsOptional() @IsInt() @Min(1) version?: number;
8
+ @Expose() @IsEnum(SegmentStatusEnum) status: SegmentStatusEnum;
9
+ }
@@ -0,0 +1,14 @@
1
+ import { SegmentOperatorEnum } from '../../../enums/SegmentOperatorEnum';
2
+
3
+ export class SegmentColumnSchemaResponse {
4
+ name: string;
5
+ type: string;
6
+ isDate: boolean;
7
+ operators: SegmentOperatorEnum[];
8
+ }
9
+
10
+ export class SegmentTableSchemaResponse {
11
+ table: string;
12
+ joinKey: string;
13
+ columns: SegmentColumnSchemaResponse[];
14
+ }
@@ -0,0 +1,7 @@
1
+ import { Expose, Type } from 'class-transformer';
2
+ import { IsDefined, ValidateNested } from 'class-validator';
3
+ import { PopulationSegmentDefinition } from './PopulationSegmentDefinition';
4
+
5
+ export class SegmentTestRequest {
6
+ @Expose() @IsDefined() @ValidateNested() @Type(() => PopulationSegmentDefinition) definition: PopulationSegmentDefinition;
7
+ }
@@ -0,0 +1,29 @@
1
+ import { SegmentErrorCodeEnum } from '../../../enums/SegmentErrorCodeEnum';
2
+ import { SegmentTestStatusEnum } from '../../../enums/SegmentTestStatusEnum';
3
+ import { SegmentParam } from './SegmentParam';
4
+
5
+ export class SegmentTestResultResponse {
6
+ count: number;
7
+ /** Ids parciales (`a41f...09c2`), hasta 20. */
8
+ sampleIds: string[];
9
+ bytesScanned: number;
10
+ durationMs: number;
11
+ }
12
+
13
+ export class SegmentTestErrorResponse {
14
+ code: SegmentErrorCodeEnum;
15
+ message: string;
16
+ }
17
+
18
+ export class SegmentTestResponse {
19
+ testId: string;
20
+ status: SegmentTestStatusEnum;
21
+ referenceAt: string;
22
+ /** Resumen en lenguaje normal generado de forma determinista (sin IA). */
23
+ humanSummary: string;
24
+ /** SQL de solo lectura + params separados (la UI no deja editarlos). */
25
+ sql: string;
26
+ params: SegmentParam[];
27
+ result?: SegmentTestResultResponse;
28
+ errors?: SegmentTestErrorResponse[];
29
+ }