feat: complete phase 3 career workspace
CI and Deploy / test (push) Failing after 1m6s
CI and Deploy / deploy (push) Has been skipped

This commit is contained in:
cesnimda
2026-07-30 22:19:13 +02:00
parent f8a7cf5205
commit 4cf26405f6
18 changed files with 215 additions and 20 deletions
+35
View File
@@ -82,6 +82,10 @@ public static class StructuredCvProfileJson
primary.Interests = primary.Interests.Count == 0
? secondary.Interests
: primary.Interests.Concat(secondary.Interests).Distinct(StringComparer.OrdinalIgnoreCase).ToList();
MergeStrings(primary.Awards, secondary.Awards);
MergeStrings(primary.Publications, secondary.Publications);
MergeStrings(primary.Organisations, secondary.Organisations);
MergeStrings(primary.References, secondary.References);
if (primary.OtherSections.Count == 0) primary.OtherSections = secondary.OtherSections;
if (primary.Sections.Count == 0) primary.Sections = secondary.Sections;
@@ -126,6 +130,22 @@ public static class StructuredCvProfileJson
case "interests":
profile.Interests = SplitList(section.Content);
break;
case "awards":
case "honours":
case "honors":
profile.Awards = SplitList(section.Content);
break;
case "publications":
profile.Publications = SplitList(section.Content);
break;
case "organisations":
case "organizations":
case "memberships":
profile.Organisations = SplitList(section.Content);
break;
case "references":
profile.References = SplitList(section.Content);
break;
case "work experience":
case "experience":
case "employment history":
@@ -193,6 +213,10 @@ public static class StructuredCvProfileJson
.Where(language => !string.IsNullOrWhiteSpace(language.Name))
.ToList();
profile.Interests = CleanList(profile.Interests);
profile.Awards = CleanList(profile.Awards);
profile.Publications = CleanList(profile.Publications);
profile.Organisations = CleanList(profile.Organisations);
profile.References = CleanList(profile.References);
profile.OtherSections = (profile.OtherSections ?? new List<StructuredCvOtherSection>())
.Select(section => new StructuredCvOtherSection
{
@@ -630,6 +654,11 @@ public static class StructuredCvProfileJson
AddSectionIfAny(sections, "Interests", profile.Interests);
AddSectionIfAny(sections, "Awards", profile.Awards);
AddSectionIfAny(sections, "Publications", profile.Publications);
AddSectionIfAny(sections, "Organisations", profile.Organisations);
AddSectionIfAny(sections, "References", profile.References);
foreach (var other in profile.OtherSections)
{
AddSectionIfAny(sections, other.Title ?? "Other", other.Items);
@@ -638,6 +667,12 @@ public static class StructuredCvProfileJson
return NormalizeSections(sections);
}
private static void MergeStrings(List<string> primary, IEnumerable<string> secondary)
{
foreach (var value in secondary)
if (!primary.Contains(value, StringComparer.OrdinalIgnoreCase)) primary.Add(value);
}
private static void AddSectionIfAny(List<StructuredCvSection> sections, string name, IEnumerable<string>? lines)
{
var content = string.Join("\n", (lines ?? Array.Empty<string>()).Where(line => !string.IsNullOrWhiteSpace(line)).Select(line => line.Trim())).Trim();