From 6f74d3ddcc9ee90a84bf03a4ab78f2c14259014d Mon Sep 17 00:00:00 2001 From: AnandaTon Date: Fri, 17 May 2024 09:42:49 +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=20employeeSalary?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/ProfileSalaryEmployeeController.ts | 2 +- src/entities/ProfileSalary.ts | 4 ++++ src/entities/ProfileSalaryHistory.ts | 7 ------- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/controllers/ProfileSalaryEmployeeController.ts b/src/controllers/ProfileSalaryEmployeeController.ts index fe23df2b..ceeb0110 100644 --- a/src/controllers/ProfileSalaryEmployeeController.ts +++ b/src/controllers/ProfileSalaryEmployeeController.ts @@ -67,7 +67,7 @@ export class ProfileSalaryEmployeeController extends Controller { } const dest_item = await this.salaryRepo.findOne({ - where: { profileId: body.profileEmployeeId }, + where: { profileEmployeeId: body.profileEmployeeId }, order: { order: "DESC" }, }); diff --git a/src/entities/ProfileSalary.ts b/src/entities/ProfileSalary.ts index 1f568f7d..3feac6ac 100644 --- a/src/entities/ProfileSalary.ts +++ b/src/entities/ProfileSalary.ts @@ -148,6 +148,10 @@ export class ProfileSalary extends EntityBase { @ManyToOne(() => Profile, (profile) => profile.profileSalary) @JoinColumn({ name: "profileId" }) profile: Profile; + + @ManyToOne(() => ProfileEmployee, (ProfileEmployee) => ProfileEmployee.profileSalarys) + @JoinColumn({ name: "profileEmployeeId" }) + profileEmployee: ProfileEmployee; } export class CreateProfileSalary { diff --git a/src/entities/ProfileSalaryHistory.ts b/src/entities/ProfileSalaryHistory.ts index b1101d07..6cfdb49a 100644 --- a/src/entities/ProfileSalaryHistory.ts +++ b/src/entities/ProfileSalaryHistory.ts @@ -14,13 +14,6 @@ import { ProfileSalary } from "./ProfileSalary"; @Entity("profileSalaryHistory") export class ProfileSalaryHistory extends EntityBase { - @Column({ - length: 40, - comment: "คีย์นอก(FK)ของตาราง profile", - type: "uuid", - }) - profileId: string; - @Column({ comment: "วันที่", type: "datetime",