This commit is contained in:
AdisakKanthawilang 2025-03-20 17:17:38 +07:00
parent 86e32d4e39
commit 91f4c59e35

View file

@ -29,6 +29,7 @@ import { ProfileEmployee } from "../entities/ProfileEmployee";
import permission from "../interfaces/permission"; import permission from "../interfaces/permission";
import { OrgRevision } from "../entities/OrgRevision"; import { OrgRevision } from "../entities/OrgRevision";
import Extension from "../interfaces/extension"; import Extension from "../interfaces/extension";
import { log } from "console";
@Route("api/v1/org/profile/salaryTemp") @Route("api/v1/org/profile/salaryTemp")
@Tags("ProfileSalaryTemp") @Tags("ProfileSalaryTemp")
@Security("bearerAuth") @Security("bearerAuth")
@ -272,6 +273,7 @@ export class ProfileSalaryTempController extends Controller {
orgRootShortName: root == null ? null : root.orgRootShortName, orgRootShortName: root == null ? null : root.orgRootShortName,
orgRevisionId: root == null ? null : root.orgRevisionId, orgRevisionId: root == null ? null : root.orgRevisionId,
org: `${_child4}${_child3}${_child2}${_child1}${root?.orgRootName ?? ""}`, org: `${_child4}${_child3}${_child2}${_child1}${root?.orgRootName ?? ""}`,
statusCheckEdit: _data.statusCheckEdit,
type: "OFFICER" type: "OFFICER"
}; };
}), }),
@ -538,6 +540,7 @@ export class ProfileSalaryTempController extends Controller {
child4Id: _data.child4IdTemp ? _data.child4IdTemp : null, child4Id: _data.child4IdTemp ? _data.child4IdTemp : null,
child4ShortName: _data.child4ShortNameTemp ? _data.child4ShortNameTemp : null, child4ShortName: _data.child4ShortNameTemp ? _data.child4ShortNameTemp : null,
org: `${_child4}${_child3}${_child2}${_child1}${root?.orgRootName ?? ""}`, org: `${_child4}${_child3}${_child2}${_child1}${root?.orgRootName ?? ""}`,
statusCheckEdit: _data.statusCheckEdit,
type: "EMPLOYEE" type: "EMPLOYEE"
}; };
}), }),
@ -606,6 +609,24 @@ export class ProfileSalaryTempController extends Controller {
// } // }
// } // }
/**
* API Get
*
* @summary API Get
*
*/
@Get("get/{salaryId}")
public async getSalary(@Path() salaryId: string, @Request() req: RequestWithUser) {
const salary = await this.salaryRepo.findOne({
where: { id: salaryId },
relations: ["profileSalary"],
});
if (!salary) {
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว");
}
return new HttpSuccess({ salaryNew: salary, salaryOld: salary.profileSalary });
}
/** /**
* API List * API List
* *
@ -725,23 +746,7 @@ export class ProfileSalaryTempController extends Controller {
} }
} }
/**
* API Get
*
* @summary API Get
*
*/
@Get("get/{salaryId}")
public async getSalary(@Path() salaryId: string, @Request() req: RequestWithUser) {
const salary = await this.salaryRepo.findOne({
where: { id: salaryId },
relations: ["profileSalary"],
});
if (!salary) {
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว");
}
return new HttpSuccess({ salaryNew: salary, salaryOld: salary.profileSalary });
}
/** /**
* API * API