import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';

export type ItemType = 'weapon' | 'armor';
export type ItemRarity = 'common' | 'rare' | 'epic' | 'legendary';

@Entity('items')
export class Item {
  @PrimaryGeneratedColumn('uuid')
  id: string;

  @Column({ length: 100 })
  name: string;

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

  @Column({ type: 'varchar', length: 20 })
  type: ItemType;

  @Column({ type: 'varchar', length: 20 })
  rarity: ItemRarity;

  @Column({ name: 'attack_bonus', default: 0 })
  attackBonus: number;

  @Column({ name: 'defense_bonus', default: 0 })
  defenseBonus: number;

  @Column({ name: 'force_bonus', default: 0 })
  forceBonus: number;

  @Column({ name: 'agilite_bonus', default: 0 })
  agiliteBonus: number;

  @Column({ name: 'intelligence_bonus', default: 0 })
  intelligenceBonus: number;

  @Column({ name: 'chance_bonus', default: 0 })
  chanceBonus: number;

  @Column({ name: 'vitalite_bonus', default: 0 })
  vitaliteBonus: number;
}
