inspection data model
This commit is contained in:
parent
95d1113ff9
commit
3ff44f7370
9 changed files with 222 additions and 21 deletions
42
src/entity/unit/inspection/inspectionPlan.ts
Normal file
42
src/entity/unit/inspection/inspectionPlan.ts
Normal file
|
@ -0,0 +1,42 @@
|
|||
import { Column, CreateDateColumn, Entity, ManyToOne, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
||||
import { Equipment } from "../equipment/equipment";
|
||||
import { Vehicle } from "../vehicle/vehicle";
|
||||
import { PlanTimeDefinition } from "../../../viewmodel/admin/unit/inspectionPlan/inspectionPlan.models";
|
||||
import { inspectionVersionedPlan } from "./inspectionVersionedPlan";
|
||||
|
||||
@Entity()
|
||||
export class inspectionPlan {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
title: string;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
inspectionInterval: PlanTimeDefinition;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
remindTime: PlanTimeDefinition;
|
||||
|
||||
@CreateDateColumn()
|
||||
created: Date;
|
||||
|
||||
@Column()
|
||||
equipmentId: string;
|
||||
|
||||
@Column()
|
||||
vehicleId: string;
|
||||
|
||||
@ManyToOne(() => Equipment)
|
||||
equipment: Equipment;
|
||||
|
||||
@ManyToOne(() => Vehicle)
|
||||
vehicle: Vehicle;
|
||||
|
||||
@OneToMany(() => inspectionVersionedPlan, (ivp) => ivp.inspectionPlan, {
|
||||
cascade: ["insert"],
|
||||
})
|
||||
versionedPlans: inspectionVersionedPlan[];
|
||||
|
||||
latestVersionedPlan?: inspectionVersionedPlan;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue