forked from Yara724/api
group lookups added also fanavaran module grant access
This commit is contained in:
@@ -107,6 +107,16 @@ export const FANAVARAN_REMOTE_LOOKUPS: FanavaranRemoteLookupDefinition[] = [
|
|||||||
url: `${FANAVARAN_LOOKUP_BASE_URL}/common/base-info/Provinces`,
|
url: `${FANAVARAN_LOOKUP_BASE_URL}/common/base-info/Provinces`,
|
||||||
cacheFile: "provinces.json",
|
cacheFile: "provinces.json",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "used-place",
|
||||||
|
url: `${FANAVARAN_LOOKUP_BASE_URL}/car/code-list/used-place`,
|
||||||
|
cacheFile: "used-place.json",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "dmg-business-line",
|
||||||
|
url: `${FANAVARAN_LOOKUP_BASE_URL}/car/code-list/dmg-business-line`,
|
||||||
|
cacheFile: "dmg-business-line.json",
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export const TEJARAT_STATIC_ACCIDENT_FILES = {
|
export const TEJARAT_STATIC_ACCIDENT_FILES = {
|
||||||
|
|||||||
@@ -16,9 +16,6 @@ import {
|
|||||||
ApiTags,
|
ApiTags,
|
||||||
} from "@nestjs/swagger";
|
} from "@nestjs/swagger";
|
||||||
import { LocalActorAuthGuard } from "src/auth/guards/actor-local.guard";
|
import { LocalActorAuthGuard } from "src/auth/guards/actor-local.guard";
|
||||||
import { RolesGuard } from "src/auth/guards/role.guard";
|
|
||||||
import { Roles } from "src/decorators/roles.decorator";
|
|
||||||
import { RoleEnum } from "src/Types&Enums/role.enum";
|
|
||||||
import { ClaimRequestManagementService } from "src/claim-request-management/claim-request-management.service";
|
import { ClaimRequestManagementService } from "src/claim-request-management/claim-request-management.service";
|
||||||
import {
|
import {
|
||||||
isFanavaranClientKey,
|
isFanavaranClientKey,
|
||||||
@@ -30,8 +27,7 @@ import {
|
|||||||
@ApiTags("fanavaran")
|
@ApiTags("fanavaran")
|
||||||
@Controller("v2/fanavaran")
|
@Controller("v2/fanavaran")
|
||||||
@ApiBearerAuth()
|
@ApiBearerAuth()
|
||||||
@UseGuards(LocalActorAuthGuard, RolesGuard)
|
@UseGuards(LocalActorAuthGuard)
|
||||||
@Roles(RoleEnum.ADMIN, RoleEnum.FIELD_EXPERT)
|
|
||||||
export class FanavaranController {
|
export class FanavaranController {
|
||||||
constructor(
|
constructor(
|
||||||
private readonly claimRequestManagementService: ClaimRequestManagementService,
|
private readonly claimRequestManagementService: ClaimRequestManagementService,
|
||||||
|
|||||||
@@ -291,6 +291,32 @@ export class LookupsController {
|
|||||||
return await this.lookupsService.getDmgHistoryStatus();
|
return await this.lookupsService.getDmgHistoryStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Get("used-place")
|
||||||
|
@ApiOperation({
|
||||||
|
summary: "Fanavaran used place lookup",
|
||||||
|
description: "Returns used place codes from car/code-list/used-place.",
|
||||||
|
})
|
||||||
|
@ApiOkResponse({
|
||||||
|
description: "Returns Fanavaran used place lookup data",
|
||||||
|
schema: { type: "array", items: { type: "object" } },
|
||||||
|
})
|
||||||
|
async getUsedPlace() {
|
||||||
|
return await this.lookupsService.getUsedPlace();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Get("dmg-business-line")
|
||||||
|
@ApiOperation({
|
||||||
|
summary: "Fanavaran damage business line lookup",
|
||||||
|
description: "Returns damage business line codes from car/code-list/dmg-business-line.",
|
||||||
|
})
|
||||||
|
@ApiOkResponse({
|
||||||
|
description: "Returns Fanavaran damage business line lookup data",
|
||||||
|
schema: { type: "array", items: { type: "object" } },
|
||||||
|
})
|
||||||
|
async getDmgBusinessLine() {
|
||||||
|
return await this.lookupsService.getDmgBusinessLine();
|
||||||
|
}
|
||||||
|
|
||||||
@Get("inquiry-by-vin")
|
@Get("inquiry-by-vin")
|
||||||
@ApiOperation({
|
@ApiOperation({
|
||||||
summary: "Fanavaran vehicle inquiry by VIN",
|
summary: "Fanavaran vehicle inquiry by VIN",
|
||||||
|
|||||||
@@ -143,6 +143,14 @@ export class LookupsService {
|
|||||||
return await this.getClientRemoteLookup("dmg-history-status");
|
return await this.getClientRemoteLookup("dmg-history-status");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getUsedPlace(): Promise<any> {
|
||||||
|
return await this.getClientRemoteLookup("used-place");
|
||||||
|
}
|
||||||
|
|
||||||
|
async getDmgBusinessLine(): Promise<any> {
|
||||||
|
return await this.getClientRemoteLookup("dmg-business-line");
|
||||||
|
}
|
||||||
|
|
||||||
async inquiryByVin(vin: string): Promise<unknown> {
|
async inquiryByVin(vin: string): Promise<unknown> {
|
||||||
const clientKey = this.activeClientKey();
|
const clientKey = this.activeClientKey();
|
||||||
return this.fanavaranLookupService.inquiryByVin(clientKey, vin);
|
return this.fanavaranLookupService.inquiryByVin(clientKey, vin);
|
||||||
|
|||||||
Reference in New Issue
Block a user