Merge branch 'develop' into develop-Bright
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m6s

This commit is contained in:
harid 2026-04-02 17:02:54 +07:00
commit 2f834d3644
9 changed files with 450 additions and 354 deletions

View file

@ -1653,12 +1653,13 @@ export class CommandController extends Controller {
_profile.leaveDate = _Date;
_profile.dateLeave = _Date;
_profile.lastUpdatedAt = _Date;
if (_profile.keycloak != null && _profile.keycloak != "") {
if (_profile.keycloak != null && _profile.keycloak != "" && _profile.isDelete === false) {
// console.log("4. disable keycloak/authen")
const delUserKeycloak = await deleteUser(_profile.keycloak, adminToken);
if (delUserKeycloak) {
// Task #228
// _profile.keycloak = "";
_profile.isDelete = true;
_profile.roleKeycloaks = [];
}
}
@ -1710,12 +1711,13 @@ export class CommandController extends Controller {
_profileEmp.leaveDate = _Date;
_profileEmp.dateLeave = _Date;
_profileEmp.lastUpdatedAt = _Date;
if (_profileEmp.keycloak != null && _profileEmp.keycloak != "") {
if (_profileEmp.keycloak != null && _profileEmp.keycloak != "" && _profileEmp.isDelete === false) {
// disable keycloak/authen
const delUserKeycloak = await deleteUser(_profileEmp.keycloak, adminToken);
if (delUserKeycloak) {
// Task #228
// _profileEmp.keycloak = "";
_profileEmp.isDelete = true;
_profileEmp.roleKeycloaks = [];
}
}
@ -4130,13 +4132,14 @@ export class CommandController extends Controller {
await removeProfileInOrganize(profile.id, "OFFICER");
}
if (clearProfile.status) {
if (profile.keycloak != null) {
if (profile.keycloak != null && profile.keycloak != "" && profile.isDelete === false) {
const delUserKeycloak = await deleteUser(profile.keycloak);
if (delUserKeycloak) {
// Task #228
// profile.keycloak = _null;
profile.roleKeycloaks = [];
profile.isActive = false;
profile.isDelete = true;
}
}
profile.leaveCommandId = item.commandId ?? _null;
@ -4290,6 +4293,7 @@ export class CommandController extends Controller {
profile.amount = item.amount ?? _null;
profile.amountSpecial = item.amountSpecial ?? _null;
profile.isActive = true;
profile.isDelete = false;
}
await this.profileRepository.save(profile);
@ -4535,13 +4539,14 @@ export class CommandController extends Controller {
}
if (clearProfile.status) {
if (profile.keycloak != null) {
if (profile.keycloak != null && profile.keycloak != "" && profile.isDelete === false) {
const delUserKeycloak = await deleteUser(profile.keycloak);
if (delUserKeycloak) {
// Task #228
// profile.keycloak = _null;
profile.roleKeycloaks = [];
profile.isActive = false;
profile.isDelete = true;
}
}
profile.leaveCommandId = item.commandId ?? _null;
@ -4756,13 +4761,14 @@ export class CommandController extends Controller {
const clearProfile = await checkCommandType(String(item.commandId));
const _null: any = null;
if (clearProfile.status) {
if (profile.keycloak != null) {
if (profile.keycloak != null && profile.keycloak != "" && profile.isDelete === false) {
const delUserKeycloak = await deleteUser(profile.keycloak);
if (delUserKeycloak) {
// Task #228
// profile.keycloak = _null;
profile.roleKeycloaks = [];
profile.isActive = false;
profile.isDelete = true;
}
}
profile.isLeave = item.isLeave;
@ -5253,13 +5259,14 @@ export class CommandController extends Controller {
const clearProfile = await checkCommandType(String(item.commandId));
if (clearProfile.status) {
retireTypeName = clearProfile.retireTypeName ?? "";
if (_profile.keycloak != null) {
if (_profile.keycloak != null && _profile.keycloak != "" && _profile.isDelete === false) {
const delUserKeycloak = await deleteUser(_profile.keycloak);
if (delUserKeycloak) {
// Task #228
// _profile.keycloak = _null;
_profile.roleKeycloaks = [];
_profile.isActive = false;
_profile.isDelete = true;
}
}
_profile.leaveCommandId = item.commandId ?? _null;
@ -5437,13 +5444,14 @@ export class CommandController extends Controller {
const clearProfile = await checkCommandType(String(item.commandId));
if (clearProfile.status) {
retireTypeName = clearProfile.retireTypeName ?? "";
if (_profile.keycloak != null) {
if (_profile.keycloak != null && _profile.keycloak != "" && _profile.isDelete === false) {
const delUserKeycloak = await deleteUser(_profile.keycloak);
if (delUserKeycloak) {
// Task #228
// _profile.keycloak = _null;
_profile.roleKeycloaks = [];
_profile.isActive = false;
_profile.isDelete = true;
}
}
_profile.leaveCommandId = item.commandId ?? _null;
@ -5776,13 +5784,14 @@ export class CommandController extends Controller {
}
const clearProfile = await checkCommandType(String(item.commandId));
if (clearProfile.status) {
if (_profile.keycloak != null) {
if (_profile.keycloak != null && _profile.keycloak != "" && _profile.isDelete === false) {
const delUserKeycloak = await deleteUser(_profile.keycloak);
if (delUserKeycloak) {
// Task #228
// _profile.keycloak = _null;
_profile.roleKeycloaks = [];
_profile.isActive = false;
_profile.isDelete = true;
}
}
_profile.leaveCommandId = item.commandId ?? _null;
@ -6214,13 +6223,14 @@ export class CommandController extends Controller {
const clearProfile = await checkCommandType(String(item.commandId));
const _null: any = null;
if (clearProfile.status) {
if (_profile.keycloak != null) {
if (_profile.keycloak != null && _profile.keycloak != "" && _profile.isDelete === false) {
const delUserKeycloak = await deleteUser(_profile.keycloak);
if (delUserKeycloak) {
// Task #228
// _profile.keycloak = _null;
_profile.roleKeycloaks = [];
_profile.isActive = false;
_profile.isDelete = true;
}
}
_profile.leaveCommandId = item.commandId ?? _null;
@ -6637,6 +6647,7 @@ export class CommandController extends Controller {
profile.isLeave = item.bodyProfile.isLeave;
profile.isRetirement = false;
profile.isActive = true;
profile.isDelete = false;
profile.dateLeave = _null;
profile.dateRetire = _dateRetire;
profile.dateRetireLaw = _dateRetireLaw;