/**
 * @copyright NHCarrigan
 * @license Naomi's Public License
 * @author Naomi Carrigan
 */
/* eslint-disable @typescript-eslint/naming-convention -- Enum members use PascalCase for display values */
/* eslint-disable import/group-exports -- Multiple exports for better organization */

export enum AchievementCategory {
  Suggestion = "SUGGESTION",
  Like = "LIKE",
  Comment = "COMMENT",
  Engagement = "ENGAGEMENT",
  Report = "REPORT",
}

export enum AchievementTier {
  Bronze = "BRONZE",
  Silver = "SILVER",
  Gold = "GOLD",
  Platinum = "PLATINUM",
  Diamond = "DIAMOND",
}

export interface AchievementRequirements {
  count?:       number;
  rate?:        number;
  streak?:      number;
  diversity?:   boolean;
  uniqueItems?: number;
  dayRange?:    number;
}

export interface AchievementDefinition {
  key:          string;
  title:        string;
  description:  string;
  category:     AchievementCategory;
  tier:         AchievementTier;
  icon:         string;
  points:       number;
  requirements: AchievementRequirements;
}

export interface UserAchievement {
  id:             string;
  userId:         string;
  achievementKey: string;
  progress:       number;
  earned:         boolean;
  earnedAt?:      Date;
  createdAt:      Date;
  updatedAt:      Date;
}

export interface AchievementProgress {
  definition: AchievementDefinition;
  progress:   number;
  earned:     boolean;
  earnedAt?:  Date;
}

export interface UserAchievementSummary {
  totalPoints:        number;
  totalEarned:        number;
  recentAchievements: Array<AchievementProgress>;
  progressByCategory: Array<{
    category: AchievementCategory;
    earned:   number;
    total:    number;
  }>;
}
