import { RewardVisibility } from './RewardVisibility'; import { IAssignmentCreateDTO } from '../../dto/assignments'; export interface UserReward { type: string; config: Record; visibility: RewardVisibility; amount: RewardAmountConfig; } export interface RewardAmountConfig { type: string; config: Record; } export interface TokenReward extends UserReward { type: 'TOKEN'; } export interface RandomPerkReward extends UserReward { type: 'RANDOM_PERK'; } export interface SpecificPerkReward extends UserReward { type: 'SPECIFIC_PERK'; config: { perkId: string; }; } export type UserStatsOperation = 'ADD' | 'SUBTRACT' | 'SET'; export interface UserStatReward extends UserReward { type: 'USER_STAT'; config: { path: string; dataType: 'number' | 'string' | 'boolean' | 'integer'; value: string | number | boolean; operation: UserStatsOperation; }; } export interface GoldTrophyReward extends UserReward { type: 'GOLD_TROPHY'; config: { path: '$.goldTrophy'; dataType: 'integer'; value: 1; operation: UserStatsOperation; }; } export interface FeaturedTrophyReward extends UserReward { type: 'FEATURED_TROPHY'; config: { path: '$.featuredTrophy'; dataType: 'integer'; value: 1; operation: UserStatsOperation; }; } export interface PerkSlotsReward extends UserReward { type: 'PERK_SLOTS'; config: { path: '$.perkSlots'; dataType: 'integer'; value: 1; operation: UserStatsOperation; }; } export interface NoneReward extends UserReward { type: 'NONE'; config: { reason: string; }; } export interface ExternalReward extends UserReward { type: 'EXTERNAL'; config: { name: string; description: string; webhook: string; webhookAuth: string; }; } export interface SpecificQuestReward extends UserReward { type: 'SPECIFIC_QUEST'; config: { questId: number; }; } export interface AssignmentReward extends UserReward { type: 'ASSIGNMENT'; config: { assignment: IAssignmentCreateDTO; }; }