-
Notifications
You must be signed in to change notification settings - Fork 0
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 #40 from DFE-Digital/CL/facet-response-for-UI
Cl/facet response for UI
- Loading branch information
Showing
5 changed files
with
87 additions
and
10 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
Dfe.Data.SearchPrototype/SearchForEstablishments/Models/EstablishmentFacet.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,29 @@ | ||
namespace Dfe.Data.SearchPrototype.SearchForEstablishments.Models; | ||
|
||
/// <summary> | ||
/// The object that encapsulates the Faceted results returned by the | ||
/// T:Dfe.Data.SearchPrototype.SearchForEstablishments.SearchByKeywordUseCase instance | ||
/// </summary> | ||
public class EstablishmentFacet | ||
{ | ||
/// <summary> | ||
/// The facet (field) name | ||
/// </summary> | ||
public string Name { get; } | ||
|
||
/// <summary> | ||
/// The collection of T:Dfe.Data.SearchPrototype.SearchForEstablishments.Models.FacetResult | ||
/// </summary> | ||
public IList<FacetResult> Results { get; } | ||
|
||
/// <summary> | ||
/// Constructor | ||
/// </summary> | ||
/// <param name="facetName"></param> | ||
/// <param name="facetResults"></param> | ||
public EstablishmentFacet(string facetName, IList<FacetResult> facetResults) | ||
{ | ||
Name = facetName; | ||
Results = facetResults; | ||
} | ||
} |
8 changes: 0 additions & 8 deletions
8
Dfe.Data.SearchPrototype/SearchForEstablishments/Models/EstablishmentStatusCode.cs
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
Dfe.Data.SearchPrototype/SearchForEstablishments/Models/FacetResult.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,28 @@ | ||
namespace Dfe.Data.SearchPrototype.SearchForEstablishments.Models; | ||
|
||
/// <summary> | ||
/// The object that encapsulates a single facet result for a facet | ||
/// </summary> | ||
public class FacetResult | ||
{ | ||
/// <summary> | ||
/// The value of the facet result | ||
/// </summary> | ||
public string Value { get; } | ||
|
||
/// <summary> | ||
/// The number of records that belong to this facet value | ||
/// </summary> | ||
public int? Count { get; } | ||
|
||
/// <summary> | ||
/// Constructor | ||
/// </summary> | ||
/// <param name="value">The value of the facet result</param> | ||
/// <param name="count">The number of records that belong to this facet value</param> | ||
public FacetResult(string value, int? count) | ||
{ | ||
Value = value; | ||
Count = count; | ||
} | ||
} |
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
12 changes: 12 additions & 0 deletions
12
Dfe.Data.SearchPrototype/SearchForEstablishments/SearchResponseStatus.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 |
---|---|---|
@@ -1,8 +1,20 @@ | ||
namespace Dfe.Data.SearchPrototype.SearchForEstablishments; | ||
|
||
/// <summary> | ||
/// The status of the search response | ||
/// </summary> | ||
public enum SearchResponseStatus | ||
{ | ||
/// <summary> | ||
/// The search request completed successfully | ||
/// </summary> | ||
Success, | ||
/// <summary> | ||
/// The request was not valid | ||
/// </summary> | ||
InvalidRequest, | ||
/// <summary> | ||
/// The request was submitted and resulted in an error | ||
/// </summary> | ||
SearchServiceError | ||
} |