diff --git a/src/controllers/InsigniaTypeController.ts b/src/controllers/InsigniaTypeController.ts index f3c6d076..ef23829d 100644 --- a/src/controllers/InsigniaTypeController.ts +++ b/src/controllers/InsigniaTypeController.ts @@ -146,7 +146,8 @@ export class InsigniaTypeController extends Controller { const insigniaType_Active = await this.insigniaTypeRepository.find({ select: ["id", "name", "createdAt", "lastUpdatedAt", "lastUpdateFullName", "isActive"], where: { isActive: true }, - order: { name: "ASC" }, + order: { name: "ASC", insignias: { level: "ASC" } }, + relations: ["insignias"], }); return new HttpSuccess(insigniaType_Active); } diff --git a/src/entities/ProfileHonor.ts b/src/entities/ProfileHonor.ts index cba41733..12643779 100644 --- a/src/entities/ProfileHonor.ts +++ b/src/entities/ProfileHonor.ts @@ -46,6 +46,14 @@ export class ProfileHonor extends EntityBase { }) issuer: string; + @Column({ + nullable: true, + length: 200, + comment: "ประเภท", + default: null, + }) + type: string; + @Column({ nullable: true, type: "datetime", @@ -88,6 +96,7 @@ export class CreateProfileHonor { issuer: string | null; refCommandDate: Date | null; refCommandNo: string | null; + type: string | null; isDate: boolean | null; } @@ -98,6 +107,7 @@ export class CreateProfileEmployeeHonor { issuer: string | null; refCommandDate: Date | null; refCommandNo: string | null; + type: string | null; isDate: boolean | null; } @@ -107,5 +117,6 @@ export type UpdateProfileHonor = { issuer?: string | null; refCommandDate?: Date | null; refCommandNo?: string | null; + type?: string | null; isDate: boolean | null; }; diff --git a/src/entities/ProfileHonorHistory.ts b/src/entities/ProfileHonorHistory.ts index c2a45581..b99e16b8 100644 --- a/src/entities/ProfileHonorHistory.ts +++ b/src/entities/ProfileHonorHistory.ts @@ -28,6 +28,14 @@ export class ProfileHonorHistory extends EntityBase { }) issuer: string; + @Column({ + nullable: true, + length: 200, + comment: "ประเภท", + default: null, + }) + type: string; + @Column({ nullable: true, type: "datetime", diff --git a/src/migration/1738042376574-UpdateprofileHonoraddtype.ts b/src/migration/1738042376574-UpdateprofileHonoraddtype.ts new file mode 100644 index 00000000..798a0e41 --- /dev/null +++ b/src/migration/1738042376574-UpdateprofileHonoraddtype.ts @@ -0,0 +1,16 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateprofileHonoraddtype1738042376574 implements MigrationInterface { + name = 'UpdateprofileHonoraddtype1738042376574' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`profileHonorHistory\` ADD \`type\` varchar(200) NULL COMMENT 'ประเภท'`); + await queryRunner.query(`ALTER TABLE \`profileHonor\` ADD \`type\` varchar(200) NULL COMMENT 'ประเภท'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`profileHonor\` DROP COLUMN \`type\``); + await queryRunner.query(`ALTER TABLE \`profileHonorHistory\` DROP COLUMN \`type\``); + } + +}