@fiado/type-kit 3.508.0 → 3.510.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/dynamicForm/dynamicForm.test.ts +78 -0
- package/_test_/unit/platformRbac/dtos/roleAssignmentsByScopeRefsDtos.test.ts +49 -0
- package/_test_/unit/retailOrg/dtos/sellerTableSources.test.ts +17 -0
- package/_test_/unit/retailWizard/sellerTableShapes.test.ts +9 -2
- package/_test_/unit/rewards/enums.test.ts +87 -0
- package/_test_/unit/rewards/grantMessages.test.ts +123 -0
- package/_test_/unit/rewards/readResponses.test.ts +136 -0
- package/_test_/unit/rewardsEligibility/events.test.ts +130 -0
- package/bin/benefitCenter/dtos/InputField.d.ts +1 -13
- package/bin/benefitCenter/dtos/InputField.js +3 -3
- package/bin/benefitCenter/dtos/InputSchema.d.ts +1 -6
- package/bin/benefitCenter/dtos/InputSchema.js +3 -3
- package/bin/benefitCenter/dtos/InputValidation.d.ts +1 -8
- package/bin/benefitCenter/dtos/InputValidation.js +3 -3
- package/bin/benefitCenter/dtos/SelectOption.d.ts +1 -4
- package/bin/benefitCenter/dtos/SelectOption.js +3 -3
- package/bin/benefitCenter/enums/InputFieldTypeEnum.d.ts +1 -10
- package/bin/benefitCenter/enums/InputFieldTypeEnum.js +3 -11
- package/bin/common/index.d.ts +1 -0
- package/bin/common/index.js +2 -0
- package/bin/common/types/JsonValue.d.ts +7 -0
- package/bin/common/types/JsonValue.js +2 -0
- package/bin/dynamicForm/dtos/InputField.d.ts +15 -0
- package/bin/dynamicForm/dtos/InputField.js +6 -0
- package/bin/dynamicForm/dtos/InputSchema.d.ts +6 -0
- package/bin/dynamicForm/dtos/InputSchema.js +6 -0
- package/bin/dynamicForm/dtos/InputValidation.d.ts +8 -0
- package/bin/dynamicForm/dtos/InputValidation.js +6 -0
- package/bin/dynamicForm/dtos/SelectOption.d.ts +4 -0
- package/bin/dynamicForm/dtos/SelectOption.js +6 -0
- package/bin/dynamicForm/enums/InputFieldTypeEnum.d.ts +18 -0
- package/bin/dynamicForm/enums/InputFieldTypeEnum.js +22 -0
- package/bin/dynamicForm/helpers/isDynamicFormValue.d.ts +7 -0
- package/bin/dynamicForm/helpers/isDynamicFormValue.js +19 -0
- package/bin/dynamicForm/index.d.ts +8 -0
- package/bin/dynamicForm/index.js +29 -0
- package/bin/dynamicForm/types/DynamicFormValue.d.ts +10 -0
- package/bin/dynamicForm/types/DynamicFormValue.js +2 -0
- package/bin/dynamicForm/validators/IsDynamicFormValues.d.ts +7 -0
- package/bin/dynamicForm/validators/IsDynamicFormValues.js +26 -0
- package/bin/index.d.ts +3 -0
- package/bin/index.js +12 -1
- package/bin/platformRbac/dtos/RoleAssignmentsByScopeRefsRequest.d.ts +4 -0
- package/bin/platformRbac/dtos/RoleAssignmentsByScopeRefsRequest.js +25 -0
- package/bin/platformRbac/dtos/RoleAssignmentsByScopeRefsResponse.d.ts +16 -0
- package/bin/platformRbac/dtos/RoleAssignmentsByScopeRefsResponse.js +2 -0
- package/bin/platformRbac/enums/ScopeRefLookupStatusEnum.d.ts +5 -0
- package/bin/platformRbac/enums/ScopeRefLookupStatusEnum.js +9 -0
- package/bin/platformRbac/index.d.ts +3 -0
- package/bin/platformRbac/index.js +3 -0
- package/bin/retailOrg/dtos/validation/PrivateSellerListResponse.d.ts +5 -1
- package/bin/retailWizard/dtos/responses/BackofficeSellerTableResponse.d.ts +21 -2
- package/bin/retailWizard/enums/SellerTableSourceStatusEnum.d.ts +3 -2
- package/bin/retailWizard/enums/SellerTableSourceStatusEnum.js +2 -1
- package/bin/rewards/constants/RewardsLimits.d.ts +2 -0
- package/bin/rewards/constants/RewardsLimits.js +5 -0
- package/bin/rewards/dtos/GrantFailedMessage.d.ts +13 -0
- package/bin/rewards/dtos/GrantFailedMessage.js +46 -0
- package/bin/rewards/dtos/GrantRequestedMessage.d.ts +21 -0
- package/bin/rewards/dtos/GrantRequestedMessage.js +61 -0
- package/bin/rewards/dtos/RewardChargeTo.d.ts +5 -0
- package/bin/rewards/dtos/RewardChargeTo.js +7 -0
- package/bin/rewards/dtos/RewardCost.d.ts +6 -0
- package/bin/rewards/dtos/RewardCost.js +7 -0
- package/bin/rewards/dtos/RewardDependency.d.ts +17 -0
- package/bin/rewards/dtos/RewardDependency.js +12 -0
- package/bin/rewards/dtos/RewardSource.d.ts +12 -0
- package/bin/rewards/dtos/RewardSource.js +40 -0
- package/bin/rewards/dtos/responses/GrantAttemptResponse.d.ts +15 -0
- package/bin/rewards/dtos/responses/GrantAttemptResponse.js +10 -0
- package/bin/rewards/dtos/responses/GrantItemResponse.d.ts +20 -0
- package/bin/rewards/dtos/responses/GrantItemResponse.js +6 -0
- package/bin/rewards/dtos/responses/GrantResponse.d.ts +23 -0
- package/bin/rewards/dtos/responses/GrantResponse.js +7 -0
- package/bin/rewards/dtos/responses/PackageContractItem.d.ts +12 -0
- package/bin/rewards/dtos/responses/PackageContractItem.js +7 -0
- package/bin/rewards/dtos/responses/PackageContractResponse.d.ts +13 -0
- package/bin/rewards/dtos/responses/PackageContractResponse.js +7 -0
- package/bin/rewards/enums/DependencyIfMissingEnum.d.ts +5 -0
- package/bin/rewards/enums/DependencyIfMissingEnum.js +9 -0
- package/bin/rewards/enums/GrantFailedReasonEnum.d.ts +11 -0
- package/bin/rewards/enums/GrantFailedReasonEnum.js +15 -0
- package/bin/rewards/enums/GrantItemStatusEnum.d.ts +6 -0
- package/bin/rewards/enums/GrantItemStatusEnum.js +10 -0
- package/bin/rewards/enums/GrantRejectReasonEnum.d.ts +6 -0
- package/bin/rewards/enums/GrantRejectReasonEnum.js +10 -0
- package/bin/rewards/enums/GrantStatusEnum.d.ts +8 -0
- package/bin/rewards/enums/GrantStatusEnum.js +12 -0
- package/bin/rewards/enums/ItemErrorCategoryEnum.d.ts +7 -0
- package/bin/rewards/enums/ItemErrorCategoryEnum.js +11 -0
- package/bin/rewards/enums/RewardStatusEnum.d.ts +4 -0
- package/bin/rewards/enums/RewardStatusEnum.js +8 -0
- package/bin/rewards/enums/RewardsErrorCodeEnum.d.ts +5 -0
- package/bin/rewards/enums/RewardsErrorCodeEnum.js +9 -0
- package/bin/rewards/enums/RewardsMessageTypeEnum.d.ts +4 -0
- package/bin/rewards/enums/RewardsMessageTypeEnum.js +8 -0
- package/bin/rewards/index.d.ts +24 -0
- package/bin/rewards/index.js +47 -0
- package/bin/rewards/types/RewardInputs.d.ts +3 -0
- package/bin/rewards/types/RewardInputs.js +2 -0
- package/bin/rewards/validators/IsRewardInputs.d.ts +7 -0
- package/bin/rewards/validators/IsRewardInputs.js +26 -0
- package/bin/rewards/validators/IsRewardTags.d.ts +7 -0
- package/bin/rewards/validators/IsRewardTags.js +28 -0
- package/bin/rewardsEligibility/dtos/EventRunResult.d.ts +11 -0
- package/bin/rewardsEligibility/dtos/EventRunResult.js +7 -0
- package/bin/rewardsEligibility/dtos/EventSource.d.ts +5 -0
- package/bin/rewardsEligibility/dtos/EventSource.js +30 -0
- package/bin/rewardsEligibility/dtos/GetRunResponse.d.ts +22 -0
- package/bin/rewardsEligibility/dtos/GetRunResponse.js +7 -0
- package/bin/rewardsEligibility/dtos/PostEventRequest.d.ts +14 -0
- package/bin/rewardsEligibility/dtos/PostEventRequest.js +47 -0
- package/bin/rewardsEligibility/dtos/PostEventResponse.d.ts +5 -0
- package/bin/rewardsEligibility/dtos/PostEventResponse.js +7 -0
- package/bin/rewardsEligibility/dtos/RunCounts.d.ts +12 -0
- package/bin/rewardsEligibility/dtos/RunCounts.js +7 -0
- package/bin/rewardsEligibility/dtos/RunResultItem.d.ts +16 -0
- package/bin/rewardsEligibility/dtos/RunResultItem.js +7 -0
- package/bin/rewardsEligibility/enums/EvaluationOutcomeEnum.d.ts +11 -0
- package/bin/rewardsEligibility/enums/EvaluationOutcomeEnum.js +15 -0
- package/bin/rewardsEligibility/enums/GrantRequestStatusEnum.d.ts +11 -0
- package/bin/rewardsEligibility/enums/GrantRequestStatusEnum.js +15 -0
- package/bin/rewardsEligibility/enums/RewardsEligibilityErrorCodeEnum.d.ts +8 -0
- package/bin/rewardsEligibility/enums/RewardsEligibilityErrorCodeEnum.js +12 -0
- package/bin/rewardsEligibility/enums/RunModeEnum.d.ts +4 -0
- package/bin/rewardsEligibility/enums/RunModeEnum.js +8 -0
- package/bin/rewardsEligibility/enums/RunStatusEnum.d.ts +9 -0
- package/bin/rewardsEligibility/enums/RunStatusEnum.js +13 -0
- package/bin/rewardsEligibility/enums/TriggerTypeEnum.d.ts +5 -0
- package/bin/rewardsEligibility/enums/TriggerTypeEnum.js +9 -0
- package/bin/rewardsEligibility/index.d.ts +13 -0
- package/bin/rewardsEligibility/index.js +31 -0
- package/package.json +1 -1
- package/src/benefitCenter/dtos/InputField.ts +2 -14
- package/src/benefitCenter/dtos/InputSchema.ts +2 -7
- package/src/benefitCenter/dtos/InputValidation.ts +2 -8
- package/src/benefitCenter/dtos/SelectOption.ts +2 -4
- package/src/benefitCenter/enums/InputFieldTypeEnum.ts +2 -10
- package/src/common/index.ts +4 -1
- package/src/common/types/JsonValue.ts +5 -0
- package/src/dynamicForm/dtos/InputField.ts +16 -0
- package/src/dynamicForm/dtos/InputSchema.ts +7 -0
- package/src/dynamicForm/dtos/InputValidation.ts +8 -0
- package/src/dynamicForm/dtos/SelectOption.ts +4 -0
- package/src/dynamicForm/enums/InputFieldTypeEnum.ts +18 -0
- package/src/dynamicForm/helpers/isDynamicFormValue.ts +16 -0
- package/src/dynamicForm/index.ts +17 -0
- package/src/dynamicForm/types/DynamicFormValue.ts +8 -0
- package/src/dynamicForm/validators/IsDynamicFormValues.ts +16 -0
- package/src/index.ts +14 -0
- package/src/platformRbac/dtos/RoleAssignmentsByScopeRefsRequest.ts +12 -0
- package/src/platformRbac/dtos/RoleAssignmentsByScopeRefsResponse.ts +22 -0
- package/src/platformRbac/enums/ScopeRefLookupStatusEnum.ts +5 -0
- package/src/platformRbac/index.ts +9 -0
- package/src/retailOrg/dtos/validation/PrivateSellerListResponse.ts +5 -1
- package/src/retailWizard/dtos/responses/BackofficeSellerTableResponse.ts +22 -2
- package/src/retailWizard/enums/SellerTableSourceStatusEnum.ts +2 -1
- package/src/rewards/constants/RewardsLimits.ts +2 -0
- package/src/rewards/dtos/GrantFailedMessage.ts +29 -0
- package/src/rewards/dtos/GrantRequestedMessage.ts +46 -0
- package/src/rewards/dtos/RewardChargeTo.ts +5 -0
- package/src/rewards/dtos/RewardCost.ts +7 -0
- package/src/rewards/dtos/RewardDependency.ts +18 -0
- package/src/rewards/dtos/RewardSource.ts +27 -0
- package/src/rewards/dtos/responses/GrantAttemptResponse.ts +16 -0
- package/src/rewards/dtos/responses/GrantItemResponse.ts +21 -0
- package/src/rewards/dtos/responses/GrantResponse.ts +24 -0
- package/src/rewards/dtos/responses/PackageContractItem.ts +13 -0
- package/src/rewards/dtos/responses/PackageContractResponse.ts +14 -0
- package/src/rewards/enums/DependencyIfMissingEnum.ts +5 -0
- package/src/rewards/enums/GrantFailedReasonEnum.ts +11 -0
- package/src/rewards/enums/GrantItemStatusEnum.ts +6 -0
- package/src/rewards/enums/GrantRejectReasonEnum.ts +6 -0
- package/src/rewards/enums/GrantStatusEnum.ts +8 -0
- package/src/rewards/enums/ItemErrorCategoryEnum.ts +7 -0
- package/src/rewards/enums/RewardStatusEnum.ts +4 -0
- package/src/rewards/enums/RewardsErrorCodeEnum.ts +5 -0
- package/src/rewards/enums/RewardsMessageTypeEnum.ts +4 -0
- package/src/rewards/index.ts +37 -0
- package/src/rewards/types/RewardInputs.ts +4 -0
- package/src/rewards/validators/IsRewardInputs.ts +18 -0
- package/src/rewards/validators/IsRewardTags.ts +18 -0
- package/src/rewardsEligibility/dtos/EventRunResult.ts +12 -0
- package/src/rewardsEligibility/dtos/EventSource.ts +15 -0
- package/src/rewardsEligibility/dtos/GetRunResponse.ts +23 -0
- package/src/rewardsEligibility/dtos/PostEventRequest.ts +32 -0
- package/src/rewardsEligibility/dtos/PostEventResponse.ts +6 -0
- package/src/rewardsEligibility/dtos/RunCounts.ts +12 -0
- package/src/rewardsEligibility/dtos/RunResultItem.ts +17 -0
- package/src/rewardsEligibility/enums/EvaluationOutcomeEnum.ts +11 -0
- package/src/rewardsEligibility/enums/GrantRequestStatusEnum.ts +11 -0
- package/src/rewardsEligibility/enums/RewardsEligibilityErrorCodeEnum.ts +8 -0
- package/src/rewardsEligibility/enums/RunModeEnum.ts +4 -0
- package/src/rewardsEligibility/enums/RunStatusEnum.ts +9 -0
- package/src/rewardsEligibility/enums/TriggerTypeEnum.ts +5 -0
- package/src/rewardsEligibility/index.ts +16 -0
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
/** `inputs`: `itemKey → inputKey → valor` (dos niveles exactos; la hoja es un DynamicFormValue). */
|
|
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(
|
|
11
|
+
(porItem) => isPlainObject(porItem) && Object.values(porItem).every(isDynamicFormValue),
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
defaultMessage(_args: ValidationArguments): string {
|
|
16
|
+
return 'inputs debe ser un mapa itemKey → (inputKey → string | number | boolean | {from, to})';
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ValidationArguments, ValidatorConstraint, ValidatorConstraintInterface } from 'class-validator';
|
|
2
|
+
import { JsonValue } from '../../common/types/JsonValue';
|
|
3
|
+
import { isPlainObject } from '../../dynamicForm/helpers/isDynamicFormValue';
|
|
4
|
+
import { REWARD_TAGS_MAX_KEYS } from '../constants/RewardsLimits';
|
|
5
|
+
|
|
6
|
+
/** `source.tags`: mapa texto → texto, máximo `REWARD_TAGS_MAX_KEYS` llaves. */
|
|
7
|
+
@ValidatorConstraint({ name: 'IsRewardTags', async: false })
|
|
8
|
+
export class IsRewardTags implements ValidatorConstraintInterface {
|
|
9
|
+
validate(value: JsonValue, _args: ValidationArguments): boolean {
|
|
10
|
+
if (!isPlainObject(value)) return false;
|
|
11
|
+
const entries = Object.entries(value);
|
|
12
|
+
return entries.length <= REWARD_TAGS_MAX_KEYS && entries.every(([, tag]) => typeof tag === 'string');
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
defaultMessage(_args: ValidationArguments): string {
|
|
16
|
+
return `tags debe ser un mapa texto → texto de máximo ${REWARD_TAGS_MAX_KEYS} llaves`;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EvaluationOutcomeEnum } from '../enums/EvaluationOutcomeEnum';
|
|
2
|
+
import { GrantRequestStatusEnum } from '../enums/GrantRequestStatusEnum';
|
|
3
|
+
|
|
4
|
+
/** Resultado de una evaluación suscrita al evento (una corrida con lote de 1). */
|
|
5
|
+
export class EventRunResult {
|
|
6
|
+
evaluationId: string;
|
|
7
|
+
runId: string;
|
|
8
|
+
outcome: EvaluationOutcomeEnum;
|
|
9
|
+
grantStatus: GrantRequestStatusEnum;
|
|
10
|
+
/** true si el `idempotencyKey` ya había creado esta corrida. */
|
|
11
|
+
idempotentReplay: boolean;
|
|
12
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsNotEmpty, IsString } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
/** Quién emite el evento. El validador no interpreta `reference`. */
|
|
5
|
+
export class EventSource {
|
|
6
|
+
@Expose()
|
|
7
|
+
@IsString()
|
|
8
|
+
@IsNotEmpty()
|
|
9
|
+
service!: string;
|
|
10
|
+
|
|
11
|
+
@Expose()
|
|
12
|
+
@IsString()
|
|
13
|
+
@IsNotEmpty()
|
|
14
|
+
reference!: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { RunModeEnum } from '../enums/RunModeEnum';
|
|
2
|
+
import { RunStatusEnum } from '../enums/RunStatusEnum';
|
|
3
|
+
import { TriggerTypeEnum } from '../enums/TriggerTypeEnum';
|
|
4
|
+
import { RunCounts } from './RunCounts';
|
|
5
|
+
import { RunResultItem } from './RunResultItem';
|
|
6
|
+
|
|
7
|
+
/** Respuesta de `GET /runs/{id}` (spec B 6.2). */
|
|
8
|
+
export class GetRunResponse {
|
|
9
|
+
runId: string;
|
|
10
|
+
evaluationId: string;
|
|
11
|
+
trigger: TriggerTypeEnum;
|
|
12
|
+
mode: RunModeEnum;
|
|
13
|
+
status: RunStatusEnum;
|
|
14
|
+
counts: RunCounts;
|
|
15
|
+
/** Una página de resultados. */
|
|
16
|
+
results: RunResultItem[];
|
|
17
|
+
/** Presente si hay más resultados. */
|
|
18
|
+
nextToken?: string;
|
|
19
|
+
/** Epoch en milisegundos. */
|
|
20
|
+
createdAt: number;
|
|
21
|
+
/** Epoch en milisegundos. */
|
|
22
|
+
updatedAt: number;
|
|
23
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Expose, Type } from 'class-transformer';
|
|
2
|
+
import { IsNotEmpty, IsString, Validate, ValidateNested } from 'class-validator';
|
|
3
|
+
import { DynamicFormValue } from '../../dynamicForm/types/DynamicFormValue';
|
|
4
|
+
import { IsDynamicFormValues } from '../../dynamicForm/validators/IsDynamicFormValues';
|
|
5
|
+
import { EventSource } from './EventSource';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Cuerpo de `POST /events` (spec B 6.1). El emisor informa qué pasó y quién participó; NO decide
|
|
9
|
+
* la elegibilidad (E3). Parsear con `excludeExtraneousValues: true`: cualquier campo extra
|
|
10
|
+
* (p. ej. `prefetchedFacts`) se descarta.
|
|
11
|
+
*/
|
|
12
|
+
export class PostEventRequest {
|
|
13
|
+
@Expose()
|
|
14
|
+
@IsString()
|
|
15
|
+
@IsNotEmpty()
|
|
16
|
+
eventKey!: string;
|
|
17
|
+
|
|
18
|
+
@Expose()
|
|
19
|
+
@IsString()
|
|
20
|
+
@IsNotEmpty()
|
|
21
|
+
idempotencyKey!: string;
|
|
22
|
+
|
|
23
|
+
@Expose()
|
|
24
|
+
@ValidateNested()
|
|
25
|
+
@Type(() => EventSource)
|
|
26
|
+
source!: EventSource;
|
|
27
|
+
|
|
28
|
+
/** Los `fields` del tipo de evento (`RewardEventType_GT`), con su valor. */
|
|
29
|
+
@Expose()
|
|
30
|
+
@Validate(IsDynamicFormValues)
|
|
31
|
+
inputs!: Record<string, DynamicFormValue>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Conteos de una corrida (mismos nombres que las métricas, spec B 5.7). */
|
|
2
|
+
export class RunCounts {
|
|
3
|
+
evaluated: number;
|
|
4
|
+
match: number;
|
|
5
|
+
noMatch: number;
|
|
6
|
+
error: number;
|
|
7
|
+
alreadyGranted: number;
|
|
8
|
+
quotaExhausted: number;
|
|
9
|
+
excluded: number;
|
|
10
|
+
requested: number;
|
|
11
|
+
requestFailed: number;
|
|
12
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EvaluationOutcomeEnum } from '../enums/EvaluationOutcomeEnum';
|
|
2
|
+
import { GrantRequestStatusEnum } from '../enums/GrantRequestStatusEnum';
|
|
3
|
+
|
|
4
|
+
/** Un resultado por sujeto, SIN traza (la traza es del backoffice). Asumido hasta cerrar P-7. */
|
|
5
|
+
export class RunResultItem {
|
|
6
|
+
subjectKey: string;
|
|
7
|
+
beneficiaryDirectoryId: string;
|
|
8
|
+
campaignId: string;
|
|
9
|
+
evaluationId: string;
|
|
10
|
+
packageId: string;
|
|
11
|
+
outcome: EvaluationOutcomeEnum;
|
|
12
|
+
grantStatus: GrantRequestStatusEnum;
|
|
13
|
+
/** `grantIdFor("rewards-eligibility", idempotencyKey)`; cruza con `GET /grants/{id}` de rewards. */
|
|
14
|
+
grantId?: string;
|
|
15
|
+
/** Solo si `outcome` es ERROR. */
|
|
16
|
+
errorMessage?: string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export enum EvaluationOutcomeEnum {
|
|
2
|
+
MATCH = 'MATCH',
|
|
3
|
+
NO_MATCH = 'NO_MATCH',
|
|
4
|
+
ERROR = 'ERROR',
|
|
5
|
+
/** La política de frecuencia lo bloqueó. */
|
|
6
|
+
ALREADY_GRANTED = 'ALREADY_GRANTED',
|
|
7
|
+
/** Calificó, pero la campaña no tenía cupo. */
|
|
8
|
+
QUOTA_EXHAUSTED = 'QUOTA_EXHAUSTED',
|
|
9
|
+
/** El operador lo sacó al aprobar. */
|
|
10
|
+
EXCLUDED = 'EXCLUDED',
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export enum GrantRequestStatusEnum {
|
|
2
|
+
NOT_APPLICABLE = 'NOT_APPLICABLE',
|
|
3
|
+
PENDING_APPROVAL = 'PENDING_APPROVAL',
|
|
4
|
+
/** Reservado, esperando su tramo de publicación. */
|
|
5
|
+
QUEUED = 'QUEUED',
|
|
6
|
+
/** Publicado en RewardsGrantQueue al instante (en línea). */
|
|
7
|
+
REQUESTED = 'REQUESTED',
|
|
8
|
+
/** La publicación falló o llegó GRANT_FAILED. */
|
|
9
|
+
REQUEST_FAILED = 'REQUEST_FAILED',
|
|
10
|
+
CANCELLED = 'CANCELLED',
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export enum RewardsEligibilityErrorCodeEnum {
|
|
2
|
+
/** 400: faltan campos obligatorios del evento o tienen tipo inválido. */
|
|
3
|
+
INPUT_INVALID = 'INPUT_INVALID',
|
|
4
|
+
/** 404: el eventKey no existe o está inactivo. */
|
|
5
|
+
EVENT_TYPE_NOT_FOUND = 'EVENT_TYPE_NOT_FOUND',
|
|
6
|
+
/** 404: GET /runs/{id} sin corrida. */
|
|
7
|
+
RUN_NOT_FOUND = 'RUN_NOT_FOUND',
|
|
8
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//Enums
|
|
2
|
+
export * from './enums/EvaluationOutcomeEnum';
|
|
3
|
+
export * from './enums/GrantRequestStatusEnum';
|
|
4
|
+
export * from './enums/RunStatusEnum';
|
|
5
|
+
export * from './enums/RunModeEnum';
|
|
6
|
+
export * from './enums/TriggerTypeEnum';
|
|
7
|
+
export * from './enums/RewardsEligibilityErrorCodeEnum';
|
|
8
|
+
|
|
9
|
+
//DTOs
|
|
10
|
+
export * from './dtos/EventSource';
|
|
11
|
+
export * from './dtos/PostEventRequest';
|
|
12
|
+
export * from './dtos/EventRunResult';
|
|
13
|
+
export * from './dtos/PostEventResponse';
|
|
14
|
+
export * from './dtos/RunCounts';
|
|
15
|
+
export * from './dtos/RunResultItem';
|
|
16
|
+
export * from './dtos/GetRunResponse';
|