1
0
forked from Yara724/api

Added refactored version of car-body

This commit is contained in:
SepehrYahyaee
2026-03-14 13:36:05 +03:30
parent 64dfd1ca8a
commit b40270f058
15 changed files with 2786 additions and 1547 deletions

View File

@@ -48,44 +48,74 @@ export class FirstPartyFileDto {
}
export class DescriptionDto {
@ApiProperty()
@ApiProperty({ description: "Accident description (required for all types)" })
desc: string;
// CAR_BODY specific fields
@ApiPropertyOptional({
description: "Date of accident (for CAR_BODY type only)",
example: "2025-12-08"
@ApiPropertyOptional({
description: "CAR_BODY only. Ignored for THIRD_PARTY.",
example: "2025-12-08",
})
accidentDate?: Date;
@ApiPropertyOptional({
description: "Time of accident (for CAR_BODY type only)",
example: "14:30"
@ApiPropertyOptional({
description: "CAR_BODY only. Ignored for THIRD_PARTY.",
example: "14:30",
})
accidentTime?: string;
@ApiPropertyOptional({
@ApiPropertyOptional({
enum: WeatherCondition,
description: "Weather condition at time of accident (for CAR_BODY type only)",
example: WeatherCondition.CLEAR
description: "CAR_BODY only. Ignored for THIRD_PARTY.",
example: WeatherCondition.CLEAR,
})
weatherCondition?: WeatherCondition;
@ApiPropertyOptional({
@ApiPropertyOptional({
enum: RoadCondition,
description: "Road condition at time of accident (for CAR_BODY type only)",
example: RoadCondition.DRY
description: "CAR_BODY only. Ignored for THIRD_PARTY.",
example: RoadCondition.DRY,
})
roadCondition?: RoadCondition;
@ApiPropertyOptional({
@ApiPropertyOptional({
enum: LightCondition,
description: "Light condition at time of accident (for CAR_BODY type only)",
example: LightCondition.DAYLIGHT
description: "CAR_BODY only. Ignored for THIRD_PARTY.",
example: LightCondition.DAYLIGHT,
})
lightCondition?: LightCondition;
}
/**
* THIRD_PARTY description step: only desc is accepted.
*/
export class ThirdPartyDescriptionDto {
@ApiProperty({ description: "Accident description" })
desc: string;
}
/**
* CAR_BODY description step: desc + accident date/time and conditions required.
*/
export class CarBodyDescriptionDto {
@ApiProperty({ description: "Accident description" })
desc: string;
@ApiProperty({ description: "Date of accident", example: "2025-12-08" })
accidentDate: Date;
@ApiProperty({ description: "Time of accident", example: "14:30" })
accidentTime: string;
@ApiProperty({ enum: WeatherCondition, example: WeatherCondition.CLEAR })
weatherCondition: WeatherCondition;
@ApiProperty({ enum: RoadCondition, example: RoadCondition.DRY })
roadCondition: RoadCondition;
@ApiProperty({ enum: LightCondition, example: LightCondition.DAYLIGHT })
lightCondition: LightCondition;
}
export class FirstPartyDetail {
// @ApiProperty({ type: String })
firstPartyId?: Types.ObjectId;