@fiado/type-kit 3.573.0 → 3.575.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_test_/unit/rewardsEligibility/evaluationStrategyDtos.test.ts +93 -0
- package/_test_/unit/rewardsEligibility/segmentMessagesAndRunDtos.test.ts +2 -2
- package/_test_/unit/rules/evaluationDatalakeDtos.test.ts +144 -0
- package/bin/retailCommission/dtos/CommissionApi.d.ts +25 -0
- package/bin/rewardsEligibility/constants/BatchLimits.d.ts +2 -0
- package/bin/rewardsEligibility/constants/BatchLimits.js +5 -0
- package/bin/rewardsEligibility/dtos/backoffice/CreateRunRequest.d.ts +2 -0
- package/bin/rewardsEligibility/dtos/backoffice/CreateRunRequest.js +7 -0
- package/bin/rewardsEligibility/dtos/backoffice/EvaluationRequest.d.ts +3 -0
- package/bin/rewardsEligibility/dtos/backoffice/EvaluationRequest.js +7 -0
- package/bin/rewardsEligibility/dtos/backoffice/EvaluationResponse.d.ts +3 -0
- package/bin/rewardsEligibility/dtos/backoffice/SimulateRequest.d.ts +2 -0
- package/bin/rewardsEligibility/dtos/backoffice/SimulateRequest.js +7 -0
- package/bin/rewardsEligibility/dtos/messages/EvaluateBatchMessage.d.ts +1 -1
- package/bin/rewardsEligibility/dtos/messages/EvaluateBatchMessage.js +3 -2
- package/bin/rewardsEligibility/index.d.ts +2 -0
- package/bin/rewardsEligibility/index.js +2 -0
- package/bin/rewardsEligibility/types/RewardInputRef.d.ts +9 -1
- package/bin/rewardsEligibility/validators/IsRewardInputs.d.ts +7 -0
- package/bin/rewardsEligibility/validators/IsRewardInputs.js +26 -0
- package/bin/rules/constants/RulesLimits.d.ts +6 -0
- package/bin/rules/constants/RulesLimits.js +7 -1
- package/bin/rules/dtos/EvaluateRulesRequest.d.ts +8 -0
- package/bin/rules/dtos/EvaluateRulesRequest.js +24 -0
- package/bin/rules/dtos/EvaluateRulesResponse.d.ts +3 -0
- package/bin/rules/dtos/ValidateRulesRequest.d.ts +5 -0
- package/bin/rules/dtos/ValidateRulesRequest.js +15 -0
- package/bin/rules/dtos/datalake/EvaluationExecutionRequest.d.ts +21 -0
- package/bin/rules/dtos/datalake/EvaluationExecutionRequest.js +83 -0
- package/bin/rules/dtos/datalake/EvaluationExecutionResponse.d.ts +6 -0
- package/bin/rules/dtos/datalake/EvaluationExecutionResponse.js +7 -0
- package/bin/rules/dtos/datalake/EvaluationExecutionResultsResponse.d.ts +11 -0
- package/bin/rules/dtos/datalake/EvaluationExecutionResultsResponse.js +7 -0
- package/bin/rules/dtos/datalake/EvaluationResultsRequest.d.ts +11 -0
- package/bin/rules/dtos/datalake/EvaluationResultsRequest.js +64 -0
- package/bin/rules/dtos/datalake/ReturnFieldsCatalogResponse.d.ts +17 -0
- package/bin/rules/dtos/datalake/ReturnFieldsCatalogResponse.js +10 -0
- package/bin/rules/dtos/population/SegmentTableSchemaResponse.d.ts +2 -0
- package/bin/rules/enums/EvaluationStrategyEnum.d.ts +5 -0
- package/bin/rules/enums/EvaluationStrategyEnum.js +9 -0
- package/bin/rules/enums/RulesErrorCodeEnum.d.ts +11 -1
- package/bin/rules/enums/RulesErrorCodeEnum.js +10 -0
- package/bin/rules/index.d.ts +6 -0
- package/bin/rules/index.js +7 -0
- package/package.json +1 -1
- package/src/retailCommission/dtos/CommissionApi.ts +26 -0
- package/src/rewardsEligibility/constants/BatchLimits.ts +2 -0
- package/src/rewardsEligibility/dtos/backoffice/CreateRunRequest.ts +7 -0
- package/src/rewardsEligibility/dtos/backoffice/EvaluationRequest.ts +8 -1
- package/src/rewardsEligibility/dtos/backoffice/EvaluationResponse.ts +3 -0
- package/src/rewardsEligibility/dtos/backoffice/SimulateRequest.ts +7 -0
- package/src/rewardsEligibility/dtos/messages/EvaluateBatchMessage.ts +3 -2
- package/src/rewardsEligibility/index.ts +2 -0
- package/src/rewardsEligibility/types/RewardInputRef.ts +6 -2
- package/src/rewardsEligibility/validators/IsRewardInputs.ts +16 -0
- package/src/rules/constants/RulesLimits.ts +6 -0
- package/src/rules/dtos/EvaluateRulesRequest.ts +26 -1
- package/src/rules/dtos/EvaluateRulesResponse.ts +3 -0
- package/src/rules/dtos/ValidateRulesRequest.ts +17 -2
- package/src/rules/dtos/datalake/EvaluationExecutionRequest.ts +73 -0
- package/src/rules/dtos/datalake/EvaluationExecutionResponse.ts +7 -0
- package/src/rules/dtos/datalake/EvaluationExecutionResultsResponse.ts +12 -0
- package/src/rules/dtos/datalake/EvaluationResultsRequest.ts +46 -0
- package/src/rules/dtos/datalake/ReturnFieldsCatalogResponse.ts +19 -0
- package/src/rules/dtos/population/SegmentTableSchemaResponse.ts +2 -0
- package/src/rules/enums/EvaluationStrategyEnum.ts +5 -0
- package/src/rules/enums/RulesErrorCodeEnum.ts +10 -0
- package/src/rules/index.ts +8 -0
|
@@ -13,6 +13,7 @@ exports.ValidateRulesRequest = void 0;
|
|
|
13
13
|
const class_transformer_1 = require("class-transformer");
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
15
|
const RulesLimits_1 = require("../constants/RulesLimits");
|
|
16
|
+
const EvaluationStrategyEnum_1 = require("../enums/EvaluationStrategyEnum");
|
|
16
17
|
/** `POST /validate`: valida una regla guardada contra el catálogo de los ítems indicados y el contrato de `input`. */
|
|
17
18
|
class ValidateRulesRequest {
|
|
18
19
|
}
|
|
@@ -42,3 +43,17 @@ __decorate([
|
|
|
42
43
|
(0, class_validator_1.IsObject)({ each: true }),
|
|
43
44
|
__metadata("design:type", Array)
|
|
44
45
|
], ValidateRulesRequest.prototype, "inputContract", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, class_transformer_1.Expose)(),
|
|
48
|
+
(0, class_validator_1.IsOptional)(),
|
|
49
|
+
(0, class_validator_1.IsEnum)(EvaluationStrategyEnum_1.EvaluationStrategyEnum),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], ValidateRulesRequest.prototype, "evaluationStrategy", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, class_transformer_1.Expose)(),
|
|
54
|
+
(0, class_validator_1.IsOptional)(),
|
|
55
|
+
(0, class_validator_1.IsArray)(),
|
|
56
|
+
(0, class_validator_1.ArrayMaxSize)(RulesLimits_1.RULES_MAX_RETURN_FIELDS),
|
|
57
|
+
(0, class_validator_1.Matches)(RulesLimits_1.RETURN_FIELD_ID_PATTERN, { each: true }),
|
|
58
|
+
__metadata("design:type", Array)
|
|
59
|
+
], ValidateRulesRequest.prototype, "returnFields", void 0);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { InputField } from '../../../dynamicForm/dtos/InputField';
|
|
2
|
+
import { RuleToEvaluate, RulesEvaluationSubject } from '../EvaluateRulesRequest';
|
|
3
|
+
/**
|
|
4
|
+
* `POST /evaluate/executions`: inicia UNA query Athena por lote (hasta 1000 sujetos).
|
|
5
|
+
* `rules` ausente = modo "solo campos" (exige `returnFields` ≥ 1: esa regla la valida el lambda).
|
|
6
|
+
*/
|
|
7
|
+
export declare class EvaluationExecutionRequest {
|
|
8
|
+
/** Quién llama (solo logs y métricas). */
|
|
9
|
+
consumer?: string;
|
|
10
|
+
/** Ids de ítems del catálogo (`source:key`) que las reglas pueden usar. */
|
|
11
|
+
items: string[];
|
|
12
|
+
rules?: RuleToEvaluate[];
|
|
13
|
+
/** Contrato de la fuente `input` (tipos de las columnas `i_<llave>`). */
|
|
14
|
+
inputContract?: InputField[];
|
|
15
|
+
subjects: RulesEvaluationSubject[];
|
|
16
|
+
/** Fecha ISO 8601 con hora (ancla del cálculo, nunca `now()`). */
|
|
17
|
+
referenceAt: string;
|
|
18
|
+
returnFields?: string[];
|
|
19
|
+
/** Mismo lote reintentado = mismo `QueryExecutionId`. */
|
|
20
|
+
idempotencyKey: string;
|
|
21
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
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.EvaluationExecutionRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const RulesLimits_1 = require("../../constants/RulesLimits");
|
|
16
|
+
const EvaluateRulesRequest_1 = require("../EvaluateRulesRequest");
|
|
17
|
+
/**
|
|
18
|
+
* `POST /evaluate/executions`: inicia UNA query Athena por lote (hasta 1000 sujetos).
|
|
19
|
+
* `rules` ausente = modo "solo campos" (exige `returnFields` ≥ 1: esa regla la valida el lambda).
|
|
20
|
+
*/
|
|
21
|
+
class EvaluationExecutionRequest {
|
|
22
|
+
}
|
|
23
|
+
exports.EvaluationExecutionRequest = EvaluationExecutionRequest;
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_transformer_1.Expose)(),
|
|
26
|
+
(0, class_validator_1.IsOptional)(),
|
|
27
|
+
(0, class_validator_1.IsString)(),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], EvaluationExecutionRequest.prototype, "consumer", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, class_transformer_1.Expose)(),
|
|
32
|
+
(0, class_validator_1.IsArray)(),
|
|
33
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
34
|
+
__metadata("design:type", Array)
|
|
35
|
+
], EvaluationExecutionRequest.prototype, "items", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, class_transformer_1.Expose)(),
|
|
38
|
+
(0, class_validator_1.IsOptional)(),
|
|
39
|
+
(0, class_validator_1.IsArray)(),
|
|
40
|
+
(0, class_validator_1.ArrayMinSize)(1),
|
|
41
|
+
(0, class_validator_1.ArrayMaxSize)(10),
|
|
42
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
43
|
+
(0, class_transformer_1.Type)(() => EvaluateRulesRequest_1.RuleToEvaluate),
|
|
44
|
+
__metadata("design:type", Array)
|
|
45
|
+
], EvaluationExecutionRequest.prototype, "rules", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, class_transformer_1.Expose)(),
|
|
48
|
+
(0, class_validator_1.IsOptional)(),
|
|
49
|
+
(0, class_validator_1.IsArray)(),
|
|
50
|
+
(0, class_validator_1.ArrayMaxSize)(RulesLimits_1.RULES_MAX_INPUT_CONTRACT),
|
|
51
|
+
(0, class_validator_1.IsObject)({ each: true }),
|
|
52
|
+
__metadata("design:type", Array)
|
|
53
|
+
], EvaluationExecutionRequest.prototype, "inputContract", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, class_transformer_1.Expose)(),
|
|
56
|
+
(0, class_validator_1.IsArray)(),
|
|
57
|
+
(0, class_validator_1.ArrayMinSize)(1),
|
|
58
|
+
(0, class_validator_1.ArrayMaxSize)(RulesLimits_1.RULES_MAX_SUBJECTS_PER_DATALAKE_CALL),
|
|
59
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
60
|
+
(0, class_transformer_1.Type)(() => EvaluateRulesRequest_1.RulesEvaluationSubject),
|
|
61
|
+
__metadata("design:type", Array)
|
|
62
|
+
], EvaluationExecutionRequest.prototype, "subjects", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, class_transformer_1.Expose)(),
|
|
65
|
+
(0, class_validator_1.IsISO8601)({ strict: true }),
|
|
66
|
+
(0, class_validator_1.Matches)(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/),
|
|
67
|
+
__metadata("design:type", String)
|
|
68
|
+
], EvaluationExecutionRequest.prototype, "referenceAt", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, class_transformer_1.Expose)(),
|
|
71
|
+
(0, class_validator_1.IsOptional)(),
|
|
72
|
+
(0, class_validator_1.IsArray)(),
|
|
73
|
+
(0, class_validator_1.ArrayMaxSize)(RulesLimits_1.RULES_MAX_RETURN_FIELDS),
|
|
74
|
+
(0, class_validator_1.Matches)(RulesLimits_1.RETURN_FIELD_ID_PATTERN, { each: true }),
|
|
75
|
+
__metadata("design:type", Array)
|
|
76
|
+
], EvaluationExecutionRequest.prototype, "returnFields", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, class_transformer_1.Expose)(),
|
|
79
|
+
(0, class_validator_1.IsString)(),
|
|
80
|
+
(0, class_validator_1.MinLength)(32),
|
|
81
|
+
(0, class_validator_1.MaxLength)(128),
|
|
82
|
+
__metadata("design:type", String)
|
|
83
|
+
], EvaluationExecutionRequest.prototype, "idempotencyKey", void 0);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EvaluationExecutionResponse = void 0;
|
|
4
|
+
/** Respuesta de `POST /evaluate/executions`. */
|
|
5
|
+
class EvaluationExecutionResponse {
|
|
6
|
+
}
|
|
7
|
+
exports.EvaluationExecutionResponse = EvaluationExecutionResponse;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PopulationExecutionStatusEnum } from '../../enums/PopulationExecutionStatusEnum';
|
|
2
|
+
import { RulesErrorCodeEnum } from '../../enums/RulesErrorCodeEnum';
|
|
3
|
+
import { RuleEvaluationResult } from '../EvaluateRulesResponse';
|
|
4
|
+
/** Pagina de resultados. Sin `nextToken` = última página. `reason` solo si `status` es `FAILED`. */
|
|
5
|
+
export declare class EvaluationExecutionResultsResponse {
|
|
6
|
+
executionId: string;
|
|
7
|
+
status: PopulationExecutionStatusEnum;
|
|
8
|
+
results: RuleEvaluationResult[];
|
|
9
|
+
nextToken?: string;
|
|
10
|
+
reason?: RulesErrorCodeEnum;
|
|
11
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EvaluationExecutionResultsResponse = void 0;
|
|
4
|
+
/** Pagina de resultados. Sin `nextToken` = última página. `reason` solo si `status` es `FAILED`. */
|
|
5
|
+
class EvaluationExecutionResultsResponse {
|
|
6
|
+
}
|
|
7
|
+
exports.EvaluationExecutionResultsResponse = EvaluationExecutionResultsResponse;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { InputField } from '../../../dynamicForm/dtos/InputField';
|
|
2
|
+
import { RuleToEvaluate } from '../EvaluateRulesRequest';
|
|
3
|
+
/** `POST /evaluate/executions/{id}/results`: pagina de resultados. Reglas, ítems e `inputContract` deben ser los del inicio. */
|
|
4
|
+
export declare class EvaluationResultsRequest {
|
|
5
|
+
consumer?: string;
|
|
6
|
+
items: string[];
|
|
7
|
+
rules?: RuleToEvaluate[];
|
|
8
|
+
inputContract?: InputField[];
|
|
9
|
+
returnFields?: string[];
|
|
10
|
+
nextToken?: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
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.EvaluationResultsRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const RulesLimits_1 = require("../../constants/RulesLimits");
|
|
16
|
+
const EvaluateRulesRequest_1 = require("../EvaluateRulesRequest");
|
|
17
|
+
/** `POST /evaluate/executions/{id}/results`: pagina de resultados. Reglas, ítems e `inputContract` deben ser los del inicio. */
|
|
18
|
+
class EvaluationResultsRequest {
|
|
19
|
+
}
|
|
20
|
+
exports.EvaluationResultsRequest = EvaluationResultsRequest;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, class_transformer_1.Expose)(),
|
|
23
|
+
(0, class_validator_1.IsOptional)(),
|
|
24
|
+
(0, class_validator_1.IsString)(),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], EvaluationResultsRequest.prototype, "consumer", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, class_transformer_1.Expose)(),
|
|
29
|
+
(0, class_validator_1.IsArray)(),
|
|
30
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
31
|
+
__metadata("design:type", Array)
|
|
32
|
+
], EvaluationResultsRequest.prototype, "items", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_transformer_1.Expose)(),
|
|
35
|
+
(0, class_validator_1.IsOptional)(),
|
|
36
|
+
(0, class_validator_1.IsArray)(),
|
|
37
|
+
(0, class_validator_1.ArrayMinSize)(1),
|
|
38
|
+
(0, class_validator_1.ArrayMaxSize)(10),
|
|
39
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
40
|
+
(0, class_transformer_1.Type)(() => EvaluateRulesRequest_1.RuleToEvaluate),
|
|
41
|
+
__metadata("design:type", Array)
|
|
42
|
+
], EvaluationResultsRequest.prototype, "rules", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, class_transformer_1.Expose)(),
|
|
45
|
+
(0, class_validator_1.IsOptional)(),
|
|
46
|
+
(0, class_validator_1.IsArray)(),
|
|
47
|
+
(0, class_validator_1.ArrayMaxSize)(RulesLimits_1.RULES_MAX_INPUT_CONTRACT),
|
|
48
|
+
(0, class_validator_1.IsObject)({ each: true }),
|
|
49
|
+
__metadata("design:type", Array)
|
|
50
|
+
], EvaluationResultsRequest.prototype, "inputContract", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, class_transformer_1.Expose)(),
|
|
53
|
+
(0, class_validator_1.IsOptional)(),
|
|
54
|
+
(0, class_validator_1.IsArray)(),
|
|
55
|
+
(0, class_validator_1.ArrayMaxSize)(RulesLimits_1.RULES_MAX_RETURN_FIELDS),
|
|
56
|
+
(0, class_validator_1.Matches)(RulesLimits_1.RETURN_FIELD_ID_PATTERN, { each: true }),
|
|
57
|
+
__metadata("design:type", Array)
|
|
58
|
+
], EvaluationResultsRequest.prototype, "returnFields", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, class_transformer_1.Expose)(),
|
|
61
|
+
(0, class_validator_1.IsOptional)(),
|
|
62
|
+
(0, class_validator_1.IsString)(),
|
|
63
|
+
__metadata("design:type", String)
|
|
64
|
+
], EvaluationResultsRequest.prototype, "nextToken", void 0);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RulesValueTypeEnum } from '../../enums/RulesValueTypeEnum';
|
|
2
|
+
/** Un campo del catálogo que se puede devolver (`GET /return-fields`). */
|
|
3
|
+
export declare class ReturnableFieldResponse {
|
|
4
|
+
/** `fuente:campo`. */
|
|
5
|
+
id: string;
|
|
6
|
+
source: string;
|
|
7
|
+
field: string;
|
|
8
|
+
label: string;
|
|
9
|
+
description: string;
|
|
10
|
+
valueType: RulesValueTypeEnum;
|
|
11
|
+
datalakeCompatible: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare class ReturnFieldsCatalogResponse {
|
|
14
|
+
/** `false` si el datalake no está disponible en el ambiente. */
|
|
15
|
+
available: boolean;
|
|
16
|
+
fields: ReturnableFieldResponse[];
|
|
17
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReturnFieldsCatalogResponse = exports.ReturnableFieldResponse = void 0;
|
|
4
|
+
/** Un campo del catálogo que se puede devolver (`GET /return-fields`). */
|
|
5
|
+
class ReturnableFieldResponse {
|
|
6
|
+
}
|
|
7
|
+
exports.ReturnableFieldResponse = ReturnableFieldResponse;
|
|
8
|
+
class ReturnFieldsCatalogResponse {
|
|
9
|
+
}
|
|
10
|
+
exports.ReturnFieldsCatalogResponse = ReturnFieldsCatalogResponse;
|
|
@@ -5,6 +5,8 @@ export declare class SegmentColumnSchemaResponse {
|
|
|
5
5
|
root?: string;
|
|
6
6
|
type: string;
|
|
7
7
|
isDate: boolean;
|
|
8
|
+
/** La hoja está detrás de al menos un `array<struct>`: semántica de elemento (`any_match`). */
|
|
9
|
+
inArray?: boolean;
|
|
8
10
|
operators: SegmentOperatorEnum[];
|
|
9
11
|
}
|
|
10
12
|
export declare class SegmentTableSchemaResponse {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EvaluationStrategyEnum = void 0;
|
|
4
|
+
/** Cómo evalúa el central una regla: `LIVE` (resolvers en vivo, default) o `DATALAKE` (una query Athena por lote). */
|
|
5
|
+
var EvaluationStrategyEnum;
|
|
6
|
+
(function (EvaluationStrategyEnum) {
|
|
7
|
+
EvaluationStrategyEnum["LIVE"] = "LIVE";
|
|
8
|
+
EvaluationStrategyEnum["DATALAKE"] = "DATALAKE";
|
|
9
|
+
})(EvaluationStrategyEnum || (exports.EvaluationStrategyEnum = EvaluationStrategyEnum = {}));
|
|
@@ -3,5 +3,15 @@ export declare enum RulesErrorCodeEnum {
|
|
|
3
3
|
UNKNOWN_CATALOG_ITEM = "UNKNOWN_CATALOG_ITEM",
|
|
4
4
|
DUPLICATE_SOURCE_IN_ITEMS = "DUPLICATE_SOURCE_IN_ITEMS",
|
|
5
5
|
TOO_MANY_SUBJECTS = "TOO_MANY_SUBJECTS",
|
|
6
|
-
VALIDATION_ERROR = "VALIDATION_ERROR"
|
|
6
|
+
VALIDATION_ERROR = "VALIDATION_ERROR",
|
|
7
|
+
/** 400: la regla usa `params`, o una tabla que el campo necesita no existe en el ambiente. */
|
|
8
|
+
RULE_NOT_DATALAKE_COMPATIBLE = "RULE_NOT_DATALAKE_COMPATIBLE",
|
|
9
|
+
/** 503: el datalake no está disponible. */
|
|
10
|
+
DATALAKE_UNAVAILABLE = "DATALAKE_UNAVAILABLE",
|
|
11
|
+
/** La query del datalake terminó en error. */
|
|
12
|
+
DATALAKE_EVALUATION_FAILED = "DATALAKE_EVALUATION_FAILED",
|
|
13
|
+
/** La query del datalake superó el tiempo de espera (reintentable). */
|
|
14
|
+
DATALAKE_EVALUATION_TIMEOUT = "DATALAKE_EVALUATION_TIMEOUT",
|
|
15
|
+
/** 400: un id de `returnFields` no existe en el catálogo ni en el esquema del datalake. */
|
|
16
|
+
UNKNOWN_RETURN_FIELD = "UNKNOWN_RETURN_FIELD"
|
|
7
17
|
}
|
|
@@ -8,4 +8,14 @@ var RulesErrorCodeEnum;
|
|
|
8
8
|
RulesErrorCodeEnum["DUPLICATE_SOURCE_IN_ITEMS"] = "DUPLICATE_SOURCE_IN_ITEMS";
|
|
9
9
|
RulesErrorCodeEnum["TOO_MANY_SUBJECTS"] = "TOO_MANY_SUBJECTS";
|
|
10
10
|
RulesErrorCodeEnum["VALIDATION_ERROR"] = "VALIDATION_ERROR";
|
|
11
|
+
/** 400: la regla usa `params`, o una tabla que el campo necesita no existe en el ambiente. */
|
|
12
|
+
RulesErrorCodeEnum["RULE_NOT_DATALAKE_COMPATIBLE"] = "RULE_NOT_DATALAKE_COMPATIBLE";
|
|
13
|
+
/** 503: el datalake no está disponible. */
|
|
14
|
+
RulesErrorCodeEnum["DATALAKE_UNAVAILABLE"] = "DATALAKE_UNAVAILABLE";
|
|
15
|
+
/** La query del datalake terminó en error. */
|
|
16
|
+
RulesErrorCodeEnum["DATALAKE_EVALUATION_FAILED"] = "DATALAKE_EVALUATION_FAILED";
|
|
17
|
+
/** La query del datalake superó el tiempo de espera (reintentable). */
|
|
18
|
+
RulesErrorCodeEnum["DATALAKE_EVALUATION_TIMEOUT"] = "DATALAKE_EVALUATION_TIMEOUT";
|
|
19
|
+
/** 400: un id de `returnFields` no existe en el catálogo ni en el esquema del datalake. */
|
|
20
|
+
RulesErrorCodeEnum["UNKNOWN_RETURN_FIELD"] = "UNKNOWN_RETURN_FIELD";
|
|
11
21
|
})(RulesErrorCodeEnum || (exports.RulesErrorCodeEnum = RulesErrorCodeEnum = {}));
|
package/bin/rules/index.d.ts
CHANGED
|
@@ -40,3 +40,9 @@ export * from './dtos/population/PopulationTestResponse';
|
|
|
40
40
|
export * from './dtos/population/PopulationExecutionRequest';
|
|
41
41
|
export * from './dtos/population/PopulationExecutionResponse';
|
|
42
42
|
export * from './dtos/population/PopulationExecutionPageResponse';
|
|
43
|
+
export * from './enums/EvaluationStrategyEnum';
|
|
44
|
+
export * from './dtos/datalake/EvaluationExecutionRequest';
|
|
45
|
+
export * from './dtos/datalake/EvaluationExecutionResponse';
|
|
46
|
+
export * from './dtos/datalake/EvaluationResultsRequest';
|
|
47
|
+
export * from './dtos/datalake/EvaluationExecutionResultsResponse';
|
|
48
|
+
export * from './dtos/datalake/ReturnFieldsCatalogResponse';
|
package/bin/rules/index.js
CHANGED
|
@@ -61,3 +61,10 @@ __exportStar(require("./dtos/population/PopulationTestResponse"), exports);
|
|
|
61
61
|
__exportStar(require("./dtos/population/PopulationExecutionRequest"), exports);
|
|
62
62
|
__exportStar(require("./dtos/population/PopulationExecutionResponse"), exports);
|
|
63
63
|
__exportStar(require("./dtos/population/PopulationExecutionPageResponse"), exports);
|
|
64
|
+
//Evaluacion DATALAKE, campos devueltos y ejecucion asincrona
|
|
65
|
+
__exportStar(require("./enums/EvaluationStrategyEnum"), exports);
|
|
66
|
+
__exportStar(require("./dtos/datalake/EvaluationExecutionRequest"), exports);
|
|
67
|
+
__exportStar(require("./dtos/datalake/EvaluationExecutionResponse"), exports);
|
|
68
|
+
__exportStar(require("./dtos/datalake/EvaluationResultsRequest"), exports);
|
|
69
|
+
__exportStar(require("./dtos/datalake/EvaluationExecutionResultsResponse"), exports);
|
|
70
|
+
__exportStar(require("./dtos/datalake/ReturnFieldsCatalogResponse"), exports);
|
package/package.json
CHANGED
|
@@ -476,6 +476,27 @@ export interface MyCommissionsTotals {
|
|
|
476
476
|
netCents: number;
|
|
477
477
|
}
|
|
478
478
|
|
|
479
|
+
/**
|
|
480
|
+
* Lo que un cierre todavía abierto va a mover en el saldo del vendedor, calculado al momento con la
|
|
481
|
+
* misma cuenta del cierre: cada venta con el «Cuándo se paga» de su plan, menos lo ya acreditado al
|
|
482
|
+
* momento, más los ajustes del corte.
|
|
483
|
+
*/
|
|
484
|
+
export interface MyCommissionsUpcomingCut {
|
|
485
|
+
periodId: string;
|
|
486
|
+
periodStart: string;
|
|
487
|
+
periodEnd: string;
|
|
488
|
+
/** Día del cierre en México (`yyyy-mm-dd`): el lunes siguiente al domingo del corte. */
|
|
489
|
+
cutDate: string;
|
|
490
|
+
/** Lo que el cierre deja por depositar; negativo si descuenta. */
|
|
491
|
+
payableCents: number;
|
|
492
|
+
/** De `payableCents`, lo que viene de ajustes del corte. */
|
|
493
|
+
adjustmentsCents: number;
|
|
494
|
+
/** Lo que el cierre retiene hasta el día 1. */
|
|
495
|
+
retainedCents: number;
|
|
496
|
+
/** Día en que se libera lo retenido (`yyyy-mm-dd`); `null` si no retiene. */
|
|
497
|
+
releaseDate: string | null;
|
|
498
|
+
}
|
|
499
|
+
|
|
479
500
|
/**
|
|
480
501
|
* `GET /commissions/me?weeks=` — las comisiones del vendedor que llama. El vendedor sale del token;
|
|
481
502
|
* no se puede pedir el de otro.
|
|
@@ -485,6 +506,11 @@ export interface GetMyCommissionsResponse {
|
|
|
485
506
|
period: { periodId: string; periodStart: string; periodEnd: string };
|
|
486
507
|
/** El corte en curso; `null` si todavía no tiene ventas, renta ni ajustes. */
|
|
487
508
|
week: CommissionSellerBreakdown | null;
|
|
509
|
+
/**
|
|
510
|
+
* Los cierres pendientes con algo que mover: el del corte anterior si todavía no cierra y el del
|
|
511
|
+
* corte en curso, del más próximo al más lejano. Ausente en motores anteriores.
|
|
512
|
+
*/
|
|
513
|
+
upcomingCuts?: MyCommissionsUpcomingCut[];
|
|
488
514
|
/** Cortes cuya semana empieza en el mes de hoy: cerrados, el anterior aún sin cerrar y el en curso. */
|
|
489
515
|
month: MyCommissionsTotals;
|
|
490
516
|
/** Cortes cuya semana empieza en el año de hoy: cerrados, el anterior aún sin cerrar y el en curso. */
|
|
@@ -2,6 +2,7 @@ import { Expose, Type } from 'class-transformer';
|
|
|
2
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
|
+
import { IsRewardInputs } from '../../validators/IsRewardInputs';
|
|
5
6
|
import { REQUEST_ID_PATTERN } from '../../constants/BackofficeLimits';
|
|
6
7
|
import { RunModeEnum } from '../../enums/RunModeEnum';
|
|
7
8
|
import { PopulationRunRequest } from './PopulationRunRequest';
|
|
@@ -28,4 +29,10 @@ export class CreateRunRequest {
|
|
|
28
29
|
@IsObject()
|
|
29
30
|
@Type(() => PopulationRunRequest)
|
|
30
31
|
population?: PopulationRunRequest;
|
|
32
|
+
|
|
33
|
+
/** Valores escritos por el operador para ESTA corrida: itemKey → inputKey → valor. */
|
|
34
|
+
@Expose()
|
|
35
|
+
@IsOptional()
|
|
36
|
+
@Validate(IsRewardInputs)
|
|
37
|
+
rewardInputs?: Record<string, Record<string, DynamicFormValue>>;
|
|
31
38
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Expose } from 'class-transformer';
|
|
2
|
-
import { ArrayMaxSize, ArrayMinSize, IsArray, IsNotEmpty, IsObject, IsOptional, IsString, Matches, MaxLength } from 'class-validator';
|
|
2
|
+
import { ArrayMaxSize, ArrayMinSize, IsArray, IsEnum, IsNotEmpty, IsObject, IsOptional, IsString, Matches, MaxLength } from 'class-validator';
|
|
3
3
|
import { JsonValue } from '../../../common';
|
|
4
|
+
import { EvaluationStrategyEnum } from '../../../rules/enums/EvaluationStrategyEnum';
|
|
4
5
|
import { InputField } from '../../../dynamicForm/dtos/InputField';
|
|
5
6
|
import { ELIGIBILITY_ID_PATTERN, INPUT_KEY_PATTERN } from '../../constants/BackofficeLimits';
|
|
6
7
|
import { EvaluationReward } from '../EvaluationReward';
|
|
@@ -80,4 +81,10 @@ export class EvaluationRequest {
|
|
|
80
81
|
@IsString()
|
|
81
82
|
@Matches(INPUT_KEY_PATTERN)
|
|
82
83
|
populationInputKey?: string;
|
|
84
|
+
|
|
85
|
+
/** Estrategia de evaluación de las corridas masivas; ausente = `LIVE`. */
|
|
86
|
+
@Expose()
|
|
87
|
+
@IsOptional()
|
|
88
|
+
@IsEnum(EvaluationStrategyEnum)
|
|
89
|
+
evaluationStrategy?: EvaluationStrategyEnum;
|
|
83
90
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { JsonValue } from '../../../common';
|
|
2
|
+
import { EvaluationStrategyEnum } from '../../../rules/enums/EvaluationStrategyEnum';
|
|
2
3
|
import { InputField } from '../../../dynamicForm/dtos/InputField';
|
|
3
4
|
import { EvaluationStatusEnum } from '../../enums/EvaluationStatusEnum';
|
|
4
5
|
import { EvaluationReward } from '../EvaluationReward';
|
|
@@ -21,6 +22,8 @@ export class EvaluationResponse {
|
|
|
21
22
|
triggers: EvaluationTrigger[];
|
|
22
23
|
populationSegmentId?: string;
|
|
23
24
|
populationInputKey?: string;
|
|
25
|
+
/** Ausente = `LIVE`. */
|
|
26
|
+
evaluationStrategy?: EvaluationStrategyEnum;
|
|
24
27
|
createdAt: number;
|
|
25
28
|
updatedAt: number;
|
|
26
29
|
updatedBy: string;
|
|
@@ -2,6 +2,7 @@ import { Expose, Type } from 'class-transformer';
|
|
|
2
2
|
import { IsOptional, IsString, Matches, Validate, ValidateNested } from 'class-validator';
|
|
3
3
|
import { DynamicFormValue } from '../../../dynamicForm/types/DynamicFormValue';
|
|
4
4
|
import { IsDynamicFormValues } from '../../../dynamicForm/validators/IsDynamicFormValues';
|
|
5
|
+
import { IsRewardInputs } from '../../validators/IsRewardInputs';
|
|
5
6
|
import { ELIGIBILITY_ID_PATTERN } from '../../constants/BackofficeLimits';
|
|
6
7
|
import { EvaluationRequest } from './EvaluationRequest';
|
|
7
8
|
|
|
@@ -22,4 +23,10 @@ export class SimulateRequest {
|
|
|
22
23
|
@Expose()
|
|
23
24
|
@Validate(IsDynamicFormValues)
|
|
24
25
|
inputs: Record<string, DynamicFormValue>;
|
|
26
|
+
|
|
27
|
+
/** Valores escritos por el operador para ESTA corrida: itemKey → inputKey → valor. */
|
|
28
|
+
@Expose()
|
|
29
|
+
@IsOptional()
|
|
30
|
+
@Validate(IsRewardInputs)
|
|
31
|
+
rewardInputs?: Record<string, Record<string, DynamicFormValue>>;
|
|
25
32
|
}
|
|
@@ -2,6 +2,7 @@ import { Expose, Type } from 'class-transformer';
|
|
|
2
2
|
import { ArrayMaxSize, ArrayMinSize, Equals, IsArray, IsNotEmpty, IsString, Validate, ValidateNested } from 'class-validator';
|
|
3
3
|
import { DynamicFormValue } from '../../../dynamicForm/types/DynamicFormValue';
|
|
4
4
|
import { IsDynamicFormValues } from '../../../dynamicForm/validators/IsDynamicFormValues';
|
|
5
|
+
import { EVALUATE_BATCH_MAX_SUBJECTS } from '../../constants/BatchLimits';
|
|
5
6
|
import { EligibilityMessageTypeEnum } from '../../enums/EligibilityMessageTypeEnum';
|
|
6
7
|
|
|
7
8
|
/** Un sujeto del lote. No lleva hechos precargados: la evaluacion siempre es en vivo. */
|
|
@@ -16,7 +17,7 @@ export class EvaluateBatchSubject {
|
|
|
16
17
|
inputs: Record<string, DynamicFormValue>;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
/** Lote de hasta
|
|
20
|
+
/** Lote de hasta 1000 sujetos a evaluar en una corrida masiva. */
|
|
20
21
|
export class EvaluateBatchMessage {
|
|
21
22
|
@Expose()
|
|
22
23
|
@Equals(EligibilityMessageTypeEnum.EVALUATE_BATCH)
|
|
@@ -35,7 +36,7 @@ export class EvaluateBatchMessage {
|
|
|
35
36
|
@Expose()
|
|
36
37
|
@IsArray()
|
|
37
38
|
@ArrayMinSize(1)
|
|
38
|
-
@ArrayMaxSize(
|
|
39
|
+
@ArrayMaxSize(EVALUATE_BATCH_MAX_SUBJECTS)
|
|
39
40
|
@ValidateNested({ each: true })
|
|
40
41
|
@Type(() => EvaluateBatchSubject)
|
|
41
42
|
subjects: EvaluateBatchSubject[];
|
|
@@ -43,6 +43,8 @@ export * from './enums/MetricsDimensionEnum';
|
|
|
43
43
|
export * from './enums/RuleValueTypeEnum';
|
|
44
44
|
export * from './enums/RulesChatRoleEnum';
|
|
45
45
|
export * from './constants/BackofficeLimits';
|
|
46
|
+
export * from './constants/BatchLimits';
|
|
47
|
+
export * from './validators/IsRewardInputs';
|
|
46
48
|
export * from './dtos/backoffice/CampaignRequest';
|
|
47
49
|
export * from './dtos/backoffice/CampaignStatusRequest';
|
|
48
50
|
export * from './dtos/backoffice/CampaignResponse';
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import { InputFieldTypeEnum } from '../../dynamicForm/enums/InputFieldTypeEnum';
|
|
1
2
|
import { DynamicFormValue } from '../../dynamicForm/types/DynamicFormValue';
|
|
2
3
|
|
|
3
|
-
/**
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Valor de un input de `reward.inputs`: constante, tomado de un input de la evaluacion (spec B 5.1)
|
|
6
|
+
* o de un campo del usuario leído del datalake (`field`). `as` lo fija el backend al guardar (tipo de la dependencia destino).
|
|
7
|
+
*/
|
|
8
|
+
export type RewardInputRef = { const: DynamicFormValue } | { input: string } | { field: string; fallback?: DynamicFormValue; as?: InputFieldTypeEnum };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ValidationArguments, ValidatorConstraint, ValidatorConstraintInterface } from 'class-validator';
|
|
2
|
+
import { JsonValue } from '../../common/types/JsonValue';
|
|
3
|
+
import { isDynamicFormValue, isPlainObject } from '../../dynamicForm/helpers/isDynamicFormValue';
|
|
4
|
+
|
|
5
|
+
/** Valida `itemKey → inputKey → DynamicFormValue` (dos niveles exactos). */
|
|
6
|
+
@ValidatorConstraint({ name: 'IsRewardInputs', async: false })
|
|
7
|
+
export class IsRewardInputs implements ValidatorConstraintInterface {
|
|
8
|
+
validate(value: JsonValue, _args: ValidationArguments): boolean {
|
|
9
|
+
if (!isPlainObject(value)) return false;
|
|
10
|
+
return Object.values(value).every((inner) => isPlainObject(inner) && Object.values(inner).every(isDynamicFormValue));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
defaultMessage(_args: ValidationArguments): string {
|
|
14
|
+
return 'rewardInputs debe ser un mapa itemKey → inputKey → string | number | boolean | {from, to}';
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -6,3 +6,9 @@ export const RULES_INPUT_SOURCE = 'input';
|
|
|
6
6
|
export const RULES_MAX_INPUT_CONTRACT = 30;
|
|
7
7
|
/** Largo máximo (caracteres) del contenido de un turno del chat de `POST /generate`. */
|
|
8
8
|
export const RULES_CHAT_TURN_MAX_LENGTH = 4000;
|
|
9
|
+
/** Máximo de sujetos por query asíncrona de evaluación DATALAKE (`POST /evaluate/executions`). */
|
|
10
|
+
export const RULES_MAX_SUBJECTS_PER_DATALAKE_CALL = 1000;
|
|
11
|
+
/** Máximo de `returnFields` por llamada. */
|
|
12
|
+
export const RULES_MAX_RETURN_FIELDS = 20;
|
|
13
|
+
/** Id de campo devuelto: `fuente:campo` (campo del catálogo) o `tabla.ruta.hoja` (hoja del esquema aplanado de Glue). */
|
|
14
|
+
export const RETURN_FIELD_ID_PATTERN = /^(?:[a-z][a-z0-9-]*:[A-Za-z][A-Za-z0-9_]*|[a-z_][a-z0-9_]*(?:\.[a-z_][a-z0-9_]*){1,8})$/;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { Expose, Type } from 'class-transformer';
|
|
2
|
-
import { IsArray, IsISO8601, IsObject, IsOptional, IsString, ValidateNested } from 'class-validator';
|
|
2
|
+
import { ArrayMaxSize, IsArray, IsEnum, IsISO8601, IsObject, IsOptional, IsString, Matches, ValidateNested } from 'class-validator';
|
|
3
3
|
import { JsonValue } from '../../common';
|
|
4
|
+
import { InputField } from '../../dynamicForm/dtos/InputField';
|
|
4
5
|
import { DynamicFormValue } from '../../dynamicForm/types/DynamicFormValue';
|
|
6
|
+
import { RETURN_FIELD_ID_PATTERN, RULES_MAX_INPUT_CONTRACT, RULES_MAX_RETURN_FIELDS } from '../constants/RulesLimits';
|
|
7
|
+
import { EvaluationStrategyEnum } from '../enums/EvaluationStrategyEnum';
|
|
5
8
|
|
|
6
9
|
/** A quién se le evalúa la regla. */
|
|
7
10
|
export class RulesEvaluationSubject {
|
|
@@ -64,4 +67,26 @@ export class EvaluateRulesRequest {
|
|
|
64
67
|
@IsOptional()
|
|
65
68
|
@IsISO8601()
|
|
66
69
|
referenceAt?: string;
|
|
70
|
+
|
|
71
|
+
/** Estrategia de evaluación; ausente = `LIVE`. */
|
|
72
|
+
@Expose()
|
|
73
|
+
@IsOptional()
|
|
74
|
+
@IsEnum(EvaluationStrategyEnum)
|
|
75
|
+
evaluationStrategy?: EvaluationStrategyEnum;
|
|
76
|
+
|
|
77
|
+
/** Campos a devolver por sujeto (`fuente:campo` o `tabla.ruta.hoja`); máx. 20. Se leen del datalake. */
|
|
78
|
+
@Expose()
|
|
79
|
+
@IsOptional()
|
|
80
|
+
@IsArray()
|
|
81
|
+
@ArrayMaxSize(RULES_MAX_RETURN_FIELDS)
|
|
82
|
+
@Matches(RETURN_FIELD_ID_PATTERN, { each: true })
|
|
83
|
+
returnFields?: string[];
|
|
84
|
+
|
|
85
|
+
/** Contrato de la fuente `input` (tipos de las columnas `i_<llave>` en DATALAKE). */
|
|
86
|
+
@Expose()
|
|
87
|
+
@IsOptional()
|
|
88
|
+
@IsArray()
|
|
89
|
+
@ArrayMaxSize(RULES_MAX_INPUT_CONTRACT)
|
|
90
|
+
@IsObject({ each: true })
|
|
91
|
+
inputContract?: InputField[];
|
|
67
92
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { JsonValue } from '../../common';
|
|
1
2
|
import { RulesOutcomeEnum } from '../enums/RulesOutcomeEnum';
|
|
2
3
|
import { RulesTraceResponse } from './RulesTraceResponse';
|
|
3
4
|
|
|
@@ -11,6 +12,8 @@ export class RuleEvaluationResult {
|
|
|
11
12
|
trace?: RulesTraceResponse;
|
|
12
13
|
/** Solo si `outcome` es `ERROR`. */
|
|
13
14
|
errorMessage?: string;
|
|
15
|
+
/** Campos devueltos pedidos en `returnFields`: clave = id del campo; `null` = sin dato. */
|
|
16
|
+
returned?: Record<string, JsonValue>;
|
|
14
17
|
}
|
|
15
18
|
|
|
16
19
|
/** `POST /evaluate`: ordenado por regla y, dentro de cada regla, por `subjectIndex`. */
|