forked from Yara724/api
81 lines
2.1 KiB
TypeScript
81 lines
2.1 KiB
TypeScript
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
|
|
import { IsEnum, IsNotEmpty, IsString } from "class-validator";
|
|
import { ClaimRequiredDocumentType } from "src/Types&Enums/claim-request-management/required-document-type.enum";
|
|
|
|
/**
|
|
* V2 DTO for uploading required document
|
|
*/
|
|
export class UploadRequiredDocumentV2Dto {
|
|
@ApiProperty({
|
|
description: "Document type/key",
|
|
example: "car_green_card",
|
|
enum: ClaimRequiredDocumentType,
|
|
})
|
|
@IsNotEmpty({ message: "Document key is required" })
|
|
@IsEnum(ClaimRequiredDocumentType, {
|
|
message: "Invalid document type",
|
|
})
|
|
documentKey: ClaimRequiredDocumentType;
|
|
|
|
@ApiProperty({
|
|
type: "string",
|
|
format: "binary",
|
|
description: "Image file (JPG, PNG, PDF)",
|
|
})
|
|
file: Express.Multer.File;
|
|
}
|
|
|
|
/**
|
|
* Response DTO for upload required document V2
|
|
*/
|
|
export class UploadRequiredDocumentV2ResponseDto {
|
|
@ApiProperty({
|
|
description: "Claim request ID",
|
|
example: "507f1f77bcf86cd799439011",
|
|
})
|
|
claimRequestId: string;
|
|
|
|
@ApiProperty({
|
|
description: "Document key that was uploaded",
|
|
example: "car_green_card",
|
|
})
|
|
documentKey: string;
|
|
|
|
@ApiProperty({
|
|
description: "File URL",
|
|
example:
|
|
"http://localhost:3000/files/documents/car-green-card-1234567890.jpg",
|
|
})
|
|
fileUrl: string;
|
|
|
|
@ApiProperty({
|
|
description: "Whether all required documents are now uploaded",
|
|
example: false,
|
|
})
|
|
allDocumentsUploaded: boolean;
|
|
|
|
@ApiProperty({
|
|
description: "Current workflow step",
|
|
example: "UPLOAD_REQUIRED_DOCUMENTS",
|
|
})
|
|
currentStep: string;
|
|
|
|
@ApiProperty({
|
|
description: "Success message",
|
|
example: "Document uploaded successfully. 12 documents remaining.",
|
|
})
|
|
message: string;
|
|
|
|
@ApiPropertyOptional({
|
|
description:
|
|
"True when the owner finished every damage-expert resend requirement and the claim is back in the expert queue.",
|
|
})
|
|
expertResendComplete?: boolean;
|
|
|
|
@ApiPropertyOptional({
|
|
description:
|
|
"Best-effort Fanavaran attachment upload result. Local document upload still succeeds when this contains a warning.",
|
|
})
|
|
fanavaranAttachment?: unknown;
|
|
}
|