ff-admin-server/src/entity/unit/inspection/inspection.ts

37 lines
1 KiB
TypeScript
Raw Normal View History

2025-05-24 13:51:38 +02:00
import { Column, ColumnType, CreateDateColumn, Entity, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
import { inspectionPlan } from "./inspectionPlan";
import { inspectionVersionedPlan } from "./inspectionVersionedPlan";
import { getTypeByORM } from "../../../migrations/ormHelper";
2025-05-25 07:01:13 +02:00
import { vehicle } from "../vehicle/vehicle";
import { equipment } from "../equipment/equipment";
2025-05-24 13:51:38 +02:00
@Entity()
export class inspection {
@PrimaryGeneratedColumn("uuid")
id: string;
@Column({ type: "text" })
context: string;
@CreateDateColumn()
createdAt: Date;
@Column({ type: getTypeByORM("date").type as ColumnType, nullable: true })
2025-05-25 07:01:13 +02:00
finishedAt?: Date;
2025-05-24 13:51:38 +02:00
@Column({ type: getTypeByORM("date").type as ColumnType, nullable: true })
nextInspection?: Date;
@ManyToOne(() => inspectionPlan)
inspectionPlan: inspectionPlan;
@ManyToOne(() => inspectionVersionedPlan)
inspectionVersionedPlan: inspectionVersionedPlan;
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
}