File tree Expand file tree Collapse file tree 5 files changed +87
-10
lines changed
Dfe.Data.SearchPrototype/SearchForEstablishments Expand file tree Collapse file tree 5 files changed +87
-10
lines changed Original file line number Diff line number Diff line change
1
+ namespace Dfe . Data . SearchPrototype . SearchForEstablishments . Models ;
2
+
3
+ /// <summary>
4
+ /// The object that encapsulates the Faceted results returned by the
5
+ /// T:Dfe.Data.SearchPrototype.SearchForEstablishments.SearchByKeywordUseCase instance
6
+ /// </summary>
7
+ public class EstablishmentFacet
8
+ {
9
+ /// <summary>
10
+ /// The facet (field) name
11
+ /// </summary>
12
+ public string Name { get ; }
13
+
14
+ /// <summary>
15
+ /// The collection of T:Dfe.Data.SearchPrototype.SearchForEstablishments.Models.FacetResult
16
+ /// </summary>
17
+ public IList < FacetResult > Results { get ; }
18
+
19
+ /// <summary>
20
+ /// Constructor
21
+ /// </summary>
22
+ /// <param name="facetName"></param>
23
+ /// <param name="facetResults"></param>
24
+ public EstablishmentFacet ( string facetName , IList < FacetResult > facetResults )
25
+ {
26
+ Name = facetName ;
27
+ Results = facetResults ;
28
+ }
29
+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ namespace Dfe . Data . SearchPrototype . SearchForEstablishments . Models ;
2
+
3
+ /// <summary>
4
+ /// The object that encapsulates a single facet result for a facet
5
+ /// </summary>
6
+ public class FacetResult
7
+ {
8
+ /// <summary>
9
+ /// The value of the facet result
10
+ /// </summary>
11
+ public string Value { get ; }
12
+
13
+ /// <summary>
14
+ /// The number of records that belong to this facet value
15
+ /// </summary>
16
+ public int ? Count { get ; }
17
+
18
+ /// <summary>
19
+ /// Constructor
20
+ /// </summary>
21
+ /// <param name="value">The value of the facet result</param>
22
+ /// <param name="count">The number of records that belong to this facet value</param>
23
+ public FacetResult ( string value , int ? count )
24
+ {
25
+ Value = value ;
26
+ Count = count ;
27
+ }
28
+ }
Original file line number Diff line number Diff line change 2
2
3
3
namespace Dfe . Data . SearchPrototype . SearchForEstablishments ;
4
4
5
+
6
+
7
+
5
8
/// <summary>
6
9
/// This is the object that carries the response (output) back from the
7
10
/// T:Dfe.Data.SearchPrototype.SearchForEstablishments.SearchByKeywordUseCase instance.
8
- /// The response will encapsulate any search results found along with a status.
9
11
/// </summary>
10
12
public sealed class SearchByKeywordResponse
11
13
{
12
14
/// <summary>
13
15
/// The readonly collection of T:Dfe.Data.SearchPrototype.Search.Establishment search results.
14
16
/// </summary>
15
17
public IReadOnlyCollection < Establishment > EstablishmentResults { get ; }
18
+
19
+ /// <summary>
20
+ /// The readonly collection of T:Dfe.Data.SearchPrototype.Search.EstablishmentFacet returned by the Establishment search
21
+ /// </summary>
22
+ public IReadOnlyCollection < EstablishmentFacet > ? EstablishmentFacetResults { get ; }
23
+
24
+ /// <summary>
25
+ /// The return status of the call to the
26
+ /// T:Dfe.Data.SearchPrototype.SearchForEstablishments.SearchByKeywordUseCase instance
27
+ /// </summary>
16
28
public SearchResponseStatus Status { get ; set ; }
17
29
18
30
/// <summary>
@@ -30,8 +42,12 @@ public SearchByKeywordResponse()
30
42
/// <param name="establishments">
31
43
/// The readonly collection of T:Dfe.Data.SearchPrototype.Search.Establishment search results.
32
44
/// </param>
33
- public SearchByKeywordResponse ( IReadOnlyCollection < Establishment > establishments )
45
+ /// <param name="facetResults">
46
+ /// The readonly collection of T:Dfe.Data.SearchPrototype.Search.EstablishmentFacet
47
+ /// </param>
48
+ public SearchByKeywordResponse ( IReadOnlyCollection < Establishment > establishments , IReadOnlyCollection < EstablishmentFacet > ? facetResults = null )
34
49
{
35
50
EstablishmentResults = establishments ;
51
+ EstablishmentFacetResults = facetResults ;
36
52
}
37
53
}
Original file line number Diff line number Diff line change 1
1
namespace Dfe . Data . SearchPrototype . SearchForEstablishments ;
2
2
3
+ /// <summary>
4
+ /// The status of the search response
5
+ /// </summary>
3
6
public enum SearchResponseStatus
4
7
{
8
+ /// <summary>
9
+ /// The search request completed successfully
10
+ /// </summary>
5
11
Success ,
12
+ /// <summary>
13
+ /// The request was not valid
14
+ /// </summary>
6
15
InvalidRequest ,
16
+ /// <summary>
17
+ /// The request was submitted and resulted in an error
18
+ /// </summary>
7
19
SearchServiceError
8
20
}
You can’t perform that action at this time.
0 commit comments