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

@Entity('trucking_trailer_positions')
export class TruckingTrailerPositionEntity {
    @PrimaryGeneratedColumn() id: number;
    @Column() trucking_location_id: number;
    @Column({ type: 'float' }) x: number;
    @Column({ type: 'float' }) y: number;
    @Column({ type: 'float' }) z: number;
    @Column() heading: number;
    @Column({ type: 'varchar', length: 64, default: 'trailers' }) model: string;

    @ManyToOne(() => TruckingLocationEntity, (tle) => tle.trailerPositions)
    @JoinColumn({ name: 'trucking_location_id' })
    location: TruckingLocationEntity;
}
