เพิ่มฟิว governant

This commit is contained in:
AnandaTon 2024-05-17 14:21:53 +07:00
parent 884fe694d0
commit ae947a48c0
2 changed files with 66 additions and 3 deletions

View file

@ -1,11 +1,28 @@
import { Body, Controller, Example, Get, Patch, Path, Delete, Post, Request, Route, Security, Tags } from "tsoa";
import {
Body,
Controller,
Example,
Get,
Patch,
Path,
Delete,
Post,
Request,
Route,
Security,
Tags,
} from "tsoa";
import { AppDataSource } from "../database/data-source";
import HttpSuccess from "../interfaces/http-success";
import HttpStatus from "../interfaces/http-status";
import HttpError from "../interfaces/http-error";
import { RequestWithUser } from "../middlewares/user";
import { ProfileEmployee } from "../entities/ProfileEmployee";
import { CreateProfileEmployeeGovernment, ProfileGovernment, UpdateProfileGovernment } from "../entities/ProfileGovernment";
import {
CreateProfileEmployeeGovernment,
ProfileGovernment,
UpdateProfileGovernment,
} from "../entities/ProfileGovernment";
import { EmployeePosition } from "../entities/EmployeePosition";
import { EmployeePosMaster } from "../entities/EmployeePosMaster";
import { calculateAge, calculateRetireDate } from "../interfaces/utils";
@ -95,6 +112,14 @@ export class ProfileGovernmentEmployeeController extends Controller {
posMasterNo: posMaster == null ? null : `${orgShortName} ${posMaster.posMasterNo}`, //เลขที่ตำแหน่ง
posType: record.posType == null ? null : record.posType.posTypeName, //ประเภท
dateLeave: record.birthDate == null ? null : calculateRetireDate(record.birthDate), //วันเกษียณ
dateAppoint: record.dateAppoint, //วันที่สั่งบรรจุ
dateStart: record.dateStart, //วันที่เริ่มปฎิบัติงานราชการ
reasonSameDate: record.reasonSameDate, //เหตุผลที่วันที่ไม่ตรงกัน
dateRetire: record.dateRetire ?? null, //วันครบเกษียณอายุ
govAge: record.dateStart == null ? null : calculateAge(record.dateStart), //อายุราชการ
govAgeAbsent: record.govAgeAbsent ?? null, // ขาดราชการ
govAgePlus: record.govAgePlus, // อายุราชการเกื้อกูล
dateRetireLaw: record.dateRetireLaw ?? null, // วันที่เกษียฯอายุราชการตามกฎหมาย
};
return new HttpSuccess(data);
}
@ -185,4 +210,4 @@ export class ProfileGovernmentEmployeeController extends Controller {
// }
// return new HttpSuccess();
// }
}
}