forked from Yara724/api
117 lines
3.9 KiB
TypeScript
117 lines
3.9 KiB
TypeScript
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;
|
||
}
|