-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: or-2350 add admin endpoint to analyze duplicates
- Loading branch information
Showing
10 changed files
with
91 additions
and
26 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
35 changes: 35 additions & 0 deletions
35
src/AssociationRegistry.Admin.Api/Administratie/DubbelControle/DubbelControleController.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 @@ | ||
namespace AssociationRegistry.Admin.Api.Administratie.DubbelControle; | ||
|
||
using Asp.Versioning; | ||
using Be.Vlaanderen.Basisregisters.Api; | ||
using DecentraalBeheer.Verenigingen.Registreer.FeitelijkeVereniging.RequetsModels; | ||
using DuplicateVerenigingDetection; | ||
using Microsoft.AspNetCore.Authorization; | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
[ApiVersion("1.0")] | ||
[AdvertiseApiVersions("1.0")] | ||
[ApiRoute("projections")] | ||
[ApiExplorerSettings(IgnoreApi = true)] | ||
[Authorize(Policy = Program.SuperAdminPolicyName)] | ||
public class DubbelControleController : ApiController | ||
{ | ||
[HttpPost("admin/dubbelcontrole")] | ||
public async Task<IActionResult> ControleerOpDubbels( | ||
[FromBody] RegistreerFeitelijkeVerenigingRequest? request, | ||
[FromQuery] double? minimumScoreOverride, | ||
[FromServices] IDuplicateVerenigingDetectionService duplicateVerenigingDetectionService | ||
) | ||
{ | ||
var command = request.ToCommand(); | ||
|
||
var result = await duplicateVerenigingDetectionService.GetDuplicates( | ||
command.Naam, command.Locaties, | ||
true, | ||
minimumScoreOverride.HasValue | ||
? new MinimumScore(minimumScoreOverride.Value) | ||
: MinimumScore.Default); | ||
|
||
return Ok(result); | ||
} | ||
} |
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
6 changes: 6 additions & 0 deletions
6
src/AssociationRegistry/DuplicateVerenigingDetection/MinimumScore.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,6 @@ | ||
namespace AssociationRegistry.DuplicateVerenigingDetection; | ||
|
||
public record MinimumScore(double Value) | ||
{ | ||
public static MinimumScore Default = new(1); | ||
}; |
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