mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 02:58:11 +00:00
27 lines
796 B
TypeScript
27 lines
796 B
TypeScript
import { BaseEntity } from '@edr/api-common';
|
|
import { Column, Entity, Index, JoinColumn, ManyToOne } from 'typeorm';
|
|
|
|
import { Yard } from '../../rule-engine/entities/yard.entity';
|
|
import { Route } from './route.entity';
|
|
|
|
@Entity({ schema: 'freight', name: 'route_milestones' })
|
|
@Index(['routeId', 'sequenceNo'], { unique: true })
|
|
export class RouteMilestone extends BaseEntity {
|
|
@Column({ name: 'route_id', type: 'uuid' })
|
|
routeId!: string;
|
|
|
|
@ManyToOne(() => Route, (route) => route.milestones, { onDelete: 'CASCADE' })
|
|
@JoinColumn({ name: 'route_id' })
|
|
route?: Route;
|
|
|
|
@Column({ name: 'yard_id', type: 'uuid' })
|
|
yardId!: string;
|
|
|
|
@ManyToOne(() => Yard)
|
|
@JoinColumn({ name: 'yard_id' })
|
|
yard?: Yard;
|
|
|
|
@Column({ name: 'sequence_no', type: 'int' })
|
|
sequenceNo!: number;
|
|
}
|