mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 03:40:56 +00:00
feat(rule-engine): add yard_locations table, seed 5 facility yard GPS coords
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import { BaseEntity } from '@edr/api-common';
|
||||
import { Column, Entity, Index, JoinColumn, OneToOne } from 'typeorm';
|
||||
|
||||
import { Yard } from './yard.entity';
|
||||
|
||||
/**
|
||||
* GPS position of a yard (decimal degrees, WGS84). One record per yard;
|
||||
* today only the five facility yards (Sebeta, GMP/Indode, Mojo, Adama,
|
||||
* Dire Dawa) are seeded.
|
||||
*/
|
||||
@Entity({ schema: 'freight', name: 'yard_locations' })
|
||||
@Index(['yardId'], { unique: true })
|
||||
export class YardLocation extends BaseEntity {
|
||||
@Column({ name: 'yard_id', type: 'uuid' })
|
||||
yardId!: string;
|
||||
|
||||
@OneToOne(() => Yard, { nullable: false, onDelete: 'CASCADE' })
|
||||
@JoinColumn({ name: 'yard_id' })
|
||||
yard?: Yard;
|
||||
|
||||
@Column({ name: 'latitude', type: 'double precision' })
|
||||
latitude!: number;
|
||||
|
||||
@Column({ name: 'longitude', type: 'double precision' })
|
||||
longitude!: number;
|
||||
}
|
||||
Reference in New Issue
Block a user