From a421625f90c372b144f271cc137cc525e96df823 Mon Sep 17 00:00:00 2001 From: MrKevJoy <60096576+MrKevJoy@users.noreply.github.com> Date: Wed, 3 Jan 2024 17:37:36 +0000 Subject: [PATCH] fix status description for unknown qts statuses (#1050) --- .../V3/Handlers/GetTeacherHandler.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/Handlers/GetTeacherHandler.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/Handlers/GetTeacherHandler.cs index 0daddc1ac..4f0e32bc5 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/Handlers/GetTeacherHandler.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/Handlers/GetTeacherHandler.cs @@ -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) ? @@ -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", @@ -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") };