- Migration 013: loot_profiles table (JSONB loot_table + loot_groups, license-scoped) - TypeORM entity matching migration schema exactly - NestJS loot module: 10 endpoints (CRUD, duplicate, apply, import, export, containers) - Multiplier logic recursively scales Min/Max/Scrap across loot tables and groups - Apply-to-server writes BetterLoot JSON via NATS file manager + RCON reload - Frontend static data: 191 Rust items, 51 container prefabs - TypeScript types for BetterLoot data model (PrefabLoot, LootEntry, LootRNG, etc.) - Fix vue-tsc errors: UngroupedItems uses LootRNG, null safety in store/view Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
37 lines
950 B
TypeScript
37 lines
950 B
TypeScript
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, JoinColumn } from 'typeorm';
|
|
import { License } from './license.entity';
|
|
|
|
@Entity('loot_profiles')
|
|
export class LootProfile {
|
|
@PrimaryGeneratedColumn('uuid')
|
|
id: string;
|
|
|
|
@Column({ type: 'uuid' })
|
|
license_id: string;
|
|
|
|
@Column({ type: 'varchar', length: 100 })
|
|
profile_name: string;
|
|
|
|
@Column({ type: 'text', nullable: true })
|
|
description: string | null;
|
|
|
|
@Column({ type: 'jsonb', default: () => "'{}'" })
|
|
loot_table: Record<string, any>;
|
|
|
|
@Column({ type: 'jsonb', default: () => "'{}'" })
|
|
loot_groups: Record<string, any>;
|
|
|
|
@Column({ type: 'boolean', default: false })
|
|
is_active: boolean;
|
|
|
|
@Column({ type: 'timestamptz', default: () => 'NOW()' })
|
|
created_at: Date;
|
|
|
|
@Column({ type: 'timestamptz', default: () => 'NOW()' })
|
|
updated_at: Date;
|
|
|
|
@ManyToOne(() => License, { onDelete: 'CASCADE' })
|
|
@JoinColumn({ name: 'license_id' })
|
|
license: License;
|
|
}
|