Compare commits
No commits in common. "3ff44f7370294a43fc6d1e3c6cef8f52552cf9ae" and "d7a0ee694f47701d5b1118b8902dffdccd7260b5" have entirely different histories.
3ff44f7370
...
d7a0ee694f
25 changed files with 0 additions and 740 deletions
|
@ -1,52 +0,0 @@
|
||||||
import { Check, Column, CreateDateColumn, Entity, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
|
|
||||||
import { Equipment } from "./equipment/equipment";
|
|
||||||
import { Wearable } from "./wearable/wearable";
|
|
||||||
import { Vehicle } from "./vehicle/vehicle";
|
|
||||||
|
|
||||||
@Entity()
|
|
||||||
export class DamageReport {
|
|
||||||
@PrimaryGeneratedColumn("uuid")
|
|
||||||
id: string;
|
|
||||||
|
|
||||||
@CreateDateColumn()
|
|
||||||
reported: Date;
|
|
||||||
|
|
||||||
@Column({ type: "varchar", length: 255 })
|
|
||||||
status: string;
|
|
||||||
|
|
||||||
@Column({ type: "boolean", default: false })
|
|
||||||
done: boolean;
|
|
||||||
|
|
||||||
@Column({ type: "text" })
|
|
||||||
description: string;
|
|
||||||
|
|
||||||
@Column({ nullable: true })
|
|
||||||
equipmentId: string;
|
|
||||||
|
|
||||||
@Column({ nullable: true })
|
|
||||||
vehicleId: string;
|
|
||||||
|
|
||||||
@Column({ nullable: true })
|
|
||||||
wearableId: string;
|
|
||||||
|
|
||||||
@ManyToOne(() => Equipment, {
|
|
||||||
nullable: true,
|
|
||||||
onDelete: "CASCADE",
|
|
||||||
onUpdate: "RESTRICT",
|
|
||||||
})
|
|
||||||
equipment: Equipment;
|
|
||||||
|
|
||||||
@ManyToOne(() => Vehicle, {
|
|
||||||
nullable: true,
|
|
||||||
onDelete: "CASCADE",
|
|
||||||
onUpdate: "RESTRICT",
|
|
||||||
})
|
|
||||||
vehicle: Vehicle;
|
|
||||||
|
|
||||||
@ManyToOne(() => Wearable, {
|
|
||||||
nullable: true,
|
|
||||||
onDelete: "CASCADE",
|
|
||||||
onUpdate: "RESTRICT",
|
|
||||||
})
|
|
||||||
wearable: Wearable;
|
|
||||||
}
|
|
|
@ -1,38 +0,0 @@
|
||||||
import { Column, ColumnType, Entity, ManyToOne, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
|
||||||
import { getTypeByORM } from "../../../migrations/ormHelper";
|
|
||||||
import { EquipmentType } from "./equipmentType";
|
|
||||||
import { DamageReport } from "../damageReport";
|
|
||||||
|
|
||||||
@Entity()
|
|
||||||
export class Equipment {
|
|
||||||
@PrimaryGeneratedColumn("uuid")
|
|
||||||
id: string;
|
|
||||||
|
|
||||||
@Column({ type: "varchar", length: 255, nullable: true, unique: true })
|
|
||||||
code?: string;
|
|
||||||
|
|
||||||
@Column({ type: "varchar", length: 255 })
|
|
||||||
name: string;
|
|
||||||
|
|
||||||
@Column({ type: "varchar", length: 255 })
|
|
||||||
location: string;
|
|
||||||
|
|
||||||
@Column({ type: getTypeByORM("datetime").type as ColumnType })
|
|
||||||
commissioned: Date;
|
|
||||||
|
|
||||||
@Column({ type: getTypeByORM("datetime").type as ColumnType, nullable: true })
|
|
||||||
decommissioned?: Date;
|
|
||||||
|
|
||||||
@Column()
|
|
||||||
equipmentTypeId: string;
|
|
||||||
|
|
||||||
@ManyToOne(() => EquipmentType, {
|
|
||||||
nullable: false,
|
|
||||||
onDelete: "RESTRICT",
|
|
||||||
onUpdate: "RESTRICT",
|
|
||||||
})
|
|
||||||
equipmentType: EquipmentType;
|
|
||||||
|
|
||||||
@OneToMany(() => DamageReport, (d) => d.equipment, { cascade: ["insert"] })
|
|
||||||
reports: DamageReport[];
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
|
||||||
import { Equipment } from "./equipment";
|
|
||||||
|
|
||||||
@Entity()
|
|
||||||
export class EquipmentType {
|
|
||||||
@PrimaryGeneratedColumn("uuid")
|
|
||||||
id: string;
|
|
||||||
|
|
||||||
@Column({ type: "varchar", length: 255 })
|
|
||||||
type: string;
|
|
||||||
|
|
||||||
@Column({ type: "text", nullable: true })
|
|
||||||
description: string;
|
|
||||||
|
|
||||||
@OneToMany(() => Equipment, (e) => e.equipmentType, { cascade: ["insert"] })
|
|
||||||
equipment: Equipment[];
|
|
||||||
|
|
||||||
inspectionPlans: Array<any>;
|
|
||||||
}
|
|
|
@ -1,36 +0,0 @@
|
||||||
import { Column, ColumnType, CreateDateColumn, Entity, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
|
|
||||||
import { inspectionPlan } from "./inspectionPlan";
|
|
||||||
import { inspectionVersionedPlan } from "./inspectionVersionedPlan";
|
|
||||||
import { getTypeByORM } from "../../../migrations/ormHelper";
|
|
||||||
import { Vehicle } from "../vehicle/vehicle";
|
|
||||||
import { Equipment } from "../equipment/equipment";
|
|
||||||
|
|
||||||
@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 })
|
|
||||||
finished?: Date;
|
|
||||||
|
|
||||||
@Column({ type: getTypeByORM("date").type as ColumnType, nullable: true })
|
|
||||||
nextInspection?: Date;
|
|
||||||
|
|
||||||
@ManyToOne(() => inspectionPlan)
|
|
||||||
inspectionPlan: inspectionPlan;
|
|
||||||
|
|
||||||
@ManyToOne(() => inspectionVersionedPlan)
|
|
||||||
inspectionVersionedPlan: inspectionVersionedPlan;
|
|
||||||
|
|
||||||
@ManyToOne(() => Equipment)
|
|
||||||
equipment: Equipment;
|
|
||||||
|
|
||||||
@ManyToOne(() => Vehicle)
|
|
||||||
vehicle: Vehicle;
|
|
||||||
}
|
|
|
@ -1,42 +0,0 @@
|
||||||
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 { 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()
|
|
||||||
created: Date;
|
|
||||||
|
|
||||||
@Column()
|
|
||||||
equipmentId: string;
|
|
||||||
|
|
||||||
@Column()
|
|
||||||
vehicleId: string;
|
|
||||||
|
|
||||||
@ManyToOne(() => Equipment)
|
|
||||||
equipment: Equipment;
|
|
||||||
|
|
||||||
@ManyToOne(() => Vehicle)
|
|
||||||
vehicle: Vehicle;
|
|
||||||
|
|
||||||
@OneToMany(() => inspectionVersionedPlan, (ivp) => ivp.inspectionPlan, {
|
|
||||||
cascade: ["insert"],
|
|
||||||
})
|
|
||||||
versionedPlans: inspectionVersionedPlan[];
|
|
||||||
|
|
||||||
latestVersionedPlan?: inspectionVersionedPlan;
|
|
||||||
}
|
|
|
@ -1,39 +0,0 @@
|
||||||
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
|
|
||||||
import { InspectionPointEnum } from "../../../enums/inspectionEnum";
|
|
||||||
import { inspectionVersionedPlan } from "./inspectionVersionedPlan";
|
|
||||||
|
|
||||||
@Entity()
|
|
||||||
export class inspectionPoint {
|
|
||||||
@PrimaryGeneratedColumn("uuid")
|
|
||||||
id: string;
|
|
||||||
|
|
||||||
@Column({ type: "varchar", length: 255 })
|
|
||||||
title: string;
|
|
||||||
|
|
||||||
@Column({ type: "text" })
|
|
||||||
description: string;
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: "varchar",
|
|
||||||
length: 255,
|
|
||||||
transformer: {
|
|
||||||
to(value: InspectionPointEnum) {
|
|
||||||
return value.toString();
|
|
||||||
},
|
|
||||||
from(value: string) {
|
|
||||||
return InspectionPointEnum[value as keyof typeof InspectionPointEnum];
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
type: InspectionPointEnum;
|
|
||||||
|
|
||||||
@Column({ type: "int", default: 0 })
|
|
||||||
min: number;
|
|
||||||
|
|
||||||
@ManyToOne(() => inspectionVersionedPlan, {
|
|
||||||
nullable: false,
|
|
||||||
onDelete: "CASCADE",
|
|
||||||
onUpdate: "RESTRICT",
|
|
||||||
})
|
|
||||||
versionedPlan: inspectionVersionedPlan;
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
|
|
||||||
import { inspection } from "./inspection";
|
|
||||||
import { inspectionPoint } from "./inspectionPoint";
|
|
||||||
import { inspectionVersionedPlan } from "./inspectionVersionedPlan";
|
|
||||||
|
|
||||||
@Entity()
|
|
||||||
export class inspectionPointResult {
|
|
||||||
@PrimaryGeneratedColumn("uuid")
|
|
||||||
id: string;
|
|
||||||
|
|
||||||
@Column({ type: "text" })
|
|
||||||
value: string;
|
|
||||||
|
|
||||||
@ManyToOne(() => inspection)
|
|
||||||
inspection: inspection;
|
|
||||||
|
|
||||||
@ManyToOne(() => inspectionPoint)
|
|
||||||
inspectionPoint: inspectionPoint;
|
|
||||||
}
|
|
|
@ -1,35 +0,0 @@
|
||||||
import { Column, CreateDateColumn, Entity, ManyToOne, OneToMany, PrimaryGeneratedColumn, Unique } from "typeorm";
|
|
||||||
import { Equipment } from "../equipment/equipment";
|
|
||||||
import { Vehicle } from "../vehicle/vehicle";
|
|
||||||
import { PlanTimeDefinition } from "../../../viewmodel/admin/unit/inspectionPlan/inspectionPlan.models";
|
|
||||||
import { inspectionPlan } from "./inspectionPlan";
|
|
||||||
import { getTypeByORM } from "../../../migrations/ormHelper";
|
|
||||||
import { inspectionPoint } from "./inspectionPoint";
|
|
||||||
|
|
||||||
@Entity()
|
|
||||||
@Unique("unique_version", ["version", "inspectionPlanId"])
|
|
||||||
export class inspectionVersionedPlan {
|
|
||||||
@PrimaryGeneratedColumn("uuid")
|
|
||||||
id: string;
|
|
||||||
|
|
||||||
@Column({ type: "int", default: 0 })
|
|
||||||
version: number;
|
|
||||||
|
|
||||||
@CreateDateColumn()
|
|
||||||
created: Date;
|
|
||||||
|
|
||||||
@Column()
|
|
||||||
inspectionPlanId: string;
|
|
||||||
|
|
||||||
@ManyToOne(() => inspectionPlan, {
|
|
||||||
nullable: false,
|
|
||||||
onDelete: "CASCADE",
|
|
||||||
onUpdate: "RESTRICT",
|
|
||||||
})
|
|
||||||
inspectionPlan: inspectionPlan;
|
|
||||||
|
|
||||||
@OneToMany(() => inspectionPoint, (ip) => ip.versionedPlan, {
|
|
||||||
cascade: ["insert"],
|
|
||||||
})
|
|
||||||
inspectionPoints: inspectionPoint[];
|
|
||||||
}
|
|
|
@ -1,38 +0,0 @@
|
||||||
import { Column, ColumnType, Entity, ManyToOne, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
|
||||||
import { getTypeByORM } from "../../../migrations/ormHelper";
|
|
||||||
import { VehicleType } from "./vehicleType";
|
|
||||||
import { DamageReport } from "../damageReport";
|
|
||||||
|
|
||||||
@Entity()
|
|
||||||
export class Vehicle {
|
|
||||||
@PrimaryGeneratedColumn("uuid")
|
|
||||||
id: string;
|
|
||||||
|
|
||||||
@Column({ type: "varchar", length: 255, nullable: true, unique: true })
|
|
||||||
code?: string;
|
|
||||||
|
|
||||||
@Column({ type: "varchar", length: 255 })
|
|
||||||
name: string;
|
|
||||||
|
|
||||||
@Column({ type: "varchar", length: 255 })
|
|
||||||
location: string;
|
|
||||||
|
|
||||||
@Column({ type: getTypeByORM("datetime").type as ColumnType })
|
|
||||||
commissioned: Date;
|
|
||||||
|
|
||||||
@Column({ type: getTypeByORM("datetime").type as ColumnType, nullable: true })
|
|
||||||
decommissioned?: Date;
|
|
||||||
|
|
||||||
@Column()
|
|
||||||
vehicleTypeId: string;
|
|
||||||
|
|
||||||
@ManyToOne(() => VehicleType, {
|
|
||||||
nullable: false,
|
|
||||||
onDelete: "RESTRICT",
|
|
||||||
onUpdate: "RESTRICT",
|
|
||||||
})
|
|
||||||
vehicleType: VehicleType;
|
|
||||||
|
|
||||||
@OneToMany(() => DamageReport, (d) => d.vehicle, { cascade: ["insert"] })
|
|
||||||
reports: DamageReport[];
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
|
||||||
import { Vehicle } from "./vehicle";
|
|
||||||
|
|
||||||
@Entity()
|
|
||||||
export class VehicleType {
|
|
||||||
@PrimaryGeneratedColumn("uuid")
|
|
||||||
id: string;
|
|
||||||
|
|
||||||
@Column({ type: "varchar", length: 255 })
|
|
||||||
type: string;
|
|
||||||
|
|
||||||
@Column({ type: "text", nullable: true })
|
|
||||||
description: string;
|
|
||||||
|
|
||||||
@OneToMany(() => Vehicle, (e) => e.vehicleType, { cascade: ["insert"] })
|
|
||||||
equipment: Vehicle[];
|
|
||||||
|
|
||||||
inspectionPlans: Array<any>;
|
|
||||||
}
|
|
|
@ -1,49 +0,0 @@
|
||||||
import { Column, ColumnType, Entity, ManyToOne, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
|
||||||
import { getTypeByORM } from "../../../migrations/ormHelper";
|
|
||||||
import { WearableType } from "./wearableType";
|
|
||||||
import { DamageReport } from "../damageReport";
|
|
||||||
import { member } from "../../club/member/member";
|
|
||||||
|
|
||||||
@Entity()
|
|
||||||
export class Wearable {
|
|
||||||
@PrimaryGeneratedColumn("uuid")
|
|
||||||
id: string;
|
|
||||||
|
|
||||||
@Column({ type: "varchar", length: 255, nullable: true, unique: true })
|
|
||||||
code?: string;
|
|
||||||
|
|
||||||
@Column({ type: "varchar", length: 255 })
|
|
||||||
name: string;
|
|
||||||
|
|
||||||
@Column({ type: "varchar", length: 255 })
|
|
||||||
location: string;
|
|
||||||
|
|
||||||
@Column({ type: getTypeByORM("datetime").type as ColumnType })
|
|
||||||
commissioned: Date;
|
|
||||||
|
|
||||||
@Column({ type: getTypeByORM("datetime").type as ColumnType, nullable: true })
|
|
||||||
decommissioned?: Date;
|
|
||||||
|
|
||||||
@Column()
|
|
||||||
equipmentTypeId: string;
|
|
||||||
|
|
||||||
@Column()
|
|
||||||
wearerId: string;
|
|
||||||
|
|
||||||
@ManyToOne(() => WearableType, {
|
|
||||||
nullable: false,
|
|
||||||
onDelete: "RESTRICT",
|
|
||||||
onUpdate: "RESTRICT",
|
|
||||||
})
|
|
||||||
wearableType: WearableType;
|
|
||||||
|
|
||||||
@ManyToOne(() => member, {
|
|
||||||
nullable: false,
|
|
||||||
onDelete: "SET NULL",
|
|
||||||
onUpdate: "RESTRICT",
|
|
||||||
})
|
|
||||||
wearer: member;
|
|
||||||
|
|
||||||
@OneToMany(() => DamageReport, (d) => d.wearable, { cascade: ["insert"] })
|
|
||||||
reports: DamageReport[];
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
|
||||||
import { Wearable } from "./wearable";
|
|
||||||
|
|
||||||
@Entity()
|
|
||||||
export class WearableType {
|
|
||||||
@PrimaryGeneratedColumn("uuid")
|
|
||||||
id: string;
|
|
||||||
|
|
||||||
@Column({ type: "varchar", length: 255 })
|
|
||||||
type: string;
|
|
||||||
|
|
||||||
@Column({ type: "text", nullable: true })
|
|
||||||
description: string;
|
|
||||||
|
|
||||||
@OneToMany(() => Wearable, (e) => e.wearableType, { cascade: ["insert"] })
|
|
||||||
equipment: Wearable[];
|
|
||||||
}
|
|
|
@ -1,5 +0,0 @@
|
||||||
export enum InspectionPointEnum {
|
|
||||||
oknok = "oknok",
|
|
||||||
text = "text",
|
|
||||||
number = "number",
|
|
||||||
}
|
|
|
@ -1,38 +0,0 @@
|
||||||
import type { EquipmentViewModel } from "../equipment/equipment.models";
|
|
||||||
import type { VehicleViewModel } from "../vehicle/vehicle.models";
|
|
||||||
import type { WearableViewModel } from "../wearable/wearable.models";
|
|
||||||
|
|
||||||
export type DamageReportViewModel = {
|
|
||||||
id: string;
|
|
||||||
reported: Date;
|
|
||||||
status: string;
|
|
||||||
done: boolean;
|
|
||||||
description: string;
|
|
||||||
providedImage: Array<string>;
|
|
||||||
relatedId: string;
|
|
||||||
} & (
|
|
||||||
| {
|
|
||||||
assigned: "equipment";
|
|
||||||
related: EquipmentViewModel;
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
assigned: "vehicle";
|
|
||||||
related: VehicleViewModel;
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
assigned: "wearable";
|
|
||||||
related: WearableViewModel;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
export interface CreateDamageReportViewModel {
|
|
||||||
description: string;
|
|
||||||
affectedId: string;
|
|
||||||
affected: "equipment" | "vehicle" | "wearable";
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface UpdateDamageReportViewModel {
|
|
||||||
id: string;
|
|
||||||
status: string;
|
|
||||||
done: boolean;
|
|
||||||
}
|
|
|
@ -1,31 +0,0 @@
|
||||||
import type { EquipmentTypeViewModel } from "../equipmentType/equipmentType.models";
|
|
||||||
import type { InspectionViewModel } from "../inspection/inspection.models";
|
|
||||||
|
|
||||||
export interface EquipmentViewModel {
|
|
||||||
id: string;
|
|
||||||
code?: string;
|
|
||||||
name: string;
|
|
||||||
location: string;
|
|
||||||
commissioned: Date;
|
|
||||||
decommissioned?: Date;
|
|
||||||
equipmentTypeId: string;
|
|
||||||
equipmentType: EquipmentTypeViewModel;
|
|
||||||
inspections: Array<InspectionViewModel>;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface CreateEquipmentViewModel {
|
|
||||||
code?: string;
|
|
||||||
name: string;
|
|
||||||
location: string;
|
|
||||||
commissioned: Date;
|
|
||||||
equipmentTypeId: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface UpdateEquipmentViewModel {
|
|
||||||
id: string;
|
|
||||||
code?: string;
|
|
||||||
name: string;
|
|
||||||
location: string;
|
|
||||||
commissioned: Date;
|
|
||||||
decommissioned?: Date;
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
import type { InspectionPlanViewModel } from "../inspectionPlan/inspectionPlan.models";
|
|
||||||
|
|
||||||
export interface EquipmentTypeViewModel {
|
|
||||||
id: string;
|
|
||||||
type: string;
|
|
||||||
description: string;
|
|
||||||
inspectionPlans: Array<InspectionPlanViewModel>;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface CreateEquipmentTypeViewModel {
|
|
||||||
type: string;
|
|
||||||
description: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface UpdateEquipmentTypeViewModel {
|
|
||||||
id: string;
|
|
||||||
type: string;
|
|
||||||
description: string;
|
|
||||||
}
|
|
|
@ -1,37 +0,0 @@
|
||||||
import type { EquipmentViewModel } from "../equipment/equipment.models";
|
|
||||||
import type {
|
|
||||||
InspectionPlanViewModel,
|
|
||||||
InspectionVersionedPlanViewModel,
|
|
||||||
} from "../inspectionPlan/inspectionPlan.models";
|
|
||||||
import type { VehicleViewModel } from "../vehicle/vehicle.models";
|
|
||||||
|
|
||||||
export type InspectionViewModel = {
|
|
||||||
id: string;
|
|
||||||
inspectionPlanId: string;
|
|
||||||
inspectionPlan: InspectionPlanViewModel;
|
|
||||||
inspectionVersionedPlanId: string;
|
|
||||||
inspectionVersionedPlan: InspectionVersionedPlanViewModel;
|
|
||||||
context: string;
|
|
||||||
created: Date;
|
|
||||||
finished?: Date;
|
|
||||||
isOpen: boolean;
|
|
||||||
nextInspection?: Date;
|
|
||||||
checks: Array<InspectionPointResultViewModel>;
|
|
||||||
relatedId: string;
|
|
||||||
} & (
|
|
||||||
| {
|
|
||||||
assigned: "equipment";
|
|
||||||
related: EquipmentViewModel;
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
assigned: "vehicle";
|
|
||||||
related: VehicleViewModel;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
export interface InspectionPointResultViewModel {
|
|
||||||
inspectionId: string;
|
|
||||||
inspectionVersionedPlanId: string;
|
|
||||||
inspectionPointId: string;
|
|
||||||
value: string;
|
|
||||||
}
|
|
|
@ -1,55 +0,0 @@
|
||||||
import { InspectionPointEnum } from "../../../../enums/inspectionEnum";
|
|
||||||
import type { EquipmentViewModel } from "../equipment/equipment.models";
|
|
||||||
import type { VehicleViewModel } from "../vehicle/vehicle.models";
|
|
||||||
|
|
||||||
export type PlanTimeDefinition = `${number}-${"d" | "m" | "y"}` | `${number}/${number | "*"}`;
|
|
||||||
|
|
||||||
export type InspectionPlanViewModel = {
|
|
||||||
id: string;
|
|
||||||
title: string;
|
|
||||||
inspectionInterval: PlanTimeDefinition;
|
|
||||||
remindTime: PlanTimeDefinition;
|
|
||||||
version: number;
|
|
||||||
created: Date;
|
|
||||||
inspectionPoints: InspectionPointViewModel[];
|
|
||||||
relatedId: string;
|
|
||||||
} & (
|
|
||||||
| {
|
|
||||||
assigned: "equipment";
|
|
||||||
related: EquipmentViewModel;
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
assigned: "vehicle";
|
|
||||||
related: VehicleViewModel;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
export interface InspectionVersionedPlanViewModel {
|
|
||||||
id: string;
|
|
||||||
version: number;
|
|
||||||
created: Date;
|
|
||||||
inspectionPoints: InspectionPointViewModel[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface InspectionPointViewModel {
|
|
||||||
id: string;
|
|
||||||
title: string;
|
|
||||||
description: string;
|
|
||||||
type: InspectionPointEnum;
|
|
||||||
min?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface CreateInspectionPlanViewModel {
|
|
||||||
title: string;
|
|
||||||
inspectionInterval: PlanTimeDefinition;
|
|
||||||
remindTime: PlanTimeDefinition;
|
|
||||||
relatedId: string;
|
|
||||||
assigned: "vehicle" | "equipment";
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface UpdateInspectionPlanViewModel {
|
|
||||||
id: string;
|
|
||||||
title: string;
|
|
||||||
inspectionInterval: PlanTimeDefinition;
|
|
||||||
remindTime?: PlanTimeDefinition;
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
import type { EquipmentViewModel } from "../equipment/equipment.models";
|
|
||||||
|
|
||||||
export interface RespiratoryGearViewModel {
|
|
||||||
id: string;
|
|
||||||
equipmentId: string;
|
|
||||||
equipment: EquipmentViewModel;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface CreateRespiratoryGearViewModel {
|
|
||||||
equipmentId: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface UpdateRespiratoryGearViewModel {
|
|
||||||
id: string;
|
|
||||||
equipmentId: string;
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
export interface RespiratoryMissionViewModel {
|
|
||||||
id: string;
|
|
||||||
date: Date;
|
|
||||||
title: string;
|
|
||||||
description: string;
|
|
||||||
// refs to used respiratory gear and wearers
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface CreateRespiratoryMissionViewModel {
|
|
||||||
date: Date;
|
|
||||||
title: string;
|
|
||||||
description: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface UpdateRespiratoryMissionViewModel {
|
|
||||||
id: string;
|
|
||||||
date: Date;
|
|
||||||
title: string;
|
|
||||||
description: string;
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
import { MemberViewModel } from "../../club/member/member.models";
|
|
||||||
|
|
||||||
export interface RespiratoryWearerViewModel {
|
|
||||||
id: string;
|
|
||||||
memberId: string;
|
|
||||||
member: MemberViewModel;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface CreateRespiratoryWearerViewModel {
|
|
||||||
memberId: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface UpdateRespiratoryWearerViewModel {
|
|
||||||
id: string;
|
|
||||||
memberId: string;
|
|
||||||
}
|
|
|
@ -1,31 +0,0 @@
|
||||||
import type { InspectionViewModel } from "../inspection/inspection.models";
|
|
||||||
import type { VehicleTypeViewModel } from "../vehicleType/vehicleType.models";
|
|
||||||
|
|
||||||
export interface VehicleViewModel {
|
|
||||||
id: string;
|
|
||||||
code?: string;
|
|
||||||
name: string;
|
|
||||||
location: string;
|
|
||||||
commissioned: Date;
|
|
||||||
decommissioned?: Date;
|
|
||||||
vehicleTypeId: string;
|
|
||||||
vehicleType: VehicleTypeViewModel;
|
|
||||||
inspections: Array<InspectionViewModel>;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface CreateVehicleViewModel {
|
|
||||||
code?: string;
|
|
||||||
name: string;
|
|
||||||
location: string;
|
|
||||||
commissioned: Date;
|
|
||||||
vehicleTypeId: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface UpdateVehicleViewModel {
|
|
||||||
id: string;
|
|
||||||
code?: string;
|
|
||||||
name: string;
|
|
||||||
location: string;
|
|
||||||
commissioned: Date;
|
|
||||||
decommissioned?: Date;
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
import type { InspectionPlanViewModel } from "../inspectionPlan/inspectionPlan.models";
|
|
||||||
|
|
||||||
export interface VehicleTypeViewModel {
|
|
||||||
id: string;
|
|
||||||
type: string;
|
|
||||||
description: string;
|
|
||||||
inspectionPlans: Array<InspectionPlanViewModel>;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface CreateVehicleTypeViewModel {
|
|
||||||
type: string;
|
|
||||||
description: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface UpdateVehicleTypeViewModel {
|
|
||||||
id: string;
|
|
||||||
type: string;
|
|
||||||
description: string;
|
|
||||||
}
|
|
|
@ -1,34 +0,0 @@
|
||||||
import { MemberViewModel } from "../../club/member/member.models";
|
|
||||||
import type { WearableTypeViewModel } from "../wearableType/wearableType.models";
|
|
||||||
|
|
||||||
export interface WearableViewModel {
|
|
||||||
id: string;
|
|
||||||
code?: string;
|
|
||||||
name: string;
|
|
||||||
location: string;
|
|
||||||
commissioned: Date;
|
|
||||||
decommissioned?: Date;
|
|
||||||
wearerId?: string;
|
|
||||||
wearer?: MemberViewModel;
|
|
||||||
wearableTypeId: string;
|
|
||||||
wearableType: WearableTypeViewModel;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface CreateWearableViewModel {
|
|
||||||
code?: string;
|
|
||||||
name: string;
|
|
||||||
wearerId?: string;
|
|
||||||
location?: string;
|
|
||||||
commissioned: Date;
|
|
||||||
wearableTypeId: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface UpdateWearableViewModel {
|
|
||||||
id: string;
|
|
||||||
code?: string;
|
|
||||||
name: string;
|
|
||||||
location?: string;
|
|
||||||
commissioned: Date;
|
|
||||||
decommissioned?: Date;
|
|
||||||
wearerId?: string;
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
export interface WearableTypeViewModel {
|
|
||||||
id: string;
|
|
||||||
type: string;
|
|
||||||
description: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface CreateWearableTypeViewModel {
|
|
||||||
type: string;
|
|
||||||
description: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface UpdateWearableTypeViewModel {
|
|
||||||
id: string;
|
|
||||||
type: string;
|
|
||||||
description: string;
|
|
||||||
}
|
|
Loading…
Add table
Reference in a new issue