From 7a0fec256cc21e4e08aae896b4b3c424cb274587 Mon Sep 17 00:00:00 2001 From: Kittapath Date: Tue, 2 Apr 2024 14:34:32 +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=84=E0=B8=B3=E0=B8=99=E0=B8=A7=E0=B8=99=E0=B9=80=E0=B8=87?= =?UTF-8?q?=E0=B8=B4=E0=B8=99=E0=B9=80=E0=B8=94=E0=B8=B7=E0=B8=AD=E0=B8=99?= =?UTF-8?q?=E0=B8=95=E0=B8=B3=E0=B9=81=E0=B8=AB=E0=B8=99=E0=B9=88=E0=B8=87?= =?UTF-8?q?=20=E0=B8=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/SalaryPeriodController.ts | 3 +++ src/entities/SalaryProfile.ts | 10 ++++++++++ src/entities/SalaryProfileEmployee.ts | 10 ++++++++++ ..._table_salaryProfileEmployee_add_isSpecial.ts | 16 ++++++++++++++++ 4 files changed, 39 insertions(+) create mode 100644 src/migration/1712043041340-update_table_salaryProfileEmployee_add_isSpecial.ts diff --git a/src/controllers/SalaryPeriodController.ts b/src/controllers/SalaryPeriodController.ts index 5d510f3..3ab1afc 100644 --- a/src/controllers/SalaryPeriodController.ts +++ b/src/controllers/SalaryPeriodController.ts @@ -372,6 +372,7 @@ export class SalaryPeriodController extends Controller { where: { posTypeId: Level.posTypeId, posLevelId: Level.id, + isSpecial: salaryProfile.isSpecial == false ? false : true, isActive: true, }, }); @@ -683,6 +684,7 @@ export class SalaryPeriodController extends Controller { where: { posTypeId: Level.posTypeId, posLevelId: Level.id, + isSpecial: salaryProfile.isSpecial == false ? false : true, isActive: true, }, }); @@ -1054,6 +1056,7 @@ export class SalaryPeriodController extends Controller { where: { posTypeId: posLevel.posTypeId, posLevelId: posLevel.id, + isSpecial: salaryProfile.isSpecial == false ? false : true, isActive: true, }, }); diff --git a/src/entities/SalaryProfile.ts b/src/entities/SalaryProfile.ts index bcb88c8..7575e4c 100644 --- a/src/entities/SalaryProfile.ts +++ b/src/entities/SalaryProfile.ts @@ -294,6 +294,13 @@ export class SalaryProfile extends EntityBase { }) isNext: boolean; + @Column({ + nullable: true, + comment: "ฉ", + default: null, + }) + isSpecial: boolean; + @ManyToOne(() => SalaryOrg, (salaryOrg) => salaryOrg.salaryProfiles) @JoinColumn({ name: "salaryOrgId" }) salaryOrg: SalaryOrg; @@ -395,4 +402,7 @@ export class CreateSalaryProfile { @Column() isRetired: boolean; + + @Column() + isSpecial: boolean; } diff --git a/src/entities/SalaryProfileEmployee.ts b/src/entities/SalaryProfileEmployee.ts index e85fc43..7407564 100644 --- a/src/entities/SalaryProfileEmployee.ts +++ b/src/entities/SalaryProfileEmployee.ts @@ -346,6 +346,13 @@ export class SalaryProfileEmployee extends EntityBase { }) isNext: boolean; + @Column({ + nullable: true, + comment: "ฉ", + default: null, + }) + isSpecial: boolean; + @ManyToOne(() => SalaryOrgEmployee, (salaryOrg) => salaryOrg.salaryProfiles) @JoinColumn({ name: "salaryOrgId" }) salaryOrg: SalaryOrgEmployee; @@ -456,4 +463,7 @@ export class CreateSalaryProfileEmployee { @Column() isRetired: boolean; + + @Column() + isSpecial: boolean; } diff --git a/src/migration/1712043041340-update_table_salaryProfileEmployee_add_isSpecial.ts b/src/migration/1712043041340-update_table_salaryProfileEmployee_add_isSpecial.ts new file mode 100644 index 0000000..ccab8d4 --- /dev/null +++ b/src/migration/1712043041340-update_table_salaryProfileEmployee_add_isSpecial.ts @@ -0,0 +1,16 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateTableSalaryProfileEmployeeAddIsSpecial1712043041340 implements MigrationInterface { + name = 'UpdateTableSalaryProfileEmployeeAddIsSpecial1712043041340' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`salaryProfileEmployee\` ADD \`isSpecial\` tinyint NULL COMMENT 'ฉ'`); + await queryRunner.query(`ALTER TABLE \`salaryProfile\` ADD \`isSpecial\` tinyint NULL COMMENT 'ฉ'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`salaryProfile\` DROP COLUMN \`isSpecial\``); + await queryRunner.query(`ALTER TABLE \`salaryProfileEmployee\` DROP COLUMN \`isSpecial\``); + } + +}