-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
154 changed files
with
166,850 additions
and
39,482 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,7 @@ echo "Deploying version ${VERSION}"; | |
git config --global user.email "[email protected]" | ||
git config --global user.name "Magda Pipeline" | ||
|
||
rm -rf "${INFRA_REPO}" | ||
git clone "[email protected]:vlaamseoverheid/${INFRA_REPO}.git" || exit 1 | ||
cd "${INFRA_REPO}" | ||
|
||
|
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
80 changes: 80 additions & 0 deletions
80
...aces/src/main/java/be/vlaanderen/vip/magda/client/diensten/GeefJaarrekeningenRequest.java
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,80 @@ | ||
package be.vlaanderen.vip.magda.client.diensten; | ||
|
||
import be.vlaanderen.vip.magda.client.MagdaDocument; | ||
import be.vlaanderen.vip.magda.client.MagdaServiceIdentification; | ||
import be.vlaanderen.vip.magda.client.diensten.subject.KBONumber; | ||
import be.vlaanderen.vip.magda.client.domeinservice.MagdaRegistrationInfo; | ||
import jakarta.validation.constraints.NotNull; | ||
import lombok.AccessLevel; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.ToString; | ||
|
||
import java.time.Year; | ||
import java.util.UUID; | ||
|
||
/** | ||
* A request to a "GeefJaarrekeningen" MAGDA service, which provides information on a company's annual accounts. | ||
* Adds the following fields to the {@link CompanyMagdaRequest}: | ||
* <ul> | ||
* <li>financialYear: the financial year of the accounts.</li> | ||
* </ul> | ||
* | ||
* @see <a href="file:resources/templates/GeefJaarrekeningen/02.00.0000/template.xml">XML template for this request type</a> | ||
* @see <a href="https://vlaamseoverheid.atlassian.net/wiki/spaces/MG/pages/499975764/Onderneming.GeefJaarrekeningen-02.00">More information on this request type</a> | ||
*/ | ||
@Getter | ||
@ToString | ||
@EqualsAndHashCode(callSuper = true) | ||
public class GeefJaarrekeningenRequest extends CompanyMagdaRequest { | ||
|
||
public static class Builder extends CompanyMagdaRequest.Builder<Builder> { | ||
|
||
@Getter(AccessLevel.PROTECTED) | ||
private Year financialYear; | ||
|
||
public Builder financialYear(Year financialYear) { | ||
this.financialYear = financialYear; | ||
return this; | ||
} | ||
|
||
public GeefJaarrekeningenRequest build() { | ||
if(getKboNumber() == null) { throw new IllegalStateException("KBO number must be given"); } | ||
if(getFinancialYear() == null) { throw new IllegalStateException("Financial year must be given"); } | ||
|
||
return new GeefJaarrekeningenRequest( | ||
getKboNumber(), | ||
getRegistration(), | ||
getFinancialYear() | ||
); | ||
} | ||
} | ||
|
||
@NotNull | ||
private final Year financialYear; | ||
|
||
public static Builder builder() { | ||
return new Builder(); | ||
} | ||
|
||
private GeefJaarrekeningenRequest( | ||
@NotNull KBONumber kboNumber, | ||
@NotNull String registratie, | ||
@NotNull Year financialYear) { | ||
super(kboNumber, registratie); | ||
this.financialYear = financialYear; | ||
} | ||
|
||
@Override | ||
public MagdaServiceIdentification magdaServiceIdentification() { | ||
return new MagdaServiceIdentification("GeefJaarrekeningen", "02.00.0000"); | ||
} | ||
|
||
@Override | ||
protected void fillIn(MagdaDocument request, UUID requestId, MagdaRegistrationInfo magdaRegistrationInfo) { | ||
fillInCommonFields(request, requestId, magdaRegistrationInfo); | ||
|
||
|
||
request.setValue("//Criteria/Boekjaar", getFinancialYear().toString()); | ||
} | ||
} |
68 changes: 68 additions & 0 deletions
68
...rc/main/java/be/vlaanderen/vip/magda/client/domain/giveannualaccounts/AnnualAccounts.java
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,68 @@ | ||
package be.vlaanderen.vip.magda.client.domain.giveannualaccounts; | ||
|
||
import be.vlaanderen.vip.magda.client.MagdaClientException; | ||
import be.vlaanderen.vip.magda.client.MagdaDocument; | ||
import be.vlaanderen.vip.magda.client.MagdaResponse; | ||
import be.vlaanderen.vip.magda.client.MagdaResponseWrapper; | ||
|
||
import java.time.Year; | ||
import java.util.List; | ||
|
||
public interface AnnualAccounts { | ||
|
||
static AnnualAccounts ofMagdaDocument(MagdaDocument magdaDocument) throws MagdaClientException { | ||
return new MagdaResponseAnnualAccountsAdapterJaxbImpl().adapt(new MagdaResponseWrapper(MagdaResponse.builder() | ||
.document(magdaDocument) | ||
.build())); | ||
} | ||
|
||
List<AnnualAccount> annualAccounts(); | ||
|
||
interface AnnualAccount { | ||
|
||
Header header(); | ||
|
||
List<Element> elements(); | ||
} | ||
|
||
interface Header { | ||
|
||
FinancialYear financialYear(); | ||
|
||
CodeAndDescription schema(); | ||
|
||
CodeAndDescription typeSchema(); | ||
|
||
CodeAndDescription nature(); | ||
} | ||
|
||
interface Element { | ||
|
||
String rubric(); | ||
|
||
NumberAmount numberAmount(); | ||
} | ||
|
||
interface NumberAmount { | ||
|
||
String value(); | ||
} | ||
|
||
interface FinancialYear { | ||
|
||
Year year(); | ||
} | ||
|
||
interface CodeAndDescription { | ||
|
||
String codeValue(); | ||
|
||
String codeDescription(); | ||
|
||
String descriptionValue(); | ||
|
||
String descriptionOrigin(); | ||
|
||
String descriptionLanguageCode(); | ||
} | ||
} |
90 changes: 90 additions & 0 deletions
90
...ain/java/be/vlaanderen/vip/magda/client/domain/giveannualaccounts/AnnualAccountsJaxb.java
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,90 @@ | ||
package be.vlaanderen.vip.magda.client.domain.giveannualaccounts; | ||
|
||
import be.vlaanderen.vip.magda.client.domain.model.shared.CodeAndDescriptionJaxb; | ||
import be.vlaanderen.vip.magda.client.domain.model.shared.YearXmlAdapter; | ||
import jakarta.xml.bind.annotation.XmlElement; | ||
import jakarta.xml.bind.annotation.XmlElementWrapper; | ||
import jakarta.xml.bind.annotation.XmlRootElement; | ||
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter; | ||
import lombok.Getter; | ||
import lombok.experimental.Accessors; | ||
|
||
import java.io.Serializable; | ||
import java.time.Year; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@XmlRootElement(name = "Jaarrekeningen") | ||
@Accessors(fluent = true) | ||
@Getter | ||
public class AnnualAccountsJaxb implements AnnualAccounts, Serializable { | ||
|
||
@XmlElement(name = "Jaarrekening") | ||
ArrayList<AnnualAccountJaxb> annualAccount = new ArrayList<>(); | ||
|
||
@Override | ||
public List<AnnualAccounts.AnnualAccount> annualAccounts() { | ||
return annualAccount.stream() | ||
.map(x -> (AnnualAccounts.AnnualAccount) x) | ||
.toList(); | ||
} | ||
|
||
@Getter | ||
private static class AnnualAccountJaxb implements AnnualAccounts.AnnualAccount, Serializable { | ||
|
||
@XmlElement(name = "Hoofding") | ||
HeaderJaxb header; | ||
|
||
@XmlElementWrapper(name = "Elementen") | ||
@XmlElement(name = "Element") | ||
ArrayList<ElementJaxb> elements = new ArrayList<>(); | ||
|
||
@Override | ||
public List<AnnualAccounts.Element> elements() { | ||
return elements.stream() | ||
.map(x -> (AnnualAccounts.Element) x) | ||
.toList(); | ||
} | ||
} | ||
|
||
@Getter | ||
private static class HeaderJaxb implements AnnualAccounts.Header, Serializable { | ||
|
||
@XmlElement(name = "Boekjaar") | ||
FinancialYearJaxb financialYear; | ||
|
||
@XmlElement(name = "Schema") | ||
CodeAndDescriptionJaxb schema; | ||
|
||
@XmlElement(name = "Soortschema") | ||
CodeAndDescriptionJaxb typeSchema; | ||
|
||
@XmlElement(name = "Aard") | ||
CodeAndDescriptionJaxb nature; | ||
} | ||
|
||
@Getter | ||
private static class ElementJaxb implements AnnualAccounts.Element, Serializable { | ||
|
||
@XmlElement(name = "Rubriek") | ||
String rubric; | ||
|
||
@XmlElement(name = "AantalBedrag") | ||
NumberAmountJaxb numberAmount; | ||
} | ||
|
||
@Getter | ||
private static class NumberAmountJaxb implements AnnualAccounts.NumberAmount, Serializable { | ||
|
||
@XmlElement(name = "Waarde") | ||
String value; | ||
} | ||
|
||
@Getter | ||
private static class FinancialYearJaxb implements AnnualAccounts.FinancialYear, Serializable { | ||
|
||
@XmlElement(name = "Jaar") | ||
@XmlJavaTypeAdapter(YearXmlAdapter.class) | ||
Year year; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...a/be/vlaanderen/vip/magda/client/domain/giveannualaccounts/GiveAnnualAccountsService.java
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,18 @@ | ||
package be.vlaanderen.vip.magda.client.domain.giveannualaccounts; | ||
|
||
import be.vlaanderen.vip.magda.client.MagdaClientException; | ||
import be.vlaanderen.vip.magda.client.diensten.GeefJaarrekeningenRequest; | ||
|
||
/** | ||
* A service for interfacing with MAGDA's "GeefJaarrekeningen" services for retrieving information on the annual accounts of enterprises. | ||
*/ | ||
public interface GiveAnnualAccountsService { | ||
|
||
/** | ||
* Retrieves annual account information from a GeefJaarrekeningen request. | ||
* | ||
* @see AnnualAccounts | ||
* @see GeefJaarrekeningenRequest | ||
*/ | ||
AnnualAccounts getAnnualAccounts(GeefJaarrekeningenRequest request) throws MagdaClientException; | ||
} |
Oops, something went wrong.