Files
yara724-api/src/expert-claim/dto/claim-list-v2.dto.ts
2026-08-19 12:30:53 +03:30

117 lines
3.9 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { BlameRequestType } from 'src/Types&Enums/blame-request-management/blameRequestType.enum';
export class ClaimListItemV2Dto {
@ApiProperty({ description: 'Claim case ID' })
claimRequestId: string;
@ApiProperty({ description: 'Public ID shared across blame+claim', example: 'A14235' })
publicId: string;
@ApiProperty({
description:
"ClaimCaseStatus (expert list may normalize EXPERT_REVIEWING → WAITING_FOR_DAMAGE_EXPERT). Post-expert owner phase: INSURER_REVIEW_* / OWNER_REPAIR_FACTOR_UPLOAD_PENDING / EXPERT_VALIDATING_REPAIR_FACTORS; see expert reply & validate-factors docs.",
example: "WAITING_FOR_DAMAGE_EXPERT",
})
status: string;
@ApiPropertyOptional({
description: "Calculated unified blame+claim lifecycle status",
example: "WAITING_FOR_DAMAGE_EXPERT",
})
unifiedFileStatus?: string;
@ApiProperty({ description: 'Workflow step', example: 'USER_SUBMISSION_COMPLETE' })
currentStep: string;
@ApiProperty({ description: 'Whether the claim is locked by another expert', example: false })
locked: boolean;
@ApiPropertyOptional({ description: 'Actor who locked this claim (only while lock is active)' })
lockedBy?: {
actorId: string;
actorName: string;
lockedAt?: string;
expiredAt?: string;
};
@ApiPropertyOptional({ description: 'Vehicle info from snapshot' })
vehicle?: {
carName?: string;
carModel?: string;
carType?: string;
};
@ApiPropertyOptional({
description: 'Blame file type from linked blame case',
enum: BlameRequestType,
example: BlameRequestType.THIRD_PARTY,
})
blameRequestType?: BlameRequestType;
@ApiPropertyOptional({
description: 'How the blame file was initiated: IN_PERSON or LINK',
example: 'IN_PERSON',
})
creationMethod?: string;
@ApiPropertyOptional({
description:
'CAR_BODY only: first-step flags — accident involved another car (`car`) and/or fixed object (`object`)',
example: { car: true, object: false },
})
carBodyFirstForm?: { car?: boolean; object?: boolean };
@ApiPropertyOptional({
description: 'Linked blame file ID (present when the claim originates from a blame case)',
example: '6a3a6f171aadfa0cc313c582',
})
blameRequestId?: string;
@ApiProperty({ description: 'Submission date', example: '2026-02-22T10:00:00.000Z' })
createdAt: string;
@ApiPropertyOptional({
description:
"True in the expert repair-factor validation queue: `status=EXPERT_VALIDATING_REPAIR_FACTORS` (or legacy `WAITING_FOR_INSURER_APPROVAL`) with `claimStatus=UNDER_REVIEW` and `currentStep=EXPERT_COST_EVALUATION`.",
})
awaitingFactorValidation?: boolean;
@ApiPropertyOptional({
description:
"True for V5 files — the FileMaker must approve or reject the claim before it is submitted to fanavaran. False (or absent) for V4 files which go straight through.",
example: true,
})
requiresFileMakerApproval?: boolean;
@ApiPropertyOptional({
description:
"V5 only. Number of times the FileMaker has rejected this claim (0–2). When this reaches 2 the FileMaker can only approve.",
example: 1,
})
fileMakerRejectionCount?: number;
@ApiPropertyOptional({
description: "V5 only. Reason text supplied with the most recent FileMaker rejection.",
example: "Damage assessment is incorrect — please re-evaluate parts X and Y",
})
fileMakerRejectionReason?: string;
}
export class GetClaimListV2ResponseDto {
@ApiProperty({ type: [ClaimListItemV2Dto] })
list: ClaimListItemV2Dto[];
@ApiProperty({ description: 'Total count after search filter' })
total: number;
@ApiPropertyOptional({ description: 'Current page when paginating' })
page?: number;
@ApiPropertyOptional({ description: 'Page size when paginating' })
limit?: number;
@ApiPropertyOptional({ description: 'Total pages when paginating' })
totalPages?: number;
}