add isRetirement? (keycloak-all-officer)

This commit is contained in:
AdisakKanthawilang 2025-02-03 17:25:54 +07:00
parent f4e8ec277e
commit 482421cea6

View file

@ -3012,6 +3012,7 @@ export class OrganizationDotnetController extends Controller {
node: number;
nodeId: string;
isAll: boolean;
isRetirement?: boolean;
},
) {
let typeCondition: any = {};
@ -3064,7 +3065,7 @@ export class OrganizationDotnetController extends Controller {
};
}
}
const profile = await this.profileRepo.find({
let profile = await this.profileRepo.find({
where: { keycloak: Not(IsNull()) || Not(""), isLeave: false, current_holders: typeCondition },
relations: [
"posType",
@ -3077,7 +3078,22 @@ export class OrganizationDotnetController extends Controller {
"current_holders.orgChild4",
],
});
if(body.isRetirement){
profile = await this.profileRepo.find({
where: { keycloak: Not(IsNull()) || Not(""), isLeave: false, current_holders: typeCondition, isRetirement: true },
relations: [
"posType",
"posLevel",
"current_holders",
"current_holders.orgRoot",
"current_holders.orgChild1",
"current_holders.orgChild2",
"current_holders.orgChild3",
"current_holders.orgChild4",
],
});
}
const findRevision = await this.orgRevisionRepo.findOne({
where: { orgRevisionIsCurrent: true },
});