unit/#102-base-management #121
5 changed files with 11 additions and 3 deletions
|
@ -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,
|
||||
}))
|
||||
)
|
||||
|
|
|
@ -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,
|
||||
}))
|
||||
)
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -40,7 +40,6 @@ export type InspectionViewModel = {
|
|||
|
||||
export interface InspectionPointResultViewModel {
|
||||
inspectionId: string;
|
||||
inspectionVersionedPlanId: string;
|
||||
inspectionPointId: string;
|
||||
inspectionPoint: InspectionPointViewModel;
|
||||
value: string;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue