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

export type ClothingItemType = 'jacket' | 'shirt';

export interface ClothingItemState {
    type: string;
    variations: {
        drawable: number;
        texture: number;
    }[];
}

@Entity('clothing_items')
export class ClothingItemEntity {
    @PrimaryGeneratedColumn() id: number;
    @Column({ type: 'varchar', length: 64, nullable: false }) name: string;
    @Column({ type: 'varchar', length: 16, nullable: false }) type: ClothingItemType;
    @Column({ type: 'int', width: 11, nullable: false }) drawable: string;
    @Column({ type: 'int', width: 11, nullable: false }) texture: string;
    @Column({ type: 'json', nullable: true }) states?: ClothingItemState[];
}
