factory and restructure view models
This commit is contained in:
parent
fcbfe560c3
commit
117ced38ab
33 changed files with 479 additions and 46 deletions
|
@ -1,7 +1,7 @@
|
|||
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 { PlanTimeDefinition } from "../../../viewmodel/admin/unit/inspection/inspectionPlan.models";
|
||||
import { inspectionVersionedPlan } from "./inspectionVersionedPlan";
|
||||
|
||||
@Entity()
|
||||
|
@ -22,16 +22,24 @@ export class inspectionPlan {
|
|||
createdAt: Date;
|
||||
|
||||
@Column()
|
||||
equipmentId: string;
|
||||
equipmentId?: string;
|
||||
|
||||
@Column()
|
||||
vehicleId: string;
|
||||
vehicleId?: string;
|
||||
|
||||
@ManyToOne(() => equipment)
|
||||
equipment: equipment;
|
||||
@ManyToOne(() => equipment, {
|
||||
nullable: true,
|
||||
onDelete: "CASCADE",
|
||||
onUpdate: "RESTRICT",
|
||||
})
|
||||
equipment?: equipment;
|
||||
|
||||
@ManyToOne(() => vehicle)
|
||||
vehicle: vehicle;
|
||||
@ManyToOne(() => vehicle, {
|
||||
nullable: true,
|
||||
onDelete: "CASCADE",
|
||||
onUpdate: "RESTRICT",
|
||||
})
|
||||
vehicle?: vehicle;
|
||||
|
||||
@OneToMany(() => inspectionVersionedPlan, (ivp) => ivp.inspectionPlan, {
|
||||
cascade: ["insert"],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue