/**
 * ============================================
 * ACHIEVEMENT TYPES
 * ============================================
 * 
 * Types for achievements and badges
 * shared between frontend and backend
 */

// ============================================
// ENUMS
// ============================================

export type AchievementCategory = 
  | 'EXERCISES'
  | 'MODULES'
  | 'STREAKS'
  | 'RANKING'
  | 'SPECIAL';

export type AchievementRarity = 'COMMON' | 'RARE' | 'EPIC' | 'LEGENDARY';

// ============================================
// ACHIEVEMENT
// ============================================

export interface Achievement {
  code: string;
  name: string;
  description: string;
  icon: string;
  rarity: AchievementRarity;
  category: AchievementCategory;
  requirementType: string;
  requirementValue: number;
  metadata?: AchievementMetadata;
}

export interface AchievementMetadata {
  color: string;
  animation?: string;
  tooltip: string;
  unlockMessage: string;
}

// ============================================
// USER ACHIEVEMENT
// ============================================

export interface UserAchievement {
  userId: string;
  achievementCode: string;
  progress: number;
  requirementValue: number;
  unlocked: boolean;
  unlockedAt: string | null;
}

export interface UserAchievementProgress {
  achievementId: string;
  code: string;
  name: string;
  description: string;
  category: string;
  rarity: string;
  icon: string;
  progress: number;
  requirementValue: number;
  unlocked: boolean;
  unlockedAt?: string;
}

// ============================================
// BADGE (For rankings)
// ============================================

export interface AchievementBadge {
  code: string;
  icon: string;
  rarity: AchievementRarity;
  name?: string;
}
