Merge branch 'develop' of github.com:Frappet/hrms-api-org into develop

This commit is contained in:
mamoss 2025-05-07 13:31:14 +07:00
commit 5e1da75b94

View file

@ -10038,7 +10038,7 @@ export class ProfileController extends Controller {
orgChild3: orgChild3Ref?.orgChild3Name,
orgChild4: orgChild4Ref?.orgChild4Name,
commandYear: new Date().getFullYear() + 543,
commandDateSign: new Date(),
// commandDateSign: new Date(),
commandDateAffect: new Date(),
commandCode: "16",
commandName: "พ้นจากราชการ",
@ -10051,6 +10051,7 @@ export class ProfileController extends Controller {
lastUpdateFullName: request.user.name,
createdAt: new Date(),
lastUpdatedAt: new Date(),
remark: "ถึงแก่กรรม",
};
delete data.id;
@ -10066,13 +10067,10 @@ export class ProfileController extends Controller {
profile.isLeave = requestBody.isLeave;
profile.leaveReason = requestBody.leaveReason;
profile.dateLeave = requestBody.dateLeave;
if (requestBody.isLeave == true) {
await removeProfileInOrganize(profile.id, "OFFICER");
}
profile.leaveType = "RETIRE_DECEASED";
profile.position = _null;
profile.posLevelId = _null;
profile.posTypeId = _null;
// profile.position = _null;
// profile.posLevelId = _null;
// profile.posTypeId = _null;
if (profile.keycloak != null) {
const delUserKeycloak = await deleteUser(profile.keycloak);
if (delUserKeycloak) {
@ -10083,7 +10081,9 @@ export class ProfileController extends Controller {
}
await this.profileRepo.save(profile, { data: request });
setLogDataDiff(request, { before, after: profile });
await removeProfileInOrganize(profile.id, "OFFICER");
if (requestBody.isLeave == true) {
await removeProfileInOrganize(profile.id, "OFFICER");
}
return new HttpSuccess();
}