คำนวนวันเกษียณอายุราชการ

This commit is contained in:
Kittapath 2024-03-26 13:57:02 +07:00
parent db479c4ab6
commit 73e07dfed6
3 changed files with 54 additions and 1236 deletions

View file

@ -25,7 +25,7 @@ import { OrgRevision } from "../entities/OrgRevision";
import { PosMaster } from "../entities/PosMaster";
import { PosLevel } from "../entities/PosLevel";
import { PosType } from "../entities/PosType";
import { calculateRetireDate, calculateRetireYear } from "../interfaces/utils";
import { calculateAge, calculateRetireDate, calculateRetireYear } from "../interfaces/utils";
import { RequestWithUser } from "../middlewares/user";
@Route("api/v1/org/profile")
@ -80,6 +80,19 @@ export class ProfileController extends Controller {
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
*