@fiado/type-kit 3.513.0 → 3.515.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/rewards/backoffice.test.ts +96 -0
- package/_test_/unit/rewardsEligibility/domainDtos.test.ts +40 -0
- package/_test_/unit/rewardsEligibility/domainEnums.test.ts +35 -0
- package/bin/rewards/constants/BackofficeLimits.d.ts +6 -0
- package/bin/rewards/constants/BackofficeLimits.js +9 -0
- package/bin/rewards/dtos/backoffice/CatalogItemListResponse.d.ts +6 -0
- package/bin/rewards/dtos/backoffice/CatalogItemListResponse.js +6 -0
- package/bin/rewards/dtos/backoffice/CatalogItemRequest.d.ts +19 -0
- package/bin/rewards/dtos/backoffice/CatalogItemRequest.js +70 -0
- package/bin/rewards/dtos/backoffice/CatalogItemResponse.d.ts +23 -0
- package/bin/rewards/dtos/backoffice/CatalogItemResponse.js +6 -0
- package/bin/rewards/dtos/backoffice/PackageItemRequest.d.ts +4 -0
- package/bin/rewards/dtos/backoffice/PackageItemRequest.js +30 -0
- package/bin/rewards/dtos/backoffice/PackageListResponse.d.ts +6 -0
- package/bin/rewards/dtos/backoffice/PackageListResponse.js +6 -0
- package/bin/rewards/dtos/backoffice/PackageRequest.d.ts +9 -0
- package/bin/rewards/dtos/backoffice/PackageRequest.js +47 -0
- package/bin/rewards/dtos/backoffice/PackageResponse.d.ts +18 -0
- package/bin/rewards/dtos/backoffice/PackageResponse.js +9 -0
- package/bin/rewards/dtos/backoffice/RewardChargeToInput.d.ts +4 -0
- package/bin/rewards/dtos/backoffice/RewardChargeToInput.js +31 -0
- package/bin/rewards/dtos/backoffice/RewardCostInput.d.ts +5 -0
- package/bin/rewards/dtos/backoffice/RewardCostInput.js +29 -0
- package/bin/rewards/dtos/backoffice/RewardTypeResponse.d.ts +6 -0
- package/bin/rewards/dtos/backoffice/RewardTypeResponse.js +7 -0
- package/bin/rewards/index.d.ts +11 -0
- package/bin/rewards/index.js +13 -0
- package/bin/rewardsEligibility/dtos/CampaignAlerts.d.ts +4 -0
- package/bin/rewardsEligibility/dtos/CampaignAlerts.js +7 -0
- package/bin/rewardsEligibility/dtos/CampaignQuota.d.ts +8 -0
- package/bin/rewardsEligibility/dtos/CampaignQuota.js +7 -0
- package/bin/rewardsEligibility/dtos/EvaluationReward.d.ts +6 -0
- package/bin/rewardsEligibility/dtos/EvaluationReward.js +7 -0
- package/bin/rewardsEligibility/dtos/EvaluationTrigger.d.ts +14 -0
- package/bin/rewardsEligibility/dtos/EvaluationTrigger.js +7 -0
- package/bin/rewardsEligibility/dtos/GrantPolicy.d.ts +12 -0
- package/bin/rewardsEligibility/dtos/GrantPolicy.js +7 -0
- package/bin/rewardsEligibility/dtos/PopulationRef.d.ts +6 -0
- package/bin/rewardsEligibility/dtos/PopulationRef.js +7 -0
- package/bin/rewardsEligibility/enums/ApprovalModeEnum.d.ts +4 -0
- package/bin/rewardsEligibility/enums/ApprovalModeEnum.js +8 -0
- package/bin/rewardsEligibility/enums/BatchPublishStateEnum.d.ts +7 -0
- package/bin/rewardsEligibility/enums/BatchPublishStateEnum.js +11 -0
- package/bin/rewardsEligibility/enums/CampaignPausedReasonEnum.d.ts +7 -0
- package/bin/rewardsEligibility/enums/CampaignPausedReasonEnum.js +11 -0
- package/bin/rewardsEligibility/enums/CampaignStatusEnum.d.ts +8 -0
- package/bin/rewardsEligibility/enums/CampaignStatusEnum.js +12 -0
- package/bin/rewardsEligibility/enums/EvaluationStatusEnum.d.ts +6 -0
- package/bin/rewardsEligibility/enums/EvaluationStatusEnum.js +10 -0
- package/bin/rewardsEligibility/enums/GrantPeriodEnum.d.ts +5 -0
- package/bin/rewardsEligibility/enums/GrantPeriodEnum.js +9 -0
- package/bin/rewardsEligibility/enums/GrantPolicyModeEnum.d.ts +11 -0
- package/bin/rewardsEligibility/enums/GrantPolicyModeEnum.js +15 -0
- package/bin/rewardsEligibility/enums/LedgerStatusEnum.d.ts +5 -0
- package/bin/rewardsEligibility/enums/LedgerStatusEnum.js +9 -0
- package/bin/rewardsEligibility/enums/QuotaExhaustedActionEnum.d.ts +7 -0
- package/bin/rewardsEligibility/enums/QuotaExhaustedActionEnum.js +11 -0
- package/bin/rewardsEligibility/enums/QuotaPeriodEnum.d.ts +7 -0
- package/bin/rewardsEligibility/enums/QuotaPeriodEnum.js +11 -0
- package/bin/rewardsEligibility/enums/TraceOriginEnum.d.ts +5 -0
- package/bin/rewardsEligibility/enums/TraceOriginEnum.js +9 -0
- package/bin/rewardsEligibility/index.d.ts +18 -0
- package/bin/rewardsEligibility/index.js +21 -0
- package/bin/rewardsEligibility/types/RewardInputRef.d.ts +7 -0
- package/bin/rewardsEligibility/types/RewardInputRef.js +2 -0
- package/package.json +1 -1
- package/src/rewards/constants/BackofficeLimits.ts +6 -0
- package/src/rewards/dtos/backoffice/CatalogItemListResponse.ts +7 -0
- package/src/rewards/dtos/backoffice/CatalogItemRequest.ts +52 -0
- package/src/rewards/dtos/backoffice/CatalogItemResponse.ts +22 -0
- package/src/rewards/dtos/backoffice/PackageItemRequest.ts +15 -0
- package/src/rewards/dtos/backoffice/PackageListResponse.ts +7 -0
- package/src/rewards/dtos/backoffice/PackageRequest.ts +31 -0
- package/src/rewards/dtos/backoffice/PackageResponse.ts +20 -0
- package/src/rewards/dtos/backoffice/RewardChargeToInput.ts +16 -0
- package/src/rewards/dtos/backoffice/RewardCostInput.ts +14 -0
- package/src/rewards/dtos/backoffice/RewardTypeResponse.ts +7 -0
- package/src/rewards/index.ts +15 -0
- package/src/rewardsEligibility/dtos/CampaignAlerts.ts +4 -0
- package/src/rewardsEligibility/dtos/CampaignQuota.ts +9 -0
- package/src/rewardsEligibility/dtos/EvaluationReward.ts +7 -0
- package/src/rewardsEligibility/dtos/EvaluationTrigger.ts +15 -0
- package/src/rewardsEligibility/dtos/GrantPolicy.ts +13 -0
- package/src/rewardsEligibility/dtos/PopulationRef.ts +7 -0
- package/src/rewardsEligibility/enums/ApprovalModeEnum.ts +4 -0
- package/src/rewardsEligibility/enums/BatchPublishStateEnum.ts +7 -0
- package/src/rewardsEligibility/enums/CampaignPausedReasonEnum.ts +7 -0
- package/src/rewardsEligibility/enums/CampaignStatusEnum.ts +8 -0
- package/src/rewardsEligibility/enums/EvaluationStatusEnum.ts +6 -0
- package/src/rewardsEligibility/enums/GrantPeriodEnum.ts +5 -0
- package/src/rewardsEligibility/enums/GrantPolicyModeEnum.ts +11 -0
- package/src/rewardsEligibility/enums/LedgerStatusEnum.ts +5 -0
- package/src/rewardsEligibility/enums/QuotaExhaustedActionEnum.ts +7 -0
- package/src/rewardsEligibility/enums/QuotaPeriodEnum.ts +7 -0
- package/src/rewardsEligibility/enums/TraceOriginEnum.ts +5 -0
- package/src/rewardsEligibility/index.ts +24 -0
- package/src/rewardsEligibility/types/RewardInputRef.ts +4 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RewardInputRef } from '../types/RewardInputRef';
|
|
2
|
+
|
|
3
|
+
/** Que se pide a rewards-business al calificar: el paquete y sus inputs `itemKey -> inputKey -> valor`. */
|
|
4
|
+
export class EvaluationReward {
|
|
5
|
+
packageId: string;
|
|
6
|
+
inputs: Record<string, Record<string, RewardInputRef>>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ApprovalModeEnum } from '../enums/ApprovalModeEnum';
|
|
2
|
+
import { TriggerTypeEnum } from '../enums/TriggerTypeEnum';
|
|
3
|
+
import { PopulationRef } from './PopulationRef';
|
|
4
|
+
|
|
5
|
+
/** Disparador de una evaluacion (spec B 5.1). Una evaluacion tiene a lo sumo UN disparador `EVENT`. */
|
|
6
|
+
export class EvaluationTrigger {
|
|
7
|
+
type: TriggerTypeEnum;
|
|
8
|
+
approval: ApprovalModeEnum;
|
|
9
|
+
/** Solo `EVENT`. */
|
|
10
|
+
eventKey?: string;
|
|
11
|
+
/** Solo `CRON`: cron de 5 campos, granularidad de 15 minutos (fase 4). */
|
|
12
|
+
schedule?: string;
|
|
13
|
+
/** Solo `CRON` (fase 4). */
|
|
14
|
+
population?: PopulationRef;
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { GrantPeriodEnum } from '../enums/GrantPeriodEnum';
|
|
2
|
+
import { GrantPolicyModeEnum } from '../enums/GrantPolicyModeEnum';
|
|
3
|
+
|
|
4
|
+
/** Politica de frecuencia de una evaluacion (spec B 5.1). Cada modo exige su campo (lo valida el backoffice). */
|
|
5
|
+
export class GrantPolicy {
|
|
6
|
+
mode: GrantPolicyModeEnum;
|
|
7
|
+
/** Solo `PER_PERIOD`. */
|
|
8
|
+
period?: GrantPeriodEnum;
|
|
9
|
+
/** Solo `PER_REFERENCE`: la `key` de un input del contrato (ej. `saleId`). */
|
|
10
|
+
referenceInput?: string;
|
|
11
|
+
/** Solo `MAX_N`: tope de premios en total (>= 1). */
|
|
12
|
+
max?: number;
|
|
13
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Por que esta pausada una campania: decide si se siguen soltando sus lotes reservados (spec B 7.6). */
|
|
2
|
+
export enum CampaignPausedReasonEnum {
|
|
3
|
+
/** Lo pauso un operador: no se sueltan lotes. */
|
|
4
|
+
MANUAL = 'MANUAL',
|
|
5
|
+
/** Se agoto un cupo con `PAUSE_CAMPAIGN`: lo reservado igual se suelta. */
|
|
6
|
+
QUOTA_EXHAUSTED = 'QUOTA_EXHAUSTED',
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Politica de frecuencia de una evaluacion (spec B E5 y 5.5). */
|
|
2
|
+
export enum GrantPolicyModeEnum {
|
|
3
|
+
/** Una vez en la vida por evaluacion. */
|
|
4
|
+
ONCE = 'ONCE',
|
|
5
|
+
/** Una por periodo (`GrantPeriodEnum`). */
|
|
6
|
+
PER_PERIOD = 'PER_PERIOD',
|
|
7
|
+
/** Una por valor del `referenceInput` (ej. `saleId`). */
|
|
8
|
+
PER_REFERENCE = 'PER_REFERENCE',
|
|
9
|
+
/** Hasta N en total (`max`), con un contador. */
|
|
10
|
+
MAX_N = 'MAX_N',
|
|
11
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Que pasa al agotarse un cupo (`onExhausted`, spec B 5.6). */
|
|
2
|
+
export enum QuotaExhaustedActionEnum {
|
|
3
|
+
/** Pausa la campania; sus evaluaciones dejan de correr. */
|
|
4
|
+
PAUSE_CAMPAIGN = 'PAUSE_CAMPAIGN',
|
|
5
|
+
/** Siguen corriendo y registrando, sin entregar (`QUOTA_EXHAUSTED`). */
|
|
6
|
+
RECORD_ONLY = 'RECORD_ONLY',
|
|
7
|
+
}
|
|
@@ -14,3 +14,27 @@ export * from './dtos/PostEventResponse';
|
|
|
14
14
|
export * from './dtos/RunCounts';
|
|
15
15
|
export * from './dtos/RunResultItem';
|
|
16
16
|
export * from './dtos/GetRunResponse';
|
|
17
|
+
|
|
18
|
+
//Enums del dominio (campanias, evaluaciones, ledger)
|
|
19
|
+
export * from './enums/CampaignStatusEnum';
|
|
20
|
+
export * from './enums/CampaignPausedReasonEnum';
|
|
21
|
+
export * from './enums/EvaluationStatusEnum';
|
|
22
|
+
export * from './enums/GrantPolicyModeEnum';
|
|
23
|
+
export * from './enums/GrantPeriodEnum';
|
|
24
|
+
export * from './enums/QuotaPeriodEnum';
|
|
25
|
+
export * from './enums/QuotaExhaustedActionEnum';
|
|
26
|
+
export * from './enums/ApprovalModeEnum';
|
|
27
|
+
export * from './enums/LedgerStatusEnum';
|
|
28
|
+
export * from './enums/BatchPublishStateEnum';
|
|
29
|
+
export * from './enums/TraceOriginEnum';
|
|
30
|
+
|
|
31
|
+
//Types
|
|
32
|
+
export * from './types/RewardInputRef';
|
|
33
|
+
|
|
34
|
+
//DTOs de configuracion (forma guardada de campanias y evaluaciones)
|
|
35
|
+
export * from './dtos/GrantPolicy';
|
|
36
|
+
export * from './dtos/CampaignQuota';
|
|
37
|
+
export * from './dtos/CampaignAlerts';
|
|
38
|
+
export * from './dtos/PopulationRef';
|
|
39
|
+
export * from './dtos/EvaluationReward';
|
|
40
|
+
export * from './dtos/EvaluationTrigger';
|