1
0
forked from Yara724/api

Added GET car-other-parts in v2 as well; deprecated old endpoints and reordered swagger documents

This commit is contained in:
SepehrYahyaee
2026-04-28 10:01:45 +03:30
parent 8caf13cf18
commit bcedd8c6f3
7 changed files with 104 additions and 7 deletions

View File

@@ -13,6 +13,7 @@ import {
UseInterceptors,
UploadedFile,
} from "@nestjs/common";
import { readFile } from "node:fs/promises";
import { ApiBearerAuth, ApiParam, ApiTags, ApiOperation, ApiResponse, ApiBody, ApiConsumes } from "@nestjs/swagger";
import { FileInterceptor } from "@nestjs/platform-express";
import { diskStorage } from "multer";
@@ -273,6 +274,28 @@ export class ClaimRequestManagementV2Controller {
return this.claimRequestManagementService.getOuterPartsCatalogV2(carType);
}
@Get("car-other-part")
@ApiOperation({
summary: "Get other (non-body) parts catalog",
description:
"Returns legacy other-parts catalog used by frontend. Response is parsed JSON.",
})
@ApiResponse({
status: 200,
description: "Other parts catalog",
})
async getCarOtherPartsV2() {
const raw = await readFile(
`${process.cwd()}/src/static/car-part.json`,
"utf-8",
);
try {
return JSON.parse(raw);
} catch {
return raw;
}
}
@Patch("select-outer-parts/:claimRequestId")
@ApiOperation({
summary: "Select Damaged Outer Car Parts (V2 - Step 2)",