/**
 * @copyright 2026 NHCarrigan
 * @license Naomi's Public License
 * @author Naomi Carrigan
 */

enum ActivityType {
  suggestion = "SUGGESTION",
  like = "LIKE",
  comment = "COMMENT",
  achievement = "ACHIEVEMENT",
}

interface ActivityUser {
  id:           string;
  username:     string;
  slug:         string | null;
  avatar:       string | null;
  primaryBadge: string | null;
  isVip:        boolean;
  isMod:        boolean;
  isStaff:      boolean;
}

interface BaseActivity {
  id:        string;
  type:      ActivityType;
  user:      ActivityUser;
  createdAt: Date;
}

interface SuggestionActivity extends BaseActivity {
  type:            ActivityType.suggestion;
  entityType:      string;
  suggestionTitle: string;
  status:          string;
}

interface LikeActivity extends BaseActivity {
  type:        ActivityType.like;
  entityType:  string;
  entityId:    string;
  entityTitle: string;
}

interface CommentActivity extends BaseActivity {
  type:           ActivityType.comment;
  entityType:     string;
  entityId:       string;
  entityTitle:    string;
  commentPreview: string;
}

interface AchievementActivity extends BaseActivity {
  type:              ActivityType.achievement;
  achievementKey:    string;
  achievementName:   string;
  achievementIcon:   string;
  achievementPoints: number;
}

type Activity = SuggestionActivity | LikeActivity | CommentActivity | AchievementActivity;

interface ActivityFeedResponse {
  activities: Array<Activity>;
  total:      number;
  hasMore:    boolean;
}

export { ActivityType };
export type {
  Activity,
  ActivityFeedResponse,
  ActivityUser,
  AchievementActivity,
  CommentActivity,
  LikeActivity,
  SuggestionActivity,
};
