// ============================================================================
// Draw Pool Constants
// ============================================================================

/**
 * Generation tags based on birth year
 */
export const GENERATION_TAGS = {
  TAG_6070: '6070',  // 1960-1979
  TAG_80: '80',      // 1980-1989
  TAG_90: '90',      // 1990+
} as const;

/**
 * Zodiac tag for Year of the Horse
 */
export const ZODIAC_TAGS = {
  HORSE: 'horse',
} as const;

export type GenerationTag = typeof GENERATION_TAGS[keyof typeof GENERATION_TAGS];
export type ZodiacTag = typeof ZODIAC_TAGS[keyof typeof ZODIAC_TAGS];
export type UserTag = GenerationTag | ZodiacTag;

/**
 * Redis Key Schema for Lucky Draw
 *
 * draw:pool:{tag}           → Set of userIds in this pool
 * draw:pool:all             → Set of all eligible userIds
 * draw:winners              → Set of userIds who have won
 * draw:winners:{round}      → Set of winners for specific round
 * draw:history              → List of draw results
 * draw:excluded             → Set of manually excluded userIds
 */
export const DRAW_KEYS = {
  pool: (tag: string) => `draw:pool:${tag}`,
  allPool: 'draw:pool:all',
  winners: 'draw:winners',
  roundWinners: (round: number) => `draw:winners:round:${round}`,
  history: 'draw:history',
  excluded: 'draw:excluded',
} as const;
