From 701ab5af6efdd7e103df1319740100de0ad4ea30 Mon Sep 17 00:00:00 2001 From: AnandaTon Date: Thu, 16 May 2024 11:36:17 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=84=E0=B8=82?= =?UTF-8?q?=E0=B8=9A=E0=B8=B1=E0=B8=84=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A?= =?UTF-8?q?=20salary?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/ProfileDisciplineController.ts | 17 +---------------- .../ProfileLeaveEmployeeController.ts | 2 +- .../ProfileNopaidEmployeeController.ts | 16 +--------------- src/entities/ProfileSalaryEmployee.ts | 1 + 4 files changed, 4 insertions(+), 32 deletions(-) diff --git a/src/controllers/ProfileDisciplineController.ts b/src/controllers/ProfileDisciplineController.ts index e7690b77..5bbf85eb 100644 --- a/src/controllers/ProfileDisciplineController.ts +++ b/src/controllers/ProfileDisciplineController.ts @@ -34,24 +34,9 @@ export class ProfileDisciplineController extends Controller { private disciplineHistoryRepository = AppDataSource.getRepository(ProfileDisciplineHistory); @Get("{profileId}") - @Example({ - status: 200, - message: "สำเร็จ", - result: [ - { - id: "debfa8a7-83fb-4801-a940-8ae74e7638d3", - date: "2024-03-12T10:09:47.000Z", - level: "string", - detail: "string", - unStigma: "string", - refCommandNo: "string", - refCommandDate: "2024-03-12T10:09:47.000Z", - }, - ], - }) public async getDiscipline(@Path() profileId: string) { const lists = await this.disciplineRepository.find({ - where: { profileId: profileId }, + where: { profileEmployeeId: profileId }, select: [ "id", "date", diff --git a/src/controllers/ProfileLeaveEmployeeController.ts b/src/controllers/ProfileLeaveEmployeeController.ts index 6fa06140..d62cb018 100644 --- a/src/controllers/ProfileLeaveEmployeeController.ts +++ b/src/controllers/ProfileLeaveEmployeeController.ts @@ -40,7 +40,7 @@ export class ProfileLeaveEmployeeController extends Controller { public async getLeave(@Path() profileId: string) { const record = await this.leaveRepo.find({ relations: { leaveType: true }, - where: { profileId }, + where: { profileEmployeeId: profileId }, }); return new HttpSuccess(record); } diff --git a/src/controllers/ProfileNopaidEmployeeController.ts b/src/controllers/ProfileNopaidEmployeeController.ts index fc54a656..bec7b723 100644 --- a/src/controllers/ProfileNopaidEmployeeController.ts +++ b/src/controllers/ProfileNopaidEmployeeController.ts @@ -34,23 +34,9 @@ export class ProfileNopaidEmployeeController extends Controller { private nopaidHistoryRepository = AppDataSource.getRepository(ProfileNopaidHistory); @Get("{profileId}") - @Example({ - status: 200, - message: "สำเร็จ", - result: [ - { - id: "debfa8a7-83fb-4801-a940-8ae74e7638d3", - date: "2024-03-12T10:09:47.000Z", - reference: "string", - detail: "string", - refCommandNo: "string", - refCommandDate: "2024-03-12T10:09:47.000Z", - }, - ], - }) public async getNopaid(@Path() profileId: string) { const lists = await this.nopaidRepository.find({ - where: { profileId }, + where: { profileEmployeeId: profileId }, }); return new HttpSuccess(lists); } diff --git a/src/entities/ProfileSalaryEmployee.ts b/src/entities/ProfileSalaryEmployee.ts index 7b21dc74..4a19c04d 100644 --- a/src/entities/ProfileSalaryEmployee.ts +++ b/src/entities/ProfileSalaryEmployee.ts @@ -229,6 +229,7 @@ export class ProfileSalaryEmployee extends EntityBase { // commandNo: string; @Column({ + nullable: true, comment: "ประเภทคำสั่ง", type: "text", })