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\``); + } + +}