diff --git a/src/Nyanbyte.PPCheck.Lib/Models/OffenderInformation.cs b/src/Nyanbyte.PPCheck.Lib/Models/OffenderInformation.cs index ff93c18..beac98a 100644 --- a/src/Nyanbyte.PPCheck.Lib/Models/OffenderInformation.cs +++ b/src/Nyanbyte.PPCheck.Lib/Models/OffenderInformation.cs @@ -20,7 +20,7 @@ public record OffenderPersona public string LastName { get; set; } = string.Empty; public string CityOfBirth { get; set; } = string.Empty; public DateTime DateOfBirth { get; set; } - public char Sex { get; set; } + public string Sex { get; set; } = string.Empty; public string FamilyName { get; set; } = string.Empty; public string? FathersName { get; set; } public string? MothersName { get; set; } @@ -29,5 +29,5 @@ public record OffenderPersona public string DwellingPlace { get; set; } = string.Empty; [JsonIgnore] - public Sex OffenderSex => (Sex)Sex; + public Sex OffenderSex => string.IsNullOrWhiteSpace(Sex) ? Models.Sex.Unknown : (Sex)Sex[0]; } diff --git a/src/Nyanbyte.PPCheck.Lib/Models/Sex.cs b/src/Nyanbyte.PPCheck.Lib/Models/Sex.cs index 38ba744..138d184 100644 --- a/src/Nyanbyte.PPCheck.Lib/Models/Sex.cs +++ b/src/Nyanbyte.PPCheck.Lib/Models/Sex.cs @@ -3,5 +3,6 @@ namespace Nyanbyte.PPCheck.Lib.Models; public enum Sex : byte { Male = (byte)'M', - Female = (byte)'F' + Female = (byte)'F', + Unknown = 0, }