forked from Yara724/api
YARA-855
This commit is contained in:
@@ -242,24 +242,19 @@ export class ExpertInsurerController {
|
||||
}
|
||||
|
||||
@ApiParam({ name: "expertId" })
|
||||
@ApiQuery({ name: "role", enum: ["claim", "blame"] })
|
||||
@ApiOperation({
|
||||
summary: "Files handled by one roster expert (summary rows)",
|
||||
description:
|
||||
"Resolves id against this insurer's `expert` then `damage-expert` roster. Blame branch runs when the id is on the expert roster (field experts). Each item is a small summary (`kind`, ids, statuses, dates)—not full file payloads. Claim matches use final or draft damage-expert reply.",
|
||||
})
|
||||
@Get("/:expertId")
|
||||
async requestDetail(
|
||||
@CurrentUser() insurer,
|
||||
@Param("expertId") id: string,
|
||||
@Query("role") role: "claim" | "blame",
|
||||
) {
|
||||
if (!Types.ObjectId.isValid(new Types.ObjectId(id))) {
|
||||
async requestDetail(@CurrentUser() insurer, @Param("expertId") id: string) {
|
||||
if (!Types.ObjectId.isValid(id)) {
|
||||
throw new BadRequestException("Invalid expert ID");
|
||||
}
|
||||
|
||||
if (!["claim", "blame"].includes(role)) {
|
||||
throw new BadRequestException("Invalid role");
|
||||
}
|
||||
|
||||
return await this.expertInsurerService.getAllFilesByExpertAndRole(
|
||||
return await this.expertInsurerService.getAllFilesForInsurerExpert(
|
||||
id,
|
||||
role,
|
||||
insurer.clientKey,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user