diff --git a/src/controllers/OrganizationDotnetController.ts b/src/controllers/OrganizationDotnetController.ts index 29a94f70..6ee5cd36 100644 --- a/src/controllers/OrganizationDotnetController.ts +++ b/src/controllers/OrganizationDotnetController.ts @@ -2657,12 +2657,17 @@ export class OrganizationDotnetController extends Controller { dutyTimeEffectiveDate: profile.dutyTimeEffectiveDate, posLevel: profile.posLevel?.posLevelName ?? "", posType: profile.posType?.posTypeName ?? "", - profileSalary: profile.profileSalary, + // profileSalary: profile.profileSalary, + profileSalary: profile.profileSalary?.map((x) => ({ + ...x, + date: x.commandDateAffect ?? new Date() + })) ?? [], // profileInsignia: profile.profileInsignias.map((x) => { // return { ...x, insignia: x.insignia.name }; // }), profileInsignia: profile.profileInsignias?.map((x) => ({ ...x, + insigniaId: x.insignia?.id ?? null, insignia: x.insignia?.name ?? null, })) ?? [], amount: profile.amount, @@ -2962,9 +2967,14 @@ export class OrganizationDotnetController extends Controller { : profile.posType?.posTypeShortName + " ") + (profile.posLevel?.posLevelName ?? ""), posType: profile.posType?.posTypeName ?? "", profileSalary: profile.profileSalary, - profileInsignia: profile.profileInsignias.map((x) => { - return { ...x, insignia: x.insignia.name }; - }), + // profileInsignia: profile.profileInsignias.map((x) => { + // return { ...x, insignia: x.insignia.name }; + // }), + profileInsignia: profile.profileInsignias?.map((x) => ({ + ...x, + insigniaId: x.insignia?.id ?? null, + insignia: x.insignia?.name ?? null, + })) ?? [], amount: profile.amount, positionSalaryAmount: profile.positionSalaryAmount, mouthSalaryAmount: profile.mouthSalaryAmount, @@ -3176,12 +3186,21 @@ export class OrganizationDotnetController extends Controller { ? "" : profile.posType?.posTypeShortName + " ") + (profile.posLevel?.posLevelName ?? ""), posType: profile.posType?.posTypeName ?? "", - profileSalary: profile.profileSalary.map((x) => { - return { ...x, date: x.commandDateAffect ?? new Date() }; - }), - profileInsignia: profile.profileInsignias.map((x) => { - return { ...x, insignia: x.insignia.name }; - }), + // profileSalary: profile.profileSalary.map((x) => { + // return { ...x, date: x.commandDateAffect ?? new Date() }; + // }), + profileSalary: profile.profileSalary?.map((x) => ({ + ...x, + date: x.commandDateAffect ?? new Date() + })) ?? [], + // profileInsignia: profile.profileInsignias.map((x) => { + // return { ...x, insignia: x.insignia.name }; + // }), + profileInsignia: profile.profileInsignias?.map((x) => ({ + ...x, + insigniaId: x.insignia?.id ?? null, + insignia: x.insignia?.name ?? null, + })) ?? [], amount: profile.amount, positionSalaryAmount: profile.positionSalaryAmount, mouthSalaryAmount: profile.mouthSalaryAmount, diff --git a/src/controllers/OrganizationUnauthorizeController.ts b/src/controllers/OrganizationUnauthorizeController.ts index d63b885c..dfd26df5 100644 --- a/src/controllers/OrganizationUnauthorizeController.ts +++ b/src/controllers/OrganizationUnauthorizeController.ts @@ -1663,12 +1663,17 @@ export class OrganizationUnauthorizeController extends Controller { dutyTimeEffectiveDate: profile.dutyTimeEffectiveDate, posLevel: profile.posLevel?.posLevelName ?? "", posType: profile.posType?.posTypeName ?? "", - profileSalary: profile.profileSalary, + // profileSalary: profile.profileSalary, + profileSalary: profile.profileSalary?.map((x) => ({ + ...x, + date: x.commandDateAffect ?? new Date() + })) ?? [], // profileInsignia: profile.profileInsignias.map((x) => { // return { ...x, insignia: x.insignia.name }; // }), profileInsignia: profile.profileInsignias?.map((x) => ({ ...x, + insigniaId: x.insignia?.id ?? null, insignia: x.insignia?.name ?? null, })) ?? [], amount: profile.amount, @@ -1879,7 +1884,12 @@ export class OrganizationUnauthorizeController extends Controller { posLevel: profile.posLevel ? profile.posLevel : null, posType: profile.posType ? profile.posType : null, profileSalary: profile.profileSalary, - profileInsignia: profile.profileInsignias, + // profileInsignia: profile.profileInsignias, + profileInsignia: profile.profileInsignias?.map((x) => ({ + ...x, + insigniaId: x.insignia?.id ?? null, + insignia: x.insignia?.name ?? null, + })) ?? [], })); return new HttpSuccess(mapProfile); @@ -2053,12 +2063,21 @@ export class OrganizationUnauthorizeController extends Controller { ? "" : profile.posType?.posTypeShortName + " ") + (profile.posLevel?.posLevelName ?? ""), posType: profile.posType?.posTypeName ?? "", - profileSalary: profile.profileSalary.map((x) => { - return { ...x, date: x.commandDateAffect ?? new Date() }; - }), - profileInsignia: profile.profileInsignias.map((x) => { - return { ...x, insignia: x.insignia.name }; - }), + // profileSalary: profile.profileSalary.map((x) => { + // return { ...x, date: x.commandDateAffect ?? new Date() }; + // }), + profileSalary: profile.profileSalary?.map((x) => ({ + ...x, + date: x.commandDateAffect ?? new Date() + })) ?? [], + // profileInsignia: profile.profileInsignias.map((x) => { + // return { ...x, insignia: x.insignia.name }; + // }), + profileInsignia: profile.profileInsignias?.map((x) => ({ + ...x, + insigniaId: x.insignia?.id ?? null, + insignia: x.insignia?.name ?? null, + })) ?? [], amount: profile.amount, positionSalaryAmount: profile.positionSalaryAmount, mouthSalaryAmount: profile.mouthSalaryAmount,