Skip to content

Commit

Permalink
docs: suspicious cases
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneD committed Jan 30, 2024
1 parent aa7a134 commit a14fbf4
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 19 deletions.
2 changes: 1 addition & 1 deletion paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ nuget Be.Vlaanderen.Basisregisters.PublicServiceRegistry.Api.Backoffice 2.1.1 c
nuget Be.Vlaanderen.Basisregisters.RoadRegistry.BackOffice 3.66.6 copy_content_to_output_dir: always
nuget Be.Vlaanderen.Basisregisters.RoadRegistry.BackOffice.Api 3.66.6 copy_content_to_output_dir: always
nuget Be.Vlaanderen.Basisregisters.RoadRegistry.BackOffice.Abstractions 3.66.6 copy_content_to_output_dir: always
nuget Be.Vlaanderen.Basisregisters.IntegrationDb.SuspiciousCases.Api.Abstractions 1.3.3 copy_content_to_output_dir: always
nuget Be.Vlaanderen.Basisregisters.IntegrationDb.SuspiciousCases.Api.Abstractions 1.3.5 copy_content_to_output_dir: always

nuget Be.Vlaanderen.Basisregisters.Build.Pipeline 6.0.5

Expand Down
2 changes: 1 addition & 1 deletion paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ NUGET
Be.Vlaanderen.Basisregisters.Crab (>= 3.0)
Be.Vlaanderen.Basisregisters.GrAr.Common (20.6)
Microsoft.CSharp (>= 4.7)
Be.Vlaanderen.Basisregisters.IntegrationDb.SuspiciousCases.Api.Abstractions (1.3.3) - copy_content_to_output_dir: always
Be.Vlaanderen.Basisregisters.IntegrationDb.SuspiciousCases.Api.Abstractions (1.3.5) - copy_content_to_output_dir: always
Be.Vlaanderen.Basisregisters.Api (>= 20.0)
Be.Vlaanderen.Basisregisters.MessageHandling.AwsSqs.Simple (4.9.1) - copy_content_to_output_dir: always
AWSSDK.Core (>= 3.7.106.8)
Expand Down
12 changes: 8 additions & 4 deletions src/Public.Api/Infrastructure/Swagger/ApiOrder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,21 @@ public static class Road
}

public const int Extract = Road.ChangeFeed + 100;
public const int Feeds = Extract + 5;
public const int Feeds = Extract + 100;

public const int CrabHouseNumber = Extract + 100;
public static class SuspiciousCases
{
public const int Base = Feeds + 100;
public const int V2 = Base + 10;
}

public const int CrabHouseNumber = SuspiciousCases.V2 + 100;
public const int CrabSubaddress = CrabHouseNumber + 5;
public const int CrabBuildings = CrabSubaddress + 5;

public const int Status = CrabHouseNumber + 100;

public const int AddressRepresentation = Status + 100;

public const int SuspiciousCases = AddressRepresentation + 100;
}

[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ public partial class SuspiciousCasesController
/// Vraag een verdacht geval op.
/// </summary>
/// <param name="type">Het type van het verdachte geval.</param>
/// <param name="offset">Nulgebaseerde index van de eerste instantie die teruggegeven wordt.</param>
/// <param name="limit">Aantal instanties dat teruggegeven wordt.</param>
/// <param name="nisCode">Filter op de NIS-code van het verdacht geval.</param>
/// <param name="offset">Nulgebaseerde index van de eerste instantie die teruggegeven wordt. De offset is echter beperkt tot 1000000, indien meer data dient ingelezen te worden is het gebruik van extra filters aangewezen op de service of verwijzen we naar de <a href="https://basisregisters.vlaanderen.be/producten/grar" target="_blank" >downloadproducten van het gebouwen- en adressenregister</a> (optioneel).</param>
/// <param name="limit">Aantal instanties dat teruggegeven wordt. Maximaal kunnen er 500 worden teruggegeven. Wanneer limit niet wordt meegegeven dan default 100 instanties (optioneel).</param>
/// <param name="niscode">Filter op de NIS-code van het verdachte geval (exact) (optioneel).</param>
/// <param name="actionContextAccessor"></param>
/// <param name="problemDetailsHelper"></param>
/// <param name="responseOptions"></param>
Expand All @@ -41,7 +41,7 @@ public partial class SuspiciousCasesController
/// <response code="429">Als het aantal requests per seconde de limiet overschreven heeft.</response>
/// <response code="500">Als er een interne fout is opgetreden.</response>
[HttpGet("verdachte-gevallen/{type}", Name = nameof(DetailSuspiciousCases))]
[ApiOrder(ApiOrder.SuspiciousCases + 2)]
[ApiOrder(ApiOrder.SuspiciousCases.V2 + 2)]
[ProducesResponseType(typeof(SuspiciousCasesDetailResponse), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)]
Expand All @@ -60,7 +60,7 @@ public async Task<IActionResult> DetailSuspiciousCases(
[FromRoute] int type,
[FromQuery] int? offset,
[FromQuery] int? limit,
[FromQuery] string nisCode,
[FromQuery] string? niscode,
[FromServices] IActionContextAccessor actionContextAccessor,
[FromServices] ProblemDetailsHelper problemDetailsHelper,
[FromServices] IOptions<SuspiciousCasesOptionsV2> responseOptions,
Expand All @@ -78,7 +78,7 @@ RestRequest BackendRequest() => CreateBackendDetailRequest(
type,
offset,
limit,
nisCode,
niscode,
actionContextAccessor);

var nextUrl = responseOptions.Value.SuspiciousCasesTypeNextUrl.Replace("{type}", type.ToString());
Expand All @@ -98,7 +98,7 @@ private static RestRequest CreateBackendDetailRequest(
int type,
int? offset,
int? limit,
string nisCode,
string? nisCode,
IActionContextAccessor actionContextAccessor)
{
var filter = new SuspiciousCasesDetailFilter
Expand Down
10 changes: 5 additions & 5 deletions src/Public.Api/SuspiciousCases/SuspiciousCasesController-List.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public partial class SuspiciousCasesController
/// <summary>
/// Vraag een lijst met verdachte gevallen op.
/// </summary>
/// <param name="nisCode">Filter op de NIS-code van het verdachte geval.</param>
/// <param name="niscode">Filter op de NIS-code van het verdachte geval (exact) (optioneel).</param>
/// <param name="actionContextAccessor"></param>
/// <param name="problemDetailsHelper"></param>
/// <param name="suspiciousCasesToggle"></param>
Expand All @@ -35,7 +35,7 @@ public partial class SuspiciousCasesController
/// <response code="429">Als het aantal requests per seconde de limiet overschreven heeft.</response>
/// <response code="500">Als er een interne fout is opgetreden.</response>
[HttpGet("verdachte-gevallen", Name = nameof(ListSuspiciousCases))]
[ApiOrder(ApiOrder.SuspiciousCases + 1)]
[ApiOrder(ApiOrder.SuspiciousCases.V2 + 1)]
[ProducesResponseType(typeof(SuspiciousCasesListResponse), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)]
Expand All @@ -51,7 +51,7 @@ public partial class SuspiciousCasesController
[HttpCacheValidation(NoCache = true, MustRevalidate = true, ProxyRevalidate = true)]
[HttpCacheExpiration(CacheLocation = CacheLocation.Private, MaxAge = DefaultListCaching, NoStore = true, NoTransform = true)]
public async Task<IActionResult> ListSuspiciousCases(
[FromQuery] string nisCode,
[FromQuery] string? niscode,
[FromServices] IActionContextAccessor actionContextAccessor,
[FromServices] ProblemDetailsHelper problemDetailsHelper,
[FromServices] ListSuspiciousCasesToggle suspiciousCasesToggle,
Expand All @@ -65,7 +65,7 @@ public async Task<IActionResult> ListSuspiciousCases(
var contentFormat = DetermineFormat(actionContextAccessor.ActionContext);

RestRequest BackendRequest() => CreateBackendListRequest(
nisCode,
niscode,
actionContextAccessor);

var value = await GetFromBackendWithBadRequestAsync(
Expand All @@ -79,7 +79,7 @@ RestRequest BackendRequest() => CreateBackendListRequest(
}

private static RestRequest CreateBackendListRequest(
string nisCode,
string? nisCode,
IActionContextAccessor actionContextAccessor)
{
var filter = new SuspiciousCasesListFilter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
[ApiVersion(Version.V2)]
[AdvertiseApiVersions(Version.V2)]
[ApiRoute("")]
[ApiExplorerSettings(GroupName = "VerdachteGevallen")]
[ApiExplorerSettings(GroupName = "Verdachte gevallen")]
[ApiProduces(EndpointType.BackOffice)]
public partial class SuspiciousCasesController : RegistryApiController<SuspiciousCasesController>
{
Expand Down

0 comments on commit a14fbf4

Please sign in to comment.