forked from Yara724/api
Initial commit after migration to gitea
This commit is contained in:
108
src/claim-request-management/dto/car-part.dto.ts
Normal file
108
src/claim-request-management/dto/car-part.dto.ts
Normal file
@@ -0,0 +1,108 @@
|
||||
import { ApiProperty } from "@nestjs/swagger";
|
||||
|
||||
export class MainParts {
|
||||
@ApiProperty({ default: false })
|
||||
backFender: boolean;
|
||||
|
||||
@ApiProperty({ default: false })
|
||||
backWheel: boolean;
|
||||
|
||||
@ApiProperty({ default: false })
|
||||
backDoor: boolean;
|
||||
|
||||
@ApiProperty({ default: false })
|
||||
frontDoor: boolean;
|
||||
|
||||
@ApiProperty({ default: false })
|
||||
mirror: boolean;
|
||||
|
||||
@ApiProperty({ default: false })
|
||||
frontWheel: boolean;
|
||||
|
||||
@ApiProperty({ default: false })
|
||||
frontFender: boolean;
|
||||
|
||||
@ApiProperty({ default: false })
|
||||
backWindow: boolean;
|
||||
|
||||
@ApiProperty({ default: false })
|
||||
frontWindow: boolean;
|
||||
}
|
||||
export class FrontParts {
|
||||
@ApiProperty({ default: false })
|
||||
frontBumper: boolean;
|
||||
|
||||
@ApiProperty({ default: false })
|
||||
frontCarWindshield: boolean;
|
||||
|
||||
@ApiProperty({ default: false })
|
||||
carHood: boolean;
|
||||
|
||||
@ApiProperty({ default: false })
|
||||
leftLight: boolean;
|
||||
|
||||
@ApiProperty({ default: false })
|
||||
rightLight: boolean;
|
||||
|
||||
@ApiProperty({ default: false, description: "جلو پنجره " })
|
||||
frontGrille: boolean;
|
||||
}
|
||||
export class BackParts {
|
||||
@ApiProperty({ default: false })
|
||||
backBumper: boolean;
|
||||
|
||||
@ApiProperty({ default: false })
|
||||
carTrunk: boolean;
|
||||
|
||||
@ApiProperty({ default: false })
|
||||
backCarWindshield: boolean;
|
||||
|
||||
@ApiProperty({ default: false })
|
||||
leftLight: boolean;
|
||||
|
||||
@ApiProperty({ default: false })
|
||||
rightLight: boolean;
|
||||
}
|
||||
export class TopParts {
|
||||
@ApiProperty({ default: false })
|
||||
roof: boolean;
|
||||
}
|
||||
export class CarDamagePartDto {
|
||||
@ApiProperty({ type: MainParts })
|
||||
left: MainParts[];
|
||||
|
||||
@ApiProperty({ type: MainParts })
|
||||
right: MainParts[];
|
||||
|
||||
@ApiProperty({ type: FrontParts })
|
||||
front: FrontParts[];
|
||||
|
||||
@ApiProperty({ type: BackParts })
|
||||
back: BackParts[];
|
||||
|
||||
@ApiProperty({ type: TopParts })
|
||||
top: TopParts[];
|
||||
}
|
||||
|
||||
export class OtherCarDamagePartDto {
|
||||
@ApiProperty({
|
||||
format: "array",
|
||||
description: "please add items of json into array",
|
||||
example: [{ "حسگر درها": true }],
|
||||
})
|
||||
otherParts: [];
|
||||
|
||||
@ApiProperty({ format: "string" })
|
||||
sheba: string;
|
||||
|
||||
@ApiProperty({ format: "string" })
|
||||
nationalCodeOfInsurer: string;
|
||||
|
||||
@ApiProperty({ type: "string", format: "binary", required: true })
|
||||
file: Express.Multer.File;
|
||||
}
|
||||
|
||||
export class CaptureCarPartDto {
|
||||
@ApiProperty({ type: "string", format: "binary", required: true })
|
||||
file: Express.Multer.File;
|
||||
}
|
||||
16
src/claim-request-management/dto/claim-detail.ts
Normal file
16
src/claim-request-management/dto/claim-detail.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { ClaimRequestManagementModel } from "src/claim-request-management/entites/schema/claim-request-management.schema";
|
||||
|
||||
export class ClaimPartUploadDetail {
|
||||
list: any;
|
||||
constructor(claimFile: ClaimRequestManagementModel[]) {
|
||||
this.list = claimFile
|
||||
.map((c) => {
|
||||
return {
|
||||
carPartDamage: c.carPartDamage,
|
||||
carOtherPartDamage: c.otherParts,
|
||||
greenCardUpload: !!c.carGreenCard.path,
|
||||
};
|
||||
})
|
||||
.flat(2);
|
||||
}
|
||||
}
|
||||
17
src/claim-request-management/dto/claim-rs-dto.ts
Normal file
17
src/claim-request-management/dto/claim-rs-dto.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { ClaimRequestManagementModel } from "src/claim-request-management/entites/schema/claim-request-management.schema";
|
||||
import { ReqClaimStatus } from "src/Types&Enums/claim-request-management/status.enum";
|
||||
|
||||
export class ClaimRequestDtoRs {
|
||||
requestDetail: any;
|
||||
messsage: string;
|
||||
status: ReqClaimStatus;
|
||||
constructor(
|
||||
req: ClaimRequestManagementModel,
|
||||
message: string,
|
||||
status: ReqClaimStatus,
|
||||
) {
|
||||
this.requestDetail = req;
|
||||
this.messsage = message;
|
||||
this.status = status;
|
||||
}
|
||||
}
|
||||
8
src/claim-request-management/dto/create-claim.dto.ts
Normal file
8
src/claim-request-management/dto/create-claim.dto.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
export class CreateClaimRequestDtoRs {
|
||||
message: string;
|
||||
requestId: string;
|
||||
constructor(requestId: string, message: string) {
|
||||
this.requestId = requestId;
|
||||
this.message = message;
|
||||
}
|
||||
}
|
||||
8
src/claim-request-management/dto/image-required.dto.ts
Normal file
8
src/claim-request-management/dto/image-required.dto.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { ClaimRequestManagementModel } from "src/claim-request-management/entites/schema/claim-request-management.schema";
|
||||
|
||||
export class ImageRequiredDto {
|
||||
public list: {} = {};
|
||||
constructor(imageModel: ClaimRequestManagementModel) {
|
||||
this.list = imageModel.imageRequired;
|
||||
}
|
||||
}
|
||||
12
src/claim-request-management/dto/in-person-visit.dto.ts
Normal file
12
src/claim-request-management/dto/in-person-visit.dto.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { ApiProperty } from "@nestjs/swagger";
|
||||
import { IsMongoId, IsNotEmpty } from "class-validator";
|
||||
|
||||
export class InPersonVisitDto {
|
||||
@ApiProperty({
|
||||
example: "60d5ec49e7b2f8001c8e4d2a",
|
||||
description: "The unique ID of the branch the user is being sent to.",
|
||||
})
|
||||
@IsNotEmpty()
|
||||
@IsMongoId()
|
||||
branchId: string;
|
||||
}
|
||||
23
src/claim-request-management/dto/my-request.dto.ts
Normal file
23
src/claim-request-management/dto/my-request.dto.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { Types } from "mongoose";
|
||||
import { ClaimRequestManagementModel } from "src/claim-request-management/entites/schema/claim-request-management.schema";
|
||||
import { ReqClaimStatus } from "src/Types&Enums/claim-request-management/status.enum";
|
||||
|
||||
export class MyRequestsDtoList {
|
||||
status: ReqClaimStatus;
|
||||
submitDate: string;
|
||||
numberOfRequest: number;
|
||||
_id: Types.ObjectId;
|
||||
constructor(request: ClaimRequestManagementModel) {
|
||||
this._id = request["_id"];
|
||||
this.status = request.claimStatus;
|
||||
this.submitDate = new Date(request.createdAt).toLocaleString("fa-IR");
|
||||
this.numberOfRequest = request.requestNumber;
|
||||
}
|
||||
}
|
||||
|
||||
export class MyRequestsDto {
|
||||
public list = [];
|
||||
constructor(requests: ClaimRequestManagementModel[]) {
|
||||
this.list = requests.map((r) => new MyRequestsDtoList(r));
|
||||
}
|
||||
}
|
||||
19
src/claim-request-management/dto/submit-reply.dto.ts
Normal file
19
src/claim-request-management/dto/submit-reply.dto.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { ClaimRequestManagementModel } from "src/claim-request-management/entites/schema/claim-request-management.schema";
|
||||
import { UserCommentDto } from "src/claim-request-management/dto/user-comment.dto";
|
||||
|
||||
export class SubmitUserReplyDtoRs {
|
||||
requestId: string;
|
||||
partsNeedFactorDetail: object;
|
||||
partsNeedFactor: boolean;
|
||||
userComment: UserCommentDto;
|
||||
constructor(
|
||||
claim: ClaimRequestManagementModel,
|
||||
partsFactorDetail?,
|
||||
partsNeedFactor?,
|
||||
) {
|
||||
this.requestId = claim["_id"];
|
||||
this.partsNeedFactorDetail = partsFactorDetail;
|
||||
this.partsNeedFactor = partsNeedFactor;
|
||||
this.userComment = claim.damageExpertReply.userComment;
|
||||
}
|
||||
}
|
||||
12
src/claim-request-management/dto/user-comment.dto.ts
Normal file
12
src/claim-request-management/dto/user-comment.dto.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { ApiProperty } from "@nestjs/swagger";
|
||||
|
||||
export class UserCommentDto {
|
||||
@ApiProperty({ type: Boolean })
|
||||
isAccept: boolean;
|
||||
|
||||
@ApiProperty({ type: "string", format: "binary", required: false })
|
||||
file?: Express.Multer.File;
|
||||
|
||||
@ApiProperty({ type: String })
|
||||
branch?: string;
|
||||
}
|
||||
47
src/claim-request-management/dto/user-objection.dto.ts
Normal file
47
src/claim-request-management/dto/user-objection.dto.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import { ApiProperty } from "@nestjs/swagger";
|
||||
import { Type } from "class-transformer";
|
||||
import { TypeOfDamage } from "src/Types&Enums/claim-request-management/type-of-damage.enum";
|
||||
|
||||
export class UserObjectionPartDto {
|
||||
@ApiProperty()
|
||||
partId: string;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
reason?: string;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
partPrice?: string;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
partSalary?: string;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
typeOfDamage?: TypeOfDamage;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
carPartDamage?: string;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
side?: string;
|
||||
}
|
||||
|
||||
export class NewPartDto {
|
||||
@ApiProperty({ required: false, nullable: true })
|
||||
partId: string | null;
|
||||
|
||||
@ApiProperty()
|
||||
partName: string;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
side?: string;
|
||||
}
|
||||
|
||||
export class UserObjectionDto {
|
||||
@ApiProperty({ type: [UserObjectionPartDto], required: false })
|
||||
@Type(() => UserObjectionPartDto)
|
||||
objectionParts?: UserObjectionPartDto[];
|
||||
|
||||
@ApiProperty({ type: [NewPartDto], required: false })
|
||||
@Type(() => NewPartDto)
|
||||
newParts?: NewPartDto[];
|
||||
}
|
||||
4
src/claim-request-management/dto/user-reply.dto.ts
Normal file
4
src/claim-request-management/dto/user-reply.dto.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export class UserReplyDtoRs {
|
||||
requestId: string;
|
||||
isAccept: string;
|
||||
}
|
||||
Reference in New Issue
Block a user