1
0
forked from Yara724/api

Rework the reports and insurer part

This commit is contained in:
2026-04-11 00:12:10 +03:30
parent 7ef057dc1f
commit 9afb079786
10 changed files with 564 additions and 1052 deletions

View File

@@ -78,6 +78,7 @@ export class ExpertInsurerController {
@ApiQuery({ name: "role", enum: ["claim", "blame"] })
@Get("/:expertId")
async requestDetail(
@CurrentUser() insurer,
@Param("expertId") id: string,
@Query("role") role: "claim" | "blame",
) {
@@ -89,7 +90,11 @@ export class ExpertInsurerController {
throw new BadRequestException("Invalid role");
}
return await this.expertInsurerService.getAllFilesByExpertAndRole(id, role);
return await this.expertInsurerService.getAllFilesByExpertAndRole(
id,
role,
insurer.clientKey,
);
}
@ApiBody({
@@ -153,6 +158,7 @@ export class ExpertInsurerController {
@ApiQuery({ name: "role", enum: ["claim", "blame"] })
@Put("/:requestId/rating")
async rateExperts(
@CurrentUser() insurer,
@Param("requestId") requestId: string,
@Body() rating: FileRating,
@Query("role") role: "claim" | "blame",
@@ -165,13 +171,13 @@ export class ExpertInsurerController {
requestId,
rating,
role,
insurer.clientKey,
);
}
@Get("branches/:insuranceId")
@ApiParam({ name: "insuranceId" })
async getInsuranceBranches(@Param("insuranceId") insuranceId: string) {
console.log("insuranceId", insuranceId);
return await this.expertInsurerService.retrieveInsuranceBranches(
insuranceId,
);