diff --git a/src/controllers/KpiUserEvaluationController.ts b/src/controllers/KpiUserEvaluationController.ts index 102a1f8..0c8e8fd 100644 --- a/src/controllers/KpiUserEvaluationController.ts +++ b/src/controllers/KpiUserEvaluationController.ts @@ -127,7 +127,7 @@ export class KpiUserEvaluationController extends Controller { kpiUserEvaluation.lastName = x.lastName; }) .catch((x) => {}); - kpiUserEvaluation.evaluationStatus = "PENDING"; + kpiUserEvaluation.evaluationStatus = "NEW"; kpiUserEvaluation.evaluationResults = "PENDING"; kpiUserEvaluation.createdUserId = request.user.sub; kpiUserEvaluation.createdFullName = request.user.name; diff --git a/src/entities/kpiUserEvaluation.ts b/src/entities/kpiUserEvaluation.ts index 54c70af..f20e494 100644 --- a/src/entities/kpiUserEvaluation.ts +++ b/src/entities/kpiUserEvaluation.ts @@ -71,7 +71,7 @@ export class KpiUserEvaluation extends EntityBase { length: 40, comment: "สถานะการประเมินผล ดังนี้ NEW = รอดำเนินการ, INPROGRESS = กําลังดำเนินการ, DONE = ประเมินเสร็จสิ้น", - default: null, + default: "NEW", }) evaluationStatus: string; diff --git a/src/migration/1715151729330-add_table_kpiDevelopment1.ts b/src/migration/1715151729330-add_table_kpiDevelopment1.ts new file mode 100644 index 0000000..06b0b21 --- /dev/null +++ b/src/migration/1715151729330-add_table_kpiDevelopment1.ts @@ -0,0 +1,14 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class AddTableKpiDevelopment11715151729330 implements MigrationInterface { + name = 'AddTableKpiDevelopment11715151729330' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` CHANGE \`evaluationStatus\` \`evaluationStatus\` varchar(40) NULL COMMENT 'สถานะการประเมินผล ดังนี้ NEW = รอดำเนินการ, INPROGRESS = กําลังดำเนินการ, DONE = ประเมินเสร็จสิ้น' DEFAULT 'NEW'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` CHANGE \`evaluationStatus\` \`evaluationStatus\` varchar(40) NULL COMMENT 'สถานะการประเมินผล ดังนี้ NEW = รอดำเนินการ, INPROGRESS = กําลังดำเนินการ, DONE = ประเมินเสร็จสิ้น'`); + } + +}