Added inner parts to APIs for expert claim

This commit is contained in:
SepehrYahyaee
2026-07-25 11:10:02 +03:30
parent 777eae1028
commit 4272790fad

View File

@@ -1,3 +1,4 @@
import { readFile } from "node:fs/promises";
import { import {
Body, Body,
Controller, Controller,
@@ -117,6 +118,21 @@ export class ExpertClaimV2Controller {
return this.claimRequestManagementService.getOuterPartsCatalogV2(carType); return this.claimRequestManagementService.getOuterPartsCatalogV2(carType);
} }
@Get("inner-parts-catalog")
@ApiOperation({
summary: "Get inner parts catalog",
description: "Returns the full list of inner car parts from the static catalog.",
})
@ApiResponse({ status: 200, description: "Inner parts catalog (object keyed by part name)" })
async getInnerPartsCatalog() {
const raw = await readFile(`${process.cwd()}/src/static/car-part.json`, "utf-8");
try {
return JSON.parse(raw);
} catch {
return raw;
}
}
@Get("branches") @Get("branches")
@ApiOperation({ @ApiOperation({
summary: "List insurer branches for this damage expert (V2)", summary: "List insurer branches for this damage expert (V2)",