unit/#102-base-management #121

Merged
jkeffects merged 35 commits from unit/#102-base-management into milestone/ff-admin-unit 2025-07-14 13:36:35 +00:00
12 changed files with 24 additions and 3 deletions
Showing only changes of commit c42a41d895 - Show all commits

View file

@ -18,4 +18,6 @@ export class equipmentType {
@OneToMany(() => inspectionPlan, (ip) => ip.equipmentType) @OneToMany(() => inspectionPlan, (ip) => ip.equipmentType)
inspectionPlans: inspectionPlan[]; inspectionPlans: inspectionPlan[];
equipmentCount: number;
} }

View file

@ -18,4 +18,6 @@ export class vehicleType {
@OneToMany(() => inspectionPlan, (ip) => ip.vehicleType) @OneToMany(() => inspectionPlan, (ip) => ip.vehicleType)
inspectionPlans: inspectionPlan[]; inspectionPlans: inspectionPlan[];
vehicleCount: number;
} }

View file

@ -18,4 +18,6 @@ export class wearableType {
@OneToMany(() => inspectionPlan, (ip) => ip.wearableType) @OneToMany(() => inspectionPlan, (ip) => ip.wearableType)
inspectionPlans: inspectionPlan[]; inspectionPlans: inspectionPlan[];
wearableCount: number;
} }

View file

@ -12,6 +12,7 @@ export default abstract class EquipmentTypeFactory {
id: record.id, id: record.id,
type: record.type, type: record.type,
description: record.description, description: record.description,
equipmentCount: record.equipmentCount,
}; };
} }

View file

@ -12,6 +12,7 @@ export default abstract class VehicleTypeFactory {
id: record.id, id: record.id,
type: record.type, type: record.type,
description: record.description, description: record.description,
vehicleCount: record.vehicleCount,
}; };
} }

View file

@ -12,6 +12,7 @@ export default abstract class WearableTypeFactory {
id: record.id, id: record.id,
type: record.type, type: record.type,
description: record.description, description: record.description,
wearableCount: record.wearableCount,
}; };
} }

View file

@ -19,7 +19,10 @@ export default abstract class EquipmentTypeService {
search?: string; search?: string;
noLimit?: boolean; noLimit?: boolean;
}): Promise<[Array<equipmentType>, number]> { }): Promise<[Array<equipmentType>, number]> {
let query = dataSource.getRepository(equipmentType).createQueryBuilder("equipmentType"); let query = dataSource
.getRepository(equipmentType)
.createQueryBuilder("equipmentType")
.loadRelationCountAndMap("equipmentType.equipmentCount", "equipmentType.equipment");
if (search != "") { if (search != "") {
query = query.where({ query = query.where({

View file

@ -19,7 +19,10 @@ export default abstract class VehicleTypeService {
search?: string; search?: string;
noLimit?: boolean; noLimit?: boolean;
}): Promise<[Array<vehicleType>, number]> { }): Promise<[Array<vehicleType>, number]> {
let query = dataSource.getRepository(vehicleType).createQueryBuilder("vehicleType"); let query = dataSource
.getRepository(vehicleType)
.createQueryBuilder("vehicleType")
.loadRelationCountAndMap("vehicleType.vehicleCount", "vehicleType.vehicle");
if (search != "") { if (search != "") {
query = query.where({ query = query.where({

View file

@ -19,7 +19,10 @@ export default abstract class WearableTypeService {
search?: string; search?: string;
noLimit?: boolean; noLimit?: boolean;
}): Promise<[Array<wearableType>, number]> { }): Promise<[Array<wearableType>, number]> {
let query = dataSource.getRepository(wearableType).createQueryBuilder("wearableType"); let query = dataSource
.getRepository(wearableType)
.createQueryBuilder("wearableType")
.loadRelationCountAndMap("wearableType.wearableCount", "wearableType.wearable");
if (search != "") { if (search != "") {
query = query.where({ query = query.where({

View file

@ -2,4 +2,5 @@ export interface EquipmentTypeViewModel {
id: string; id: string;
type: string; type: string;
description: string; description: string;
equipmentCount: number;
} }

View file

@ -2,4 +2,5 @@ export interface VehicleTypeViewModel {
id: string; id: string;
type: string; type: string;
description: string; description: string;
vehicleCount: number;
} }

View file

@ -2,4 +2,5 @@ export interface WearableTypeViewModel {
id: string; id: string;
type: string; type: string;
description: string; description: string;
wearableCount: number;
} }