หาสังกัดตัวเอง

This commit is contained in:
Kittapath 2024-02-27 12:34:44 +07:00
parent 0a8cccc3aa
commit f5ba594a84

View file

@ -38,8 +38,8 @@ export class SalaryPeriodController extends Controller {
* @summary SLR_030 - #29
*
*/
@Get("latest")
async GetGroupSalaryPeriodLatest() {
@Get("latest/{id}")
async GetGroupSalaryPeriodLatest(@Path() id: string) {
//xxxx รอบเงินเดือนล่าสุดยังไม่แน่ใจเอาจากรอบไหน
//xxxx หาสังกัดคนนั้น
// const dateNow = new Date();
@ -56,8 +56,8 @@ export class SalaryPeriodController extends Controller {
}
const data = {
group1id: salaryPeriod.salaryOrgs.find((x) => x.group == "GROUP1")?.id,
group2id: salaryPeriod.salaryOrgs.find((x) => x.group == "GROUP2")?.id,
group1id: salaryPeriod.salaryOrgs.find((x) => x.group == "GROUP1" && x.rootId == id)?.id,
group2id: salaryPeriod.salaryOrgs.find((x) => x.group == "GROUP2" && x.rootId == id)?.id,
effectiveDate: salaryPeriod.effectiveDate,
period: salaryPeriod.period,
};