Merge branch 'dev/methapon' into develop

This commit is contained in:
Methapon2001 2024-03-18 16:02:44 +07:00
commit 9b0a5e9194
5 changed files with 43 additions and 7 deletions

View file

@ -77,6 +77,7 @@ export class ProfileHonorController extends Controller {
issuer: "issuer", issuer: "issuer",
refCommandDate: "2024-03-12T10:10:31.000Z", refCommandDate: "2024-03-12T10:10:31.000Z",
refCommandNo: "refCommandNo", refCommandNo: "refCommandNo",
isDate: true,
profileHonorId: "debfa8a7-83fb-4801-a940-8ae74e7638d3", profileHonorId: "debfa8a7-83fb-4801-a940-8ae74e7638d3",
}, },
{ {
@ -93,6 +94,7 @@ export class ProfileHonorController extends Controller {
issuer: "string", issuer: "string",
refCommandDate: "2024-03-12T10:09:47.000Z", refCommandDate: "2024-03-12T10:09:47.000Z",
refCommandNo: "string", refCommandNo: "string",
isDate: true,
profileHonorId: "debfa8a7-83fb-4801-a940-8ae74e7638d3", profileHonorId: "debfa8a7-83fb-4801-a940-8ae74e7638d3",
}, },
], ],

View file

@ -91,6 +91,7 @@ export class ProfileTrainingController extends Controller {
duration: "string", duration: "string",
name: "string", name: "string",
yearly: 0, yearly: 0,
isDate: true,
profileTrainingId: "3cf02fb7-2f0c-471b-b641-51d557375c0a", profileTrainingId: "3cf02fb7-2f0c-471b-b641-51d557375c0a",
}, },
{ {
@ -112,6 +113,7 @@ export class ProfileTrainingController extends Controller {
duration: "string", duration: "string",
name: "name", name: "name",
yearly: 0, yearly: 0,
isDate: true,
profileTrainingId: "3cf02fb7-2f0c-471b-b641-51d557375c0a", profileTrainingId: "3cf02fb7-2f0c-471b-b641-51d557375c0a",
}, },
], ],

View file

@ -5,7 +5,6 @@ import { ProfileHonor } from "./ProfileHonor";
@Entity("profileHonorHistory") @Entity("profileHonorHistory")
export class ProfileHonorHistory extends EntityBase { export class ProfileHonorHistory extends EntityBase {
@Column({ @Column({
comment: "สถานะการใช้งาน", comment: "สถานะการใช้งาน",
default: false, default: false,
@ -60,13 +59,19 @@ export class ProfileHonorHistory extends EntityBase {
}) })
profileHonorId: string; profileHonorId: string;
@Column({
nullable: true,
comment: "ประเภทช่วงเวลาการศึกษา",
default: null,
})
isDate: boolean;
@ManyToOne(() => ProfileHonor, (profileHonor) => profileHonor.profileHonorHistories) @ManyToOne(() => ProfileHonor, (profileHonor) => profileHonor.profileHonorHistories)
@JoinColumn({ name: "profileHonorId" }) @JoinColumn({ name: "profileHonorId" })
histories: ProfileHonor; histories: ProfileHonor;
} }
export class CreateProfileHonorHistory { export class CreateProfileHonorHistory {
@Column() @Column()
isActive: boolean; isActive: boolean;
@ -80,11 +85,14 @@ export class CreateProfileHonorHistory {
issuer: string | null; issuer: string | null;
@Column() @Column()
refCommandDate: Date | null; refCommandDate: Date | null;
@Column() @Column()
refCommandNo: string | null; refCommandNo: string | null;
@Column()
isDate: boolean | null;
@Column("uuid") @Column("uuid")
profileHonorId: string | null; profileHonorId: string | null;
} }

View file

@ -5,7 +5,6 @@ import { ProfileTraining } from "./ProfileTraining";
@Entity("profileTrainingHistory") @Entity("profileTrainingHistory")
export class ProfileTrainingHistory extends EntityBase { export class ProfileTrainingHistory extends EntityBase {
@Column({ @Column({
comment: "สถานะการใช้งาน", comment: "สถานะการใช้งาน",
default: false, default: false,
@ -98,14 +97,20 @@ export class ProfileTrainingHistory extends EntityBase {
default: null, default: null,
}) })
profileTrainingId: string; profileTrainingId: string;
@Column({
nullable: true,
comment: "ประเภทช่วงเวลาการศึกษา",
default: null,
})
isDate: boolean;
@ManyToOne(() => ProfileTraining, (profileTraining) => profileTraining.profileTrainingHistories) @ManyToOne(() => ProfileTraining, (profileTraining) => profileTraining.profileTrainingHistories)
@JoinColumn({ name: "profileTrainingId" }) @JoinColumn({ name: "profileTrainingId" })
histories: ProfileTraining; histories: ProfileTraining;
} }
export class CreateProfileTrainingHistory { export class CreateProfileTrainingHistory {
@Column() @Column()
isActive: boolean; isActive: boolean;
@ -116,7 +121,7 @@ export class CreateProfileTrainingHistory {
endDate: Date | null; endDate: Date | null;
@Column() @Column()
numberOrder: string | null; numberOrder: string | null;
@Column() @Column()
topic: string | null; topic: string | null;
@ -139,6 +144,9 @@ export class CreateProfileTrainingHistory {
@Column() @Column()
yearly: number | null; yearly: number | null;
@Column()
isDate: boolean | null;
@Column("uuid") @Column("uuid")
profileTrainingId: string | null; profileTrainingId: string | null;
} }

View file

@ -0,0 +1,16 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class UpdateTableProfileHistoryAddIsDate1710752446531 implements MigrationInterface {
name = 'UpdateTableProfileHistoryAddIsDate1710752446531'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`profileHonorHistory\` ADD \`isDate\` tinyint NULL COMMENT 'ประเภทช่วงเวลาการศึกษา'`);
await queryRunner.query(`ALTER TABLE \`profileTrainingHistory\` ADD \`isDate\` tinyint NULL COMMENT 'ประเภทช่วงเวลาการศึกษา'`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`profileTrainingHistory\` DROP COLUMN \`isDate\``);
await queryRunner.query(`ALTER TABLE \`profileHonorHistory\` DROP COLUMN \`isDate\``);
}
}