diff --git a/src/controllers/OrganizationUnauthorizeController.ts b/src/controllers/OrganizationUnauthorizeController.ts index be8e1f49..782b8f5f 100644 --- a/src/controllers/OrganizationUnauthorizeController.ts +++ b/src/controllers/OrganizationUnauthorizeController.ts @@ -398,6 +398,7 @@ export class OrganizationUnauthorizeController extends Controller { ); return { salaryLevel: item.current_holder.salaryLevel, + group: item.current_holder.group, 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 94739200..bf312ee6 100644 --- a/src/controllers/ProfileEmployeeController.ts +++ b/src/controllers/ProfileEmployeeController.ts @@ -1003,6 +1003,7 @@ export class ProfileEmployeeController extends Controller { return { salaryLevel: item.current_holder.salaryLevel, + group: item.current_holder.group, 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 740237a3..d194e864 100644 --- a/src/entities/ProfileEmployee.ts +++ b/src/entities/ProfileEmployee.ts @@ -118,6 +118,13 @@ export class ProfileEmployee extends EntityBase { }) salaryLevel: number | null; + @Column({ + nullable: true, + comment: "กลุ่มบัญชีการจ้าง", + default: null, + }) + group: number; + @Column({ nullable: true, comment: "เชื้อชาติ", diff --git a/src/migration/1711033351014-update_table_profileemployee_add_group.ts b/src/migration/1711033351014-update_table_profileemployee_add_group.ts new file mode 100644 index 00000000..086f480f --- /dev/null +++ b/src/migration/1711033351014-update_table_profileemployee_add_group.ts @@ -0,0 +1,16 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateTableProfileemployeeAddGroup1711033351014 implements MigrationInterface { + name = 'UpdateTableProfileemployeeAddGroup1711033351014' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`group\` int NULL COMMENT 'กลุ่มบัญชีการจ้าง'`); + await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`group\` int NULL COMMENT 'กลุ่มบัญชีการจ้าง'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`group\``); + await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`group\``); + } + +}