import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
import { PrisonCellEntity } from './prison-cell.entity';

@Entity('prison_cell_blocks')
export class PrisonCellBlockEntity {
    @PrimaryGeneratedColumn() id: number;
    @Column({ type: 'varchar', length: 32 }) name: string;
    @Column({ type: 'varchar', length: 128 }) description: string;
    @Column({ type: 'tinyint', width: 1 }) lock_cells_on_start: boolean;

    @OneToMany(() => PrisonCellEntity, (cell) => cell.prisonCellBlock)
    prisonCells: PrisonCellEntity[];
}
