forked from Yara724/api
Initial commit after migration to gitea
This commit is contained in:
99
src/lookups/lookups.controller.ts
Normal file
99
src/lookups/lookups.controller.ts
Normal file
@@ -0,0 +1,99 @@
|
||||
import { Controller, Get } from "@nestjs/common";
|
||||
import { ApiOkResponse, ApiTags } from "@nestjs/swagger";
|
||||
import { LookupsService } from "./lookups.service";
|
||||
|
||||
@ApiTags("lookups")
|
||||
@Controller("lookups")
|
||||
export class LookupsController {
|
||||
constructor(private readonly lookupsService: LookupsService) {}
|
||||
|
||||
@Get("accident-causes")
|
||||
@ApiOkResponse({
|
||||
description: "Returns accident causes lookup data",
|
||||
schema: {
|
||||
type: "array",
|
||||
items: {
|
||||
type: "object",
|
||||
properties: {
|
||||
Caption: { type: "string" },
|
||||
Id: { type: "number" },
|
||||
IsActive: { type: "number" },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
async getAccidentCauses() {
|
||||
return await this.lookupsService.getAccidentCauses();
|
||||
}
|
||||
|
||||
@Get("accident-report-type")
|
||||
@ApiOkResponse({
|
||||
description: "Returns accident report type lookup data",
|
||||
schema: {
|
||||
type: "array",
|
||||
items: {
|
||||
type: "object",
|
||||
},
|
||||
},
|
||||
})
|
||||
async getAccidentReportType() {
|
||||
return await this.lookupsService.getAccidentReportType();
|
||||
}
|
||||
|
||||
@Get("vehicle-use-types")
|
||||
@ApiOkResponse({
|
||||
description: "Returns vehicle use types lookup data",
|
||||
schema: {
|
||||
type: "array",
|
||||
items: {
|
||||
type: "object",
|
||||
},
|
||||
},
|
||||
})
|
||||
async getVehicleUseTypes() {
|
||||
return await this.lookupsService.getVehicleUseTypes();
|
||||
}
|
||||
|
||||
@Get("dmg-pay-method")
|
||||
@ApiOkResponse({
|
||||
description: "Returns damage pay method lookup data",
|
||||
schema: {
|
||||
type: "array",
|
||||
items: {
|
||||
type: "object",
|
||||
},
|
||||
},
|
||||
})
|
||||
async getDmgPayMethod() {
|
||||
return await this.lookupsService.getDmgPayMethod();
|
||||
}
|
||||
|
||||
@Get("driving-licence-types")
|
||||
@ApiOkResponse({
|
||||
description: "Returns driving licence types lookup data",
|
||||
schema: {
|
||||
type: "array",
|
||||
items: {
|
||||
type: "object",
|
||||
},
|
||||
},
|
||||
})
|
||||
async getDrivingLicenceTypes() {
|
||||
return await this.lookupsService.getDrivingLicenceTypes();
|
||||
}
|
||||
|
||||
@Get("accident-culprit-type")
|
||||
@ApiOkResponse({
|
||||
description: "Returns accident culprit type lookup data",
|
||||
schema: {
|
||||
type: "array",
|
||||
items: {
|
||||
type: "object",
|
||||
},
|
||||
},
|
||||
})
|
||||
async getAccidentCulpritType() {
|
||||
return await this.lookupsService.getAccidentCulpritType();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user