คำนวนวันเกษียณอายุราชการ
This commit is contained in:
parent
db479c4ab6
commit
73e07dfed6
3 changed files with 54 additions and 1236 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -25,7 +25,7 @@ import { OrgRevision } from "../entities/OrgRevision";
|
||||||
import { PosMaster } from "../entities/PosMaster";
|
import { PosMaster } from "../entities/PosMaster";
|
||||||
import { PosLevel } from "../entities/PosLevel";
|
import { PosLevel } from "../entities/PosLevel";
|
||||||
import { PosType } from "../entities/PosType";
|
import { PosType } from "../entities/PosType";
|
||||||
import { calculateRetireDate, calculateRetireYear } from "../interfaces/utils";
|
import { calculateAge, calculateRetireDate, calculateRetireYear } from "../interfaces/utils";
|
||||||
import { RequestWithUser } from "../middlewares/user";
|
import { RequestWithUser } from "../middlewares/user";
|
||||||
|
|
||||||
@Route("api/v1/org/profile")
|
@Route("api/v1/org/profile")
|
||||||
|
|
@ -80,6 +80,19 @@ export class ProfileController extends Controller {
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API คำนวนวันเกษียณ
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Post("cal/retire")
|
||||||
|
async calDateRetire(@Body() birthDate: Date) {
|
||||||
|
const retireDate = await calculateRetireDate(birthDate);
|
||||||
|
const age = calculateAge(birthDate);
|
||||||
|
|
||||||
|
return new HttpSuccess({ retireDate, age });
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API แก้ไขทะเบียนประวัติ
|
* API แก้ไขทะเบียนประวัติ
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||||
|
|
||||||
|
export class UpdateTableProfileAddIsLeave11711421865315 implements MigrationInterface {
|
||||||
|
name = 'UpdateTableProfileAddIsLeave11711421865315'
|
||||||
|
|
||||||
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profile\` ADD \`nationality\` varchar(255) NULL COMMENT 'สัญชาติ'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileHistory\` ADD \`nationality\` varchar(255) NULL COMMENT 'สัญชาติ'`);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileHistory\` DROP COLUMN \`nationality\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profile\` DROP COLUMN \`nationality\``);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue