import { Column, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import { ImpoundLotEntity } from './impound-lot.entity';

@Entity('impound_lot_parking_spots')
export class ImpoundLotParkingEntity {
    @PrimaryGeneratedColumn() id: number;
    @Column({ type: 'int' }) impound_lot: number;
    @Column({ type: 'int' }) x: number;
    @Column({ type: 'int' }) y: number;
    @Column({ type: 'int' }) z: number;
    @Column({ type: 'int' }) heading: number;
    @Column({ type: 'datetime' }) added: Date;
    @Column({ type: 'int' }) added_by: number;

    @ManyToOne(() => ImpoundLotEntity, (lot) => lot.parking)
    @JoinColumn({ name: 'impound_lot' })
    impound: ImpoundLotEntity;
}
