Skip to content

Commit

Permalink
CON-997 Renamed property per PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
indiwiz committed Nov 4, 2019
1 parent b1f869b commit 119e065
Show file tree
Hide file tree
Showing 21 changed files with 24 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public async Task MapFromVacancyAsync(DisplayVacancyViewModel vm, Vacancy vacanc
{
vm.TrainingTitle = programme?.Title;
vm.TrainingType = programme?.ApprenticeshipType.GetDisplayName();
vm.TrainingLevel = programme?.Level.GetDisplayName();
vm.TrainingLevel = programme?.ApprenticeshipLevel.GetDisplayName();
}

if (vacancy.Wage != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public async Task<ConfirmTrainingViewModel> GetConfirmTrainingViewModelAsync(Vac
return new ConfirmTrainingViewModel
{
ProgrammeId = programme.Id,
Level = programme.Level,
ApprenticeshipLevel = programme.ApprenticeshipLevel,
TrainingTitle = programme.Title,
DurationMonths = programme.Duration,
ProgrammeType = programme.ApprenticeshipType.GetDisplayName(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public async Task<VacancyPreviewViewModel> GetVacancyPreviewViewModelAsync(Vacan
vm.SoftValidationErrors = GetSoftValidationErrors(vacancy);
vm.EducationLevelName = EducationLevelNumberHelper.GetEducationLevelName(programme.EducationLevelNumber);

if (programme != null) vm.Level = programme.Level;
if (programme != null) vm.Level = programme.ApprenticeshipLevel;

if (vacancy.Status == VacancyStatus.Referred)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Esfa.Recruit.Employer.Web.ViewModels.Part1.Training
public class ConfirmTrainingViewModel
{
public string TrainingTitle { get; set; }
public ApprenticeshipLevel Level { get; set; }
public ApprenticeshipLevel ApprenticeshipLevel { get; set; }
public int DurationMonths { get; set; }
public string ProgrammeType {get; set; }
public string ProgrammeId { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public async Task MapFromVacancyAsync(DisplayVacancyViewModel vm, Vacancy vacanc
{
vm.TrainingTitle = programme?.Title;
vm.TrainingType = programme?.ApprenticeshipType.GetDisplayName();
vm.TrainingLevel = programme?.Level.GetDisplayName();
vm.TrainingLevel = programme?.ApprenticeshipLevel.GetDisplayName();
}

if (vacancy.Wage != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public async Task<ConfirmTrainingViewModel> GetConfirmTrainingViewModelAsync(Vac
return new ConfirmTrainingViewModel
{
ProgrammeId = programme.Id,
Level = programme.Level,
ApprenticeshipLevel = programme.ApprenticeshipLevel,
TrainingTitle = programme.Title,
DurationMonths = programme.Duration,
ProgrammeType = programme.ApprenticeshipType.GetDisplayName(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public async Task<VacancyPreviewViewModel> GetVacancyPreviewViewModelAsync(Vacan
vm.CanShowDraftHeader = vacancy.Status == VacancyStatus.Draft;
vm.SoftValidationErrors = GetSoftValidationErrors(vacancy);

if (programme != null) vm.Level = programme.Level;
if (programme != null) vm.Level = programme.ApprenticeshipLevel;

if (vacancy.Status == VacancyStatus.Referred)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Esfa.Recruit.Provider.Web.ViewModels.Part1.Training
public class ConfirmTrainingViewModel
{
public string TrainingTitle { get; set; }
public ApprenticeshipLevel Level { get; set; }
public ApprenticeshipLevel ApprenticeshipLevel { get; set; }
public string EducationLevelName { get; set; }
public int DurationMonths { get; set; }
public string ProgrammeType {get; set; }
Expand Down
4 changes: 2 additions & 2 deletions src/QA/QA.Web/Mappings/ReviewMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ await Task.WhenAll(
vm.VacancyReferenceNumber = $"VAC{vacancy.VacancyReference}";
vm.TrainingTitle = programme.Title;
vm.TrainingType = programme.ApprenticeshipType.GetDisplayName();
vm.TrainingLevel = programme.Level.GetDisplayName();
vm.Level = programme.Level;
vm.TrainingLevel = programme.ApprenticeshipLevel.GetDisplayName();
vm.Level = programme.ApprenticeshipLevel;
vm.ExpectedDuration = (vacancy.Wage.DurationUnit.HasValue && vacancy.Wage.Duration.HasValue)
? vacancy.Wage.DurationUnit.Value.GetDisplayName().ToQuantity(vacancy.Wage.Duration.Value)
: null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static ApprenticeshipProgrammeViewModel ToViewModel(this IApprenticeshipP
return new ApprenticeshipProgrammeViewModel
{
Id = programme.Id,
Name = $"{programme.Title}, Level: {programme.Level}, level {(int)programme.Level} ({programme.ApprenticeshipType.ToString()})"
Name = $"{programme.Title}, Level: {programme.ApprenticeshipLevel}, level {(int)programme.ApprenticeshipLevel} ({programme.ApprenticeshipType.ToString()})"
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ namespace Esfa.Recruit.Vacancies.Client.Domain.Entities
{
public static class ApprenticeshipLevelHelper
{
//TODO: PeteM - TryRemapFromEducationLevel
public static bool TryRemapFromInt(int value, out ApprenticeshipLevel result)
{
switch (value)
Expand All @@ -26,7 +25,6 @@ public static bool TryRemapFromInt(int value, out ApprenticeshipLevel result)
return false;
}

//TODO: PeteM - RemapFromEducationLevel
public static ApprenticeshipLevel RemapFromInt(int value)
{
if (TryRemapFromInt(value, out ApprenticeshipLevel result))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public interface IApprenticeshipProgramme
string Title { get; }
DateTime? EffectiveFrom { get; }
DateTime? EffectiveTo { get; }
ApprenticeshipLevel Level { get; }
ApprenticeshipLevel ApprenticeshipLevel { get; }
int Duration { get; }
bool IsActive { get; set; }
int? EducationLevelNumber { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static T ToVacancyProjectionBase<T>(this Vacancy vacancy, ApprenticeshipP
projectedVacancy.NumberOfPositions = vacancy.NumberOfPositions.GetValueOrDefault();
projectedVacancy.OutcomeDescription = vacancy.OutcomeDescription;
projectedVacancy.ProgrammeId = vacancy.ProgrammeId;
projectedVacancy.ProgrammeLevel = programme.Level.ToString();
projectedVacancy.ProgrammeLevel = programme.ApprenticeshipLevel.ToString();
projectedVacancy.ProgrammeType = programme.ApprenticeshipType.ToString();
projectedVacancy.Qualifications = vacancy.Qualifications.ToProjection();
projectedVacancy.ShortDescription = vacancy.ShortDescription;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static IEnumerable<ApprenticeshipProgramme> FilterAndMapToApprenticeshipP
IsActive = IsStandardActive(x),
EffectiveFrom = x.EffectiveFrom,
EffectiveTo = x.EffectiveTo,
Level = ApprenticeshipLevelHelper.RemapFromInt(x.Level),
ApprenticeshipLevel = ApprenticeshipLevelHelper.RemapFromInt(x.Level),
EducationLevelNumber = x.Level,
Duration = x.Duration
});
Expand All @@ -40,7 +40,7 @@ public static IEnumerable<ApprenticeshipProgramme> FilterAndMapToApprenticeshipP
IsActive = IsFrameworkActive(x),
EffectiveFrom = x.EffectiveFrom,
EffectiveTo = x.EffectiveTo,
Level = ApprenticeshipLevelHelper.RemapFromInt(x.Level),
ApprenticeshipLevel = ApprenticeshipLevelHelper.RemapFromInt(x.Level),
EducationLevelNumber = x.Level,
Duration = x.Duration
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class ApprenticeshipProgramme : IApprenticeshipProgramme

public DateTime? EffectiveTo { get; set; }

public ApprenticeshipLevel Level { get; set; }
public ApprenticeshipLevel ApprenticeshipLevel { get; set; }

public int Duration { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class ApprenticeshipProgrammeEqualityComparer : IEqualityComparer<Apprent
public bool Equals(ApprenticeshipProgramme x, ApprenticeshipProgramme y)
{
return x.Id.Equals(y.Id)
&& x.Level == y.Level
&& x.ApprenticeshipLevel == y.ApprenticeshipLevel
&& x.ApprenticeshipType == y.ApprenticeshipType;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private async Task UpdateWithTrainingProgrammeInfo(VacancySummary summary)
{
summary.TrainingTitle = programme.Title;
summary.TrainingType = programme.ApprenticeshipType;
summary.TrainingLevel = programme.Level;
summary.TrainingLevel = programme.ApprenticeshipLevel;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ private async Task UpdateWithTrainingProgrammeInfo(VacancySummary summary)
{
summary.TrainingTitle = programme.Title;
summary.TrainingType = programme.ApprenticeshipType;
summary.TrainingLevel = programme.Level;
summary.TrainingLevel = programme.ApprenticeshipLevel;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class TestApprenticeshipProgramme : IApprenticeshipProgramme

public DateTime? EffectiveTo { get; set; }

public ApprenticeshipLevel Level { get; set; }
public ApprenticeshipLevel ApprenticeshipLevel { get; set; }

public int Duration { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class VacancyExtensionsTests
private DateTime _now = DateTime.UtcNow;
private ApprenticeshipProgramme _programme = new ApprenticeshipProgramme
{
Level = ApprenticeshipLevel.Advanced,
ApprenticeshipLevel = ApprenticeshipLevel.Advanced,
ApprenticeshipType = TrainingType.Standard,
EducationLevelNumber = 7
};
Expand Down Expand Up @@ -119,7 +119,7 @@ private void AssertCommonProperties(Vacancy v, VacancyProjectionBase p)
p.NumberOfPositions.Should().Be(v.NumberOfPositions.Value);
p.OutcomeDescription.Should().Be(v.OutcomeDescription);
p.ProgrammeId.Should().Be(v.ProgrammeId);
p.ProgrammeLevel.Should().Be(_programme.Level.ToString());
p.ProgrammeLevel.Should().Be(_programme.ApprenticeshipLevel.ToString());
p.ProgrammeType.Should().Be(_programme.ApprenticeshipType.ToString());
p.EducationLevelNumber.Should().Be(_programme.EducationLevelNumber);
p.ShortDescription.Should().Be(v.ShortDescription);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public async Task WhenApprenticeshipsApiReturnsDuplicateStandards_ThenOnlyDistin
apprenticeshipProgrammesReferenceData.Data.Count.Should().Be(3);
apprenticeshipProgrammesReferenceData.Data.Where(ap => ap.ApprenticeshipType == TrainingType.Standard).Count().Should().Be(2);
firstItem.Id.Equals(secondItem.Id).Should().BeFalse();
firstItem.Level.Equals(secondItem.Level).Should().BeFalse();
firstItem.ApprenticeshipLevel.Equals(secondItem.ApprenticeshipLevel).Should().BeFalse();
firstItem.Title.Equals(secondItem.Title).Should().BeFalse();
}

Expand Down Expand Up @@ -237,7 +237,7 @@ public async Task WhenApprenticeshipsApiReturnsDuplicateFrameworks_ThenOnlyDisti
apprenticeshipProgrammesReferenceData.Data.Count().Should().Be(3);
apprenticeshipProgrammesReferenceData.Data.Where(ap => ap.ApprenticeshipType == TrainingType.Framework).Count().Should().Be(2);
firstItem.Id.Equals(secondItem.Id).Should().BeFalse();
firstItem.Level.Equals(secondItem.Level).Should().BeFalse();
firstItem.ApprenticeshipLevel.Equals(secondItem.ApprenticeshipLevel).Should().BeFalse();
firstItem.Title.Equals(secondItem.Title).Should().BeFalse();
}

Expand Down

0 comments on commit 119e065

Please sign in to comment.