forked from Yara724/api
blame and claim refactored
This commit is contained in:
@@ -101,3 +101,27 @@ export class AllRequestDtoRs {
|
||||
this.data = requests.map((r) => new AllRequestDto(r));
|
||||
}
|
||||
}
|
||||
|
||||
/** V2: list item from blameCases (BlameRequest) for expert panel */
|
||||
export class AllRequestDtoV2 {
|
||||
requestId: string;
|
||||
status: string;
|
||||
userComment: null;
|
||||
requestCode: string;
|
||||
date: string;
|
||||
time: string;
|
||||
updatedAtDate: string;
|
||||
updatedAtTime: string;
|
||||
lockFile: boolean;
|
||||
lockTime: string | null;
|
||||
type: string;
|
||||
blameStatus: string;
|
||||
partiesInitialForms: { firstParty: string; secondParty: string };
|
||||
}
|
||||
|
||||
export class AllRequestDtoRsV2 {
|
||||
data: AllRequestDtoV2[];
|
||||
constructor(items: AllRequestDtoV2[]) {
|
||||
this.data = items;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,42 +3,81 @@ import { Types } from "mongoose";
|
||||
import { BlameDocumentType } from "src/request-management/entities/schema/blame-document.schema";
|
||||
|
||||
export class AccidentWayIF {
|
||||
@ApiProperty({ required: true })
|
||||
@ApiProperty({ required: true, example: "9" })
|
||||
id: string;
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@ApiProperty({ required: true, example: "جلو به پهلو" })
|
||||
label: string;
|
||||
}
|
||||
export class AccidentReasonIF {
|
||||
@ApiProperty({ required: true })
|
||||
@ApiProperty({ required: true, example: "23" })
|
||||
id: string;
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@ApiProperty({ required: true, example: "عدم رعايت فاصله جانبی" })
|
||||
label: string;
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@ApiProperty({ required: true, example: 3 })
|
||||
fanavaran: number;
|
||||
}
|
||||
|
||||
export class FieldsInterface {
|
||||
@ApiProperty({ required: true })
|
||||
@ApiProperty({
|
||||
required: true,
|
||||
example: { id: "9", label: "جلو به پهلو" },
|
||||
})
|
||||
accidentWay: AccidentWayIF;
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@ApiProperty({
|
||||
required: true,
|
||||
example: {
|
||||
id: "23",
|
||||
label: "عدم رعايت فاصله جانبی",
|
||||
fanavaran: 3,
|
||||
},
|
||||
})
|
||||
accidentReason: AccidentReasonIF;
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@ApiProperty({
|
||||
required: true,
|
||||
example: {
|
||||
id: "3",
|
||||
label: "برخورد یک وسیله نقلیه با وسیله نقلیه پارک شده",
|
||||
},
|
||||
})
|
||||
accidentType: AccidentWayIF;
|
||||
}
|
||||
|
||||
export class SubmitReplyDto {
|
||||
@ApiProperty({ required: true })
|
||||
@ApiProperty({
|
||||
required: true,
|
||||
example: "Expert's decision explanation",
|
||||
description: "Detailed explanation of the expert's decision",
|
||||
})
|
||||
description: string;
|
||||
|
||||
@ApiProperty({ required: true, type: Types.ObjectId })
|
||||
@ApiProperty({
|
||||
required: true,
|
||||
type: String,
|
||||
example: "507f1f77bcf86cd799439011",
|
||||
description: "ObjectId of the guilty party",
|
||||
})
|
||||
guiltyUserId: Types.ObjectId;
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@ApiProperty({
|
||||
required: true,
|
||||
example: {
|
||||
accidentWay: { id: "9", label: "جلو به پهلو" },
|
||||
accidentReason: {
|
||||
id: "23",
|
||||
label: "عدم رعايت فاصله جانبی",
|
||||
fanavaran: 3,
|
||||
},
|
||||
accidentType: {
|
||||
id: "3",
|
||||
label: "برخورد یک وسیله نقلیه با وسیله نقلیه پارک شده",
|
||||
},
|
||||
},
|
||||
})
|
||||
fields: FieldsInterface;
|
||||
}
|
||||
|
||||
|
||||
45
src/expert-blame/dto/resend.dto.ts
Normal file
45
src/expert-blame/dto/resend.dto.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import { ApiProperty } from "@nestjs/swagger";
|
||||
import { Types } from "mongoose";
|
||||
import { ResendItemType } from "src/Types&Enums/blame-request-management/resendItemType.enum";
|
||||
|
||||
export class PartyResendRequestDto {
|
||||
@ApiProperty({
|
||||
required: true,
|
||||
type: String,
|
||||
example: "507f1f77bcf86cd799439011",
|
||||
description: "userId (person.userId) of the party member to request documents from",
|
||||
})
|
||||
partyId: Types.ObjectId;
|
||||
|
||||
@ApiProperty({
|
||||
required: true,
|
||||
isArray: true,
|
||||
enum: ResendItemType,
|
||||
example: [ResendItemType.DRIVING_LICENSE, ResendItemType.CAR_CERTIFICATE],
|
||||
description: "Array of items to request from this party",
|
||||
})
|
||||
requestedItems: ResendItemType[];
|
||||
|
||||
@ApiProperty({
|
||||
required: false,
|
||||
example: "Please resend your driving license and car certificate with better quality",
|
||||
description: "Optional explanation for why these items are needed",
|
||||
})
|
||||
description?: string;
|
||||
}
|
||||
|
||||
export class ResendRequestDto {
|
||||
@ApiProperty({
|
||||
required: true,
|
||||
type: [PartyResendRequestDto],
|
||||
description: "Array of resend requests (can include first party, second party, or both)",
|
||||
example: [
|
||||
{
|
||||
partyId: "507f1f77bcf86cd799439011",
|
||||
requestedItems: ["drivingLicense", "carCertificate"],
|
||||
description: "Please resend with better quality",
|
||||
},
|
||||
],
|
||||
})
|
||||
parties: PartyResendRequestDto[];
|
||||
}
|
||||
Reference in New Issue
Block a user