Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbucket-pipelines committed Oct 30, 2024
2 parents ba2bba4 + 74cee6f commit d7aeb5c
Show file tree
Hide file tree
Showing 154 changed files with 166,850 additions and 39,482 deletions.
20 changes: 5 additions & 15 deletions bitbucket-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,14 @@ definitions:
image: softwareimprovementgroup/sigridci
name: Publish to Sigrid
script:
- timeout 10m sigridci.py --customer $SIGRID_CI_ACCOUNT --system "Solid" --subsystem $(echo "magdamock.service"| sed -e "s/\./-/g") --source . --publish --include-history
- step: &dependencyTree
name: Dependency tree
caches:
- maven
script:
- mvn dependency:tree > maven.tree
- git config --global --add safe.directory /opt/atlassian/pipelines/agent/build
- timeout 10m sigridci.py --customer $SIGRID_CI_ACCOUNT --system $(echo $BITBUCKET_REPO_FULL_NAME | cut -d'/' -f 2 | cut -c 1-45| sed -e "s/\./-/g") --source . --publishonly --include-history
- step: &sigridCI
image: softwareimprovementgroup/sigridci
name: Sigrid CI
script:
- timeout 10m sigridci.py --customer $SIGRID_CI_ACCOUNT --system "Solid" --subsystem $(echo "magdamock.service"| sed -e "s/\./-/g") --source .
- git config --global --add safe.directory /opt/atlassian/pipelines/agent/build
- timeout 10m sigridci.py --customer $SIGRID_CI_ACCOUNT --system $(echo $BITBUCKET_REPO_FULL_NAME | cut -d'/' -f 2 | cut -c 1-45| sed -e "s/\./-/g") --source .
- step: &githubMirror
name: Sync to Github
clone:
Expand Down Expand Up @@ -110,8 +106,6 @@ pipelines:
- mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout > target/pom_version
artifacts:
- target/pom_version
- step:
<<: *dependencyTree
- step:
<<: *sigridPublish
- step:
Expand Down Expand Up @@ -150,8 +144,6 @@ pipelines:
artifacts:
- "**/*.jar"
- target/pom_version
- step:
<<: *dependencyTree
- step:
<<: *sigridPublish
- step:
Expand Down Expand Up @@ -205,8 +197,6 @@ pipelines:
- mvn -B -U clean verify sonar:sonar -s .m2/settings.xml -Dbuild=bitbucket -Dsonar.host.url=${SONAR_HOST} -Dsonar.projectKey=${SONAR_PROJECT} -Dsonar.login=${SONAR_USERNAME} -Dsonar.password=${SONAR_PASSWORD} -Dsonar.branch.name="$BITBUCKET_BRANCH"
artifacts:
- "**/*.jar"
- step:
<<: *dependencyTree
- step:
<<: *sigridCI
custom:
Expand Down Expand Up @@ -307,7 +297,7 @@ pipelines:
- maven
script:
- export MAVEN_OPTS="-Xmx1024m"
- mvn -B org.owasp:dependency-check-maven:7.4.4:aggregate -DskipSystemScope=true "-DsuppressionFile=.owasp/owasp-suppression.xml" "-DhintsFile=.owasp/owasp-hints.xml" -DfailBuildOnCVSS=7 -s .m2/settings.xml
- mvn -B org.owasp:dependency-check-maven:7.4.4:aggregate -DskipSystemScope=true "-DsuppressionFile=.owasp/owasp-suppression.xml" "-DhintsFile=.owasp/owasp-hints.xml" -DfailBuildOnCVSS=7 -DnvdApiKey=$NVD_API_KEY -s .m2/settings.xml
artifacts:
- target/dependency-check-report.html
after-script:
Expand Down
2 changes: 1 addition & 1 deletion common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>magda</artifactId>
<groupId>be.vlaanderen.vip.mock</groupId>
<version>2.52.0</version>
<version>2.53.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
4 changes: 1 addition & 3 deletions create-hotfix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@ else
echo "Using master branch for hotfix"
fi

mvn -B com.amashchenko.maven.plugin:gitflow-maven-plugin:1.17.0:hotfix-start \
mvn -B com.amashchenko.maven.plugin:gitflow-maven-plugin:1.19.0:hotfix-start \
-Dverbose="true" \
-DuseSnapshotInHotfix="true" \
-DpreHotfixGoals="clean deploy -Pcucumber-tests -Pdocker" \
-DpostHotfixGoals="deploy -Pcucumber-tests -Pdocker-release" \
-DpushRemote="true" \
-DversionsForceUpdate="true" \
-DargLine="-B -s .m2/settings.xml" \
Expand Down
2 changes: 1 addition & 1 deletion create-support.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ else
exit 1;
fi

mvn -B com.amashchenko.maven.plugin:gitflow-maven-plugin:1.14.0:support-start \
mvn -B com.amashchenko.maven.plugin:gitflow-maven-plugin:1.19.0:support-start \
-Dverbose="true" \
-DuseSnapshotInSupport="true" \
-DpushRemote="true" \
Expand Down
1 change: 1 addition & 0 deletions deploy-with-argocd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down
4 changes: 2 additions & 2 deletions finish-hotfix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ shopt -s nocasematch

# no merge if skipMergeDev is true
if [ "$skipMergeDev" == "true" ]; then
mvn -B com.amashchenko.maven.plugin:gitflow-maven-plugin:1.17.0:hotfix-finish \
mvn -B com.amashchenko.maven.plugin:gitflow-maven-plugin:1.19.0:hotfix-finish \
-Dverbose="true" \
-DuseSnapshotInHotfix="true" \
-DpreHotfixGoals="" \
Expand All @@ -33,7 +33,7 @@ if [ "$skipMergeDev" == "true" ]; then
-DargLine="-B -s .m2/settings.xml"
else
# finish gitflow hotfix with merge to develop
mvn -B com.amashchenko.maven.plugin:gitflow-maven-plugin:1.17.0:hotfix-finish \
mvn -B com.amashchenko.maven.plugin:gitflow-maven-plugin:1.19.0:hotfix-finish \
-Dverbose="true" \
-DuseSnapshotInHotfix="true" \
-DpreHotfixGoals="" \
Expand Down
2 changes: 1 addition & 1 deletion interfaces/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>magda</artifactId>
<groupId>be.vlaanderen.vip.mock</groupId>
<version>2.52.0</version>
<version>2.53.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
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());
}
}
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();
}
}
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;
}
}
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;
}
Loading

0 comments on commit d7aeb5c

Please sign in to comment.