-
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-2067 allow KBO in oprichting
- Loading branch information
1 parent
e27f9df
commit c77c16e
Showing
7 changed files
with
251 additions
and
4 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
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
60 changes: 60 additions & 0 deletions
60
...ervice/When_Retrieving_VerenigingVolgensKbo/Status/Given_A_GeefOndernemingResponseBody.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,60 @@ | ||
namespace AssociationRegistry.Test.Admin.Api.Magda.MagdaKboService.When_Retrieving_VerenigingVolgensKbo.Status; | ||
|
||
using AssociationRegistry.Admin.Api.Magda; | ||
using AssociationRegistry.Framework; | ||
using AssociationRegistry.Kbo; | ||
using AssociationRegistry.Magda; | ||
using AssociationRegistry.Magda.Configuration; | ||
using AssociationRegistry.Magda.Constants; | ||
using AssociationRegistry.Magda.Models; | ||
using AssociationRegistry.Magda.Models.GeefOnderneming; | ||
using AssociationRegistry.Magda.Onderneming.GeefOnderneming; | ||
using AssociationRegistry.Test.Admin.Api.Framework; | ||
using AssociationRegistry.Vereniging; | ||
using AutoFixture; | ||
using FluentAssertions; | ||
using FluentAssertions.Execution; | ||
using Microsoft.Extensions.Logging.Abstractions; | ||
using Moq; | ||
using ResultNet; | ||
using Xunit; | ||
using Xunit.Categories; | ||
|
||
[UnitTest] | ||
public class Given_A_GeefOndernemingResponseBody_Which_Is_Active | ||
{ | ||
private readonly MagdaGeefVerenigingService _service; | ||
private readonly Fixture _fixture; | ||
|
||
public Given_A_GeefOndernemingResponseBody_Which_Is_Active() | ||
{ | ||
_fixture = new Fixture().CustomizeAdminApi(); | ||
|
||
var magdaFacade = new Mock<IMagdaFacade>(); | ||
var responseEnvelope = _fixture.Create<ResponseEnvelope<GeefOndernemingResponseBody>>(); | ||
|
||
responseEnvelope.Body!.GeefOndernemingResponse!.Repliek.Antwoorden.Antwoord.Inhoud.Onderneming.StatusKBO = new StatusKBOType | ||
{ | ||
Code = new CodeStatusKBOType | ||
{ | ||
Value = StatusKBOCodes.Actief, | ||
}, | ||
}; | ||
|
||
magdaFacade.Setup(facade => facade.GeefOnderneming(It.IsAny<string>(), It.IsAny<MagdaCallReference>())) | ||
.ReturnsAsync(responseEnvelope); | ||
|
||
_service = new MagdaGeefVerenigingService(Mock.Of<IMagdaCallReferenceRepository>(), magdaFacade.Object, | ||
new TemporaryMagdaVertegenwoordigersSection(), | ||
new NullLogger<MagdaGeefVerenigingService>()); | ||
} | ||
|
||
[Fact] | ||
public async Task Then_It_Returns_A_SuccessResult() | ||
{ | ||
var result = await _service.GeefVereniging(_fixture.Create<KboNummer>(), _fixture.Create<CommandMetadata>(), | ||
CancellationToken.None); | ||
|
||
result.IsSuccess().Should().BeTrue(); | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
...VerenigingVolgensKbo/Status/Given_A_GeefOndernemingResponseBody_Which_Is_In_Oprichting.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,58 @@ | ||
namespace AssociationRegistry.Test.Admin.Api.Magda.MagdaKboService.When_Retrieving_VerenigingVolgensKbo.Status; | ||
|
||
using AssociationRegistry.Admin.Api.Magda; | ||
using AssociationRegistry.Framework; | ||
using AssociationRegistry.Magda; | ||
using AssociationRegistry.Magda.Configuration; | ||
using AssociationRegistry.Magda.Constants; | ||
using AssociationRegistry.Magda.Models; | ||
using AssociationRegistry.Magda.Models.GeefOnderneming; | ||
using AssociationRegistry.Magda.Onderneming.GeefOnderneming; | ||
using AutoFixture; | ||
using FluentAssertions; | ||
using Framework; | ||
using Microsoft.Extensions.Logging.Abstractions; | ||
using Moq; | ||
using ResultNet; | ||
using Vereniging; | ||
using Xunit; | ||
using Xunit.Categories; | ||
|
||
[UnitTest] | ||
public class Given_A_GeefOndernemingResponseBody_Which_Is_In_Oprichting | ||
{ | ||
private readonly MagdaGeefVerenigingService _service; | ||
private readonly Fixture _fixture; | ||
|
||
public Given_A_GeefOndernemingResponseBody_Which_Is_In_Oprichting() | ||
{ | ||
_fixture = new Fixture().CustomizeAdminApi(); | ||
|
||
var magdaFacade = new Mock<IMagdaFacade>(); | ||
var responseEnvelope = _fixture.Create<ResponseEnvelope<GeefOndernemingResponseBody>>(); | ||
|
||
responseEnvelope.Body!.GeefOndernemingResponse!.Repliek.Antwoorden.Antwoord.Inhoud.Onderneming.StatusKBO = new StatusKBOType | ||
{ | ||
Code = new CodeStatusKBOType | ||
{ | ||
Value = StatusKBOCodes.InOprichting, | ||
}, | ||
}; | ||
|
||
magdaFacade.Setup(facade => facade.GeefOnderneming(It.IsAny<string>(), It.IsAny<MagdaCallReference>())) | ||
.ReturnsAsync(responseEnvelope); | ||
|
||
_service = new MagdaGeefVerenigingService(Mock.Of<IMagdaCallReferenceRepository>(), magdaFacade.Object, | ||
new TemporaryMagdaVertegenwoordigersSection(), | ||
new NullLogger<MagdaGeefVerenigingService>()); | ||
} | ||
|
||
[Fact] | ||
public async Task Then_It_Returns_A_SuccessResult() | ||
{ | ||
var result = await _service.GeefVereniging(_fixture.Create<KboNummer>(), _fixture.Create<CommandMetadata>(), | ||
CancellationToken.None); | ||
|
||
result.IsSuccess().Should().BeTrue(); | ||
} | ||
} |
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
122 changes: 122 additions & 0 deletions
122
wiremock/__files/GeefOndernemingResponses/0407622011.xml
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,122 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> | ||
<SOAP-ENV:Header xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" /> | ||
<SOAP-ENV:Body xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> | ||
<web:GeefOndernemingResponse | ||
xmlns:web="http://webservice.geefondernemingdienst-02_00.onderneming-02_00.vip.vlaanderen.be"> | ||
<Repliek> | ||
<Context> | ||
<Naam>GeefOnderneming</Naam> | ||
<Versie>02.00.0000</Versie> | ||
<Bericht> | ||
<Type>ANTWOORD</Type> | ||
<Tijdstip> | ||
<Datum>2023-08-10</Datum> | ||
<Tijd>09:45:34.243</Tijd> | ||
</Tijdstip> | ||
<Afzender> | ||
<Identificatie>vip.vlaanderen.be</Identificatie> | ||
<Naam>MagdaGateway</Naam> | ||
<Referte>202bfd76-aa75-4265-b560-936beeb77f86</Referte> | ||
</Afzender> | ||
<Ontvanger> | ||
<Identificatie>kbbj.vlaanderen.be/dv/verenigingsregister-aip</Identificatie> | ||
<Referte>AREF_QT_610527_134233</Referte> | ||
<Hoedanigheid /> | ||
</Ontvanger> | ||
</Bericht> | ||
</Context> | ||
<Antwoorden> | ||
<Antwoord> | ||
<Referte>efb55ac2-5421-4a7f-bb25-26b1b8a5eb10</Referte> | ||
<Inhoud> | ||
<Onderneming> | ||
<Ondernemingsnummer>0407622011</Ondernemingsnummer> | ||
<AuthentiekBron> | ||
<Code>03</Code> | ||
<Omschrijving>KBO</Omschrijving> | ||
</AuthentiekBron> | ||
<OndernemingOfVestiging> | ||
<Code Beschrijving="Onderneming">1</Code> | ||
</OndernemingOfVestiging> | ||
<StatusKBO> | ||
<Code>JU</Code> | ||
</StatusKBO> | ||
<SoortOnderneming> | ||
<Code Beschrijving="Rechtspersoon">2</Code> | ||
</SoortOnderneming> | ||
<Namen> | ||
<MaatschappelijkeNamen> | ||
<MaatschappelijkeNaam DatumBegin="2004-10-11"> | ||
<Naam>Jeugdraad Lille vzw De Bosuil</Naam> | ||
<Taalcode>nl</Taalcode> | ||
</MaatschappelijkeNaam> | ||
</MaatschappelijkeNamen> | ||
<AfgekorteNamen> | ||
<AfgekorteNaam DatumBegin="2004-10-11"> | ||
<Naam>Jeugdraad Lille vzw of De Bosuil</Naam> | ||
<Taalcode>nl</Taalcode> | ||
</AfgekorteNaam> | ||
</AfgekorteNamen> | ||
</Namen> | ||
<Adressen> | ||
<Adres DatumBegin="1995-06-08"> | ||
<Straat> | ||
<Code>8020</Code> | ||
</Straat> | ||
<Huisnummer>4</Huisnummer> | ||
<Gemeente> | ||
<NISCode>72025</NISCode> | ||
<PostCode>3910</PostCode> | ||
</Gemeente> | ||
<Land> | ||
<NISCode>150</NISCode> | ||
<ISOCode>BE</ISOCode> | ||
<Naam>BELGIE</Naam> | ||
</Land> | ||
<Type> | ||
<Code>001</Code> | ||
</Type> | ||
<Descripties> | ||
<Descriptie> | ||
<Adres> | ||
<Straat> | ||
<Naam>Bosuilstraat(SHL)</Naam> | ||
</Straat> | ||
<Gemeente> | ||
<Naam>Neerpelt</Naam> | ||
</Gemeente> | ||
<Land> | ||
<NISCode>150</NISCode> | ||
<Naam>België</Naam> | ||
</Land> | ||
</Adres> | ||
<Contact> | ||
<Telefoonnummer>011642985</Telefoonnummer> | ||
<Faxnummer>011663513</Faxnummer> | ||
<Email>info@opdebosuil.be</Email> | ||
<Website>www.opdebosuil.be</Website> | ||
</Contact> | ||
</Descriptie> | ||
</Descripties> | ||
</Adres> | ||
</Adressen> | ||
<Start> | ||
<Datum>1964-12-17</Datum> | ||
</Start> | ||
<Inschrijving> | ||
<Datum>2003-01-18</Datum> | ||
</Inschrijving> | ||
<Rechtsvormen> | ||
<Rechtsvorm DatumBegin="1964-12-17"> | ||
<Code>017</Code> | ||
</Rechtsvorm> | ||
</Rechtsvormen> | ||
</Onderneming> | ||
</Inhoud> | ||
</Antwoord> | ||
</Antwoorden> | ||
</Repliek> | ||
</web:GeefOndernemingResponse> | ||
</SOAP-ENV:Body> | ||
</soapenv:Envelope> |