feat(loot): add item, loot table, and combat reward entities
Declares every new TypeORM entity Slice 0.4 needs (ItemDefinition, CharacterItem, LootTable, LootTableEntry, CombatReward, CombatRewardItem) plus the ItemType/EquipmentSlot/ItemRarity enums, and adds the two columns existing entities gain: Character.silver and MonsterDefinition.lootTableId. No migration SQL or service logic yet - just schema declarations backed by a metadata-driven schema spec. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,9 +3,12 @@ import {
|
||||
CreateDateColumn,
|
||||
Entity,
|
||||
Index,
|
||||
JoinColumn,
|
||||
ManyToOne,
|
||||
PrimaryGeneratedColumn,
|
||||
UpdateDateColumn,
|
||||
} from 'typeorm';
|
||||
import { LootTable } from '../../loot/entities/loot-table.entity';
|
||||
|
||||
@Entity({ name: 'monster_definitions' })
|
||||
@Index('IDX_monster_definitions_key', ['key'], { unique: true })
|
||||
@@ -43,9 +46,16 @@ export class MonsterDefinition {
|
||||
@Column({ name: 'artwork_path', type: 'varchar', length: 255 })
|
||||
artworkPath!: string;
|
||||
|
||||
@Column({ name: 'loot_table_id', type: 'uuid', nullable: true })
|
||||
lootTableId!: string | null;
|
||||
|
||||
@CreateDateColumn({ name: 'created_at', type: 'timestamptz' })
|
||||
createdAt!: Date;
|
||||
|
||||
@UpdateDateColumn({ name: 'updated_at', type: 'timestamptz' })
|
||||
updatedAt!: Date;
|
||||
|
||||
@ManyToOne(() => LootTable, { onDelete: 'RESTRICT', nullable: true })
|
||||
@JoinColumn({ name: 'loot_table_id' })
|
||||
lootTable!: LootTable | null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user