From 23754e849c33f2622ddf4e765ac455c75a1e2eed Mon Sep 17 00:00:00 2001 From: Kittapath Date: Mon, 18 Mar 2024 13:51:10 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1?= =?UTF-8?q?=E0=B8=82=E0=B8=B1=E0=B9=89=E0=B8=99=E0=B9=80=E0=B8=87=E0=B8=B4?= =?UTF-8?q?=E0=B8=99=E0=B9=80=E0=B8=94=E0=B8=B7=E0=B8=AD=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OrganizationUnauthorizeController.ts | 1 + src/controllers/ProfileEmployeeController.ts | 1 + src/entities/ProfileEmployee.ts | 8 ++++++++ ...0-update_table_salaryprofile_add_salarylevel.ts | 14 ++++++++++++++ 4 files changed, 24 insertions(+) create mode 100644 src/migration/1710744584780-update_table_salaryprofile_add_salarylevel.ts diff --git a/src/controllers/OrganizationUnauthorizeController.ts b/src/controllers/OrganizationUnauthorizeController.ts index 117d5629..2dc2ab4a 100644 --- a/src/controllers/OrganizationUnauthorizeController.ts +++ b/src/controllers/OrganizationUnauthorizeController.ts @@ -397,6 +397,7 @@ export class OrganizationUnauthorizeController extends Controller { ), ); return { + salaryLevel: item.current_holder.salaryLevel, prefix: item.current_holder.prefix, firstName: item.current_holder.firstName, lastName: item.current_holder.lastName, diff --git a/src/controllers/ProfileEmployeeController.ts b/src/controllers/ProfileEmployeeController.ts index 16467c63..ddc3f9a3 100644 --- a/src/controllers/ProfileEmployeeController.ts +++ b/src/controllers/ProfileEmployeeController.ts @@ -1049,6 +1049,7 @@ export class ProfileEmployeeController extends Controller { ); return { + salaryLevel: item.current_holder.salaryLevel, prefix: item.current_holder.prefix, firstName: item.current_holder.firstName, lastName: item.current_holder.lastName, diff --git a/src/entities/ProfileEmployee.ts b/src/entities/ProfileEmployee.ts index c6a75c0e..aa15bbe9 100644 --- a/src/entities/ProfileEmployee.ts +++ b/src/entities/ProfileEmployee.ts @@ -141,6 +141,14 @@ export class ProfileEmployee extends EntityBase { }) birthDate: Date; + @Column({ + type: "double", + nullable: true, + comment: "ขั้นเงินเดือน", + default: null, + }) + salaryLevel: number | null; + @OneToMany(() => EmployeePosMaster, (posMaster) => posMaster.current_holder) current_holders: EmployeePosMaster[]; diff --git a/src/migration/1710744584780-update_table_salaryprofile_add_salarylevel.ts b/src/migration/1710744584780-update_table_salaryprofile_add_salarylevel.ts new file mode 100644 index 00000000..6aa36535 --- /dev/null +++ b/src/migration/1710744584780-update_table_salaryprofile_add_salarylevel.ts @@ -0,0 +1,14 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateTableSalaryprofileAddSalarylevel1710744584780 implements MigrationInterface { + name = 'UpdateTableSalaryprofileAddSalarylevel1710744584780' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`salaryLevel\` double NULL COMMENT 'ขั้นเงินเดือน'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`salaryLevel\``); + } + +}