@fiado/type-kit 3.530.0 → 3.531.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/backofficeBarrel.test.ts +5 -1
- package/_test_/unit/rewardsEligibility/catalogDtos.test.ts +1 -7
- package/_test_/unit/rewardsEligibility/evaluationDtos.test.ts +7 -0
- package/bin/rewardsEligibility/dtos/EvaluationTrigger.d.ts +0 -3
- package/bin/rewardsEligibility/index.d.ts +0 -2
- package/bin/rewardsEligibility/index.js +0 -2
- package/package.json +1 -1
- package/src/rewardsEligibility/dtos/EvaluationTrigger.ts +0 -3
- package/src/rewardsEligibility/index.ts +0 -2
- package/bin/rewardsEligibility/dtos/PopulationRef.d.ts +0 -6
- package/bin/rewardsEligibility/dtos/PopulationRef.js +0 -7
- package/bin/rewardsEligibility/dtos/backoffice/PopulationSourceResponse.d.ts +0 -11
- package/bin/rewardsEligibility/dtos/backoffice/PopulationSourceResponse.js +0 -7
- package/src/rewardsEligibility/dtos/PopulationRef.ts +0 -7
- package/src/rewardsEligibility/dtos/backoffice/PopulationSourceResponse.ts +0 -12
|
@@ -6,7 +6,7 @@ describe('barrel rewardsEligibility incluye el backoffice', () => {
|
|
|
6
6
|
'CampaignRequest', 'CampaignStatusRequest', 'CampaignResponse', 'CampaignListResponse', 'QuotaUsageResponse', 'CampaignSummaryResponse',
|
|
7
7
|
'EventTypeRequest', 'EventTypeResponse', 'EventTypeListResponse', 'EvaluationRequest', 'EvaluationStatusRequest', 'EvaluationResponse',
|
|
8
8
|
'EvaluationListResponse', 'ResultTraceResponse', 'TraceGroupResponse', 'TraceConditionResponse', 'SimulateRequest', 'SimulateResponse',
|
|
9
|
-
'RuleCatalogResponse', 'RuleCatalogSourceResponse', 'RuleCatalogFieldResponse', '
|
|
9
|
+
'RuleCatalogResponse', 'RuleCatalogSourceResponse', 'RuleCatalogFieldResponse', 'InputTypeResponse',
|
|
10
10
|
'CreateRunRequest', 'PopulationRunRequest', 'ApproveRunRequest', 'QuotaImpactResponse', 'RunResponse', 'RunListResponse',
|
|
11
11
|
'RunResultResponse', 'RunResultListResponse', 'CreateRunResponse', 'MetricsPointResponse', 'FailedConditionStatResponse', 'MetricsQuery',
|
|
12
12
|
'MetricsDimensionEnum', 'RuleValueTypeEnum', 'ELIGIBILITY_ID_PATTERN', 'EVENT_KEY_PATTERN', 'REQUEST_ID_PATTERN', 'MAX_QUOTAS_PER_CAMPAIGN',
|
|
@@ -20,4 +20,8 @@ describe('barrel rewardsEligibility incluye el backoffice', () => {
|
|
|
20
20
|
])('exporta %s', (name) => {
|
|
21
21
|
expect((kit as Record<string, object | string | number | RegExp>)[name]).toBeDefined();
|
|
22
22
|
});
|
|
23
|
+
|
|
24
|
+
it.each(['PopulationSourceResponse', 'PopulationRef'])('ya no exporta %s (reemplazado por segmentos)', (name) => {
|
|
25
|
+
expect((kit as Record<string, object | string | number | RegExp>)[name]).toBeUndefined();
|
|
26
|
+
});
|
|
23
27
|
});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { RuleValueTypeEnum } from '../../../src/rewardsEligibility/enums/RuleValueTypeEnum';
|
|
2
2
|
import { InputFieldTypeEnum } from '../../../src/dynamicForm/enums/InputFieldTypeEnum';
|
|
3
3
|
import type { RuleCatalogResponse } from '../../../src/rewardsEligibility/dtos/backoffice/RuleCatalogResponse';
|
|
4
|
-
import type { PopulationSourceResponse } from '../../../src/rewardsEligibility/dtos/backoffice/PopulationSourceResponse';
|
|
5
4
|
import type { InputTypeResponse } from '../../../src/rewardsEligibility/dtos/backoffice/InputTypeResponse';
|
|
6
5
|
|
|
7
6
|
describe('DTOs de catálogos (forma)', () => {
|
|
@@ -15,13 +14,8 @@ describe('DTOs de catálogos (forma)', () => {
|
|
|
15
14
|
};
|
|
16
15
|
expect(catalog.sources[0]?.fields[0]?.valueType).toBe('NUMBER');
|
|
17
16
|
});
|
|
18
|
-
it('
|
|
19
|
-
const source: PopulationSourceResponse = {
|
|
20
|
-
source: 'TX_ACTIVE_IN_WINDOW', label: 'Con transacciones', description: 'd',
|
|
21
|
-
paramsSchema: [{ key: 'window', type: InputFieldTypeEnum.TEXT, label: 'Ventana', required: true }], provides: ['directoryId'],
|
|
22
|
-
};
|
|
17
|
+
it('un tipo de input', () => {
|
|
23
18
|
const type: InputTypeResponse = { type: InputFieldTypeEnum.DIRECTORY, label: 'Usuario' };
|
|
24
|
-
expect(source.provides).toEqual(['directoryId']);
|
|
25
19
|
expect(type.type).toBe('DIRECTORY');
|
|
26
20
|
});
|
|
27
21
|
});
|
|
@@ -3,6 +3,7 @@ import { plainToInstance } from 'class-transformer';
|
|
|
3
3
|
import { validate } from 'class-validator';
|
|
4
4
|
import { EvaluationRequest } from '../../../src/rewardsEligibility/dtos/backoffice/EvaluationRequest';
|
|
5
5
|
import { EvaluationStatusRequest } from '../../../src/rewardsEligibility/dtos/backoffice/EvaluationStatusRequest';
|
|
6
|
+
import { EvaluationTrigger } from '../../../src/rewardsEligibility/dtos/EvaluationTrigger';
|
|
6
7
|
import { SimulateRequest } from '../../../src/rewardsEligibility/dtos/backoffice/SimulateRequest';
|
|
7
8
|
|
|
8
9
|
const parse = <T extends object>(cls: new () => T, value: object): T => plainToInstance(cls, value, { excludeExtraneousValues: true });
|
|
@@ -51,3 +52,9 @@ describe('EvaluationStatusRequest / SimulateRequest', () => {
|
|
|
51
52
|
expect((await validate(parse(SimulateRequest, { evaluationId: 'x' }))).length).toBeGreaterThan(0);
|
|
52
53
|
});
|
|
53
54
|
});
|
|
55
|
+
|
|
56
|
+
describe('EvaluationTrigger', () => {
|
|
57
|
+
it('ya no declara `population` (reemplazado por populationSegmentId de la evaluacion)', () => {
|
|
58
|
+
expect('population' in new EvaluationTrigger()).toBe(false);
|
|
59
|
+
});
|
|
60
|
+
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ApprovalModeEnum } from '../enums/ApprovalModeEnum';
|
|
2
2
|
import { TriggerTypeEnum } from '../enums/TriggerTypeEnum';
|
|
3
|
-
import { PopulationRef } from './PopulationRef';
|
|
4
3
|
/** Disparador de una evaluacion (spec B 5.1). Una evaluacion tiene a lo sumo UN disparador `EVENT`. */
|
|
5
4
|
export declare class EvaluationTrigger {
|
|
6
5
|
type: TriggerTypeEnum;
|
|
@@ -9,6 +8,4 @@ export declare class EvaluationTrigger {
|
|
|
9
8
|
eventKey?: string;
|
|
10
9
|
/** Solo `CRON`: cron de 5 campos, granularidad de 15 minutos (fase 4). */
|
|
11
10
|
schedule?: string;
|
|
12
|
-
/** Solo `CRON` (fase 4). */
|
|
13
|
-
population?: PopulationRef;
|
|
14
11
|
}
|
|
@@ -26,7 +26,6 @@ export * from './types/RewardInputRef';
|
|
|
26
26
|
export * from './dtos/GrantPolicy';
|
|
27
27
|
export * from './dtos/CampaignQuota';
|
|
28
28
|
export * from './dtos/CampaignAlerts';
|
|
29
|
-
export * from './dtos/PopulationRef';
|
|
30
29
|
export * from './dtos/EvaluationReward';
|
|
31
30
|
export * from './dtos/EvaluationTrigger';
|
|
32
31
|
export * from './enums/MetricsDimensionEnum';
|
|
@@ -50,7 +49,6 @@ export * from './dtos/backoffice/ResultTraceResponse';
|
|
|
50
49
|
export * from './dtos/backoffice/SimulateRequest';
|
|
51
50
|
export * from './dtos/backoffice/SimulateResponse';
|
|
52
51
|
export * from './dtos/backoffice/RuleCatalogResponse';
|
|
53
|
-
export * from './dtos/backoffice/PopulationSourceResponse';
|
|
54
52
|
export * from './dtos/backoffice/InputTypeResponse';
|
|
55
53
|
export * from './dtos/backoffice/RulesChatTurn';
|
|
56
54
|
export * from './dtos/backoffice/GenerateRulesRequest';
|
|
@@ -47,7 +47,6 @@ __exportStar(require("./types/RewardInputRef"), exports);
|
|
|
47
47
|
__exportStar(require("./dtos/GrantPolicy"), exports);
|
|
48
48
|
__exportStar(require("./dtos/CampaignQuota"), exports);
|
|
49
49
|
__exportStar(require("./dtos/CampaignAlerts"), exports);
|
|
50
|
-
__exportStar(require("./dtos/PopulationRef"), exports);
|
|
51
50
|
__exportStar(require("./dtos/EvaluationReward"), exports);
|
|
52
51
|
__exportStar(require("./dtos/EvaluationTrigger"), exports);
|
|
53
52
|
//Backoffice (fase 3): enums, constantes y DTOs
|
|
@@ -72,7 +71,6 @@ __exportStar(require("./dtos/backoffice/ResultTraceResponse"), exports);
|
|
|
72
71
|
__exportStar(require("./dtos/backoffice/SimulateRequest"), exports);
|
|
73
72
|
__exportStar(require("./dtos/backoffice/SimulateResponse"), exports);
|
|
74
73
|
__exportStar(require("./dtos/backoffice/RuleCatalogResponse"), exports);
|
|
75
|
-
__exportStar(require("./dtos/backoffice/PopulationSourceResponse"), exports);
|
|
76
74
|
__exportStar(require("./dtos/backoffice/InputTypeResponse"), exports);
|
|
77
75
|
__exportStar(require("./dtos/backoffice/RulesChatTurn"), exports);
|
|
78
76
|
__exportStar(require("./dtos/backoffice/GenerateRulesRequest"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ApprovalModeEnum } from '../enums/ApprovalModeEnum';
|
|
2
2
|
import { TriggerTypeEnum } from '../enums/TriggerTypeEnum';
|
|
3
|
-
import { PopulationRef } from './PopulationRef';
|
|
4
3
|
|
|
5
4
|
/** Disparador de una evaluacion (spec B 5.1). Una evaluacion tiene a lo sumo UN disparador `EVENT`. */
|
|
6
5
|
export class EvaluationTrigger {
|
|
@@ -10,6 +9,4 @@ export class EvaluationTrigger {
|
|
|
10
9
|
eventKey?: string;
|
|
11
10
|
/** Solo `CRON`: cron de 5 campos, granularidad de 15 minutos (fase 4). */
|
|
12
11
|
schedule?: string;
|
|
13
|
-
/** Solo `CRON` (fase 4). */
|
|
14
|
-
population?: PopulationRef;
|
|
15
12
|
}
|
|
@@ -35,7 +35,6 @@ export * from './types/RewardInputRef';
|
|
|
35
35
|
export * from './dtos/GrantPolicy';
|
|
36
36
|
export * from './dtos/CampaignQuota';
|
|
37
37
|
export * from './dtos/CampaignAlerts';
|
|
38
|
-
export * from './dtos/PopulationRef';
|
|
39
38
|
export * from './dtos/EvaluationReward';
|
|
40
39
|
export * from './dtos/EvaluationTrigger';
|
|
41
40
|
|
|
@@ -61,7 +60,6 @@ export * from './dtos/backoffice/ResultTraceResponse';
|
|
|
61
60
|
export * from './dtos/backoffice/SimulateRequest';
|
|
62
61
|
export * from './dtos/backoffice/SimulateResponse';
|
|
63
62
|
export * from './dtos/backoffice/RuleCatalogResponse';
|
|
64
|
-
export * from './dtos/backoffice/PopulationSourceResponse';
|
|
65
63
|
export * from './dtos/backoffice/InputTypeResponse';
|
|
66
64
|
export * from './dtos/backoffice/RulesChatTurn';
|
|
67
65
|
export * from './dtos/backoffice/GenerateRulesRequest';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { InputField } from '../../../dynamicForm/dtos/InputField';
|
|
2
|
-
/** `GET /population-sources`: fuente de población para un disparador `CRON` (la ejecución llega en la fase 4). */
|
|
3
|
-
export declare class PopulationSourceResponse {
|
|
4
|
-
source: string;
|
|
5
|
-
label: string;
|
|
6
|
-
description: string;
|
|
7
|
-
/** Formulario de los params de la fuente. */
|
|
8
|
-
paramsSchema: InputField[];
|
|
9
|
-
/** Keys de input que la fuente provee por sujeto. */
|
|
10
|
-
provides: string[];
|
|
11
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PopulationSourceResponse = void 0;
|
|
4
|
-
/** `GET /population-sources`: fuente de población para un disparador `CRON` (la ejecución llega en la fase 4). */
|
|
5
|
-
class PopulationSourceResponse {
|
|
6
|
-
}
|
|
7
|
-
exports.PopulationSourceResponse = PopulationSourceResponse;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { InputField } from '../../../dynamicForm/dtos/InputField';
|
|
2
|
-
|
|
3
|
-
/** `GET /population-sources`: fuente de población para un disparador `CRON` (la ejecución llega en la fase 4). */
|
|
4
|
-
export class PopulationSourceResponse {
|
|
5
|
-
source: string;
|
|
6
|
-
label: string;
|
|
7
|
-
description: string;
|
|
8
|
-
/** Formulario de los params de la fuente. */
|
|
9
|
-
paramsSchema: InputField[];
|
|
10
|
-
/** Keys de input que la fuente provee por sujeto. */
|
|
11
|
-
provides: string[];
|
|
12
|
-
}
|