วันที่เกษียณ
This commit is contained in:
parent
39e6c6e1c5
commit
27fefee8d7
3 changed files with 58 additions and 18 deletions
|
|
@ -154,7 +154,7 @@ export class Profile extends EntityBase {
|
|||
@Column({
|
||||
nullable: true,
|
||||
type: "datetime",
|
||||
comment: "วันที่พักราชการ",
|
||||
comment: "วันครบเกษียณอายุ",
|
||||
default: null,
|
||||
})
|
||||
dateRetire: Date;
|
||||
|
|
@ -167,6 +167,14 @@ export class Profile extends EntityBase {
|
|||
})
|
||||
dateAppoint: Date;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "datetime",
|
||||
comment: "วันที่เกษียณอายุราชการตามกฏหมาย",
|
||||
default: null,
|
||||
})
|
||||
dateRetireLaw: Date;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "datetime",
|
||||
|
|
@ -327,7 +335,7 @@ export class Profile extends EntityBase {
|
|||
@OneToMany(() => ProfileFamilyMother, (v) => v.profile)
|
||||
profileFamilyMother: ProfileFamilyMother[];
|
||||
|
||||
@OneToMany(() => ProfileFamilyCouple , (v) => v.profile)
|
||||
@OneToMany(() => ProfileFamilyCouple, (v) => v.profile)
|
||||
profileFamilyCouple: ProfileFamilyCouple[];
|
||||
|
||||
@ManyToOne(() => PosLevel, (posLevel) => posLevel.profiles)
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ export class ProfileEmployee extends EntityBase {
|
|||
@Column({
|
||||
nullable: true,
|
||||
type: "datetime",
|
||||
comment: "วันที่พักราชการ",
|
||||
comment: "วันครบเกษียณอายุ",
|
||||
default: null,
|
||||
})
|
||||
dateRetire: Date;
|
||||
|
|
@ -148,6 +148,14 @@ export class ProfileEmployee extends EntityBase {
|
|||
})
|
||||
birthDate: Date;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "datetime",
|
||||
comment: "วันที่เกษียณอายุราชการตามกฏหมาย",
|
||||
default: null,
|
||||
})
|
||||
dateRetireLaw: Date;
|
||||
|
||||
@Column({
|
||||
type: "double",
|
||||
nullable: true,
|
||||
|
|
@ -286,7 +294,7 @@ export class ProfileEmployee extends EntityBase {
|
|||
@OneToMany(() => ProfileFamilyMother, (v) => v.profile)
|
||||
profileFamilyMother: ProfileFamilyMother[];
|
||||
|
||||
@OneToMany(() => ProfileFamilyCouple , (v) => v.profile)
|
||||
@OneToMany(() => ProfileFamilyCouple, (v) => v.profile)
|
||||
profileFamilyCouple: ProfileFamilyCouple[];
|
||||
}
|
||||
|
||||
|
|
@ -309,22 +317,22 @@ export class CreateProfileEmployee {
|
|||
prefix: string;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
position: string;
|
||||
isProbation: boolean | null;
|
||||
dateRetire: Date | null;
|
||||
// position: string;
|
||||
// isProbation: boolean | null;
|
||||
// dateRetire: Date | null;
|
||||
birthDate: Date | null;
|
||||
salaryLevel: number | null;
|
||||
ethnicity: string | null;
|
||||
telephoneNumber: string | null;
|
||||
// ethnicity: string | null;
|
||||
// telephoneNumber: string | null;
|
||||
citizenId: string;
|
||||
religion: string | null;
|
||||
// religion: string | null;
|
||||
posLevelId: string | null;
|
||||
posTypeId: string | null;
|
||||
gender: string | null;
|
||||
relationship: string | null;
|
||||
bloodGroup: string | null;
|
||||
email: string | null;
|
||||
phone: string | null;
|
||||
// gender: string | null;
|
||||
// relationship: string | null;
|
||||
// bloodGroup: string | null;
|
||||
// email: string | null;
|
||||
// phone: string | null;
|
||||
}
|
||||
|
||||
export type UpdateProfileEmployee = {
|
||||
|
|
@ -332,9 +340,9 @@ export type UpdateProfileEmployee = {
|
|||
prefix?: string | null;
|
||||
firstName?: string | null;
|
||||
lastName?: string | null;
|
||||
position?: string | null;
|
||||
isProbation?: boolean | null;
|
||||
dateRetire?: Date | null;
|
||||
// position?: string | null;
|
||||
// isProbation?: boolean | null;
|
||||
// dateRetire?: Date | null;
|
||||
birthDate?: Date | null;
|
||||
salaryLevel?: number | null;
|
||||
ethnicity?: string | null;
|
||||
|
|
|
|||
24
src/migration/1715683984766-add_table_dateRetire.ts
Normal file
24
src/migration/1715683984766-add_table_dateRetire.ts
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class AddTableDateRetire1715683984766 implements MigrationInterface {
|
||||
name = 'AddTableDateRetire1715683984766'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`dateRetireLaw\` datetime NULL COMMENT 'วันที่เกษียณอายุราชการตามกฏหมาย'`);
|
||||
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`dateRetireLaw\` datetime NULL COMMENT 'วันที่เกษียณอายุราชการตามกฏหมาย'`);
|
||||
await queryRunner.query(`ALTER TABLE \`profile\` ADD \`dateRetireLaw\` datetime NULL COMMENT 'วันที่เกษียณอายุราชการตามกฏหมาย'`);
|
||||
await queryRunner.query(`ALTER TABLE \`profileHistory\` ADD \`dateRetireLaw\` datetime NULL COMMENT 'วันที่เกษียณอายุราชการตามกฏหมาย'`);
|
||||
await queryRunner.query(`ALTER TABLE \`profileEmployee\` CHANGE \`dateRetire\` \`dateRetire\` datetime NULL COMMENT 'วันครบเกษียณอายุ'`);
|
||||
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` CHANGE \`dateRetire\` \`dateRetire\` datetime NULL COMMENT 'วันครบเกษียณอายุ'`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` CHANGE \`dateRetire\` \`dateRetire\` datetime NULL COMMENT 'วันที่พักราชการ'`);
|
||||
await queryRunner.query(`ALTER TABLE \`profileEmployee\` CHANGE \`dateRetire\` \`dateRetire\` datetime NULL COMMENT 'วันที่พักราชการ'`);
|
||||
await queryRunner.query(`ALTER TABLE \`profileHistory\` DROP COLUMN \`dateRetireLaw\``);
|
||||
await queryRunner.query(`ALTER TABLE \`profile\` DROP COLUMN \`dateRetireLaw\``);
|
||||
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`dateRetireLaw\``);
|
||||
await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`dateRetireLaw\``);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue