import { Column, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import { CharacterEntity } from './character.entity';

@Entity('weapon_attachments')
export class WeaponAttachmentEntity {
    @PrimaryGeneratedColumn() id: number;
    @Column({ type: 'int' }) character_id: number;
    @Column({ type: 'int' }) weapon_id: string;
    @Column({ type: 'int' }) bone: number;
    @Column({ type: 'json' }) position: number[];
    @Column({ type: 'tinyint' }) hidden: boolean;

    @ManyToOne(() => CharacterEntity, (character) => character.weaponAttachments)
    @JoinColumn({
        name: 'character_id',
    })
    character: CharacterEntity;
}
