forked from Yara724/api
blame and claim refactored
This commit is contained in:
77
src/expert-claim/dto/claim-detail-v2.dto.ts
Normal file
77
src/expert-claim/dto/claim-detail-v2.dto.ts
Normal file
@@ -0,0 +1,77 @@
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
|
||||
export class ClaimDetailV2ResponseDto {
|
||||
@ApiProperty()
|
||||
claimRequestId: string;
|
||||
|
||||
@ApiProperty()
|
||||
publicId: string;
|
||||
|
||||
@ApiProperty()
|
||||
status: string;
|
||||
|
||||
@ApiProperty()
|
||||
claimStatus: string;
|
||||
|
||||
@ApiProperty()
|
||||
currentStep: string;
|
||||
|
||||
@ApiPropertyOptional()
|
||||
nextStep?: string;
|
||||
|
||||
@ApiProperty({ description: 'Whether claim is locked' })
|
||||
locked: boolean;
|
||||
|
||||
@ApiPropertyOptional()
|
||||
lockedBy?: {
|
||||
actorId: string;
|
||||
actorName: string;
|
||||
lockedAt: string;
|
||||
};
|
||||
|
||||
@ApiPropertyOptional()
|
||||
owner?: {
|
||||
userId: string;
|
||||
fullName?: string;
|
||||
};
|
||||
|
||||
@ApiPropertyOptional()
|
||||
vehicle?: {
|
||||
carName?: string;
|
||||
carModel?: string;
|
||||
carType?: string;
|
||||
plate?: any;
|
||||
};
|
||||
|
||||
@ApiPropertyOptional({ description: 'Blame request ID', example: '507f...' })
|
||||
blameRequestId?: string;
|
||||
|
||||
@ApiPropertyOptional({ description: 'Blame request number', example: 'BL12345' })
|
||||
blameRequestNo?: string;
|
||||
|
||||
@ApiPropertyOptional({ description: 'Selected outer damaged parts' })
|
||||
selectedParts?: string[];
|
||||
|
||||
@ApiPropertyOptional({ description: 'Selected other damaged parts' })
|
||||
otherParts?: string[];
|
||||
|
||||
@ApiPropertyOptional({ description: 'Required documents status' })
|
||||
requiredDocuments?: Record<string, {
|
||||
uploaded: boolean;
|
||||
fileId?: string;
|
||||
fileName?: string;
|
||||
filePath?: string;
|
||||
}>;
|
||||
|
||||
@ApiPropertyOptional({ description: 'Car angles captured' })
|
||||
carAngles?: Record<string, { captured: boolean; url?: string }>;
|
||||
|
||||
@ApiPropertyOptional({ description: 'Damaged parts captured' })
|
||||
damagedParts?: Record<string, { captured: boolean; url?: string }>;
|
||||
|
||||
@ApiProperty()
|
||||
createdAt: string;
|
||||
|
||||
@ApiProperty()
|
||||
updatedAt: string;
|
||||
}
|
||||
42
src/expert-claim/dto/claim-list-v2.dto.ts
Normal file
42
src/expert-claim/dto/claim-list-v2.dto.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
|
||||
export class ClaimListItemV2Dto {
|
||||
@ApiProperty({ description: 'Claim case ID' })
|
||||
claimRequestId: string;
|
||||
|
||||
@ApiProperty({ description: 'Public ID shared across blame+claim', example: 'A14235' })
|
||||
publicId: string;
|
||||
|
||||
@ApiProperty({ description: 'Overall case status', example: 'WAITING_FOR_DAMAGE_EXPERT' })
|
||||
status: 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' })
|
||||
lockedBy?: {
|
||||
actorId: string;
|
||||
actorName: string;
|
||||
};
|
||||
|
||||
@ApiPropertyOptional({ description: 'Vehicle info from snapshot' })
|
||||
vehicle?: {
|
||||
carName?: string;
|
||||
carModel?: string;
|
||||
carType?: string;
|
||||
};
|
||||
|
||||
@ApiProperty({ description: 'Submission date', example: '2026-02-22T10:00:00.000Z' })
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export class GetClaimListV2ResponseDto {
|
||||
@ApiProperty({ type: [ClaimListItemV2Dto] })
|
||||
list: ClaimListItemV2Dto[];
|
||||
|
||||
@ApiProperty({ description: 'Total count' })
|
||||
total: number;
|
||||
}
|
||||
70
src/expert-claim/dto/expert-claim-v2.dto.ts
Normal file
70
src/expert-claim/dto/expert-claim-v2.dto.ts
Normal file
@@ -0,0 +1,70 @@
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import {
|
||||
IsString,
|
||||
IsNotEmpty,
|
||||
IsArray,
|
||||
IsBoolean,
|
||||
IsOptional,
|
||||
ValidateNested,
|
||||
} from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
|
||||
export class CarPartDamageV2Dto {
|
||||
@ApiProperty({ example: 'left' })
|
||||
@IsString()
|
||||
side: string;
|
||||
|
||||
@ApiProperty({ example: 'front_door' })
|
||||
@IsString()
|
||||
part: string;
|
||||
}
|
||||
|
||||
export class PartPricingV2Dto {
|
||||
@ApiProperty({ example: 'part-001' })
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
partId: string;
|
||||
|
||||
@ApiProperty({ type: CarPartDamageV2Dto })
|
||||
@ValidateNested()
|
||||
@Type(() => CarPartDamageV2Dto)
|
||||
carPartDamage: CarPartDamageV2Dto;
|
||||
|
||||
@ApiProperty({ example: 'Minor' })
|
||||
@IsString()
|
||||
typeOfDamage: string;
|
||||
|
||||
@ApiProperty({ example: '5000000' })
|
||||
@IsString()
|
||||
price: string;
|
||||
|
||||
@ApiProperty({ example: '2000000' })
|
||||
@IsString()
|
||||
salary: string;
|
||||
|
||||
@ApiProperty({ example: '7000000' })
|
||||
@IsString()
|
||||
totalPayment: string;
|
||||
|
||||
@ApiPropertyOptional({ example: '500000' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
daghi?: string;
|
||||
|
||||
@ApiProperty({ example: false })
|
||||
@IsBoolean()
|
||||
factorNeeded: boolean;
|
||||
}
|
||||
|
||||
export class SubmitExpertReplyV2Dto {
|
||||
@ApiProperty({ example: 'Front door and hood have severe paint damage' })
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
description: string;
|
||||
|
||||
@ApiProperty({ type: [PartPricingV2Dto] })
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => PartPricingV2Dto)
|
||||
parts: PartPricingV2Dto[];
|
||||
}
|
||||
Reference in New Issue
Block a user