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
5 changed files with 11 additions and 3 deletions
Showing only changes of commit 8747baaf2e - Show all commits

View file

@ -51,6 +51,7 @@ export default abstract class InspectionPointCommandHandler {
.values(
sync.map((s) => ({
...s,
id: points.some((p) => p.id == s.id) ? s.id : undefined,
versionedPlanId,
}))
)

View file

@ -40,7 +40,13 @@ export default abstract class InspectionVersionedPlanCommandHandler {
.into(inspectionPoint)
.values(
inspectionPoints.map((ip) => ({
...ip,
title: ip.title,
description: ip.description,
type: ip.type,
min: ip.min,
max: ip.max,
others: ip.others,
sort: ip.sort,
versionedPlanId: returnId,
}))
)

View file

@ -11,7 +11,6 @@ export default abstract class InspectionPointResultFactory {
public static mapToSingle(record: inspectionPointResult): InspectionPointResultViewModel {
return {
inspectionId: record.inspectionId,
inspectionVersionedPlanId: record.inspection.inspectionVersionedPlanId,
inspectionPointId: record.inspectionPointId,
inspectionPoint: InspectionPointFactory.mapToSingle(record.inspectionPoint),
value: record.value,

View file

@ -9,6 +9,9 @@ export default abstract class InspectionService {
.getRepository(inspection)
.createQueryBuilder("inspection")
.leftJoinAndSelect("inspection.inspectionPlan", "inspectionPlan")
.leftJoinAndSelect("inspectionPlan.equipmentType", "equipmentType")
.leftJoinAndSelect("inspectionPlan.vehicleType", "vehicleType")
.leftJoinAndSelect("inspectionPlan.wearableType", "wearableType")
.leftJoinAndSelect("inspection.inspectionVersionedPlan", "inspectionVersionedPlan")
.leftJoinAndSelect("inspectionVersionedPlan.inspectionPoints", "inspectionPoints")
.leftJoinAndSelect("inspection.pointResults", "pointResults")

View file

@ -40,7 +40,6 @@ export type InspectionViewModel = {
export interface InspectionPointResultViewModel {
inspectionId: string;
inspectionVersionedPlanId: string;
inspectionPointId: string;
inspectionPoint: InspectionPointViewModel;
value: string;