change according to connection from frontend
This commit is contained in:
parent
2609ecc1bf
commit
e3db523a0e
36 changed files with 611 additions and 173 deletions
|
@ -18,10 +18,10 @@ export class equipment {
|
|||
@Column({ type: "varchar", length: 255 })
|
||||
location: string;
|
||||
|
||||
@Column({ type: getTypeByORM("datetime").type as ColumnType })
|
||||
@Column({ type: getTypeByORM("date").type as ColumnType })
|
||||
commissioned: Date;
|
||||
|
||||
@Column({ type: getTypeByORM("datetime").type as ColumnType, nullable: true, default: null })
|
||||
@Column({ type: getTypeByORM("date").type as ColumnType, nullable: true, default: null })
|
||||
decommissioned?: Date;
|
||||
|
||||
@Column()
|
||||
|
|
|
@ -16,6 +16,6 @@ export class equipmentType {
|
|||
@OneToMany(() => equipment, (e) => e.equipmentType, { cascade: ["insert"] })
|
||||
equipment: equipment[];
|
||||
|
||||
@OneToMany(() => inspectionPlan, (ip) => ip.equipment)
|
||||
@OneToMany(() => inspectionPlan, (ip) => ip.equipmentType)
|
||||
inspectionPlans: inspectionPlan[];
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
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/inspection/inspectionPlan.models";
|
||||
import { inspectionVersionedPlan } from "./inspectionVersionedPlan";
|
||||
import { equipmentType } from "../equipment/equipmentType";
|
||||
import { vehicleType } from "../vehicle/vehicleType";
|
||||
|
||||
@Entity()
|
||||
export class inspectionPlan {
|
||||
|
@ -22,24 +22,24 @@ export class inspectionPlan {
|
|||
createdAt: Date;
|
||||
|
||||
@Column()
|
||||
equipmentId?: string;
|
||||
equipmentTypeId?: string;
|
||||
|
||||
@Column()
|
||||
vehicleId?: string;
|
||||
vehicleTypeId?: string;
|
||||
|
||||
@ManyToOne(() => equipment, {
|
||||
@ManyToOne(() => equipmentType, {
|
||||
nullable: true,
|
||||
onDelete: "CASCADE",
|
||||
onUpdate: "RESTRICT",
|
||||
})
|
||||
equipment?: equipment;
|
||||
equipmentType?: equipmentType;
|
||||
|
||||
@ManyToOne(() => vehicle, {
|
||||
@ManyToOne(() => vehicleType, {
|
||||
nullable: true,
|
||||
onDelete: "CASCADE",
|
||||
onUpdate: "RESTRICT",
|
||||
})
|
||||
vehicle?: vehicle;
|
||||
vehicleType?: vehicleType;
|
||||
|
||||
@OneToMany(() => inspectionVersionedPlan, (ivp) => ivp.inspectionPlan, {
|
||||
cascade: ["insert"],
|
||||
|
|
|
@ -18,10 +18,10 @@ export class vehicle {
|
|||
@Column({ type: "varchar", length: 255 })
|
||||
location: string;
|
||||
|
||||
@Column({ type: getTypeByORM("datetime").type as ColumnType })
|
||||
@Column({ type: getTypeByORM("date").type as ColumnType })
|
||||
commissioned: Date;
|
||||
|
||||
@Column({ type: getTypeByORM("datetime").type as ColumnType, nullable: true, default: null })
|
||||
@Column({ type: getTypeByORM("date").type as ColumnType, nullable: true, default: null })
|
||||
decommissioned?: Date;
|
||||
|
||||
@Column()
|
||||
|
|
|
@ -16,6 +16,6 @@ export class vehicleType {
|
|||
@OneToMany(() => vehicle, (e) => e.vehicleType, { cascade: ["insert"] })
|
||||
vehicle: vehicle[];
|
||||
|
||||
@OneToMany(() => inspectionPlan, (ip) => ip.vehicle)
|
||||
@OneToMany(() => inspectionPlan, (ip) => ip.vehicleType)
|
||||
inspectionPlans: inspectionPlan[];
|
||||
}
|
||||
|
|
|
@ -19,10 +19,10 @@ export class wearable {
|
|||
@Column({ type: "varchar", length: 255 })
|
||||
location: string;
|
||||
|
||||
@Column({ type: getTypeByORM("datetime").type as ColumnType })
|
||||
@Column({ type: getTypeByORM("date").type as ColumnType })
|
||||
commissioned: Date;
|
||||
|
||||
@Column({ type: getTypeByORM("datetime").type as ColumnType, nullable: true, default: null })
|
||||
@Column({ type: getTypeByORM("date").type as ColumnType, nullable: true, default: null })
|
||||
decommissioned?: Date;
|
||||
|
||||
@Column()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue