search root dna

This commit is contained in:
mamoss 2025-04-17 23:10:20 +07:00
parent 8895eb85d4
commit 134f1f43ee

View file

@ -639,6 +639,36 @@ export class OrganizationDotnetController extends Controller {
x.orgRevision?.orgRevisionIsDraft == false &&
x.orgRevision?.orgRevisionIsCurrent == true,
)?.orgChild4Id ?? null,
rootDnaId:
profile?.current_holders?.find(
(x) =>
x.orgRevision?.orgRevisionIsDraft == false &&
x.orgRevision?.orgRevisionIsCurrent == true,
)?.orgRoot?.ancestorDNA ?? null,
child1DnaId:
profile?.current_holders?.find(
(x) =>
x.orgRevision?.orgRevisionIsDraft == false &&
x.orgRevision?.orgRevisionIsCurrent == true,
)?.orgChild1?.ancestorDNA ?? null,
child2DnaId:
profile?.current_holders?.find(
(x) =>
x.orgRevision?.orgRevisionIsDraft == false &&
x.orgRevision?.orgRevisionIsCurrent == true,
)?.orgChild2?.ancestorDNA ?? null,
child3DnaId:
profile?.current_holders?.find(
(x) =>
x.orgRevision?.orgRevisionIsDraft == false &&
x.orgRevision?.orgRevisionIsCurrent == true,
)?.orgChild3?.ancestorDNA ?? null,
child4DnaId:
profile?.current_holders?.find(
(x) =>
x.orgRevision?.orgRevisionIsDraft == false &&
x.orgRevision?.orgRevisionIsCurrent == true,
)?.orgChild4?.ancestorDNA ?? null,
commander: fullname,
commanderPositionName,
commanderId,
@ -965,6 +995,36 @@ export class OrganizationDotnetController extends Controller {
x.orgRevision?.orgRevisionIsDraft == false &&
x.orgRevision?.orgRevisionIsCurrent == true,
)?.orgChild4Id ?? null,
rootDnaId:
profile?.current_holders?.find(
(x) =>
x.orgRevision?.orgRevisionIsDraft == false &&
x.orgRevision?.orgRevisionIsCurrent == true,
)?.orgRoot?.ancestorDNA ?? null,
child1DnaId:
profile?.current_holders?.find(
(x) =>
x.orgRevision?.orgRevisionIsDraft == false &&
x.orgRevision?.orgRevisionIsCurrent == true,
)?.orgChild1?.ancestorDNA ?? null,
child2DnaId:
profile?.current_holders?.find(
(x) =>
x.orgRevision?.orgRevisionIsDraft == false &&
x.orgRevision?.orgRevisionIsCurrent == true,
)?.orgChild2?.ancestorDNA ?? null,
child3DnaId:
profile?.current_holders?.find(
(x) =>
x.orgRevision?.orgRevisionIsDraft == false &&
x.orgRevision?.orgRevisionIsCurrent == true,
)?.orgChild3?.ancestorDNA ?? null,
child4DnaId:
profile?.current_holders?.find(
(x) =>
x.orgRevision?.orgRevisionIsDraft == false &&
x.orgRevision?.orgRevisionIsCurrent == true,
)?.orgChild4?.ancestorDNA ?? null,
commander: fullname,
commanderPositionName,
commanderId,
@ -2875,6 +2935,7 @@ export class OrganizationDotnetController extends Controller {
rootId: root == null ? null : root.id,
root: root == null ? null : root.orgRootName,
rootShortName: root == null ? null : root.orgRootShortName,
rootDnaId: root == null ? null : root.ancestorDNA,
};
return new HttpSuccess(_profile);
}