chore: update endpoints tag

This commit is contained in:
Methapon Metanipat 2024-09-17 08:47:44 +07:00
parent 96b18f1049
commit fdf3a42659

View file

@ -545,7 +545,6 @@ export class EmployeeController extends Controller {
}
@Route("api/v1/employee/{employeeId}")
@Tags("Employee")
export class EmployeeFileController extends Controller {
private async checkPermission(user: RequestWithUser["user"], id: string) {
const data = await prisma.employee.findFirst({
@ -570,12 +569,14 @@ export class EmployeeFileController extends Controller {
@Get("image")
@Security("keycloak")
@Tags("Employee")
async listImage(@Request() req: RequestWithUser, @Path() employeeId: string) {
await this.checkPermission(req.user, employeeId);
return await listFile(fileLocation.employee.img(employeeId));
}
@Get("image/{name}")
@Tags("Employee")
async getImage(
@Request() req: RequestWithUser,
@Path() employeeId: string,
@ -586,6 +587,7 @@ export class EmployeeFileController extends Controller {
@Put("image/{name}")
@Security("keycloak")
@Tags("Employee")
async putImage(
@Request() req: RequestWithUser,
@Path() employeeId: string,
@ -600,6 +602,7 @@ export class EmployeeFileController extends Controller {
@Delete("image/{name}")
@Security("keycloak")
@Tags("Employee")
async delImage(
@Request() req: RequestWithUser,
@Path() employeeId: string,
@ -611,6 +614,7 @@ export class EmployeeFileController extends Controller {
@Get("attachment")
@Security("keycloak")
@Tags("Employee")
async listAttachment(@Request() req: RequestWithUser, @Path() employeeId: string) {
await this.checkPermission(req.user, employeeId);
return await listFile(fileLocation.employee.attachment(employeeId));
@ -618,12 +622,14 @@ export class EmployeeFileController extends Controller {
@Get("attachment/{name}")
@Security("keycloak")
@Tags("Employee")
async getAttachment(@Path() employeeId: string, @Path() name: string) {
return await getFile(fileLocation.employee.attachment(employeeId, name));
}
@Put("attachment/{name}")
@Security("keycloak")
@Tags("Employee")
async putAttachment(
@Request() req: RequestWithUser,
@Path() employeeId: string,
@ -635,6 +641,7 @@ export class EmployeeFileController extends Controller {
@Delete("attachment/{name}")
@Security("keycloak")
@Tags("Employee")
async delAttachment(
@Request() req: RequestWithUser,
@Path() employeeId: string,
@ -646,6 +653,7 @@ export class EmployeeFileController extends Controller {
@Get("file-passport")
@Security("keycloak")
@Tags("Employee Passport")
async listPassport(@Request() req: RequestWithUser, @Path() employeeId: string) {
await this.checkPermission(req.user, employeeId);
return await listFile(fileLocation.employee.passport(employeeId));
@ -653,12 +661,14 @@ export class EmployeeFileController extends Controller {
@Get("file-passport/{passportId}")
@Security("keycloak")
@Tags("Employee Passport")
async getPassport(@Path() employeeId: string, @Path() passportId: string) {
return await getFile(fileLocation.employee.passport(employeeId, passportId));
}
@Put("file-passport/{passportId}")
@Security("keycloak")
@Tags("Employee Passport")
async putPassport(
@Request() req: RequestWithUser,
@Path() employeeId: string,
@ -670,6 +680,7 @@ export class EmployeeFileController extends Controller {
@Delete("file-passport/{passportId}")
@Security("keycloak")
@Tags("Employee Passport")
async delPassport(
@Request() req: RequestWithUser,
@Path() employeeId: string,
@ -681,6 +692,7 @@ export class EmployeeFileController extends Controller {
@Get("file-visa")
@Security("keycloak")
@Tags("Employee Visa")
async listVisa(@Request() req: RequestWithUser, @Path() employeeId: string) {
await this.checkPermission(req.user, employeeId);
return await listFile(fileLocation.employee.visa(employeeId));
@ -688,12 +700,14 @@ export class EmployeeFileController extends Controller {
@Get("file-visa/{visaId}")
@Security("keycloak")
@Tags("Employee Visa")
async getVisa(@Path() employeeId: string, @Path() visaId: string) {
return await getFile(fileLocation.employee.visa(employeeId, visaId));
}
@Put("file-visa/{visaId}")
@Security("keycloak")
@Tags("Employee Visa")
async putVisa(
@Request() req: RequestWithUser,
@Path() employeeId: string,
@ -705,6 +719,7 @@ export class EmployeeFileController extends Controller {
@Delete("file-visa/{visaId}")
@Security("keycloak")
@Tags("Employee Visa")
async delVisa(
@Request() req: RequestWithUser,
@Path() employeeId: string,
@ -716,6 +731,7 @@ export class EmployeeFileController extends Controller {
@Get("file-in-country-notice")
@Security("keycloak")
@Tags("Employee In Country Notice")
async listNotice(@Request() req: RequestWithUser, @Path() employeeId: string) {
await this.checkPermission(req.user, employeeId);
return await listFile(fileLocation.employee.inCountryNotice(employeeId));
@ -723,12 +739,14 @@ export class EmployeeFileController extends Controller {
@Get("file-in-country-notice/{noticeId}")
@Security("keycloak")
@Tags("Employee In Country Notice")
async getNotice(@Path() employeeId: string, @Path() noticeId: string) {
return await getFile(fileLocation.employee.inCountryNotice(employeeId, noticeId));
}
@Put("file-in-country-notice/{noticeId}")
@Security("keycloak")
@Tags("Employee In Country Notice")
async putNotice(
@Request() req: RequestWithUser,
@Path() employeeId: string,
@ -742,6 +760,7 @@ export class EmployeeFileController extends Controller {
@Delete("file-in-country-notice/{noticeId}")
@Security("keycloak")
@Tags("Employee In Country Notice")
async delNotice(
@Request() req: RequestWithUser,
@Path() employeeId: string,