2025-05-24 13:51:38 +02:00
|
|
|
import { Column, CreateDateColumn, Entity, ManyToOne, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
2025-05-25 07:01:13 +02:00
|
|
|
import { equipment } from "../equipment/equipment";
|
|
|
|
import { vehicle } from "../vehicle/vehicle";
|
2025-05-24 13:51:38 +02:00
|
|
|
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()
|
2025-05-26 14:53:25 +02:00
|
|
|
createdAt: Date;
|
2025-05-24 13:51:38 +02:00
|
|
|
|
|
|
|
@Column()
|
|
|
|
equipmentId: string;
|
|
|
|
|
|
|
|
@Column()
|
|
|
|
vehicleId: string;
|
|
|
|
|
2025-05-25 07:01:13 +02:00
|
|
|
@ManyToOne(() => equipment)
|
|
|
|
equipment: equipment;
|
2025-05-24 13:51:38 +02:00
|
|
|
|
2025-05-25 07:01:13 +02:00
|
|
|
@ManyToOne(() => vehicle)
|
|
|
|
vehicle: vehicle;
|
2025-05-24 13:51:38 +02:00
|
|
|
|
|
|
|
@OneToMany(() => inspectionVersionedPlan, (ivp) => ivp.inspectionPlan, {
|
|
|
|
cascade: ["insert"],
|
|
|
|
})
|
|
|
|
versionedPlans: inspectionVersionedPlan[];
|
|
|
|
|
|
|
|
latestVersionedPlan?: inspectionVersionedPlan;
|
|
|
|
}
|