Ziele Massnahmen Trennung

This commit is contained in:
2026-08-06 12:40:33 +02:00
parent a21128d62b
commit 0871802411
2 changed files with 28 additions and 2 deletions

View File

@@ -54,7 +54,10 @@ namespace AICore.Context.Entry.Navigation
[JsonPropertyName("Mitarbeiter")]
public string Employee { get; set; }
[JsonPropertyName("Ziele")]
[JsonPropertyName("Massnahmen")]
public List<string> Goals { get; set; }
[JsonPropertyName("Ziele")]
public List<string> GoalCategories { get; set; }
}
}

View File

@@ -1,7 +1,9 @@
using System;
using System.Linq;
using AICore.Context.Entry.Navigation;
using BS.Shared;
using BS.Shared.DataContracts;
using BS.Shared.Extensions;
namespace AICore.Context.EntryMapper.Detail
{
@@ -26,10 +28,31 @@ namespace AICore.Context.EntryMapper.Detail
pContext.InsUser = pObject.InsUser;
pContext.Employee = pObject.Employee.FirstNameLastName;
pContext.Goals = new System.Collections.Generic.List<string>();
pContext.GoalCategories = new System.Collections.Generic.List<string>();
if (pObject.Goals is object && pObject.Goals.Any())
{
pContext.Goals.AddRange(pObject.Goals.Select(x => x.TypeDescription));
foreach (var goal in pObject.Goals)
{
if(goal.Type == ValueListEntryType.SupportConceptGoalCategoryType
|| goal.Type == ValueListEntryType.SupportConceptIndividualGoalCategoryType)
{
// Ziel
pContext.GoalCategories.Add(goal.TypeDescription);
}
else if (goal.Type == ValueListEntryType.SupportConceptGoalType
|| goal.Type == ValueListEntryType.SupportConceptIndividualGoalType)
{
// Massnahme
pContext.Goals.Add(goal.TypeDescription);
}
else
{
// sonst
}
}
}
}