no message

This commit is contained in:
kittapath 2025-01-21 10:45:14 +07:00
parent 33533d5638
commit d18d28cb5b
7 changed files with 26 additions and 20 deletions

View file

@ -8,7 +8,12 @@ import { Profile } from "../entities/Profile";
import { ProfileGovernment, UpdateProfileGovernment } from "../entities/ProfileGovernment";
import { Position } from "../entities/Position";
import { PosMaster } from "../entities/PosMaster";
import { calculateAge, calculateGovAge, calculateRetireDate, setLogDataDiff } from "../interfaces/utils";
import {
calculateAge,
calculateGovAge,
calculateRetireDate,
setLogDataDiff,
} from "../interfaces/utils";
import permission from "../interfaces/permission";
import { OrgRevision } from "../entities/OrgRevision";
@Route("api/v1/org/profile/government")
@ -89,7 +94,7 @@ export class ProfileGovernmentHistoryController extends Controller {
posMaster == null || posMaster.orgChild1 == null ? null : posMaster.orgChild1.orgChild1Name,
posMaster == null || posMaster.orgRoot == null ? null : posMaster.orgRoot.orgRootName,
];
const org = fullNameParts.filter((part) => part !== undefined && part !== null).join("/");
const org = fullNameParts.filter((part) => part !== undefined && part !== null).join(" ");
let orgShortName = "";
if (posMaster != null) {
if (posMaster.orgChild1Id === null) {
@ -120,7 +125,7 @@ export class ProfileGovernmentHistoryController extends Controller {
dateLeave: record.birthDate == null ? null : calculateRetireDate(record.birthDate),
dateRetireLaw: record.dateRetireLaw ?? null,
// govAge: record.dateStart == null ? null : calculateAge(record.dateStart),
govAge: await calculateGovAge(profile.id,"OFFICER"),
govAge: await calculateGovAge(profile.id, "OFFICER"),
dateAppoint: record.dateAppoint,
dateStart: record.dateStart,
govAgeAbsent: record.govAgeAbsent,
@ -200,7 +205,7 @@ export class ProfileGovernmentHistoryController extends Controller {
posMaster == null || posMaster.orgChild1 == null ? null : posMaster.orgChild1.orgChild1Name,
posMaster == null || posMaster.orgRoot == null ? null : posMaster.orgRoot.orgRootName,
];
const org = fullNameParts.filter((part) => part !== undefined && part !== null).join("/");
const org = fullNameParts.filter((part) => part !== undefined && part !== null).join(" ");
let orgShortName = "";
if (posMaster != null) {
if (posMaster.orgChild1Id === null) {
@ -231,7 +236,7 @@ export class ProfileGovernmentHistoryController extends Controller {
dateLeave: record.birthDate == null ? null : calculateRetireDate(record.birthDate),
dateRetireLaw: record.dateRetireLaw ?? null,
// govAge: record.dateStart == null ? null : calculateAge(record.dateStart),
govAge: await calculateGovAge(profileId,"OFFICER"),
govAge: await calculateGovAge(profileId, "OFFICER"),
dateAppoint: record.dateAppoint,
dateStart: record.dateStart,
govAgeAbsent: record.govAgeAbsent,
@ -294,7 +299,7 @@ export class ProfileGovernmentHistoryController extends Controller {
posMaster == null || posMaster.orgChild1 == null ? null : posMaster.orgChild1.orgChild1Name,
posMaster == null || posMaster.orgRoot == null ? null : posMaster.orgRoot.orgRootName,
];
const org = fullNameParts.filter((part) => part !== undefined && part !== null).join("/");
const org = fullNameParts.filter((part) => part !== undefined && part !== null).join(" ");
let orgShortName = "";
if (posMaster != null) {
if (posMaster.orgChild1Id === null) {
@ -325,7 +330,7 @@ export class ProfileGovernmentHistoryController extends Controller {
dateLeave: record.birthDate == null ? null : calculateRetireDate(record.birthDate),
dateRetireLaw: record.dateRetireLaw ?? null,
// govAge: record.dateStart == null ? null : calculateAge(record.dateStart),
govAge: await calculateGovAge(profileId,"OFFICER"),
govAge: await calculateGovAge(profileId, "OFFICER"),
dateAppoint: record.dateAppoint,
dateStart: record.dateStart,
govAgeAbsent: record.govAgeAbsent,