Skip to content

Commit

Permalink
addressed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielClarkeEducation committed Nov 27, 2024
1 parent d15a1f8 commit e6ef8d6
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ public class MockQualificationsRepository : IQualificationsRepository
"eyq-115" => await Task.FromResult(CreateQualification("EYQ-115", "NCFE",
AwardingOrganisations.Various, 3, false)),
"eyq-114" => await Task.FromResult(CreateLevel2FurtherActionRequiredQualification("EYQ-114", "Level 2 Further Action Qualification", AwardingOrganisations.Ncfe, 3)),

"eyq-241" => await Task.FromResult(CreateQualification("EYQ-241", "BTEC",
AwardingOrganisations.Various, 2)),
_ => await Task.FromResult(CreateQualification("EYQ-240",
"T Level Technical Qualification in Education and Childcare (Specialism - Early Years Educator)",
AwardingOrganisations.Ncfe, 3))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,19 @@ public async Task<IActionResult> Index(string qualificationId)

if (!validateAdditionalRequirementQuestions.isValid)
{
await CheckLevel2EdgeCase(model, qualification);
await QualificationLevel3OrAboveMightBeRelevantAtLevel2(model, qualification);
return validateAdditionalRequirementQuestions.actionResult!;
}

// If all the additional requirement checks pass, then we can go to check each level individually
await CheckRatioRequirements(qualificationStartedBeforeSeptember2014, qualification, model);

await CheckLevel2EdgeCase(model, qualification);
await QualificationLevel3OrAboveMightBeRelevantAtLevel2(model, qualification);

return View(model);
}

private async Task CheckLevel2EdgeCase(QualificationDetailsModel model, Qualification qualification)
private async Task QualificationLevel3OrAboveMightBeRelevantAtLevel2(QualificationDetailsModel model, Qualification qualification)
{
// Check if the qualification is not full and relevant and was started between Sept 2014 and Aug 2019 and is above a level 2 qualification
if (model.RatioRequirements.IsNotFullAndRelevant && userJourneyCookieService.WasStartedBetweenSept2014AndAug2019() && qualification.QualificationLevel > 2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@ public class RatioRequirementModel

public QualificationApprovalStatus ApprovedForUnqualified { get; set; }

public bool IsNotFullAndRelevant =>
ApprovedForLevel2 != QualificationApprovalStatus.Approved
&& ApprovedForLevel3 != QualificationApprovalStatus.Approved
&& ApprovedForLevel6 != QualificationApprovalStatus.Approved;
public bool IsNotFullAndRelevant
{
get
{
return ApprovedForLevel2 != QualificationApprovalStatus.Approved
&& ApprovedForLevel3 != QualificationApprovalStatus.Approved
&& ApprovedForLevel6 != QualificationApprovalStatus.Approved;
}
}


public string RequirementsHeadingForLevel2 { get; set; } = string.Empty;

Expand Down
8 changes: 7 additions & 1 deletion src/Dfe.EarlyYearsQualification.Web/Models/RatioRowModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ public class RatioRowModel
{
public string LevelText { get; init; } = string.Empty;

public string RatioId => string.Concat(LevelText.Where(c => !char.IsWhiteSpace(c)));
public string RatioId
{
get
{
return string.Concat(LevelText.Where(c => !char.IsWhiteSpace(c)));
}
}

public QualificationApprovalStatus ApprovalStatus { get; init; }

Expand Down

0 comments on commit e6ef8d6

Please sign in to comment.