Skip to content

Commit 59fe03e

Browse files
committed
Update AccountType mapping to handle Unknown type
1 parent f4e34af commit 59fe03e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

OpenBioCardServer/Utilities/Mappers/ClassicMapper.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,19 +421,24 @@ public static void UpdateProfileFromPatch(ProfileEntity profile, ClassicProfileP
421421
}
422422

423423
// === Helpers for Account Type ===
424+
424425
private static string ToUserTypeString(AccountType type) => type switch
425426
{
426427
AccountType.Company => "company",
427428
AccountType.Organization => "organization",
428429
AccountType.Personal => "personal",
429-
_ => "personal" // Default Unknown or others to personal
430+
AccountType.Unknown => "",
431+
_ => "personal"
430432
};
433+
431434

432435
private static AccountType ParseUserType(string? type) => type?.ToLowerInvariant() switch
433436
{
434437
"company" => AccountType.Company,
435438
"organization" => AccountType.Organization,
436439
"personal" => AccountType.Personal,
437-
_ => AccountType.Personal // Default to Personal as requested
440+
"" => AccountType.Unknown,
441+
"unknown" => AccountType.Unknown,
442+
_ => AccountType.Personal
438443
};
439444
}

0 commit comments

Comments
 (0)