forked from Yara724/api
Added inner parts to APIs for expert claim
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { readFile } from "node:fs/promises";
|
||||
import {
|
||||
Body,
|
||||
Controller,
|
||||
@@ -117,6 +118,21 @@ export class ExpertClaimV2Controller {
|
||||
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")
|
||||
@ApiOperation({
|
||||
summary: "List insurer branches for this damage expert (V2)",
|
||||
|
||||
Reference in New Issue
Block a user