import {
  Entity,
  PrimaryGeneratedColumn,
  Column,
  ManyToOne,
  JoinColumn,
} from 'typeorm';
import { CommunityGoal } from './community-goal.entity';

@Entity('active_boosts')
export class ActiveBoost {
  @PrimaryGeneratedColumn('uuid')
  id: string;

  @Column({ name: 'boost_type', length: 30 })
  boostType: string; // 'xp_boost' | 'loot_boost'

  @Column({ type: 'decimal', precision: 3, scale: 2 })
  multiplier: number;

  @Column({ name: 'expires_at', type: 'timestamp' })
  expiresAt: Date;

  @Column({ name: 'source_goal_id' })
  sourceGoalId: string;

  @ManyToOne(() => CommunityGoal)
  @JoinColumn({ name: 'source_goal_id' })
  sourceGoal: CommunityGoal;
}
