import { Column, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import { TruckingLocationEntity } from './trucking-location.entity';

@Entity('trucking_location_loading_bays')
export class TruckingLocationLoadingBayEntity {
    @PrimaryGeneratedColumn() id: number;
    @Column() trucking_location_id: number;
    @Column({ type: 'float' }) crate_base_x: number;
    @Column({ type: 'float' }) crate_base_y: number;
    @Column({ type: 'float' }) crate_base_z: number;
    @Column({ type: 'float' }) crate_base_h: number;
    @Column({ type: 'float' }) forklift_x: number;
    @Column({ type: 'float' }) forklift_y: number;
    @Column({ type: 'float' }) forklift_z: number;
    @Column({ type: 'float' }) forklift_h: number;

    @ManyToOne(() => TruckingLocationEntity, (location) => location.loadingBays, {
        eager: true,
    })
    @JoinColumn({ name: 'trucking_location_id' })
    truckingLocation: TruckingLocationEntity;
}
