db schema connects
This commit is contained in:
parent
baa3b2cc8c
commit
8c81c8f336
7 changed files with 33 additions and 2 deletions
|
@ -2,6 +2,7 @@ import { Column, ColumnType, Entity, ManyToOne, OneToMany, PrimaryGeneratedColum
|
||||||
import { getTypeByORM } from "../../../migrations/ormHelper";
|
import { getTypeByORM } from "../../../migrations/ormHelper";
|
||||||
import { equipmentType } from "./equipmentType";
|
import { equipmentType } from "./equipmentType";
|
||||||
import { damageReport } from "../damageReport";
|
import { damageReport } from "../damageReport";
|
||||||
|
import { inspection } from "../inspection/inspection";
|
||||||
|
|
||||||
@Entity()
|
@Entity()
|
||||||
export class equipment {
|
export class equipment {
|
||||||
|
@ -35,4 +36,7 @@ export class equipment {
|
||||||
|
|
||||||
@OneToMany(() => damageReport, (d) => d.equipment, { cascade: ["insert"] })
|
@OneToMany(() => damageReport, (d) => d.equipment, { cascade: ["insert"] })
|
||||||
reports: damageReport[];
|
reports: damageReport[];
|
||||||
|
|
||||||
|
@OneToMany(() => inspection, (i) => i.equipment)
|
||||||
|
inspections: inspection[];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
||||||
import { equipment } from "./equipment";
|
import { equipment } from "./equipment";
|
||||||
|
import { inspectionPlan } from "../inspection/inspectionPlan";
|
||||||
|
|
||||||
@Entity()
|
@Entity()
|
||||||
export class equipmentType {
|
export class equipmentType {
|
||||||
|
@ -15,5 +16,6 @@ export class equipmentType {
|
||||||
@OneToMany(() => equipment, (e) => e.equipmentType, { cascade: ["insert"] })
|
@OneToMany(() => equipment, (e) => e.equipmentType, { cascade: ["insert"] })
|
||||||
equipment: equipment[];
|
equipment: equipment[];
|
||||||
|
|
||||||
inspectionPlans: Array<any>;
|
@OneToMany(() => inspectionPlan, (ip) => ip.equipment)
|
||||||
|
inspectionPlans: inspectionPlan[];
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,18 @@ export class inspection {
|
||||||
@Column({ type: getTypeByORM("date").type as ColumnType, nullable: true, default: null })
|
@Column({ type: getTypeByORM("date").type as ColumnType, nullable: true, default: null })
|
||||||
nextInspection?: Date;
|
nextInspection?: Date;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
inspectionPlanId: string;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
inspectionVersionedPlanId: string;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
equipmentId: string;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
vehicleId: string;
|
||||||
|
|
||||||
@ManyToOne(() => inspectionPlan, {
|
@ManyToOne(() => inspectionPlan, {
|
||||||
nullable: false,
|
nullable: false,
|
||||||
onDelete: "RESTRICT",
|
onDelete: "RESTRICT",
|
||||||
|
|
|
@ -10,6 +10,12 @@ export class inspectionPointResult {
|
||||||
@Column({ type: "text" })
|
@Column({ type: "text" })
|
||||||
value: string;
|
value: string;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
inspectionId: string;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
inspectionPointId: string;
|
||||||
|
|
||||||
@ManyToOne(() => inspection, {
|
@ManyToOne(() => inspection, {
|
||||||
nullable: false,
|
nullable: false,
|
||||||
onDelete: "CASCADE",
|
onDelete: "CASCADE",
|
||||||
|
|
|
@ -2,6 +2,7 @@ import { Column, ColumnType, Entity, ManyToOne, OneToMany, PrimaryGeneratedColum
|
||||||
import { getTypeByORM } from "../../../migrations/ormHelper";
|
import { getTypeByORM } from "../../../migrations/ormHelper";
|
||||||
import { vehicleType } from "./vehicleType";
|
import { vehicleType } from "./vehicleType";
|
||||||
import { damageReport } from "../damageReport";
|
import { damageReport } from "../damageReport";
|
||||||
|
import { inspection } from "../inspection/inspection";
|
||||||
|
|
||||||
@Entity()
|
@Entity()
|
||||||
export class vehicle {
|
export class vehicle {
|
||||||
|
@ -35,4 +36,7 @@ export class vehicle {
|
||||||
|
|
||||||
@OneToMany(() => damageReport, (d) => d.vehicle, { cascade: ["insert"] })
|
@OneToMany(() => damageReport, (d) => d.vehicle, { cascade: ["insert"] })
|
||||||
reports: damageReport[];
|
reports: damageReport[];
|
||||||
|
|
||||||
|
@OneToMany(() => inspection, (i) => i.vehicle)
|
||||||
|
inspections: inspection[];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
||||||
import { vehicle } from "./vehicle";
|
import { vehicle } from "./vehicle";
|
||||||
|
import { inspectionPlan } from "../inspection/inspectionPlan";
|
||||||
|
|
||||||
@Entity()
|
@Entity()
|
||||||
export class vehicleType {
|
export class vehicleType {
|
||||||
|
@ -15,5 +16,6 @@ export class vehicleType {
|
||||||
@OneToMany(() => vehicle, (e) => e.vehicleType, { cascade: ["insert"] })
|
@OneToMany(() => vehicle, (e) => e.vehicleType, { cascade: ["insert"] })
|
||||||
vehicle: vehicle[];
|
vehicle: vehicle[];
|
||||||
|
|
||||||
inspectionPlans: Array<any>;
|
@OneToMany(() => inspectionPlan, (ip) => ip.vehicle)
|
||||||
|
inspectionPlans: inspectionPlan[];
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ import { getTypeByORM } from "../../../migrations/ormHelper";
|
||||||
import { wearableType } from "./wearableType";
|
import { wearableType } from "./wearableType";
|
||||||
import { damageReport } from "../damageReport";
|
import { damageReport } from "../damageReport";
|
||||||
import { member } from "../../club/member/member";
|
import { member } from "../../club/member/member";
|
||||||
|
import { inspection } from "../inspection/inspection";
|
||||||
|
|
||||||
@Entity()
|
@Entity()
|
||||||
export class wearable {
|
export class wearable {
|
||||||
|
|
Loading…
Add table
Reference in a new issue