UNPKG

@alba-cars/common-modules

Version:

A package containing DTOs, validation classes and common modules and interfaces for Alba Cars

766 lines (765 loc) 38.3 kB
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.VehicleInspectionDTO = exports.ElectricalsInspectionDTO = exports.EngineInspectionDTO = exports.InteriorInspectionDTO = exports.SteeringAndSuspensionInspectionDTO = exports.TyresInspectionDTO = exports.ExteriorInspectionDTO = exports.BaseInspectionDTO = exports.InspectionPointDTO = exports.InspectionStatus = void 0; const class_validator_1 = require("class-validator"); const class_transformer_1 = require("class-transformer"); const class_validator_2 = require("class-validator"); // Define InspectionStatus enum var InspectionStatus; (function (InspectionStatus) { InspectionStatus["PERFECT"] = "Perfect"; InspectionStatus["IMPERFECTIONS"] = "Imperfections"; InspectionStatus["NOT_APPLICABLE"] = "Not Applicable"; })(InspectionStatus = exports.InspectionStatus || (exports.InspectionStatus = {})); // Define InspectionPointDTO class class InspectionPointDTO { constructor(status = InspectionStatus.PERFECT) { this.status = status; } } __decorate([ (0, class_validator_2.IsEnum)(InspectionStatus), __metadata("design:type", String) ], InspectionPointDTO.prototype, "status", void 0); __decorate([ (0, class_validator_2.IsOptional)(), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], InspectionPointDTO.prototype, "imperfections", void 0); exports.InspectionPointDTO = InspectionPointDTO; // Define BaseInspectionDTO for shared functionality class BaseInspectionDTO { validate() { const errors = (0, class_validator_1.validateSync)(this); return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat(); } static fromPlain(plain) { return (0, class_transformer_1.plainToClass)(this, plain); } toPlain() { return (0, class_transformer_1.instanceToPlain)(this); } } __decorate([ (0, class_validator_2.IsOptional)(), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Array) ], BaseInspectionDTO.prototype, "validate", null); exports.BaseInspectionDTO = BaseInspectionDTO; // Define ExteriorInspectionDTO class ExteriorInspectionDTO extends BaseInspectionDTO { constructor() { super(); this.hood = new InspectionPointDTO(InspectionStatus.PERFECT); this.roof = new InspectionPointDTO(InspectionStatus.PERFECT); this.trunk = new InspectionPointDTO(InspectionStatus.PERFECT); this.frontLeftDoor = new InspectionPointDTO(InspectionStatus.PERFECT); this.frontRightDoor = new InspectionPointDTO(InspectionStatus.PERFECT); this.rearLeftDoor = new InspectionPointDTO(InspectionStatus.PERFECT); this.rearRightDoor = new InspectionPointDTO(InspectionStatus.PERFECT); this.frontBumper = new InspectionPointDTO(InspectionStatus.PERFECT); this.rearBumper = new InspectionPointDTO(InspectionStatus.PERFECT); this.leftFender = new InspectionPointDTO(InspectionStatus.PERFECT); this.rightFender = new InspectionPointDTO(InspectionStatus.PERFECT); this.leftQuarterPanel = new InspectionPointDTO(InspectionStatus.PERFECT); this.rightQuarterPanel = new InspectionPointDTO(InspectionStatus.PERFECT); this.leftAPillar = new InspectionPointDTO(InspectionStatus.PERFECT); this.rightAPillar = new InspectionPointDTO(InspectionStatus.PERFECT); this.leftAtoBPillarBeading = new InspectionPointDTO(InspectionStatus.PERFECT); this.rightAtoBPillarBeading = new InspectionPointDTO(InspectionStatus.PERFECT); this.leftBPillarTrim = new InspectionPointDTO(InspectionStatus.PERFECT); this.rightBtoCPillarBeading = new InspectionPointDTO(InspectionStatus.PERFECT); this.leftRunningBoard = new InspectionPointDTO(InspectionStatus.PERFECT); this.rightRunningBoard = new InspectionPointDTO(InspectionStatus.PERFECT); this.frontWindshield = new InspectionPointDTO(InspectionStatus.PERFECT); this.rearWindshield = new InspectionPointDTO(InspectionStatus.PERFECT); this.chassisCondition = new InspectionPointDTO(InspectionStatus.PERFECT); this.apron = new InspectionPointDTO(InspectionStatus.PERFECT); this.bootFloor = new InspectionPointDTO(InspectionStatus.PERFECT); this.firewallCondition = new InspectionPointDTO(InspectionStatus.PERFECT); this.leftFrontAlloyRim = new InspectionPointDTO(InspectionStatus.PERFECT); this.leftRearAlloyRim = new InspectionPointDTO(InspectionStatus.PERFECT); this.rightFrontAlloyRim = new InspectionPointDTO(InspectionStatus.PERFECT); this.rightRearAlloyRim = new InspectionPointDTO(InspectionStatus.PERFECT); this.spareAlloyRimCondition = new InspectionPointDTO(InspectionStatus.PERFECT); this.wheelCover = new InspectionPointDTO(InspectionStatus.PERFECT); this.grillCondition = new InspectionPointDTO(InspectionStatus.PERFECT); this.windowGlass = new InspectionPointDTO(InspectionStatus.PERFECT); this.wiper = new InspectionPointDTO(InspectionStatus.PERFECT); this.panelCondition = new InspectionPointDTO(InspectionStatus.PERFECT); } } __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "frontLeftDoor", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "frontRightDoor", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "rearLeftDoor", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "rearRightDoor", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "leftFender", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "rightFender", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "frontBumper", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "rearBumper", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "hood", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "trunk", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "roof", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "leftQuarterPanel", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "rightQuarterPanel", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "leftAPillar", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "rightAPillar", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "leftAtoBPillarBeading", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "rightAtoBPillarBeading", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "leftBPillarTrim", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "rightBtoCPillarBeading", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "leftRunningBoard", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "rightRunningBoard", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "frontWindshield", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "rearWindshield", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "chassisCondition", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "apron", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "bootFloor", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "firewallCondition", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "leftFrontAlloyRim", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "leftRearAlloyRim", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "rightFrontAlloyRim", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "rightRearAlloyRim", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "spareAlloyRimCondition", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "wheelCover", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "grillCondition", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "windowGlass", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "wiper", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ExteriorInspectionDTO.prototype, "panelCondition", void 0); exports.ExteriorInspectionDTO = ExteriorInspectionDTO; // Define TyresInspectionDTO class TyresInspectionDTO extends BaseInspectionDTO { constructor() { super(); this.leftFrontTyre = new InspectionPointDTO(InspectionStatus.PERFECT); this.rightFrontTyre = new InspectionPointDTO(InspectionStatus.PERFECT); this.leftRearTyre = new InspectionPointDTO(InspectionStatus.PERFECT); this.rightRearTyre = new InspectionPointDTO(InspectionStatus.PERFECT); this.spareTyre = new InspectionPointDTO(InspectionStatus.PERFECT); this.leftFrontTyreLife = 100; this.rightFrontTyreLife = 100; this.leftRearTyreLife = 100; this.rightRearTyreLife = 100; this.spareTyreLife = 100; } } __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], TyresInspectionDTO.prototype, "leftFrontTyre", void 0); __decorate([ (0, class_validator_1.IsNumber)(), (0, class_validator_1.Min)(0), (0, class_validator_1.Max)(100), __metadata("design:type", Number) ], TyresInspectionDTO.prototype, "leftFrontTyreLife", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], TyresInspectionDTO.prototype, "rightFrontTyre", void 0); __decorate([ (0, class_validator_1.IsNumber)(), (0, class_validator_1.Min)(0), (0, class_validator_1.Max)(100), __metadata("design:type", Number) ], TyresInspectionDTO.prototype, "rightFrontTyreLife", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], TyresInspectionDTO.prototype, "leftRearTyre", void 0); __decorate([ (0, class_validator_1.IsNumber)(), (0, class_validator_1.Min)(0), (0, class_validator_1.Max)(100), __metadata("design:type", Number) ], TyresInspectionDTO.prototype, "leftRearTyreLife", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], TyresInspectionDTO.prototype, "rightRearTyre", void 0); __decorate([ (0, class_validator_1.IsNumber)(), (0, class_validator_1.Min)(0), (0, class_validator_1.Max)(100), __metadata("design:type", Number) ], TyresInspectionDTO.prototype, "rightRearTyreLife", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], TyresInspectionDTO.prototype, "spareTyre", void 0); __decorate([ (0, class_validator_1.IsNumber)(), (0, class_validator_1.Min)(0), (0, class_validator_1.Max)(100), __metadata("design:type", Number) ], TyresInspectionDTO.prototype, "spareTyreLife", void 0); exports.TyresInspectionDTO = TyresInspectionDTO; class SteeringAndSuspensionInspectionDTO extends BaseInspectionDTO { constructor() { super(); this.steeringWheel = new InspectionPointDTO(InspectionStatus.PERFECT); this.parkingBrake = new InspectionPointDTO(InspectionStatus.PERFECT); this.brakeMasterCylinder = new InspectionPointDTO(InspectionStatus.PERFECT); this.brakeDiscAndPad = new InspectionPointDTO(InspectionStatus.PERFECT); this.brakeFluid = new InspectionPointDTO(InspectionStatus.PERFECT); this.shockAbsorbers = new InspectionPointDTO(InspectionStatus.PERFECT); } } __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], SteeringAndSuspensionInspectionDTO.prototype, "steeringWheel", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], SteeringAndSuspensionInspectionDTO.prototype, "parkingBrake", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], SteeringAndSuspensionInspectionDTO.prototype, "brakeMasterCylinder", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], SteeringAndSuspensionInspectionDTO.prototype, "brakeDiscAndPad", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], SteeringAndSuspensionInspectionDTO.prototype, "brakeFluid", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], SteeringAndSuspensionInspectionDTO.prototype, "shockAbsorbers", void 0); exports.SteeringAndSuspensionInspectionDTO = SteeringAndSuspensionInspectionDTO; class InteriorInspectionDTO extends BaseInspectionDTO { constructor() { super(); this.dashboard = new InspectionPointDTO(InspectionStatus.PERFECT); this.centralConsole = new InspectionPointDTO(InspectionStatus.PERFECT); this.gloveBox = new InspectionPointDTO(InspectionStatus.PERFECT); this.sunvisor = new InspectionPointDTO(InspectionStatus.PERFECT); this.seatUpholstery = new InspectionPointDTO(InspectionStatus.PERFECT); this.carpets = new InspectionPointDTO(InspectionStatus.PERFECT); this.headliner = new InspectionPointDTO(InspectionStatus.PERFECT); this.manualSeatMovement = new InspectionPointDTO(InspectionStatus.PERFECT); this.seatBelts = new InspectionPointDTO(InspectionStatus.PERFECT); this.headRest = new InspectionPointDTO(InspectionStatus.PERFECT); this.doorControls = new InspectionPointDTO(InspectionStatus.PERFECT); this.grabHandle = new InspectionPointDTO(InspectionStatus.PERFECT); this.rearViewMirror = new InspectionPointDTO(InspectionStatus.PERFECT); this.toolKit = new InspectionPointDTO(InspectionStatus.PERFECT); } } __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], InteriorInspectionDTO.prototype, "dashboard", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], InteriorInspectionDTO.prototype, "centralConsole", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], InteriorInspectionDTO.prototype, "gloveBox", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], InteriorInspectionDTO.prototype, "sunvisor", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], InteriorInspectionDTO.prototype, "seatUpholstery", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], InteriorInspectionDTO.prototype, "carpets", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], InteriorInspectionDTO.prototype, "headliner", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], InteriorInspectionDTO.prototype, "manualSeatMovement", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], InteriorInspectionDTO.prototype, "seatBelts", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], InteriorInspectionDTO.prototype, "headRest", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], InteriorInspectionDTO.prototype, "doorControls", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], InteriorInspectionDTO.prototype, "grabHandle", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], InteriorInspectionDTO.prototype, "rearViewMirror", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], InteriorInspectionDTO.prototype, "toolKit", void 0); exports.InteriorInspectionDTO = InteriorInspectionDTO; class EngineInspectionDTO extends BaseInspectionDTO { constructor() { super(); this.engineBody = new InspectionPointDTO(InspectionStatus.PERFECT); this.enginePerformance = new InspectionPointDTO(InspectionStatus.PERFECT); this.engineOil = new InspectionPointDTO(InspectionStatus.PERFECT); this.exhaustSystem = new InspectionPointDTO(InspectionStatus.PERFECT); this.radiator = new InspectionPointDTO(InspectionStatus.PERFECT); this.coolant = new InspectionPointDTO(InspectionStatus.PERFECT); this.fuelTank = new InspectionPointDTO(InspectionStatus.PERFECT); this.gearShifting = new InspectionPointDTO(InspectionStatus.PERFECT); this.driveAxle = new InspectionPointDTO(InspectionStatus.PERFECT); this.transmissionFluid = new InspectionPointDTO(InspectionStatus.PERFECT); } } __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], EngineInspectionDTO.prototype, "engineBody", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], EngineInspectionDTO.prototype, "enginePerformance", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], EngineInspectionDTO.prototype, "engineOil", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], EngineInspectionDTO.prototype, "exhaustSystem", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], EngineInspectionDTO.prototype, "radiator", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], EngineInspectionDTO.prototype, "coolant", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], EngineInspectionDTO.prototype, "fuelTank", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], EngineInspectionDTO.prototype, "gearShifting", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], EngineInspectionDTO.prototype, "driveAxle", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], EngineInspectionDTO.prototype, "transmissionFluid", void 0); exports.EngineInspectionDTO = EngineInspectionDTO; class ElectricalsInspectionDTO extends BaseInspectionDTO { constructor() { super(); this.masterKey = new InspectionPointDTO(InspectionStatus.PERFECT); this.spareKey = new InspectionPointDTO(InspectionStatus.PERFECT); this.childSafetyLocking = new InspectionPointDTO(InspectionStatus.PERFECT); this.instrumentPanel = new InspectionPointDTO(InspectionStatus.PERFECT); this.airbags = new InspectionPointDTO(InspectionStatus.PERFECT); this.controls = new InspectionPointDTO(InspectionStatus.PERFECT); this.cruiseControl = new InspectionPointDTO(InspectionStatus.PERFECT); this.infotainmentDisplay = new InspectionPointDTO(InspectionStatus.PERFECT); this.obdConnector = new InspectionPointDTO(InspectionStatus.PERFECT); this.musicSystem = new InspectionPointDTO(InspectionStatus.PERFECT); this.headlight = new InspectionPointDTO(InspectionStatus.PERFECT); this.interiorLights = new InspectionPointDTO(InspectionStatus.PERFECT); this.tailLightCluster = new InspectionPointDTO(InspectionStatus.PERFECT); this.licensePlateLight = new InspectionPointDTO(InspectionStatus.PERFECT); this.acCooling = new InspectionPointDTO(InspectionStatus.PERFECT); this.acSwitch = new InspectionPointDTO(InspectionStatus.PERFECT); this.acLeaks = new InspectionPointDTO(InspectionStatus.PERFECT); this.centerAcVent = new InspectionPointDTO(InspectionStatus.PERFECT); this.frontRightAcVent = new InspectionPointDTO(InspectionStatus.PERFECT); this.heater = new InspectionPointDTO(InspectionStatus.PERFECT); this.parkingSensors = new InspectionPointDTO(InspectionStatus.PERFECT); this.rearDefogger = new InspectionPointDTO(InspectionStatus.PERFECT); this.usbChargingPort = new InspectionPointDTO(InspectionStatus.PERFECT); this.powerManualWindows = new InspectionPointDTO(InspectionStatus.PERFECT); } } __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ElectricalsInspectionDTO.prototype, "masterKey", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ElectricalsInspectionDTO.prototype, "spareKey", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ElectricalsInspectionDTO.prototype, "childSafetyLocking", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ElectricalsInspectionDTO.prototype, "instrumentPanel", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ElectricalsInspectionDTO.prototype, "airbags", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ElectricalsInspectionDTO.prototype, "controls", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ElectricalsInspectionDTO.prototype, "cruiseControl", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ElectricalsInspectionDTO.prototype, "infotainmentDisplay", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ElectricalsInspectionDTO.prototype, "obdConnector", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ElectricalsInspectionDTO.prototype, "musicSystem", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ElectricalsInspectionDTO.prototype, "headlight", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ElectricalsInspectionDTO.prototype, "interiorLights", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ElectricalsInspectionDTO.prototype, "tailLightCluster", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ElectricalsInspectionDTO.prototype, "licensePlateLight", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ElectricalsInspectionDTO.prototype, "acCooling", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ElectricalsInspectionDTO.prototype, "acSwitch", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ElectricalsInspectionDTO.prototype, "acLeaks", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ElectricalsInspectionDTO.prototype, "centerAcVent", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ElectricalsInspectionDTO.prototype, "frontRightAcVent", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ElectricalsInspectionDTO.prototype, "heater", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ElectricalsInspectionDTO.prototype, "parkingSensors", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ElectricalsInspectionDTO.prototype, "rearDefogger", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ElectricalsInspectionDTO.prototype, "usbChargingPort", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InspectionPointDTO), __metadata("design:type", InspectionPointDTO) ], ElectricalsInspectionDTO.prototype, "powerManualWindows", void 0); exports.ElectricalsInspectionDTO = ElectricalsInspectionDTO; class VehicleInspectionDTO { validate() { const errors = (0, class_validator_1.validateSync)(this); return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat(); } static fromPlain(plain) { return (0, class_transformer_1.plainToClass)(VehicleInspectionDTO, plain); } toPlain() { return (0, class_transformer_1.instanceToPlain)(this); } } __decorate([ (0, class_validator_1.IsString)(), __metadata("design:type", String) ], VehicleInspectionDTO.prototype, "vehicle", void 0); __decorate([ (0, class_validator_1.IsString)(), (0, class_validator_2.IsOptional)(), __metadata("design:type", String) ], VehicleInspectionDTO.prototype, "inspectorId", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => ExteriorInspectionDTO), __metadata("design:type", ExteriorInspectionDTO) ], VehicleInspectionDTO.prototype, "exterior", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => SteeringAndSuspensionInspectionDTO), __metadata("design:type", SteeringAndSuspensionInspectionDTO) ], VehicleInspectionDTO.prototype, "steeringAndSuspension", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => InteriorInspectionDTO), __metadata("design:type", InteriorInspectionDTO) ], VehicleInspectionDTO.prototype, "interior", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => EngineInspectionDTO), __metadata("design:type", EngineInspectionDTO) ], VehicleInspectionDTO.prototype, "engine", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => ElectricalsInspectionDTO), __metadata("design:type", ElectricalsInspectionDTO) ], VehicleInspectionDTO.prototype, "electricals", void 0); __decorate([ (0, class_validator_2.ValidateNested)(), (0, class_transformer_1.Type)(() => TyresInspectionDTO), __metadata("design:type", TyresInspectionDTO) ], VehicleInspectionDTO.prototype, "tyres", void 0); __decorate([ (0, class_validator_2.IsOptional)(), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Array) ], VehicleInspectionDTO.prototype, "validate", null); exports.VehicleInspectionDTO = VehicleInspectionDTO;