import { Column, CreateDateColumn, Entity, PrimaryColumn } from 'typeorm';

@Entity({ name: 'achievements' })
export class AchievementOrmEntity {
  @PrimaryColumn({ type: 'text' })
  id!: string;

  @Column({ type: 'text' })
  name!: string;

  @Column({ type: 'text' })
  description!: string;

  @Column({ type: 'text' })
  category!: string;

  @Column({ type: 'text' })
  rarity!: string;

  @Column({ type: 'text', nullable: true })
  iconUrl!: string | null;

  @Column({ type: 'int' })
  points!: number;

  @Column({ type: 'jsonb' })
  requirements!: Array<{ type: string; value: number; operator: string }>;

  @Column({ type: 'boolean' })
  isSecret!: boolean;

  @CreateDateColumn({ type: 'timestamptz' })
  createdAt!: Date;
}