Skip to content

Commit

Permalink
Merge pull request #46 from Informatievlaanderen/feat/OR-1229_update_…
Browse files Browse the repository at this point in the history
…base_uri

feat: OR-1229 update base uri
  • Loading branch information
QuintenGreenstack authored Sep 30, 2022
2 parents fa188ad + 23f2883 commit 8d5d95d
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 32 deletions.
3 changes: 2 additions & 1 deletion src/AssociationRegistry.Public.Api/AppSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@

public class AppSettings
{
public string BaseUrl { get; set; } = null!;
public string OrganisationRegistryUri { get; set; } = null!;
public string AssociationRegistryUri { get; set; } = null!;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public DetailVerenigingResponseExamples(AppSettings appSettings)

public DetailVerenigingResponse GetExamples()
=> new(
$"{_appSettings.BaseUrl}api/v1/contexten/detail-vereniging-context.json",
$"{_appSettings.AssociationRegistryUri}v1/contexten/detail-vereniging-context.json",
new VerenigingDetail(
"V123",
"Voorbeeld Vereniging",
Expand All @@ -40,7 +40,7 @@ public DetailVerenigingResponse GetExamples()
ImmutableArray.Create(
new Activiteit(
"Sport",
new Uri($"{_appSettings.BaseUrl}api/v1/verenigingen/V12")
new Uri($"{_appSettings.AssociationRegistryUri}v1/verenigingen/V12")
)
),
ImmutableArray.Create(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ public async Task<IActionResult> Detail(
if (maybeVereniging is not { } vereniging)
return NotFound();

return Ok(new DetailVerenigingResponse($"{appsettings.BaseUrl}api/v1/contexten/detail-vereniging-context.json", vereniging));
return Ok(new DetailVerenigingResponse($"{appsettings.AssociationRegistryUri}v1/contexten/detail-vereniging-context.json", vereniging));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public async Task<IActionResult> List(
var paginationRequest = ExtractPaginationRequest(paginationQueryParams);
var totalCount = await _verenigingenRepository.TotalCount();
var listVerenigingenResponse = new ListVerenigingenResponse(
$"{appsettings.BaseUrl}api/v1/contexten/list-verenigingen-context.json",
$"{appsettings.AssociationRegistryUri}v1/contexten/list-verenigingen-context.json",
(await _verenigingenRepository.List())
.Skip(paginationRequest.Offset)
.Take(paginationRequest.Limit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public ListVerenigingenResponseExamples(AppSettings appSettings)

public ListVerenigingenResponse GetExamples()
=> new(
$"{_appSettings.BaseUrl}api/v1/contexten/list-verenigingen-context.json",
$"{_appSettings.AssociationRegistryUri}v1/contexten/list-verenigingen-context.json",
ImmutableArray.Create(
new ListVerenigingenResponseItem(
"V001",
Expand All @@ -26,12 +26,12 @@ public ListVerenigingenResponse GetExamples()
ImmutableArray.Create(
new Activiteit(
"Sport",
new Uri($"{_appSettings.BaseUrl}api/v1/verenigingen/V001")
new Uri($"{_appSettings.AssociationRegistryUri}v1/verenigingen/V001")
)
),
ImmutableArray.Create(
new Link(
$"{_appSettings.BaseUrl}api/v1/verenigingen/V001",
$"{_appSettings.AssociationRegistryUri}v1/verenigingen/V001",
"GET",
"Detail")
)
Expand All @@ -44,12 +44,12 @@ public ListVerenigingenResponse GetExamples()
ImmutableArray.Create(
new Activiteit(
"Sport",
new Uri($"{_appSettings.BaseUrl}api/v1/verenigingen/V001")
new Uri($"{_appSettings.AssociationRegistryUri}v1/verenigingen/V001")
)
),
ImmutableArray.Create(
new Link(
$"{_appSettings.BaseUrl}api/v1/verenigingen/V002",
$"{_appSettings.AssociationRegistryUri}v1/verenigingen/V002",
"GET",
"Detail")
)
Expand All @@ -62,12 +62,12 @@ public ListVerenigingenResponse GetExamples()
ImmutableArray.Create(
new Activiteit(
"Kaartclub",
new Uri($"{_appSettings.BaseUrl}api/v1/verenigingen/V001")
new Uri($"{_appSettings.AssociationRegistryUri}v1/verenigingen/V001")
)
),
ImmutableArray.Create(
new Link(
$"{_appSettings.BaseUrl}api/v1/verenigingen/V003",
$"{_appSettings.AssociationRegistryUri}v1/verenigingen/V003",
"GET",
"Detail")
)
Expand Down
8 changes: 4 additions & 4 deletions src/AssociationRegistry.Public.Api/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ public IServiceProvider ConfigureServices(IServiceCollection services)
"DVB",
new Locatie("1770", "Liedekerke"),
ImmutableArray.Create(
new ListVerenigingActiviteit("Badminton", new Uri($"{associationRegistryUri}/V000010")),
new ListVerenigingActiviteit("Tennis", new Uri($"{associationRegistryUri}/V000010")))),
new ListVerenigingActiviteit("Badminton", new Uri($"{associationRegistryUri}v1/verenigingen/V000010")),
new ListVerenigingActiviteit("Tennis", new Uri($"{associationRegistryUri}v1/verenigingen/V000010")))),
},
new VerenigingDetail[]
{
Expand All @@ -102,8 +102,8 @@ public IServiceProvider ConfigureServices(IServiceCollection services)
new ContactGegeven("telefoon", "100"))),
ImmutableArray.Create(new DetailVerenigingen.Locatie("1770", "Liedekerke")),
ImmutableArray.Create(
new DetailVerenigingActiviteit("Badminton", new Uri($"{associationRegistryUri}/V000010")),
new DetailVerenigingActiviteit("Tennis", new Uri($"{associationRegistryUri}/V000010"))),
new DetailVerenigingActiviteit("Badminton", new Uri($"{associationRegistryUri}v1/verenigingen/V000010")),
new DetailVerenigingActiviteit("Tennis", new Uri($"{associationRegistryUri}v1/verenigingen/V000010"))),
ImmutableArray.Create(
new ContactGegeven("telefoon", "025462323"),
new ContactGegeven("email", "info@dotimeforyou.be"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"Minio_Server": "http://localhost:9010",
"Minio_Root_User": "Q3AM3UQ867SPQQA43P2F",
"Minio_Root_Password": "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG",
"OrganisationRegistryUri": "https://organisation.dev-vlaanderen.be/api/v1/organisation",
"AssociationRegistryUri": "https://association.dev-vlaanderen.be/api/v1/verenigingen"
"OrganisationRegistryUri": "https://organisation.dev-vlaanderen.be/",
"AssociationRegistryUri": "https://public-api.verenigingen.test-vlaanderen.be/"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"@context": "http://localhost:11003/api/v1/contexten/detail-vereniging-context.json",
"@context": "https://localhost:11003/v1/contexten/detail-vereniging-context.json",
"vereniging": {
"id": "V1234567",
"naam": "FWA De vrolijke BA’s",
Expand All @@ -8,11 +8,11 @@
"activiteiten": [
{
"type": "Badminton",
"beheerder": "https://association.dev-vlaanderen.be/api/v1/verenigingen/V000010"
"beheerder": "https://localhost:11003/v1/verenigingen/V000010"
},
{
"type": "Tennis",
"beheerder": "https://association.dev-vlaanderen.be/api/v1/verenigingen/V000010"
"beheerder": "https://localhost:11003/v1/verenigingen/V000010"
}
],
"rechtsvorm": "Feitelijke vereniging",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"@context": "http://localhost:11003/api/v1/contexten/detail-vereniging-context.json",
"@context": "https://localhost:11003/v1/contexten/detail-vereniging-context.json",
"vereniging": {
"id": "V1234568",
"naam": "FWA De vrolijke BA’s",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"@context": "http://localhost:11003/api/v1/contexten/list-verenigingen-context.json",
"@context": "https://localhost:11003/v1/contexten/list-verenigingen-context.json",
"verenigingen": [
{
"id": "V1234567",
Expand All @@ -12,11 +12,11 @@
"activiteiten": [
{
"type": "Badminton",
"beheerder": "https://association.dev-vlaanderen.be/api/v1/verenigingen/V000010"
"beheerder": "https://localhost:11003/v1/verenigingen/V000010"
},
{
"type": "Tennis",
"beheerder": "https://association.dev-vlaanderen.be/api/v1/verenigingen/V000010"
"beheerder": "https://localhost:11003/v1/verenigingen/V000010"
}
],
"links": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static async Task<ListVerenigingenResponse> When_retrieving_a_list_of_ver
var controller = new ListVerenigingenController(verenigingenRepositoryStub);

var response = await controller.List(
new AppSettings { BaseUrl = "http://localhost:11003/" },
new AppSettings { AssociationRegistryUri = "http://localhost:11003/" },
new PaginationQueryParams(offset, limit));

return response.Should().BeOfType<OkObjectResult>()
Expand All @@ -40,7 +40,7 @@ public static async Task<ListVerenigingenResponse> When_retrieving_a_list_of_ver
var controller = new ListVerenigingenController(verenigingenRepositoryStub);

var response = await controller.List(
new AppSettings { BaseUrl = "http://localhost:11003/" },
new AppSettings { AssociationRegistryUri = "http://localhost:11003/" },
new PaginationQueryParams());

return response.Should().BeOfType<OkObjectResult>()
Expand All @@ -55,7 +55,7 @@ public static async Task<DetailVerenigingResponse> When_retrieving_a_vereniging_

var response =
await controller.Detail(
new AppSettings { BaseUrl = "http://localhost:11003/" },
new AppSettings { AssociationRegistryUri = "http://localhost:11003/" },
vereniging.Id);

return response.Should().BeOfType<OkObjectResult>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@ public async Task Then_a_vereniging_has_a_hoofdLocatie_gemeentenaam()
public async Task Then_a_vereniging_has_a_jsonld_context_base()
=> (await Scenario.When_retrieving_a_list_of_verenigingen(_verenigingen)).Context
.Should()
.Be("http://localhost:11003/api/v1/contexten/list-verenigingen-context.json");
.Be("http://localhost:11003/v1/contexten/list-verenigingen-context.json");
}
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,5 @@ public async Task Then_a_vereniging_has_list_of_locaties()
public async Task Then_a_vereniging_has_a_jsonld_context()
=> (await Scenario.When_retrieving_a_vereniging_detail(_vereniging)).Context
.Should()
.Be("http://localhost:11003/api/v1/contexten/detail-vereniging-context.json");
.Be("http://localhost:11003/v1/contexten/detail-vereniging-context.json");
}
4 changes: 2 additions & 2 deletions test/AssociationRegistry.Test/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"Minio_Server": "http://localhost:9010",
"Minio_Root_User": "Q3AM3UQ867SPQQA43P2F",
"Minio_Root_Password": "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG",
"OrganisationRegistryUri": "https://organisation.dev-vlaanderen.be/api/v1/organisation",
"AssociationRegistryUri": "https://association.dev-vlaanderen.be/api/v1/verenigingen",
"OrganisationRegistryUri": "https://organisation.dev-vlaanderen.be/",
"AssociationRegistryUri": "https://localhost:11003/",
"OAuth2IntrospectionOptions": {
"ClientId": "association-registry-local-dev",
"ClientSecret": "a_very=Secr3t*Key",
Expand Down

0 comments on commit 8d5d95d

Please sign in to comment.