Skip to content

Commit

Permalink
Merged develop into fix/increase-log-level
Browse files Browse the repository at this point in the history
  • Loading branch information
laurensdeb committed Mar 28, 2024
2 parents 5f0a352 + 08b4aaa commit f47859c
Show file tree
Hide file tree
Showing 67 changed files with 4,273 additions and 50 deletions.
17 changes: 13 additions & 4 deletions bitbucket-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
image:
name: vlaamseoverheid-magda-docker-public.jfrog.io/magda/magda-base-pipeline:jdk20-latest
name: vlaamseoverheid-magda-docker-public.jfrog.io/magda/magda-base-pipeline:jdk21-latest
username: $ARTIFACTORY_USER
password: $ARTIFACTORY_PASSWORD

Expand Down Expand Up @@ -72,6 +72,12 @@ definitions:
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
- step: &sigridCI
image: softwareimprovementgroup/sigridci
name: Sigrid CI
Expand All @@ -89,9 +95,6 @@ clone:
depth: full

pipelines:
default:
- step:
<<: *build
branches:
master:
- parallel:
Expand All @@ -107,6 +110,8 @@ 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 @@ -145,6 +150,8 @@ pipelines:
artifacts:
- "**/*.jar"
- target/pom_version
- step:
<<: *dependencyTree
- step:
<<: *sigridPublish
- step:
Expand Down Expand Up @@ -198,6 +205,8 @@ 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
4 changes: 2 additions & 2 deletions 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.11.0-SNAPSHOT</version>
<version>2.16.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -35,7 +35,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.12.1</version>
<version>3.13.0</version>
<configuration>
<encoding>${project.build.sourceEncoding}</encoding>
<forceJavacCompilerUse>true</forceJavacCompilerUse>
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.11.0-SNAPSHOT</version>
<version>2.16.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import lombok.AccessLevel;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;

/**
* A request that pertains to a company, identified by KBO number.
Expand All @@ -15,6 +16,7 @@
* </ul>
*/
@Getter
@ToString
@EqualsAndHashCode(callSuper = true)
public abstract class CompanyMagdaRequest extends MagdaRequest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Null;
import lombok.AccessLevel;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;

Expand All @@ -31,6 +32,7 @@
*/
@Getter
@ToString
@EqualsAndHashCode(callSuper = true)
public class GeefBetalingenHandicapRequest extends PersonMagdaRequest {

public static class Builder extends PersonMagdaRequest.Builder<Builder> {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
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.INSZNumber;
import be.vlaanderen.vip.magda.client.domeinservice.MagdaRegistrationInfo;
import jakarta.annotation.Nullable;
import jakarta.validation.constraints.NotNull;
import lombok.AccessLevel;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.Arrays;
import java.util.Set;

/**
* A request to a "GeefDossierHandicap" MAGDA service, which provides information regarding disability for an INSZ.
* Adds the following fields to the {@link PersonMagdaRequest}:
* <ul>
* <li>referenceDate: the reference date</li>
* <li>sources: include the sources to consult</li>
* <li>parts: include file parts</li>
* </ul>
*
* @see <a href="file:resources/templates/GeefDossierHandicap/03.00.0000/template.xml">XML template for this request type</a>
* @see <a href="https://vlaamseoverheid.atlassian.net/wiki/spaces/MG/pages/1624016756/SocZek.GeefDossierHandicap-03.00">More information on this request type</a>
*/
@Getter
@ToString
@EqualsAndHashCode(callSuper = true)
public class GeefDossierHandicapByDateRequest extends PersonMagdaRequest {

public static class Builder extends PersonMagdaRequest.Builder<Builder> {

@Getter(AccessLevel.PROTECTED)
private LocalDate referenceDate;
@Getter(AccessLevel.PROTECTED)
private Set<HandicapAuthenticSourceType> sources;
@Getter(AccessLevel.PROTECTED)
private Set<HandicapFilePartType> parts;


public Builder referenceDate(LocalDate date) {
this.referenceDate = date;
return this;
}

public Builder sources(Set<HandicapAuthenticSourceType> sources) {
this.sources = sources;
return this;
}

public Builder parts(Set<HandicapFilePartType> parts) {
this.parts = parts;
return this;
}

public GeefDossierHandicapByDateRequest build() {
if(getInsz() == null) { throw new IllegalStateException("INSZ number must be given"); }
if(getReferenceDate() == null) { throw new IllegalStateException("Reference date must be given"); }

return new GeefDossierHandicapByDateRequest(
getInsz(),
getRegistration(),
getReferenceDate(),
getSources(),
getParts()
);
}
}

public static Builder builder() {
return new Builder();
}

@NotNull
private final LocalDate referenceDate;
@Nullable
private final Set<HandicapAuthenticSourceType> sources;
@Nullable
private final Set<HandicapFilePartType> parts;

public GeefDossierHandicapByDateRequest(
@NotNull INSZNumber insz,
@NotNull String registration,
@NotNull LocalDate referenceDate,
@Nullable Set<HandicapAuthenticSourceType> sources,
@Nullable Set<HandicapFilePartType> parts) {
super(insz, registration);
this.referenceDate = referenceDate;
this.sources = sources;
this.parts = parts;
}

@Override
public MagdaServiceIdentification magdaServiceIdentification() {
return new MagdaServiceIdentification("GeefDossierHandicap", "03.00.0000");
}

@Override
protected void fillIn(MagdaDocument request, MagdaRegistrationInfo magdaRegistrationInfo) {
fillInCommonFields(request, magdaRegistrationInfo);

var dateFormatter = DateTimeFormatter.ISO_LOCAL_DATE;
request.setValue("//ConsultFilesByDateCriteria/ssin", getInsz().getValue());
request.setValue("//ConsultFilesByDateCriteria/referenceDate", getReferenceDate().format(dateFormatter));
Arrays.stream(HandicapAuthenticSourceType.values()).forEach(x -> {
request.createTextNode("//ConsultFilesByDateCriteria/handicapAuthenticSources", x.getTypeString(), getSources() != null && getSources().contains(x) ? "true" : "false");
});
Arrays.stream(HandicapFilePartType.values()).forEach(x -> {
request.createTextNode("//ConsultFilesByDateCriteria/parts", x.getTypeString(), getParts() != null && getParts().contains(x) ? "true" : "false");
});

request.removeNode("//ConsultFilesByPeriodCriteria");
}

public enum HandicapAuthenticSourceType {
DGPH("DGPH"),
VSB("VSB"),
IRISCARE("IrisCare"),
NICCIN("NicCin"),
AVIQ("AVIQ"),
DSL("DSL");

private final String typeString;

HandicapAuthenticSourceType(String typeString) {
this.typeString = typeString;
}

public String getTypeString() {
return typeString;
}
}

public enum HandicapFilePartType {
EVOLUTION_OF_REQUEST("evolutionOfRequest"),
HANDICAP_RECOGNITIONS("handicapRecognitions"),
RIGHTS("rights"),
SOCIAL_CARDS("socialCards");

private final String typeString;

HandicapFilePartType(String typeString) {
this.typeString = typeString;
}

public String getTypeString() {
return typeString;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import jakarta.annotation.Nullable;
import jakarta.validation.constraints.NotNull;
import lombok.AccessLevel;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;

Expand All @@ -28,6 +29,7 @@
*/
@Getter
@ToString
@EqualsAndHashCode(callSuper = true)
public class GeefFunctiesByPersonRequest extends PersonMagdaRequest{

public static class Builder extends PersonMagdaRequest.Builder<Builder> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import jakarta.annotation.Nullable;
import jakarta.validation.constraints.NotNull;
import lombok.AccessLevel;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;

Expand All @@ -27,6 +28,7 @@
*/
@Getter
@ToString
@EqualsAndHashCode(callSuper = true)
public class GeefHistoriekGezinssamenstellingRequest extends PersonMagdaRequest {

public static class Builder extends PersonMagdaRequest.Builder<Builder> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import jakarta.annotation.Nullable;
import jakarta.validation.constraints.NotNull;
import lombok.AccessLevel;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;

Expand All @@ -26,6 +27,7 @@
*/
@Getter
@ToString
@EqualsAndHashCode(callSuper = true)
public class GeefLeefLoonBedragenRequest extends PersonMagdaRequest {

public static class Builder extends PersonMagdaRequest.Builder<Builder> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import jakarta.annotation.Nullable;
import jakarta.validation.constraints.NotNull;
import lombok.AccessLevel;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import java.time.LocalDate;
Expand All @@ -23,6 +24,7 @@
*/
@Getter
@ToString
@EqualsAndHashCode(callSuper = true)
public class GeefLoopbaanARZARequest extends PersonMagdaRequest {

public static class Builder extends PersonMagdaRequest.Builder<Builder> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import jakarta.validation.constraints.NotNull;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;

import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;
Expand All @@ -25,6 +26,7 @@
* @see <a href="https://vlaamseoverheid.atlassian.net/wiki/spaces/MG/pages/1243022119/SocZek.GeefSociaalStatuut-03.00">More information on this request type</a>
*/
@Getter
@ToString
@EqualsAndHashCode(callSuper = true)
public class GeefSociaalStatuutRequest extends PersonMagdaRequest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Null;
import lombok.AccessLevel;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;

Expand All @@ -31,6 +32,7 @@
*/
@Getter
@ToString
@EqualsAndHashCode(callSuper = true)
public class GeefWerkrelatiesRequest extends PersonMagdaRequest{

public static class Builder extends PersonMagdaRequest.Builder<Builder> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import lombok.AccessLevel;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;

/**
* A request that pertains to a person, identified by INSZ number.
Expand All @@ -15,6 +16,7 @@
* </ul>
*/
@Getter
@ToString
@EqualsAndHashCode(callSuper = true)
public abstract class PersonMagdaRequest extends MagdaRequest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ public class NoResponseException extends ServerException {
private final UUID transactionID;
private final UUID localTransactionID;
private final String serviceName;
private final int statusCode;

public NoResponseException(String bericht, Throwable oorzaak, MagdaRequest magdaRequest) {
public NoResponseException(String bericht, Throwable oorzaak, MagdaRequest magdaRequest, int statusCode) {
super(bericht, oorzaak);
this.transactionID = magdaRequest.getCorrelationId();
this.localTransactionID = magdaRequest.getRequestId();
this.serviceName = magdaRequest.magdaServiceIdentification().getName();
this.statusCode = statusCode;
}
}
Loading

0 comments on commit f47859c

Please sign in to comment.