Skip to content

Commit

Permalink
fix status description for unknown qts statuses (#1050)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKevJoy authored Jan 3, 2024
1 parent f2b0d5b commit a421625
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ public GetTeacherHandler(
NationalInsuranceNumber = teacher.dfeta_NINumber,
PendingNameChange = request.Include.HasFlag(GetTeacherRequestIncludes.PendingDetailChanges) ? Option.Some(pendingNameChange) : default,
PendingDateOfBirthChange = request.Include.HasFlag(GetTeacherRequestIncludes.PendingDetailChanges) ? Option.Some(pendingDateOfBirthChange) : default,
Qts = MapQts(qts?.dfeta_QTSDate?.ToDateOnlyWithDqtBstFix(isLocalTime: true), qtsAwardedInWales, request.AccessMode, qtsStatus != null ? GetQTSStatusDescription(qtsStatus!.dfeta_Value!) : null),
Qts = MapQts(qts?.dfeta_QTSDate?.ToDateOnlyWithDqtBstFix(isLocalTime: true), qtsAwardedInWales, request.AccessMode, qtsStatus != null ? GetQTSStatusDescription(qtsStatus!.dfeta_Value!, qtsStatus.dfeta_name) : null),
Eyts = MapEyts(eyts?.dfeta_EYTSDate?.ToDateOnlyWithDqtBstFix(isLocalTime: true), request.AccessMode, eytsTeacherStatus != null ? GetEytsStatusDescription(eytsTeacherStatus!.dfeta_Value!) : null),
Email = teacher.EMailAddress1,
Induction = request.Include.HasFlag(GetTeacherRequestIncludes.Induction) ?
Expand Down Expand Up @@ -330,7 +330,7 @@ public GetTeacherHandler(
_ => throw new ArgumentException("Invalid EYTS Status")
};

private string? GetQTSStatusDescription(string value) => value switch
private string? GetQTSStatusDescription(string value, string statusDescription) => value switch
{
"28" => "Qualified",
"50" => "Qualified",
Expand All @@ -349,6 +349,7 @@ public GetTeacherHandler(
"213" => "Qualified",
"214" => "Partial qualified teacher status",
"223" => "Qualified",
_ when statusDescription.StartsWith("Qualified teacher:", StringComparison.InvariantCultureIgnoreCase) => "Qualified",
_ => throw new ArgumentException("Invalid QTS Status")
};

Expand Down

0 comments on commit a421625

Please sign in to comment.