This repository has been archived by the owner on Jul 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from SkillsFundingAgency/FC-516_Apprenticeshi…
…p_Search FC-516 / FC-517 / FC-554 Apprenticeship Search
- Loading branch information
Showing
66 changed files
with
2,481 additions
and
332 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
namespace SFA.DAS.Apprenticeships.Api.Types.V3 | ||
{ | ||
public class Address | ||
{ | ||
public string Primary { get; set; } | ||
|
||
public string Secondary { get; set; } | ||
|
||
public string Street { get; set; } | ||
|
||
public string Town { get; set; } | ||
|
||
public string Postcode { get; set; } | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/SFA.DAS.Apprenticeships.Api.Types/V3/ApprenticeshipSearchResults.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace SFA.DAS.Apprenticeships.Api.Types.V3 | ||
{ | ||
public sealed class ApprenticeshipSearchResults : PagedResults<ApprenticeshipSearchResultsItem> | ||
{ | ||
public Dictionary<int, long?> LevelAggregation { get; set; } | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/SFA.DAS.Apprenticeships.Api.Types/V3/ApprenticeshipSearchResultsItem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace SFA.DAS.Apprenticeships.Api.Types.V3 | ||
{ | ||
public class ApprenticeshipSearchResultsItem | ||
{ | ||
public string Id { get; set; } | ||
public ApprenticeshipTrainingType ProgrammeType { get; set; } | ||
public string Title { get; set; } | ||
public List<string> JobRoles { get; set; } | ||
public List<string> Keywords { get; set; } | ||
public int Level { get; set; } | ||
public bool Published { get; set; } | ||
public int Duration { get; set; } | ||
public DateTime? EffectiveFrom { get; set; } | ||
public DateTime? EffectiveTo { get; set; } | ||
public DateTime? LastDateForNewStarts { get; set; } | ||
|
||
// Should be removed when frameworks are finally gone. | ||
public string FrameworkName { get; set; } | ||
public string PathwayName { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System.Runtime.Serialization; | ||
|
||
namespace SFA.DAS.Apprenticeships.Api.Types.V3 | ||
{ | ||
public enum DeliveryMode | ||
{ | ||
[EnumMember(Value = "DayRelease")] | ||
DayRelease, | ||
[EnumMember(Value = "BlockRelease")] | ||
BlockRelease, | ||
[EnumMember(Value = "100PercentEmployer")] | ||
HundredPercentEmployer | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace SFA.DAS.Apprenticeships.Api.Types.V3 | ||
{ | ||
public class Feedback | ||
{ | ||
public ICollection<ProviderAttribute> Strengths { get; set; } | ||
public ICollection<ProviderAttribute> Weaknesses { get; set; } | ||
public int ExcellentFeedbackCount { get; set; } | ||
public int GoodFeedbackCount { get; set; } | ||
public int PoorFeedbackCount { get; set; } | ||
public int VeryPoorFeedbackCount { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace SFA.DAS.Apprenticeships.Api.Types.V3 | ||
{ | ||
public abstract class PagedResults<T> where T : class | ||
{ | ||
public long TotalResults { get; set; } | ||
|
||
public int PageSize { get; set; } | ||
|
||
public int PageNumber { get; set; } | ||
|
||
public IEnumerable<T> Results { get; set; } | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/SFA.DAS.Apprenticeships.Api.Types/V3/ProviderApprenticeshipLocationSearchResult.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace SFA.DAS.Apprenticeships.Api.Types.V3 | ||
{ | ||
public class ProviderApprenticeshipLocationSearchResult : PagedResults<ProviderSearchResultItem> | ||
{ | ||
public Dictionary<string, long?> TrainingOptionsAggregation { get; set; } | ||
|
||
public Dictionary<string, long?> NationalProvidersAggregation { get; set; } | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/SFA.DAS.Apprenticeships.Api.Types/V3/ProviderAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace SFA.DAS.Apprenticeships.Api.Types.V3 | ||
{ | ||
public class ProviderAttribute | ||
{ | ||
public string Name { get; set; } | ||
|
||
public int Count { get; set; } | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
src/SFA.DAS.Apprenticeships.Api.Types/V3/ProviderSearchResultItem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace SFA.DAS.Apprenticeships.Api.Types.V3 | ||
{ | ||
public class ProviderSearchResultItem | ||
{ | ||
public int Ukprn { get; set; } | ||
|
||
public TrainingLocation Location { get; set; } | ||
|
||
public string ProviderName { get; set; } | ||
|
||
public double? OverallAchievementRate { get; set; } | ||
|
||
public bool NationalProvider { get; set; } | ||
|
||
public List<string> DeliveryModes { get; set; } | ||
|
||
public double Distance { get; set; } | ||
|
||
public double? EmployerSatisfaction { get; set; } | ||
|
||
public double? LearnerSatisfaction { get; set; } | ||
|
||
public double? NationalOverallAchievementRate { get; set; } | ||
|
||
public string OverallCohort { get; set; } | ||
|
||
public bool HasNonLevyContract { get; set; } | ||
|
||
public bool IsLevyPayerOnly { get; set; } | ||
|
||
public bool CurrentlyNotStartingNewApprentices { get; set; } | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/SFA.DAS.Apprenticeships.Api.Types/V3/TrainingLocation.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace SFA.DAS.Apprenticeships.Api.Types.V3 | ||
{ | ||
public class TrainingLocation | ||
{ | ||
public int LocationId { get; set; } | ||
|
||
public string LocationName { get; set; } | ||
|
||
public Address Address { get; set; } | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/SFA.DAS.Apprenticeships.Api.Types/enums/ApprenticeshipResultsOrder.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace SFA.DAS.Apprenticeships.Api.Types.enums | ||
{ | ||
public enum ApprenticeshipResultsOrder : int | ||
{ | ||
BestMatch = 1, | ||
LevelDescending = 2, | ||
LevelAscending = 3 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/Sfa.Das.ApprenticeshipInfoService.Api/App_Start/Swagger/RemoveV1ApiVersionParameter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System.Linq; | ||
using System.Web.Http.Description; | ||
using Swashbuckle.Swagger; | ||
|
||
namespace Sfa.Das.ApprenticeshipInfoService.Api.Swagger | ||
{ | ||
|
||
internal class RemoveV1ApiVersionParameter : IOperationFilter | ||
{ | ||
public void Apply(Operation operation, SchemaRegistry schemaRegistry, ApiDescription apiDescription) | ||
{ | ||
if (apiDescription.GetGroupName() == "v1" && operation.parameters != null) | ||
{ | ||
var versionParameter = operation.parameters.SingleOrDefault(x => x.name == "api-version"); | ||
|
||
if (versionParameter != null) | ||
{ | ||
operation.parameters.Remove(versionParameter); | ||
} | ||
} | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/Sfa.Das.ApprenticeshipInfoService.Api/App_Start/Swagger/RemoveV1SpecificOperations.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System.Linq; | ||
using System.Web.Http.Description; | ||
using Swashbuckle.Swagger; | ||
|
||
namespace Sfa.Das.ApprenticeshipInfoService.Api.Swagger | ||
{ | ||
internal class RemoveV1SpecificOperations : IDocumentFilter | ||
{ | ||
public void Apply(SwaggerDocument swaggerDoc, SchemaRegistry schemaRegistry, IApiExplorer apiExplorer) | ||
{ | ||
var v1Paths = swaggerDoc.paths.Where(x => x.Key.StartsWith("/v1/")).ToList(); | ||
|
||
foreach (var path in v1Paths) | ||
{ | ||
swaggerDoc.paths.Remove(path.Key); | ||
} | ||
} | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
src/Sfa.Das.ApprenticeshipInfoService.Api/App_Start/Swagger/SwaggerDefaultValues.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using System.Linq; | ||
using System.Web.Http.Description; | ||
using Swashbuckle.Swagger; | ||
|
||
namespace Sfa.Das.ApprenticeshipInfoService.Api.Swagger | ||
{ | ||
/// <summary> | ||
/// Represents the Swagger/Swashbuckle operation filter used to provide default values. | ||
/// </summary> | ||
/// <remarks>This <see cref="IOperationFilter"/> is only required due to bugs in the <see cref="SwaggerGenerator"/>. | ||
/// Once they are fixed and published, this class can be removed.</remarks> | ||
public class SwaggerDefaultValues : IOperationFilter | ||
{ | ||
/// <summary> | ||
/// Applies the filter to the specified operation using the given context. | ||
/// </summary> | ||
/// <param name="operation">The operation to apply the filter to.</param> | ||
/// <param name="schemaRegistry">The API schema registry.</param> | ||
/// <param name="apiDescription">The API description being filtered.</param> | ||
public void Apply(Operation operation, SchemaRegistry schemaRegistry, ApiDescription apiDescription) | ||
{ | ||
operation.deprecated = apiDescription.IsDeprecated(); | ||
|
||
if (operation.parameters == null) | ||
{ | ||
return; | ||
} | ||
|
||
foreach (var parameter in operation.parameters) | ||
{ | ||
var description = apiDescription.ParameterDescriptions.First(p => p.Name == parameter.name); | ||
|
||
// REF: https://github.com/domaindrivendev/Swashbuckle/issues/1101 | ||
if (parameter.description == null) | ||
{ | ||
parameter.description = description.Documentation; | ||
} | ||
|
||
// REF: https://github.com/domaindrivendev/Swashbuckle/issues/1089 | ||
// REF: https://github.com/domaindrivendev/Swashbuckle/pull/1090 | ||
if (parameter.@default == null) | ||
{ | ||
parameter.@default = description.ParameterDescriptor?.DefaultValue; | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.