diff --git a/.github/workflows/ci-rc.yml b/.github/workflows/ci-rc.yml
index f383a84c..2c58569e 100644
--- a/.github/workflows/ci-rc.yml
+++ b/.github/workflows/ci-rc.yml
@@ -9,14 +9,14 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Set up JDK 21
- uses: actions/setup-java@v3
+ uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- name: Build with Maven
- run: mvn -B clean package
+ run: mvn -B clean package --no-transfer-progress
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@0.20.0
with:
@@ -26,10 +26,10 @@ jobs:
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'
- name: Upload jar
- uses: actions/upload-artifact@v3
+ uses: actions/upload-artifact@v4
with:
- name: jar
- path: target/*.jar
+ name: app-jar
+ path: platine-management-api/target/*.jar
get_version:
needs: build
@@ -40,7 +40,7 @@ jobs:
version: ${{steps.version.outputs.version}}
steps:
- name: Checkout current branch
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Get current version
@@ -53,7 +53,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout current branch
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- uses: softprops/action-gh-release@v1
@@ -72,15 +72,15 @@ jobs:
needs: get_version
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Download jar
id: download
- uses: actions/download-artifact@v3
+ uses: actions/download-artifact@v4
with:
- name: jar
- path: target
+ name: app-jar
+ path: platine-management-api/target
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index b1045841..31fb884e 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -9,19 +9,19 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Set up JDK 21
- uses: actions/setup-java@v3
+ uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- name: Build with Maven
- run: mvn -B clean package
+ run: mvn -B clean package --no-transfer-progress
- name: Upload jar
- uses: actions/upload-artifact@v3
+ uses: actions/upload-artifact@v4
with:
- name: jar
- path: target/*.jar
+ name: app-jar
+ path: platine-management-api/target/*.jar
get_version:
needs: build
@@ -32,7 +32,7 @@ jobs:
version: ${{steps.version.outputs.version}}
steps:
- name: Checkout current branch
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Get current version
@@ -45,7 +45,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout current branch
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- uses: softprops/action-gh-release@v1
@@ -62,15 +62,15 @@ jobs:
needs: get_version
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Download jar
id: download
- uses: actions/download-artifact@v3
+ uses: actions/download-artifact@v4
with:
- name: jar
- path: target
+ name: app-jar
+ path: platine-management-api/target
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml
index 96fafd5a..dfe63560 100644
--- a/.github/workflows/sonar.yml
+++ b/.github/workflows/sonar.yml
@@ -12,11 +12,11 @@ jobs:
name: Build and analyze
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 21
- uses: actions/setup-java@v3
+ uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
diff --git a/.github/workflows/trivy.yml b/.github/workflows/trivy.yml
index 92f121b9..2d54e590 100644
--- a/.github/workflows/trivy.yml
+++ b/.github/workflows/trivy.yml
@@ -12,11 +12,11 @@ jobs:
name: Build and analyze
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 21
- uses: actions/setup-java@v3
+ uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
diff --git a/.gitignore b/.gitignore
index 2045b9ff..61318ab0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -33,4 +33,9 @@ build/
### VS Code ###
.vscode/
-src/main/resources/application-*.properties
+
+logs
+**/.flattened-pom.xml
+**/src/main/resources/application-*.yaml
+**/src/main/resources/application-*.yml
+**/src/main/resources/application-*.properties
diff --git a/Dockerfile b/Dockerfile
deleted file mode 100644
index 1e044d0a..00000000
--- a/Dockerfile
+++ /dev/null
@@ -1,14 +0,0 @@
-FROM eclipse-temurin:21.0.2_13-jre-alpine
-
-WORKDIR /opt/app/
-COPY ./target/*.jar /opt/app/app.jar
-
-# Setup a non-root user context (security)
-RUN addgroup -g 1000 tomcatgroup
-RUN adduser -D -s / -u 1000 tomcatuser -G tomcatgroup
-RUN mkdir /opt/app/temp-files
-RUN chown -R 1000:1000 /opt/app
-
-USER 1000
-
-ENTRYPOINT ["java", "-jar", "/opt/app/app.jar"]
diff --git a/platine-management-api/Dockerfile b/platine-management-api/Dockerfile
new file mode 100644
index 00000000..14bf3335
--- /dev/null
+++ b/platine-management-api/Dockerfile
@@ -0,0 +1,20 @@
+FROM eclipse-temurin:21.0.4_7-jre-alpine
+
+ENV PATH_TO_JAR=/opt/app/app.jar
+WORKDIR /opt/app/
+COPY ./target/*.jar $PATH_TO_JAR
+
+ENV JAVA_TOOL_OPTIONS_DEFAULT \
+ -XX:MaxRAMPercentage=75
+
+# Setup a non-root user context (security)
+RUN addgroup -g 1000 tomcatgroup
+RUN adduser -D -s / -u 1000 tomcatuser -G tomcatgroup
+RUN mkdir /opt/app/temp-files
+RUN chown -R 1000:1000 /opt/app
+
+USER 1000
+
+ENTRYPOINT [ "/bin/sh", "-c", \
+ "export JAVA_TOOL_OPTIONS=\"$JAVA_TOOL_OPTIONS_DEFAULT $JAVA_TOOL_OPTIONS\"; \
+ exec java -jar $PATH_TO_JAR" ]
\ No newline at end of file
diff --git a/platine-management-api/pom.xml b/platine-management-api/pom.xml
new file mode 100644
index 00000000..0d628332
--- /dev/null
+++ b/platine-management-api/pom.xml
@@ -0,0 +1,193 @@
+
+
+ 4.0.0
+
+ fr.insee.survey
+ platine-management
+ ${revision}${changelist}
+
+
+ platine-management-api
+
+
+ 2.6.0
+ 3.1.0
+ 7.18.0
+
+
+
+
+ fr.insee.survey
+ platine-management-shared
+ ${project.version}
+
+
+
+ fr.insee.survey
+ platine-management-service
+ ${project.version}
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+ org.springframework.boot
+ spring-boot-starter-tomcat
+
+
+ org.springframework.boot
+ spring-boot-devtools
+ runtime
+ true
+
+
+ org.springframework.boot
+ spring-boot-starter-mail
+
+
+ org.springdoc
+ springdoc-openapi-starter-webmvc-ui
+ ${springdoc-version}
+
+
+
+ jakarta.ws.rs
+ jakarta.ws.rs-api
+ ${jakarta-version}
+
+
+
+ com.fasterxml.jackson.dataformat
+ jackson-dataformat-xml
+
+
+ jakarta.xml.bind
+ jakarta.xml.bind-api
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-oauth2-resource-server
+
+
+ org.springframework.boot
+ spring-boot-starter-security
+
+
+ org.springframework.security
+ spring-security-oauth2-client
+
+
+
+
+ org.junit.platform
+ junit-platform-suite
+ test
+
+
+ io.cucumber
+ cucumber-java
+ ${cucumber.version}
+ test
+
+
+ io.cucumber
+ cucumber-spring
+ ${cucumber.version}
+
+
+ io.cucumber
+ cucumber-junit-platform-engine
+ ${cucumber.version}
+
+
+
+
+ org.springframework.security
+ spring-security-test
+ test
+
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-actuator
+
+
+
+
+ io.micrometer
+ micrometer-registry-prometheus
+
+
+
+ com.h2database
+ h2
+ test
+
+
+
+
+
+
+ coverage
+
+
+
+ org.jacoco
+ jacoco-maven-plugin
+ 0.8.12
+
+
+ report-aggregate
+
+ report-aggregate
+
+
+ true
+
+ verify
+
+
+
+
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+ build-info
+
+ build-info
+
+
+
+
+
+
+ org.projectlombok
+ lombok
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/DatacollectionManagementApplication.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/DatacollectionManagementApplication.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/DatacollectionManagementApplication.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/DatacollectionManagementApplication.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/config/ApplicationConfig.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/ApplicationConfig.java
similarity index 95%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/config/ApplicationConfig.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/ApplicationConfig.java
index bbbac362..63080579 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/config/ApplicationConfig.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/ApplicationConfig.java
@@ -1,4 +1,4 @@
-package fr.insee.survey.datacollectionmanagement.config;
+package fr.insee.survey.datacollectionmanagement.configuration;
import lombok.Getter;
import lombok.Setter;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/config/CorsGlobalConfig.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/CorsGlobalConfig.java
similarity index 94%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/config/CorsGlobalConfig.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/CorsGlobalConfig.java
index 0c1cf9d2..775efed6 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/config/CorsGlobalConfig.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/CorsGlobalConfig.java
@@ -1,4 +1,4 @@
-package fr.insee.survey.datacollectionmanagement.config;
+package fr.insee.survey.datacollectionmanagement.configuration;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Bean;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/config/ForwardedHeaderFilterBean.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/ForwardedHeaderFilterBean.java
similarity index 84%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/config/ForwardedHeaderFilterBean.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/ForwardedHeaderFilterBean.java
index 7f928509..1df5b579 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/config/ForwardedHeaderFilterBean.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/ForwardedHeaderFilterBean.java
@@ -1,4 +1,4 @@
-package fr.insee.survey.datacollectionmanagement.config;
+package fr.insee.survey.datacollectionmanagement.configuration;
import org.springframework.context.annotation.Bean;
import org.springframework.web.filter.ForwardedHeaderFilter;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/config/LogInterceptor.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/LogInterceptor.java
similarity index 91%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/config/LogInterceptor.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/LogInterceptor.java
index 53415cc2..17dbcc64 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/config/LogInterceptor.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/LogInterceptor.java
@@ -1,6 +1,6 @@
-package fr.insee.survey.datacollectionmanagement.config;
+package fr.insee.survey.datacollectionmanagement.configuration;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthenticationUserHelper;
+import fr.insee.survey.datacollectionmanagement.configuration.auth.user.AuthenticationUserHelper;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/config/MapperConfiguration.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/MapperConfiguration.java
similarity index 82%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/config/MapperConfiguration.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/MapperConfiguration.java
index 13038818..c9bbbfb0 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/config/MapperConfiguration.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/MapperConfiguration.java
@@ -1,4 +1,4 @@
-package fr.insee.survey.datacollectionmanagement.config;
+package fr.insee.survey.datacollectionmanagement.configuration;
import org.modelmapper.ModelMapper;
import org.springframework.context.annotation.Bean;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/config/OpenAPIConfiguration.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/OpenAPIConfiguration.java
similarity index 97%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/config/OpenAPIConfiguration.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/OpenAPIConfiguration.java
index 8f907222..2ad16862 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/config/OpenAPIConfiguration.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/OpenAPIConfiguration.java
@@ -1,4 +1,4 @@
-package fr.insee.survey.datacollectionmanagement.config;
+package fr.insee.survey.datacollectionmanagement.configuration;
import fr.insee.survey.datacollectionmanagement.constants.AuthConstants;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/config/PropertyLogger.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/PropertyLogger.java
similarity index 96%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/config/PropertyLogger.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/PropertyLogger.java
index e7e44c8d..2746a48d 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/config/PropertyLogger.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/PropertyLogger.java
@@ -1,4 +1,4 @@
-package fr.insee.survey.datacollectionmanagement.config;
+package fr.insee.survey.datacollectionmanagement.configuration;
import lombok.extern.slf4j.Slf4j;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/config/WebConfig.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/WebConfig.java
similarity index 69%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/config/WebConfig.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/WebConfig.java
index 5a168a94..4b862d8f 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/config/WebConfig.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/WebConfig.java
@@ -1,6 +1,6 @@
-package fr.insee.survey.datacollectionmanagement.config;
+package fr.insee.survey.datacollectionmanagement.configuration;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthenticationUserHelper;
+import fr.insee.survey.datacollectionmanagement.configuration.auth.user.AuthenticationUserHelper;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -13,6 +13,8 @@ public class WebConfig implements WebMvcConfigurer {
private final AuthenticationUserHelper authenticationUserHelper;
+ private final ApplicationConfig applicationConfig;
+
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(this.myLogInterceptor());
@@ -23,4 +25,8 @@ public LogInterceptor myLogInterceptor() {
return new LogInterceptor(authenticationUserHelper);
}
+ @Bean
+ public String questioningUrl() {
+ return applicationConfig.getQuestioningUrl();
+ }
}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/config/auth/security/DefaultSecurityContext.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/auth/security/DefaultSecurityContext.java
similarity index 94%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/config/auth/security/DefaultSecurityContext.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/auth/security/DefaultSecurityContext.java
index 4a1bfbb7..cdd5cddf 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/config/auth/security/DefaultSecurityContext.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/auth/security/DefaultSecurityContext.java
@@ -1,6 +1,6 @@
-package fr.insee.survey.datacollectionmanagement.config.auth.security;
+package fr.insee.survey.datacollectionmanagement.configuration.auth.security;
-import fr.insee.survey.datacollectionmanagement.config.ApplicationConfig;
+import fr.insee.survey.datacollectionmanagement.configuration.ApplicationConfig;
import lombok.AllArgsConstructor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/config/auth/security/GrantedAuthorityConverter.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/auth/security/GrantedAuthorityConverter.java
similarity index 89%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/config/auth/security/GrantedAuthorityConverter.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/auth/security/GrantedAuthorityConverter.java
index 4f3b4fdb..66b6fb37 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/config/auth/security/GrantedAuthorityConverter.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/auth/security/GrantedAuthorityConverter.java
@@ -1,7 +1,7 @@
-package fr.insee.survey.datacollectionmanagement.config.auth.security;
+package fr.insee.survey.datacollectionmanagement.configuration.auth.security;
-import fr.insee.survey.datacollectionmanagement.config.ApplicationConfig;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityRoleEnum;
+import fr.insee.survey.datacollectionmanagement.configuration.ApplicationConfig;
+import fr.insee.survey.datacollectionmanagement.constants.AuthorityRoleEnum;
import lombok.AllArgsConstructor;
import lombok.NonNull;
import org.springframework.core.convert.converter.Converter;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/config/auth/security/OpenIDConnectSecurityContext.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/auth/security/OpenIDConnectSecurityContext.java
similarity index 96%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/config/auth/security/OpenIDConnectSecurityContext.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/auth/security/OpenIDConnectSecurityContext.java
index 78c89251..40139cf9 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/config/auth/security/OpenIDConnectSecurityContext.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/auth/security/OpenIDConnectSecurityContext.java
@@ -1,6 +1,6 @@
-package fr.insee.survey.datacollectionmanagement.config.auth.security;
+package fr.insee.survey.datacollectionmanagement.configuration.auth.security;
-import fr.insee.survey.datacollectionmanagement.config.ApplicationConfig;
+import fr.insee.survey.datacollectionmanagement.configuration.ApplicationConfig;
import fr.insee.survey.datacollectionmanagement.constants.AuthConstants;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import lombok.RequiredArgsConstructor;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/config/auth/security/PublicSecurityFilterChain.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/auth/security/PublicSecurityFilterChain.java
similarity index 96%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/config/auth/security/PublicSecurityFilterChain.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/auth/security/PublicSecurityFilterChain.java
index 048a7e54..9ef60f25 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/config/auth/security/PublicSecurityFilterChain.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/auth/security/PublicSecurityFilterChain.java
@@ -1,4 +1,4 @@
-package fr.insee.survey.datacollectionmanagement.config.auth.security;
+package fr.insee.survey.datacollectionmanagement.configuration.auth.security;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/config/auth/user/AuthenticationUserHelper.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/auth/user/AuthenticationUserHelper.java
similarity index 82%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/config/auth/user/AuthenticationUserHelper.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/auth/user/AuthenticationUserHelper.java
index 710a6f22..08819bfb 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/config/auth/user/AuthenticationUserHelper.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/auth/user/AuthenticationUserHelper.java
@@ -1,4 +1,4 @@
-package fr.insee.survey.datacollectionmanagement.config.auth.user;
+package fr.insee.survey.datacollectionmanagement.configuration.auth.user;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/config/auth/user/AuthorityPrivileges.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/auth/user/AuthorityPrivileges.java
similarity index 90%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/config/auth/user/AuthorityPrivileges.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/auth/user/AuthorityPrivileges.java
index 148227a3..cd375b75 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/config/auth/user/AuthorityPrivileges.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/configuration/auth/user/AuthorityPrivileges.java
@@ -1,4 +1,4 @@
-package fr.insee.survey.datacollectionmanagement.config.auth.user;
+package fr.insee.survey.datacollectionmanagement.configuration.auth.user;
public class AuthorityPrivileges {
private AuthorityPrivileges() {
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/constants/Constants.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/constants/Constants.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/constants/Constants.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/constants/Constants.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/controller/AddressController.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/contact/controller/AddressController.java
similarity index 93%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/contact/controller/AddressController.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/contact/controller/AddressController.java
index 2da362aa..381e51cd 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/controller/AddressController.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/contact/controller/AddressController.java
@@ -1,105 +1,105 @@
-package fr.insee.survey.datacollectionmanagement.contact.controller;
-
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityPrivileges;
-import fr.insee.survey.datacollectionmanagement.constants.Constants;
-import fr.insee.survey.datacollectionmanagement.contact.domain.Address;
-import fr.insee.survey.datacollectionmanagement.contact.domain.Contact;
-import fr.insee.survey.datacollectionmanagement.contact.domain.ContactEvent;
-import fr.insee.survey.datacollectionmanagement.contact.domain.ContactEvent.ContactEventType;
-import fr.insee.survey.datacollectionmanagement.contact.dto.AddressDto;
-import fr.insee.survey.datacollectionmanagement.contact.service.AddressService;
-import fr.insee.survey.datacollectionmanagement.contact.service.ContactEventService;
-import fr.insee.survey.datacollectionmanagement.contact.service.ContactService;
-import fr.insee.survey.datacollectionmanagement.contact.util.PayloadUtil;
-import fr.insee.survey.datacollectionmanagement.exception.NotFoundException;
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.data.domain.PageImpl;
-import org.springframework.data.domain.Pageable;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.security.core.Authentication;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
-
-import java.util.List;
-
-@RestController
-@PreAuthorize(AuthorityPrivileges.HAS_MANAGEMENT_PRIVILEGES)
-@Tag(name = "1 - Contacts", description = "Enpoints to create, update, delete and find contacts")
-@Slf4j
-@RequiredArgsConstructor
-public class AddressController {
-
- private final AddressService addressService;
-
- private final ContactService contactService;
-
- private final ContactEventService contactEventService;
-
- /**
- * @deprecated
- */
- @Operation(summary = "Search for a contact address by the contact id")
- @GetMapping(value = Constants.API_CONTACTS_ID_ADDRESS, produces = "application/json")
- @PreAuthorize(AuthorityPrivileges.HAS_MANAGEMENT_PRIVILEGES + " || " + AuthorityPrivileges.HAS_REPONDENT_LIMITATED_PRIVILEGES)
- @Deprecated(since="2.6.0", forRemoval=true)
- public ResponseEntity getContactAddress(@PathVariable("id") String id) {
- Contact contact = contactService.findByIdentifier(id);
- if (contact.getAddress() != null)
- return ResponseEntity.status(HttpStatus.OK)
- .body(addressService.convertToDto(contact.getAddress()));
- else throw new NotFoundException(String.format("No address found for contact %s", id));
-
-
- }
-
- @Operation(summary = "Update or create an address by the contact id")
- @PutMapping(value = Constants.API_CONTACTS_ID_ADDRESS, produces = "application/json", consumes = "application/json")
- @PreAuthorize(AuthorityPrivileges.HAS_MANAGEMENT_PRIVILEGES + " || " + AuthorityPrivileges.HAS_REPONDENT_LIMITATED_PRIVILEGES)
- public ResponseEntity putAddress(@PathVariable("id") String id,
- @RequestBody AddressDto addressDto,
- Authentication auth) {
- Contact contact = contactService.findByIdentifier(id);
- HttpStatus httpStatus;
- Address addressUpdate;
- Address address = addressService.convertToEntity(addressDto);
- HttpHeaders responseHeaders = new HttpHeaders();
- responseHeaders.set(HttpHeaders.LOCATION, ServletUriComponentsBuilder.fromCurrentRequest().toUriString());
-
- if (contact.getAddress() != null) {
- log.info("Update address for the contact {} ", id);
- address.setId(contact.getAddress().getId());
- addressUpdate = addressService.saveAddress(address);
- httpStatus = HttpStatus.OK;
- } else {
- log.info("Create address for the contact {} ", id);
- addressUpdate = addressService.saveAddress(address);
- contact.setAddress(addressUpdate);
- contactService.saveContact(contact);
- httpStatus = HttpStatus.CREATED;
- }
- PayloadUtil.getPayloadAuthor(auth.getName());
- ContactEvent contactEventUpdate = contactEventService.createContactEvent(contact, ContactEventType.update,
- null);
- contactEventService.saveContactEvent(contactEventUpdate);
- return ResponseEntity.status(httpStatus).headers(responseHeaders)
- .body(addressService.convertToDto(addressUpdate));
-
-
- }
-
- class AddressPage extends PageImpl {
-
- private static final long serialVersionUID = -5570255373624396569L;
-
- public AddressPage(List content, Pageable pageable, long total) {
- super(content, pageable, total);
- }
- }
-
-}
+package fr.insee.survey.datacollectionmanagement.contact.controller;
+
+import fr.insee.survey.datacollectionmanagement.configuration.auth.user.AuthorityPrivileges;
+import fr.insee.survey.datacollectionmanagement.constants.Constants;
+import fr.insee.survey.datacollectionmanagement.contact.domain.Address;
+import fr.insee.survey.datacollectionmanagement.contact.domain.Contact;
+import fr.insee.survey.datacollectionmanagement.contact.domain.ContactEvent;
+import fr.insee.survey.datacollectionmanagement.contact.dto.AddressDto;
+import fr.insee.survey.datacollectionmanagement.contact.enums.ContactEventTypeEnum;
+import fr.insee.survey.datacollectionmanagement.contact.service.AddressService;
+import fr.insee.survey.datacollectionmanagement.contact.service.ContactEventService;
+import fr.insee.survey.datacollectionmanagement.contact.service.ContactService;
+import fr.insee.survey.datacollectionmanagement.contact.util.PayloadUtil;
+import fr.insee.survey.datacollectionmanagement.exception.NotFoundException;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.data.domain.PageImpl;
+import org.springframework.data.domain.Pageable;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.security.core.Authentication;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
+
+import java.util.List;
+
+@RestController
+@PreAuthorize(AuthorityPrivileges.HAS_MANAGEMENT_PRIVILEGES)
+@Tag(name = "1 - Contacts", description = "Enpoints to create, update, delete and find contacts")
+@Slf4j
+@RequiredArgsConstructor
+public class AddressController {
+
+ private final AddressService addressService;
+
+ private final ContactService contactService;
+
+ private final ContactEventService contactEventService;
+
+ /**
+ * @deprecated
+ */
+ @Operation(summary = "Search for a contact address by the contact id")
+ @GetMapping(value = Constants.API_CONTACTS_ID_ADDRESS, produces = "application/json")
+ @PreAuthorize(AuthorityPrivileges.HAS_MANAGEMENT_PRIVILEGES + " || " + AuthorityPrivileges.HAS_REPONDENT_LIMITATED_PRIVILEGES)
+ @Deprecated(since="2.6.0", forRemoval=true)
+ public ResponseEntity getContactAddress(@PathVariable("id") String id) {
+ Contact contact = contactService.findByIdentifier(id);
+ if (contact.getAddress() != null)
+ return ResponseEntity.status(HttpStatus.OK)
+ .body(addressService.convertToDto(contact.getAddress()));
+ else throw new NotFoundException(String.format("No address found for contact %s", id));
+
+
+ }
+
+ @Operation(summary = "Update or create an address by the contact id")
+ @PutMapping(value = Constants.API_CONTACTS_ID_ADDRESS, produces = "application/json", consumes = "application/json")
+ @PreAuthorize(AuthorityPrivileges.HAS_MANAGEMENT_PRIVILEGES + " || " + AuthorityPrivileges.HAS_REPONDENT_LIMITATED_PRIVILEGES)
+ public ResponseEntity putAddress(@PathVariable("id") String id,
+ @RequestBody AddressDto addressDto,
+ Authentication auth) {
+ Contact contact = contactService.findByIdentifier(id);
+ HttpStatus httpStatus;
+ Address addressUpdate;
+ Address address = addressService.convertToEntity(addressDto);
+ HttpHeaders responseHeaders = new HttpHeaders();
+ responseHeaders.set(HttpHeaders.LOCATION, ServletUriComponentsBuilder.fromCurrentRequest().toUriString());
+
+ if (contact.getAddress() != null) {
+ log.info("Update address for the contact {} ", id);
+ address.setId(contact.getAddress().getId());
+ addressUpdate = addressService.saveAddress(address);
+ httpStatus = HttpStatus.OK;
+ } else {
+ log.info("Create address for the contact {} ", id);
+ addressUpdate = addressService.saveAddress(address);
+ contact.setAddress(addressUpdate);
+ contactService.saveContact(contact);
+ httpStatus = HttpStatus.CREATED;
+ }
+ PayloadUtil.getPayloadAuthor(auth.getName());
+ ContactEvent contactEventUpdate = contactEventService.createContactEvent(contact, ContactEventTypeEnum.update,
+ null);
+ contactEventService.saveContactEvent(contactEventUpdate);
+ return ResponseEntity.status(httpStatus).headers(responseHeaders)
+ .body(addressService.convertToDto(addressUpdate));
+
+
+ }
+
+ class AddressPage extends PageImpl {
+
+ private static final long serialVersionUID = -5570255373624396569L;
+
+ public AddressPage(List content, Pageable pageable, long total) {
+ super(content, pageable, total);
+ }
+ }
+
+}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/controller/ContactController.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/contact/controller/ContactController.java
similarity index 94%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/contact/controller/ContactController.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/contact/controller/ContactController.java
index 76516791..88fb971f 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/controller/ContactController.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/contact/controller/ContactController.java
@@ -1,219 +1,220 @@
-package fr.insee.survey.datacollectionmanagement.contact.controller;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.JsonNode;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityPrivileges;
-import fr.insee.survey.datacollectionmanagement.constants.Constants;
-import fr.insee.survey.datacollectionmanagement.contact.domain.Contact;
-import fr.insee.survey.datacollectionmanagement.contact.dto.ContactDetailsDto;
-import fr.insee.survey.datacollectionmanagement.contact.dto.ContactDto;
-import fr.insee.survey.datacollectionmanagement.contact.dto.SearchContactDto;
-import fr.insee.survey.datacollectionmanagement.contact.service.AddressService;
-import fr.insee.survey.datacollectionmanagement.contact.service.ContactService;
-import fr.insee.survey.datacollectionmanagement.contact.util.ContactParamEnum;
-import fr.insee.survey.datacollectionmanagement.contact.util.PayloadUtil;
-import fr.insee.survey.datacollectionmanagement.contact.validation.ValidContactParam;
-import fr.insee.survey.datacollectionmanagement.exception.ImpossibleToDeleteException;
-import fr.insee.survey.datacollectionmanagement.exception.NotFoundException;
-import fr.insee.survey.datacollectionmanagement.exception.NotMatchException;
-import fr.insee.survey.datacollectionmanagement.questioning.service.QuestioningAccreditationService;
-import fr.insee.survey.datacollectionmanagement.view.service.ViewService;
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.media.ArraySchema;
-import io.swagger.v3.oas.annotations.media.Content;
-import io.swagger.v3.oas.annotations.media.Schema;
-import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import jakarta.validation.Valid;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.StringUtils;
-import org.modelmapper.ModelMapper;
-import org.springframework.data.domain.*;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.security.core.Authentication;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
-
-import java.io.Serial;
-import java.util.Collections;
-import java.util.List;
-
-@RestController
-@PreAuthorize(AuthorityPrivileges.HAS_MANAGEMENT_PRIVILEGES)
-@Tag(name = "1 - Contacts", description = "Endpoints to create, update, delete and find contacts")
-@Slf4j
-@RequiredArgsConstructor
-@Validated
-public class ContactController {
-
- private final ContactService contactService;
-
- private final AddressService addressService;
-
- private final ViewService viewService;
-
- private final QuestioningAccreditationService questioningAccreditationService;
-
- private final ModelMapper modelMapper;
-
- /**
- * @deprecated
- */
- @Operation(summary = "Search for contacts, paginated")
- @GetMapping(value = Constants.API_CONTACTS_ALL, produces = "application/json")
- @Deprecated(since = "2.6.0", forRemoval = true)
- public ContactPage getContacts(
- @RequestParam(defaultValue = "0") Integer page,
- @RequestParam(defaultValue = "20") Integer size,
- @RequestParam(defaultValue = "identifier") String sort) {
- Pageable pageable = PageRequest.of(page, size, Sort.by(sort));
- Page pageC = contactService.findAll(pageable);
- List listC = pageC.stream().map(this::convertToDto).toList();
- return new ContactPage(listC, pageable, pageC.getTotalElements());
- }
-
- @Operation(summary = "Search for a contact by its id")
- @GetMapping(value = Constants.API_CONTACTS_ID)
- @PreAuthorize(AuthorityPrivileges.HAS_MANAGEMENT_PRIVILEGES + " || " + AuthorityPrivileges.HAS_REPONDENT_LIMITATED_PRIVILEGES)
- public ContactDetailsDto getContact(@PathVariable("id") String id) {
- String idContact = StringUtils.upperCase(id);
- Contact contact = contactService.findByIdentifier(idContact);
- List listCampaigns = viewService.findDistinctCampaignByIdentifier(idContact);
- return convertToContactDetailsDto(contact, listCampaigns);
-
-
- }
-
-
- @Operation(summary = "Update or create a contact")
- @PutMapping(value = Constants.API_CONTACTS_ID, produces = "application/json", consumes = "application/json")
- @PreAuthorize(AuthorityPrivileges.HAS_MANAGEMENT_PRIVILEGES + " || " + AuthorityPrivileges.HAS_REPONDENT_LIMITATED_PRIVILEGES)
- public ResponseEntity putContact(@PathVariable("id") String id,
- @RequestBody @Valid ContactDto contactDto,
- Authentication auth) throws JsonProcessingException {
- if (!contactDto.getIdentifier().equalsIgnoreCase(id)) {
- throw new NotMatchException("id and contact identifier don't match");
- }
- Contact contact;
- HttpHeaders responseHeaders = new HttpHeaders();
- responseHeaders.set(HttpHeaders.LOCATION, ServletUriComponentsBuilder.fromCurrentRequest()
- .buildAndExpand(contactDto.getIdentifier()).toUriString());
-
- JsonNode payload = PayloadUtil.getPayloadAuthor(auth.getName());
-
- try {
- contact = convertToEntity(contactDto);
- if (contactDto.getAddress() != null)
- contact.setAddress(addressService.convertToEntity(contactDto.getAddress()));
- Contact contactUpdate = contactService.updateContactAddressEvent(contact, payload);
- return ResponseEntity.ok().headers(responseHeaders).body(convertToDto(contactUpdate));
- } catch (NotFoundException e) {
- log.info("Creating contact with the identifier {}", contactDto.getIdentifier());
- contact = convertToEntityNewContact(contactDto);
- if (contactDto.getAddress() != null)
- contact.setAddress(addressService.convertToEntity(contactDto.getAddress()));
- Contact contactCreate = contactService.createContactAddressEvent(contact, payload);
- viewService.createView(id, null, null);
- return ResponseEntity.status(HttpStatus.CREATED).headers(responseHeaders).body(convertToDto(contactCreate));
- }
-
- }
-
-
- /**
- * @deprecated
- */
- @Operation(summary = "Delete a contact, its address, its contactEvents")
- @DeleteMapping(value = Constants.API_CONTACTS_ID)
- @ResponseStatus(HttpStatus.NO_CONTENT)
- @Deprecated(since = "2.6.0", forRemoval = true)
- public void deleteContact(@PathVariable("id") String id) {
-
- if (!questioningAccreditationService.findByContactIdentifier(id).isEmpty()) {
- throw new ImpossibleToDeleteException(
- String.format("Contact %s cannot be deleted as he/she is still entitled to answer one or more questionnaires", id));
- }
-
- log.info("Delete contact {}", id);
- Contact contact = contactService.findByIdentifier(id);
- contactService.deleteContactAddressEvent(contact);
-
- }
-
- @GetMapping(path = Constants.API_CONTACTS_SEARCH, produces = "application/json")
- @Operation(summary = "Multi-criteria search contacts")
- @ApiResponses(value = {
- @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = SearchContactDto.class)))),
- @ApiResponse(responseCode = "400", description = "Bad Request")
- })
- public Page searchContacts(
- @RequestParam(required = true) String searchParam,
- @RequestParam(required = false) @Valid @ValidContactParam String searchType,
- @RequestParam(defaultValue = "0") Integer page,
- @RequestParam(defaultValue = "10") Integer pageSize,
- @RequestParam(defaultValue = "identifier") String sort) {
-
- log.info(
- "Search contact by {} with param = {} page = {} pageSize = {}", searchType, searchParam, page, pageSize);
-
- Pageable pageable = PageRequest.of(page, pageSize, Sort.by(sort));
-
- switch (ContactParamEnum.fromValue(searchType)) {
- case ContactParamEnum.IDENTIFIER:
- return contactService.searchContactByIdentifier(searchParam, pageable);
- case ContactParamEnum.NAME:
- return contactService.searchContactByName(searchParam, pageable);
- case ContactParamEnum.EMAIL:
- return contactService.searchContactByEmail(searchParam, pageable);
- }
- return new PageImpl<>(Collections.emptyList());
-
- }
-
- private ContactDto convertToDto(Contact contact) {
- ContactDto contactDto = modelMapper.map(contact, ContactDto.class);
- contactDto.setCivility(contact.getGender().name());
- return contactDto;
- }
-
- private ContactDetailsDto convertToContactDetailsDto(Contact contact, List listCampaigns) {
- ContactDetailsDto contactDetailsDto = modelMapper.map(contact, ContactDetailsDto.class);
- contactDetailsDto.setCivility(contact.getGender());
- contactDetailsDto.setListCampaigns(listCampaigns);
- return contactDetailsDto;
- }
-
- private Contact convertToEntity(ContactDto contactDto) {
- Contact contact = modelMapper.map(contactDto, Contact.class);
- contact.setGender(Contact.Gender.valueOf(contactDto.getCivility()));
- Contact oldContact = contactService.findByIdentifier(contactDto.getIdentifier());
- contact.setComment(oldContact.getComment());
- contact.setAddress(oldContact.getAddress());
- contact.setContactEvents(oldContact.getContactEvents());
-
- return contact;
- }
-
- private Contact convertToEntityNewContact(ContactDto contactDto) {
- Contact contact = modelMapper.map(contactDto, Contact.class);
- contact.setGender(Contact.Gender.valueOf(contactDto.getCivility()));
- return contact;
- }
-
- static class ContactPage extends PageImpl {
-
- @Serial
- private static final long serialVersionUID = 656181199902518234L;
-
- public ContactPage(List content, Pageable pageable, long total) {
- super(content, pageable, total);
- }
- }
-
-}
+package fr.insee.survey.datacollectionmanagement.contact.controller;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonNode;
+import fr.insee.survey.datacollectionmanagement.configuration.auth.user.AuthorityPrivileges;
+import fr.insee.survey.datacollectionmanagement.constants.Constants;
+import fr.insee.survey.datacollectionmanagement.contact.domain.Contact;
+import fr.insee.survey.datacollectionmanagement.contact.dto.ContactDetailsDto;
+import fr.insee.survey.datacollectionmanagement.contact.dto.ContactDto;
+import fr.insee.survey.datacollectionmanagement.contact.dto.SearchContactDto;
+import fr.insee.survey.datacollectionmanagement.contact.enums.ContactParamEnum;
+import fr.insee.survey.datacollectionmanagement.contact.enums.GenderEnum;
+import fr.insee.survey.datacollectionmanagement.contact.service.AddressService;
+import fr.insee.survey.datacollectionmanagement.contact.service.ContactService;
+import fr.insee.survey.datacollectionmanagement.contact.util.PayloadUtil;
+import fr.insee.survey.datacollectionmanagement.contact.validation.ValidContactParam;
+import fr.insee.survey.datacollectionmanagement.exception.ImpossibleToDeleteException;
+import fr.insee.survey.datacollectionmanagement.exception.NotFoundException;
+import fr.insee.survey.datacollectionmanagement.exception.NotMatchException;
+import fr.insee.survey.datacollectionmanagement.questioning.service.QuestioningAccreditationService;
+import fr.insee.survey.datacollectionmanagement.view.service.ViewService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.media.ArraySchema;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
+import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.validation.Valid;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.modelmapper.ModelMapper;
+import org.springframework.data.domain.*;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.security.core.Authentication;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
+
+import java.io.Serial;
+import java.util.Collections;
+import java.util.List;
+
+@RestController
+@PreAuthorize(AuthorityPrivileges.HAS_MANAGEMENT_PRIVILEGES)
+@Tag(name = "1 - Contacts", description = "Endpoints to create, update, delete and find contacts")
+@Slf4j
+@RequiredArgsConstructor
+@Validated
+public class ContactController {
+
+ private final ContactService contactService;
+
+ private final AddressService addressService;
+
+ private final ViewService viewService;
+
+ private final QuestioningAccreditationService questioningAccreditationService;
+
+ private final ModelMapper modelMapper;
+
+ /**
+ * @deprecated
+ */
+ @Operation(summary = "Search for contacts, paginated")
+ @GetMapping(value = Constants.API_CONTACTS_ALL, produces = "application/json")
+ @Deprecated(since = "2.6.0", forRemoval = true)
+ public ContactPage getContacts(
+ @RequestParam(defaultValue = "0") Integer page,
+ @RequestParam(defaultValue = "20") Integer size,
+ @RequestParam(defaultValue = "identifier") String sort) {
+ Pageable pageable = PageRequest.of(page, size, Sort.by(sort));
+ Page pageC = contactService.findAll(pageable);
+ List listC = pageC.stream().map(this::convertToDto).toList();
+ return new ContactPage(listC, pageable, pageC.getTotalElements());
+ }
+
+ @Operation(summary = "Search for a contact by its id")
+ @GetMapping(value = Constants.API_CONTACTS_ID)
+ @PreAuthorize(AuthorityPrivileges.HAS_MANAGEMENT_PRIVILEGES + " || " + AuthorityPrivileges.HAS_REPONDENT_LIMITATED_PRIVILEGES)
+ public ContactDetailsDto getContact(@PathVariable("id") String id) {
+ String idContact = StringUtils.upperCase(id);
+ Contact contact = contactService.findByIdentifier(idContact);
+ List listCampaigns = viewService.findDistinctCampaignByIdentifier(idContact);
+ return convertToContactDetailsDto(contact, listCampaigns);
+
+
+ }
+
+
+ @Operation(summary = "Update or create a contact")
+ @PutMapping(value = Constants.API_CONTACTS_ID, produces = "application/json", consumes = "application/json")
+ @PreAuthorize(AuthorityPrivileges.HAS_MANAGEMENT_PRIVILEGES + " || " + AuthorityPrivileges.HAS_REPONDENT_LIMITATED_PRIVILEGES)
+ public ResponseEntity putContact(@PathVariable("id") String id,
+ @RequestBody @Valid ContactDto contactDto,
+ Authentication auth) throws JsonProcessingException {
+ if (!contactDto.getIdentifier().equalsIgnoreCase(id)) {
+ throw new NotMatchException("id and contact identifier don't match");
+ }
+ Contact contact;
+ HttpHeaders responseHeaders = new HttpHeaders();
+ responseHeaders.set(HttpHeaders.LOCATION, ServletUriComponentsBuilder.fromCurrentRequest()
+ .buildAndExpand(contactDto.getIdentifier()).toUriString());
+
+ JsonNode payload = PayloadUtil.getPayloadAuthor(auth.getName());
+
+ try {
+ contact = convertToEntity(contactDto);
+ if (contactDto.getAddress() != null)
+ contact.setAddress(addressService.convertToEntity(contactDto.getAddress()));
+ Contact contactUpdate = contactService.updateContactAddressEvent(contact, payload);
+ return ResponseEntity.ok().headers(responseHeaders).body(convertToDto(contactUpdate));
+ } catch (NotFoundException e) {
+ log.info("Creating contact with the identifier {}", contactDto.getIdentifier());
+ contact = convertToEntityNewContact(contactDto);
+ if (contactDto.getAddress() != null)
+ contact.setAddress(addressService.convertToEntity(contactDto.getAddress()));
+ Contact contactCreate = contactService.createContactAddressEvent(contact, payload);
+ viewService.createView(id, null, null);
+ return ResponseEntity.status(HttpStatus.CREATED).headers(responseHeaders).body(convertToDto(contactCreate));
+ }
+
+ }
+
+
+ /**
+ * @deprecated
+ */
+ @Operation(summary = "Delete a contact, its address, its contactEvents")
+ @DeleteMapping(value = Constants.API_CONTACTS_ID)
+ @ResponseStatus(HttpStatus.NO_CONTENT)
+ @Deprecated(since = "2.6.0", forRemoval = true)
+ public void deleteContact(@PathVariable("id") String id) {
+
+ if (!questioningAccreditationService.findByContactIdentifier(id).isEmpty()) {
+ throw new ImpossibleToDeleteException(
+ String.format("Contact %s cannot be deleted as he/she is still entitled to answer one or more questionnaires", id));
+ }
+
+ log.info("Delete contact {}", id);
+ Contact contact = contactService.findByIdentifier(id);
+ contactService.deleteContactAddressEvent(contact);
+
+ }
+
+ @GetMapping(path = Constants.API_CONTACTS_SEARCH, produces = "application/json")
+ @Operation(summary = "Multi-criteria search contacts")
+ @ApiResponses(value = {
+ @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = SearchContactDto.class)))),
+ @ApiResponse(responseCode = "400", description = "Bad Request")
+ })
+ public Page searchContacts(
+ @RequestParam(required = true) String searchParam,
+ @RequestParam(required = false) @Valid @ValidContactParam String searchType,
+ @RequestParam(defaultValue = "0") Integer page,
+ @RequestParam(defaultValue = "10") Integer pageSize,
+ @RequestParam(defaultValue = "identifier") String sort) {
+
+ log.info(
+ "Search contact by {} with param = {} page = {} pageSize = {}", searchType, searchParam, page, pageSize);
+
+ Pageable pageable = PageRequest.of(page, pageSize, Sort.by(sort));
+
+ switch (ContactParamEnum.fromValue(searchType)) {
+ case ContactParamEnum.IDENTIFIER:
+ return contactService.searchContactByIdentifier(searchParam, pageable);
+ case ContactParamEnum.NAME:
+ return contactService.searchContactByName(searchParam, pageable);
+ case ContactParamEnum.EMAIL:
+ return contactService.searchContactByEmail(searchParam, pageable);
+ }
+ return new PageImpl<>(Collections.emptyList());
+
+ }
+
+ private ContactDto convertToDto(Contact contact) {
+ ContactDto contactDto = modelMapper.map(contact, ContactDto.class);
+ contactDto.setCivility(contact.getGender().name());
+ return contactDto;
+ }
+
+ private ContactDetailsDto convertToContactDetailsDto(Contact contact, List listCampaigns) {
+ ContactDetailsDto contactDetailsDto = modelMapper.map(contact, ContactDetailsDto.class);
+ contactDetailsDto.setCivility(contact.getGender());
+ contactDetailsDto.setListCampaigns(listCampaigns);
+ return contactDetailsDto;
+ }
+
+ private Contact convertToEntity(ContactDto contactDto) {
+ Contact contact = modelMapper.map(contactDto, Contact.class);
+ contact.setGender(GenderEnum.valueOf(contactDto.getCivility()));
+ Contact oldContact = contactService.findByIdentifier(contactDto.getIdentifier());
+ contact.setComment(oldContact.getComment());
+ contact.setAddress(oldContact.getAddress());
+ contact.setContactEvents(oldContact.getContactEvents());
+
+ return contact;
+ }
+
+ private Contact convertToEntityNewContact(ContactDto contactDto) {
+ Contact contact = modelMapper.map(contactDto, Contact.class);
+ contact.setGender(GenderEnum.valueOf(contactDto.getCivility()));
+ return contact;
+ }
+
+ static class ContactPage extends PageImpl {
+
+ @Serial
+ private static final long serialVersionUID = 656181199902518234L;
+
+ public ContactPage(List content, Pageable pageable, long total) {
+ super(content, pageable, total);
+ }
+ }
+
+}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/controller/ContactEventController.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/contact/controller/ContactEventController.java
similarity index 96%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/contact/controller/ContactEventController.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/contact/controller/ContactEventController.java
index 87f44966..510073ac 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/controller/ContactEventController.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/contact/controller/ContactEventController.java
@@ -1,120 +1,120 @@
-package fr.insee.survey.datacollectionmanagement.contact.controller;
-
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityPrivileges;
-import fr.insee.survey.datacollectionmanagement.constants.Constants;
-import fr.insee.survey.datacollectionmanagement.contact.domain.Contact;
-import fr.insee.survey.datacollectionmanagement.contact.domain.ContactEvent;
-import fr.insee.survey.datacollectionmanagement.contact.dto.ContactEventDto;
-import fr.insee.survey.datacollectionmanagement.contact.service.ContactEventService;
-import fr.insee.survey.datacollectionmanagement.contact.service.ContactService;
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import jakarta.validation.Valid;
-import lombok.RequiredArgsConstructor;
-import org.modelmapper.ModelMapper;
-import org.springframework.data.domain.PageImpl;
-import org.springframework.data.domain.Pageable;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
-
-import java.util.List;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-@RestController(value = "contactEvents")
-@PreAuthorize(AuthorityPrivileges.HAS_USER_PRIVILEGES)
-@Tag(name = "1 - Contacts", description = "Enpoints to create, update, delete and find contacts")
-@RequiredArgsConstructor
-@Validated
-public class ContactEventController {
-
- private final ContactEventService contactEventService;
-
- private final ContactService contactService;
-
- private final ModelMapper modelMapper;
-
- /**
- * @deprecated
- */
- @Operation(summary = "Search for contactEvents by the contact id")
- @GetMapping(value = Constants.API_CONTACTS_ID_CONTACTEVENTS, produces = "application/json")
- @Deprecated(since = "2.6.0", forRemoval = true)
- public ResponseEntity> getContactContactEvents(@PathVariable("id") String identifier) {
- Contact contact = contactService.findByIdentifier(identifier);
- return ResponseEntity.status(HttpStatus.OK)
- .body(contact.getContactEvents().stream().map(this::convertToDto)
- .toList());
-
-
- }
-
-
- /**
- * @deprecated
- */
- @Operation(summary = "Create a contactEvent")
- @PostMapping(value = Constants.API_CONTACTEVENTS, produces = "application/json", consumes = "application/json")
- @Deprecated(since = "2.6.0", forRemoval = true)
- public ResponseEntity postContactEvent(@RequestBody @Valid ContactEventDto contactEventDto) {
-
- Contact contact = contactService.findByIdentifier(contactEventDto.getIdentifier());
- ContactEvent contactEvent = convertToEntity(contactEventDto);
- ContactEvent newContactEvent = contactEventService.saveContactEvent(contactEvent);
- Set setContactEvents = contact.getContactEvents();
- setContactEvents.add(newContactEvent);
- contact.setContactEvents(setContactEvents);
- contactService.saveContact(contact);
- HttpHeaders responseHeaders = new HttpHeaders();
- responseHeaders.set(HttpHeaders.LOCATION,
- ServletUriComponentsBuilder.fromCurrentRequest().toUriString());
- return ResponseEntity.status(HttpStatus.CREATED).headers(responseHeaders)
- .body(convertToDto(newContactEvent));
-
- }
-
-
-
- /**
- * @deprecated
- */
- @Operation(summary = "Delete a contact event")
- @DeleteMapping(value = Constants.API_CONTACTEVENTS_ID, produces = "application/json")
- @ResponseStatus(HttpStatus.NO_CONTENT)
- @Deprecated(since = "2.6.0", forRemoval = true)
- public void deleteContactEvent(@PathVariable("id") Long id) {
- ContactEvent contactEvent = contactEventService.findById(id);
- Contact contact = contactEvent.getContact();
- contact.setContactEvents(contact.getContactEvents().stream().filter(ce -> !ce.equals(contactEvent))
- .collect(Collectors.toSet()));
- contactService.saveContact(contact);
- contactEventService.deleteContactEvent(id);
-
- }
-
- private ContactEventDto convertToDto(ContactEvent contactEvent) {
- ContactEventDto ceDto = modelMapper.map(contactEvent, ContactEventDto.class);
- ceDto.setIdentifier(contactEvent.getContact().getIdentifier());
- return ceDto;
- }
-
- private ContactEvent convertToEntity(ContactEventDto contactEventDto) {
- return modelMapper.map(contactEventDto, ContactEvent.class);
- }
-
- class ContactEventPage extends PageImpl {
-
- private static final long serialVersionUID = 3619811755902956158L;
-
- public ContactEventPage(List content, Pageable pageable, long total) {
- super(content, pageable, total);
- }
- }
-
-
-}
+package fr.insee.survey.datacollectionmanagement.contact.controller;
+
+import fr.insee.survey.datacollectionmanagement.configuration.auth.user.AuthorityPrivileges;
+import fr.insee.survey.datacollectionmanagement.constants.Constants;
+import fr.insee.survey.datacollectionmanagement.contact.domain.Contact;
+import fr.insee.survey.datacollectionmanagement.contact.domain.ContactEvent;
+import fr.insee.survey.datacollectionmanagement.contact.dto.ContactEventDto;
+import fr.insee.survey.datacollectionmanagement.contact.service.ContactEventService;
+import fr.insee.survey.datacollectionmanagement.contact.service.ContactService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.validation.Valid;
+import lombok.RequiredArgsConstructor;
+import org.modelmapper.ModelMapper;
+import org.springframework.data.domain.PageImpl;
+import org.springframework.data.domain.Pageable;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
+
+import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+@RestController(value = "contactEvents")
+@PreAuthorize(AuthorityPrivileges.HAS_USER_PRIVILEGES)
+@Tag(name = "1 - Contacts", description = "Enpoints to create, update, delete and find contacts")
+@RequiredArgsConstructor
+@Validated
+public class ContactEventController {
+
+ private final ContactEventService contactEventService;
+
+ private final ContactService contactService;
+
+ private final ModelMapper modelMapper;
+
+ /**
+ * @deprecated
+ */
+ @Operation(summary = "Search for contactEvents by the contact id")
+ @GetMapping(value = Constants.API_CONTACTS_ID_CONTACTEVENTS, produces = "application/json")
+ @Deprecated(since = "2.6.0", forRemoval = true)
+ public ResponseEntity> getContactContactEvents(@PathVariable("id") String identifier) {
+ Contact contact = contactService.findByIdentifier(identifier);
+ return ResponseEntity.status(HttpStatus.OK)
+ .body(contact.getContactEvents().stream().map(this::convertToDto)
+ .toList());
+
+
+ }
+
+
+ /**
+ * @deprecated
+ */
+ @Operation(summary = "Create a contactEvent")
+ @PostMapping(value = Constants.API_CONTACTEVENTS, produces = "application/json", consumes = "application/json")
+ @Deprecated(since = "2.6.0", forRemoval = true)
+ public ResponseEntity postContactEvent(@RequestBody @Valid ContactEventDto contactEventDto) {
+
+ Contact contact = contactService.findByIdentifier(contactEventDto.getIdentifier());
+ ContactEvent contactEvent = convertToEntity(contactEventDto);
+ ContactEvent newContactEvent = contactEventService.saveContactEvent(contactEvent);
+ Set setContactEvents = contact.getContactEvents();
+ setContactEvents.add(newContactEvent);
+ contact.setContactEvents(setContactEvents);
+ contactService.saveContact(contact);
+ HttpHeaders responseHeaders = new HttpHeaders();
+ responseHeaders.set(HttpHeaders.LOCATION,
+ ServletUriComponentsBuilder.fromCurrentRequest().toUriString());
+ return ResponseEntity.status(HttpStatus.CREATED).headers(responseHeaders)
+ .body(convertToDto(newContactEvent));
+
+ }
+
+
+
+ /**
+ * @deprecated
+ */
+ @Operation(summary = "Delete a contact event")
+ @DeleteMapping(value = Constants.API_CONTACTEVENTS_ID, produces = "application/json")
+ @ResponseStatus(HttpStatus.NO_CONTENT)
+ @Deprecated(since = "2.6.0", forRemoval = true)
+ public void deleteContactEvent(@PathVariable("id") Long id) {
+ ContactEvent contactEvent = contactEventService.findById(id);
+ Contact contact = contactEvent.getContact();
+ contact.setContactEvents(contact.getContactEvents().stream().filter(ce -> !ce.equals(contactEvent))
+ .collect(Collectors.toSet()));
+ contactService.saveContact(contact);
+ contactEventService.deleteContactEvent(id);
+
+ }
+
+ private ContactEventDto convertToDto(ContactEvent contactEvent) {
+ ContactEventDto ceDto = modelMapper.map(contactEvent, ContactEventDto.class);
+ ceDto.setIdentifier(contactEvent.getContact().getIdentifier());
+ return ceDto;
+ }
+
+ private ContactEvent convertToEntity(ContactEventDto contactEventDto) {
+ return modelMapper.map(contactEventDto, ContactEvent.class);
+ }
+
+ class ContactEventPage extends PageImpl {
+
+ private static final long serialVersionUID = 3619811755902956158L;
+
+ public ContactEventPage(List content, Pageable pageable, long total) {
+ super(content, pageable, total);
+ }
+ }
+
+
+}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/util/PayloadUtil.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/contact/util/PayloadUtil.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/contact/util/PayloadUtil.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/contact/util/PayloadUtil.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/exception/ApiError.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/exception/ApiError.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/exception/ApiError.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/exception/ApiError.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/exception/ApiExceptionComponent.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/exception/ApiExceptionComponent.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/exception/ApiExceptionComponent.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/exception/ApiExceptionComponent.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/exception/ExceptionControllerAdvice.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/exception/ExceptionControllerAdvice.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/exception/ExceptionControllerAdvice.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/exception/ExceptionControllerAdvice.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/heathcheck/controller/HealthcheckController.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/healthcheck/controller/HealthcheckController.java
similarity index 81%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/heathcheck/controller/HealthcheckController.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/healthcheck/controller/HealthcheckController.java
index 5cdc7de5..58bfccff 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/heathcheck/controller/HealthcheckController.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/healthcheck/controller/HealthcheckController.java
@@ -1,7 +1,7 @@
-package fr.insee.survey.datacollectionmanagement.heathcheck.controller;
+package fr.insee.survey.datacollectionmanagement.healthcheck.controller;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
-import fr.insee.survey.datacollectionmanagement.heathcheck.dto.HealthcheckDto;
+import fr.insee.survey.datacollectionmanagement.healthcheck.dto.HealthcheckDto;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/CampaignController.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/CampaignController.java
similarity index 94%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/CampaignController.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/CampaignController.java
index 874f7b1f..31f011b0 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/CampaignController.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/CampaignController.java
@@ -1,262 +1,263 @@
-package fr.insee.survey.datacollectionmanagement.metadata.controller;
-
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityPrivileges;
-import fr.insee.survey.datacollectionmanagement.constants.Constants;
-import fr.insee.survey.datacollectionmanagement.exception.ImpossibleToDeleteException;
-import fr.insee.survey.datacollectionmanagement.exception.NotFoundException;
-import fr.insee.survey.datacollectionmanagement.exception.NotMatchException;
-import fr.insee.survey.datacollectionmanagement.metadata.domain.Campaign;
-import fr.insee.survey.datacollectionmanagement.metadata.domain.Parameters;
-import fr.insee.survey.datacollectionmanagement.metadata.domain.Partitioning;
-import fr.insee.survey.datacollectionmanagement.metadata.domain.Survey;
-import fr.insee.survey.datacollectionmanagement.metadata.dto.CampaignDto;
-import fr.insee.survey.datacollectionmanagement.metadata.dto.CampaignPartitioningsDto;
-import fr.insee.survey.datacollectionmanagement.metadata.dto.OnGoingDto;
-import fr.insee.survey.datacollectionmanagement.metadata.dto.ParamsDto;
-import fr.insee.survey.datacollectionmanagement.metadata.service.CampaignService;
-import fr.insee.survey.datacollectionmanagement.metadata.service.SurveyService;
-import fr.insee.survey.datacollectionmanagement.questioning.domain.Upload;
-import fr.insee.survey.datacollectionmanagement.questioning.service.QuestioningService;
-import fr.insee.survey.datacollectionmanagement.questioning.service.UploadService;
-import fr.insee.survey.datacollectionmanagement.util.EmailValidatorRegex;
-import fr.insee.survey.datacollectionmanagement.view.service.ViewService;
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.media.Content;
-import io.swagger.v3.oas.annotations.media.Schema;
-import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import jakarta.validation.Valid;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.StringUtils;
-import org.modelmapper.ModelMapper;
-import org.springframework.data.domain.*;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-import static fr.insee.survey.datacollectionmanagement.questioning.util.UrlTypeEnum.values;
-import static java.util.stream.Collectors.joining;
-
-@RestController
-@PreAuthorize(AuthorityPrivileges.HAS_MANAGEMENT_PRIVILEGES)
-@Tag(name = "3 - Metadata", description = "Enpoints to create, update, delete and find entities in metadata domain")
-@Slf4j
-@Validated
-@RequiredArgsConstructor
-public class CampaignController {
-
- private final CampaignService campaignService;
-
- private final SurveyService surveyService;
-
- private final ViewService viewService;
-
- private final QuestioningService questioningService;
-
- private final UploadService uploadService;
-
- private final ModelMapper modelmapper;
-
-
- @Operation(summary = "Search for campaigns, paginated")
- @GetMapping(value = Constants.API_CAMPAIGNS, produces = "application/json")
- public ResponseEntity getSources(
- @RequestParam(defaultValue = "0") Integer page,
- @RequestParam(defaultValue = "20") Integer size,
- @RequestParam(defaultValue = "id") String sort) {
- Pageable pageable = PageRequest.of(page, size, Sort.by(sort));
- Page pageCampaign = campaignService.findAll(pageable);
- List listCampaigns = pageCampaign.stream().map(this::convertToDto).toList();
- return ResponseEntity.ok().body(new CampaignPage(listCampaigns, pageable, pageCampaign.getTotalElements()));
- }
-
- @Operation(summary = "Search for campaigns by the survey id")
- @GetMapping(value = Constants.API_SURVEYS_ID_CAMPAIGNS, produces = "application/json")
- public ResponseEntity> getCampaignsBySurvey(@PathVariable("id") String id) {
-
- Survey survey = surveyService.findById(id);
- return ResponseEntity.ok()
- .body(survey.getCampaigns().stream().map(this::convertToDto).toList());
-
- }
-
- @Operation(summary = "Search for campaigns and partitionings by the survey id")
- @GetMapping(value = Constants.API_SURVEYS_ID_CAMPAIGNS_PARTITIONINGS, produces = "application/json")
- public ResponseEntity> getCampaignsPartitioningsBySurvey(@PathVariable("id") String id) {
-
- Survey survey = surveyService.findById(id);
- return ResponseEntity.ok()
- .body(survey.getCampaigns().stream().map(this::convertToCampaignPartitioningsDto).toList());
-
- }
-
- @Operation(summary = "Search for a campaign by its id")
- @GetMapping(value = Constants.API_CAMPAIGNS_ID, produces = "application/json")
- @ApiResponses(value = {
- @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CampaignDto.class))),
- @ApiResponse(responseCode = "404", description = "Not found"),
- @ApiResponse(responseCode = "400", description = "Bad request")
- })
- public ResponseEntity getCampaign(@PathVariable("id") String id) {
- Campaign campaign = campaignService.findById(StringUtils.upperCase(id));
- return ResponseEntity.ok().body(convertToDto(campaign));
-
-
- }
-
-
- @Operation(summary = "Get campaign parameters")
- @GetMapping(value = "/api/campaigns/{id}/params", produces = "application/json")
- public ResponseEntity> getParams(@PathVariable("id") String id) {
- Campaign campaign = campaignService.findById(StringUtils.upperCase(id));
- List listParams = campaign.getParams().stream().map(this::convertToDto).toList();
- return ResponseEntity.ok().body(listParams);
- }
-
-
- @Operation(summary = "Create a parameter for a campaign")
- @PutMapping(value = "/api/campaigns/{id}/params", produces = "application/json")
- public void putParams(@PathVariable("id") String id, @RequestBody @Valid ParamsDto paramsDto) {
- Campaign campaign = campaignService.findById(StringUtils.upperCase(id));
-
- if (paramsDto.getParamId().equalsIgnoreCase(Parameters.ParameterEnum.URL_TYPE.name())
- && Arrays.stream(values()).noneMatch(p -> p.name().equals(paramsDto.getParamValue()))) {
-
- throw new NotMatchException(String.format("Only %s are valid values for URL_TYPE", Arrays.stream(values()).map(Enum::name)
- .collect(joining(" "))));
- }
- if (paramsDto.getParamId().equalsIgnoreCase(Parameters.ParameterEnum.MAIL_ASSISTANCE.name())
- && !EmailValidatorRegex.isValidEmail(paramsDto.getParamValue())) {
-
- throw new NotMatchException(String.format("Email %s is not valid", paramsDto.getParamValue()));
- }
- Parameters param = convertToEntity(paramsDto);
- param.setMetadataId(StringUtils.upperCase(id));
- Set setParams = campaign.getParams().stream()
- .filter(parameter -> !parameter.getParamId().equals(param.getParamId()))
- .collect(Collectors.toSet());
- setParams.add(param);
- campaign.setParams(setParams);
- campaignService.insertOrUpdateCampaign(campaign);
- }
-
-
- @Operation(summary = "Update or create a campaign")
- @PutMapping(value = Constants.API_CAMPAIGNS_ID, produces = "application/json", consumes = "application/json")
- @ApiResponses(value = {
- @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CampaignDto.class))),
- @ApiResponse(responseCode = "201", description = "Created", content = @Content(schema = @Schema(implementation = CampaignDto.class))),
- @ApiResponse(responseCode = "400", description = "Bad request")
- })
- public ResponseEntity putCampaign(@PathVariable("id") String id, @RequestBody @Valid CampaignDto campaignDto) {
- if (!campaignDto.getId().equalsIgnoreCase(id)) {
- throw new NotMatchException("id and idCampaign don't match");
- }
- HttpHeaders responseHeaders = new HttpHeaders();
- responseHeaders.set(HttpHeaders.LOCATION,
- ServletUriComponentsBuilder.fromCurrentRequest().buildAndExpand(campaignDto.getId()).toUriString());
- HttpStatus httpStatus;
-
- try {
- campaignService.findById(id);
- log.info("Update campaign with the id {}", campaignDto.getId());
- httpStatus = HttpStatus.OK;
- } catch (NotFoundException e) {
- log.info("Create campaign with the id {}", campaignDto.getId());
- httpStatus = HttpStatus.CREATED;
- }
-
- Campaign campaign = campaignService.insertOrUpdateCampaign(convertToEntity(campaignDto));
- Survey survey = campaign.getSurvey();
- survey.getCampaigns().add(campaign);
- surveyService.insertOrUpdateSurvey(survey);
- return ResponseEntity.status(httpStatus).headers(responseHeaders).body(convertToDto(campaign));
- }
-
- @Operation(summary = "Delete a campaign, its campaigns, partitionings, questionings ...")
- @DeleteMapping(value = {Constants.API_CAMPAIGNS_ID, Constants.MOOG_API_CAMPAIGNS_ID})
-
- @Transactional
- public void deleteCampaign(@PathVariable("id") String id) throws fr.insee.survey.datacollectionmanagement.exception.NotFoundException {
-
- if (campaignService.isCampaignOngoing(id)) {
- throw new ImpossibleToDeleteException("Campaign is still ongoing and can't be deleted");
- }
-
- Campaign campaign = campaignService.findById(id);
-
- int nbQuestioningDeleted = 0;
- Survey survey = campaign.getSurvey();
- survey.getCampaigns().remove(campaign);
- surveyService.insertOrUpdateSurvey(survey);
- List uploadsCamp = uploadService.findAllByIdCampaign(id);
- campaignService.deleteCampaignById(id);
- Set listPartitionings = campaign.getPartitionings();
-
- int nbViewDeleted = viewService.deleteViewsOfOneCampaign(campaign);
-
- for (Partitioning partitioning : listPartitionings) {
- nbQuestioningDeleted += questioningService.deleteQuestioningsOfOnePartitioning(partitioning);
- }
- uploadsCamp.forEach(uploadService::delete);
- log.info("Campaign {} deleted with all its metadata children - {} questioning deleted - {} view deleted - {} uploads deleted",
- id,
- nbQuestioningDeleted, nbViewDeleted, uploadsCamp.size());
-
- }
-
- @Operation(summary = "campaign is ongoing")
- @GetMapping(value = Constants.CAMPAIGNS_ID_ONGOING, produces = "application/json")
- @ApiResponses(value = {
- @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = OnGoingDto.class))),
- @ApiResponse(responseCode = "404", description = "Not found")
- })
- public ResponseEntity isOnGoingCampaign(@PathVariable("id") String id) {
- boolean isOnGoing = campaignService.isCampaignOngoing(id);
- return ResponseEntity.ok().body(new OnGoingDto(isOnGoing));
-
- }
-
- private CampaignDto convertToDto(Campaign campaign) {
- return modelmapper.map(campaign, CampaignDto.class);
- }
-
- private ParamsDto convertToDto(Parameters params) {
- return modelmapper.map(params, ParamsDto.class);
- }
-
- private CampaignPartitioningsDto convertToCampaignPartitioningsDto(Campaign campaign) {
- return modelmapper.map(campaign, CampaignPartitioningsDto.class);
- }
-
- private Campaign convertToEntity(CampaignDto campaignDto) {
- return modelmapper.map(campaignDto, Campaign.class);
- }
-
- private Parameters convertToEntity(ParamsDto paramsDto) {
-
- Parameters params = modelmapper.map(paramsDto, Parameters.class);
- params.setParamId(Parameters.ParameterEnum.valueOf(paramsDto.getParamId()));
- return params;
- }
-
- class CampaignPage extends PageImpl {
-
- public CampaignPage(List content, Pageable pageable, long total) {
- super(content, pageable, total);
- }
- }
-
-}
+package fr.insee.survey.datacollectionmanagement.metadata.controller;
+
+import fr.insee.survey.datacollectionmanagement.configuration.auth.user.AuthorityPrivileges;
+import fr.insee.survey.datacollectionmanagement.constants.Constants;
+import fr.insee.survey.datacollectionmanagement.exception.ImpossibleToDeleteException;
+import fr.insee.survey.datacollectionmanagement.exception.NotFoundException;
+import fr.insee.survey.datacollectionmanagement.exception.NotMatchException;
+import fr.insee.survey.datacollectionmanagement.metadata.domain.Campaign;
+import fr.insee.survey.datacollectionmanagement.metadata.domain.Parameters;
+import fr.insee.survey.datacollectionmanagement.metadata.domain.Partitioning;
+import fr.insee.survey.datacollectionmanagement.metadata.domain.Survey;
+import fr.insee.survey.datacollectionmanagement.metadata.dto.CampaignDto;
+import fr.insee.survey.datacollectionmanagement.metadata.dto.CampaignPartitioningsDto;
+import fr.insee.survey.datacollectionmanagement.metadata.dto.OnGoingDto;
+import fr.insee.survey.datacollectionmanagement.metadata.dto.ParamsDto;
+import fr.insee.survey.datacollectionmanagement.metadata.enums.ParameterEnum;
+import fr.insee.survey.datacollectionmanagement.metadata.service.CampaignService;
+import fr.insee.survey.datacollectionmanagement.metadata.service.SurveyService;
+import fr.insee.survey.datacollectionmanagement.questioning.domain.Upload;
+import fr.insee.survey.datacollectionmanagement.questioning.service.QuestioningService;
+import fr.insee.survey.datacollectionmanagement.questioning.service.UploadService;
+import fr.insee.survey.datacollectionmanagement.util.EmailValidatorRegex;
+import fr.insee.survey.datacollectionmanagement.view.service.ViewService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
+import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.validation.Valid;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.modelmapper.ModelMapper;
+import org.springframework.data.domain.*;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import static fr.insee.survey.datacollectionmanagement.questioning.enums.UrlTypeEnum.values;
+import static java.util.stream.Collectors.joining;
+
+@RestController
+@PreAuthorize(AuthorityPrivileges.HAS_MANAGEMENT_PRIVILEGES)
+@Tag(name = "3 - Metadata", description = "Enpoints to create, update, delete and find entities in metadata domain")
+@Slf4j
+@Validated
+@RequiredArgsConstructor
+public class CampaignController {
+
+ private final CampaignService campaignService;
+
+ private final SurveyService surveyService;
+
+ private final ViewService viewService;
+
+ private final QuestioningService questioningService;
+
+ private final UploadService uploadService;
+
+ private final ModelMapper modelmapper;
+
+
+ @Operation(summary = "Search for campaigns, paginated")
+ @GetMapping(value = Constants.API_CAMPAIGNS, produces = "application/json")
+ public ResponseEntity getSources(
+ @RequestParam(defaultValue = "0") Integer page,
+ @RequestParam(defaultValue = "20") Integer size,
+ @RequestParam(defaultValue = "id") String sort) {
+ Pageable pageable = PageRequest.of(page, size, Sort.by(sort));
+ Page pageCampaign = campaignService.findAll(pageable);
+ List listCampaigns = pageCampaign.stream().map(this::convertToDto).toList();
+ return ResponseEntity.ok().body(new CampaignPage(listCampaigns, pageable, pageCampaign.getTotalElements()));
+ }
+
+ @Operation(summary = "Search for campaigns by the survey id")
+ @GetMapping(value = Constants.API_SURVEYS_ID_CAMPAIGNS, produces = "application/json")
+ public ResponseEntity> getCampaignsBySurvey(@PathVariable("id") String id) {
+
+ Survey survey = surveyService.findById(id);
+ return ResponseEntity.ok()
+ .body(survey.getCampaigns().stream().map(this::convertToDto).toList());
+
+ }
+
+ @Operation(summary = "Search for campaigns and partitionings by the survey id")
+ @GetMapping(value = Constants.API_SURVEYS_ID_CAMPAIGNS_PARTITIONINGS, produces = "application/json")
+ public ResponseEntity> getCampaignsPartitioningsBySurvey(@PathVariable("id") String id) {
+
+ Survey survey = surveyService.findById(id);
+ return ResponseEntity.ok()
+ .body(survey.getCampaigns().stream().map(this::convertToCampaignPartitioningsDto).toList());
+
+ }
+
+ @Operation(summary = "Search for a campaign by its id")
+ @GetMapping(value = Constants.API_CAMPAIGNS_ID, produces = "application/json")
+ @ApiResponses(value = {
+ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CampaignDto.class))),
+ @ApiResponse(responseCode = "404", description = "Not found"),
+ @ApiResponse(responseCode = "400", description = "Bad request")
+ })
+ public ResponseEntity getCampaign(@PathVariable("id") String id) {
+ Campaign campaign = campaignService.findById(StringUtils.upperCase(id));
+ return ResponseEntity.ok().body(convertToDto(campaign));
+
+
+ }
+
+
+ @Operation(summary = "Get campaign parameters")
+ @GetMapping(value = "/api/campaigns/{id}/params", produces = "application/json")
+ public ResponseEntity> getParams(@PathVariable("id") String id) {
+ Campaign campaign = campaignService.findById(StringUtils.upperCase(id));
+ List listParams = campaign.getParams().stream().map(this::convertToDto).toList();
+ return ResponseEntity.ok().body(listParams);
+ }
+
+
+ @Operation(summary = "Create a parameter for a campaign")
+ @PutMapping(value = "/api/campaigns/{id}/params", produces = "application/json")
+ public void putParams(@PathVariable("id") String id, @RequestBody @Valid ParamsDto paramsDto) {
+ Campaign campaign = campaignService.findById(StringUtils.upperCase(id));
+
+ if (paramsDto.getParamId().equalsIgnoreCase(ParameterEnum.URL_TYPE.name())
+ && Arrays.stream(values()).noneMatch(p -> p.name().equals(paramsDto.getParamValue()))) {
+
+ throw new NotMatchException(String.format("Only %s are valid values for URL_TYPE", Arrays.stream(values()).map(Enum::name)
+ .collect(joining(" "))));
+ }
+ if (paramsDto.getParamId().equalsIgnoreCase(ParameterEnum.MAIL_ASSISTANCE.name())
+ && !EmailValidatorRegex.isValidEmail(paramsDto.getParamValue())) {
+
+ throw new NotMatchException(String.format("Email %s is not valid", paramsDto.getParamValue()));
+ }
+ Parameters param = convertToEntity(paramsDto);
+ param.setMetadataId(StringUtils.upperCase(id));
+ Set setParams = campaign.getParams().stream()
+ .filter(parameter -> !parameter.getParamId().equals(param.getParamId()))
+ .collect(Collectors.toSet());
+ setParams.add(param);
+ campaign.setParams(setParams);
+ campaignService.insertOrUpdateCampaign(campaign);
+ }
+
+
+ @Operation(summary = "Update or create a campaign")
+ @PutMapping(value = Constants.API_CAMPAIGNS_ID, produces = "application/json", consumes = "application/json")
+ @ApiResponses(value = {
+ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = CampaignDto.class))),
+ @ApiResponse(responseCode = "201", description = "Created", content = @Content(schema = @Schema(implementation = CampaignDto.class))),
+ @ApiResponse(responseCode = "400", description = "Bad request")
+ })
+ public ResponseEntity putCampaign(@PathVariable("id") String id, @RequestBody @Valid CampaignDto campaignDto) {
+ if (!campaignDto.getId().equalsIgnoreCase(id)) {
+ throw new NotMatchException("id and idCampaign don't match");
+ }
+ HttpHeaders responseHeaders = new HttpHeaders();
+ responseHeaders.set(HttpHeaders.LOCATION,
+ ServletUriComponentsBuilder.fromCurrentRequest().buildAndExpand(campaignDto.getId()).toUriString());
+ HttpStatus httpStatus;
+
+ try {
+ campaignService.findById(id);
+ log.info("Update campaign with the id {}", campaignDto.getId());
+ httpStatus = HttpStatus.OK;
+ } catch (NotFoundException e) {
+ log.info("Create campaign with the id {}", campaignDto.getId());
+ httpStatus = HttpStatus.CREATED;
+ }
+
+ Campaign campaign = campaignService.insertOrUpdateCampaign(convertToEntity(campaignDto));
+ Survey survey = campaign.getSurvey();
+ survey.getCampaigns().add(campaign);
+ surveyService.insertOrUpdateSurvey(survey);
+ return ResponseEntity.status(httpStatus).headers(responseHeaders).body(convertToDto(campaign));
+ }
+
+ @Operation(summary = "Delete a campaign, its campaigns, partitionings, questionings ...")
+ @DeleteMapping(value = {Constants.API_CAMPAIGNS_ID, Constants.MOOG_API_CAMPAIGNS_ID})
+
+ @Transactional
+ public void deleteCampaign(@PathVariable("id") String id) throws fr.insee.survey.datacollectionmanagement.exception.NotFoundException {
+
+ if (campaignService.isCampaignOngoing(id)) {
+ throw new ImpossibleToDeleteException("Campaign is still ongoing and can't be deleted");
+ }
+
+ Campaign campaign = campaignService.findById(id);
+
+ int nbQuestioningDeleted = 0;
+ Survey survey = campaign.getSurvey();
+ survey.getCampaigns().remove(campaign);
+ surveyService.insertOrUpdateSurvey(survey);
+ List uploadsCamp = uploadService.findAllByIdCampaign(id);
+ campaignService.deleteCampaignById(id);
+ Set listPartitionings = campaign.getPartitionings();
+
+ int nbViewDeleted = viewService.deleteViewsOfOneCampaign(campaign);
+
+ for (Partitioning partitioning : listPartitionings) {
+ nbQuestioningDeleted += questioningService.deleteQuestioningsOfOnePartitioning(partitioning);
+ }
+ uploadsCamp.forEach(uploadService::delete);
+ log.info("Campaign {} deleted with all its metadata children - {} questioning deleted - {} view deleted - {} uploads deleted",
+ id,
+ nbQuestioningDeleted, nbViewDeleted, uploadsCamp.size());
+
+ }
+
+ @Operation(summary = "campaign is ongoing")
+ @GetMapping(value = Constants.CAMPAIGNS_ID_ONGOING, produces = "application/json")
+ @ApiResponses(value = {
+ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = OnGoingDto.class))),
+ @ApiResponse(responseCode = "404", description = "Not found")
+ })
+ public ResponseEntity isOnGoingCampaign(@PathVariable("id") String id) {
+ boolean isOnGoing = campaignService.isCampaignOngoing(id);
+ return ResponseEntity.ok().body(new OnGoingDto(isOnGoing));
+
+ }
+
+ private CampaignDto convertToDto(Campaign campaign) {
+ return modelmapper.map(campaign, CampaignDto.class);
+ }
+
+ private ParamsDto convertToDto(Parameters params) {
+ return modelmapper.map(params, ParamsDto.class);
+ }
+
+ private CampaignPartitioningsDto convertToCampaignPartitioningsDto(Campaign campaign) {
+ return modelmapper.map(campaign, CampaignPartitioningsDto.class);
+ }
+
+ private Campaign convertToEntity(CampaignDto campaignDto) {
+ return modelmapper.map(campaignDto, Campaign.class);
+ }
+
+ private Parameters convertToEntity(ParamsDto paramsDto) {
+
+ Parameters params = modelmapper.map(paramsDto, Parameters.class);
+ params.setParamId(ParameterEnum.valueOf(paramsDto.getParamId()));
+ return params;
+ }
+
+ class CampaignPage extends PageImpl {
+
+ public CampaignPage(List content, Pageable pageable, long total) {
+ super(content, pageable, total);
+ }
+ }
+
+}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/MetadataController.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/MetadataController.java
similarity index 92%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/MetadataController.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/MetadataController.java
index a8e2292f..14afbc01 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/MetadataController.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/MetadataController.java
@@ -1,7 +1,7 @@
package fr.insee.survey.datacollectionmanagement.metadata.controller;
-import fr.insee.survey.datacollectionmanagement.config.JSONCollectionWrapper;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityPrivileges;
+import fr.insee.survey.datacollectionmanagement.util.JSONCollectionWrapper;
+import fr.insee.survey.datacollectionmanagement.configuration.auth.user.AuthorityPrivileges;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import fr.insee.survey.datacollectionmanagement.metadata.domain.Campaign;
import fr.insee.survey.datacollectionmanagement.metadata.dto.CampaignMoogDto;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/OwnerController.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/OwnerController.java
similarity index 97%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/OwnerController.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/OwnerController.java
index ce927968..0324e49a 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/OwnerController.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/OwnerController.java
@@ -1,6 +1,6 @@
package fr.insee.survey.datacollectionmanagement.metadata.controller;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityPrivileges;
+import fr.insee.survey.datacollectionmanagement.configuration.auth.user.AuthorityPrivileges;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import fr.insee.survey.datacollectionmanagement.exception.NotFoundException;
import fr.insee.survey.datacollectionmanagement.exception.NotMatchException;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/PartitioningController.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/PartitioningController.java
similarity index 98%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/PartitioningController.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/PartitioningController.java
index 46e6d6ed..69a298aa 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/PartitioningController.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/PartitioningController.java
@@ -1,6 +1,6 @@
package fr.insee.survey.datacollectionmanagement.metadata.controller;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityPrivileges;
+import fr.insee.survey.datacollectionmanagement.configuration.auth.user.AuthorityPrivileges;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import fr.insee.survey.datacollectionmanagement.exception.NotFoundException;
import fr.insee.survey.datacollectionmanagement.exception.NotMatchException;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/PeriodPeriodicityController.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/PeriodPeriodicityController.java
similarity index 92%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/PeriodPeriodicityController.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/PeriodPeriodicityController.java
index cd4ab608..a89b101b 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/PeriodPeriodicityController.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/PeriodPeriodicityController.java
@@ -1,12 +1,12 @@
package fr.insee.survey.datacollectionmanagement.metadata.controller;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityPrivileges;
+import fr.insee.survey.datacollectionmanagement.configuration.auth.user.AuthorityPrivileges;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import fr.insee.survey.datacollectionmanagement.exception.NotFoundException;
import fr.insee.survey.datacollectionmanagement.metadata.dto.PeriodDto;
import fr.insee.survey.datacollectionmanagement.metadata.dto.PeriodicityDto;
-import fr.insee.survey.datacollectionmanagement.metadata.util.PeriodEnum;
-import fr.insee.survey.datacollectionmanagement.metadata.util.PeriodicityEnum;
+import fr.insee.survey.datacollectionmanagement.metadata.enums.PeriodEnum;
+import fr.insee.survey.datacollectionmanagement.metadata.enums.PeriodicityEnum;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/SourceController.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/SourceController.java
similarity index 98%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/SourceController.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/SourceController.java
index 41bc52ed..9482e12e 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/SourceController.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/SourceController.java
@@ -1,6 +1,6 @@
package fr.insee.survey.datacollectionmanagement.metadata.controller;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityPrivileges;
+import fr.insee.survey.datacollectionmanagement.configuration.auth.user.AuthorityPrivileges;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import fr.insee.survey.datacollectionmanagement.exception.NotFoundException;
import fr.insee.survey.datacollectionmanagement.exception.NotMatchException;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/SupportController.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/SupportController.java
similarity index 97%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/SupportController.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/SupportController.java
index 7ee6f5b6..3efce74e 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/SupportController.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/SupportController.java
@@ -1,6 +1,6 @@
package fr.insee.survey.datacollectionmanagement.metadata.controller;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityPrivileges;
+import fr.insee.survey.datacollectionmanagement.configuration.auth.user.AuthorityPrivileges;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import fr.insee.survey.datacollectionmanagement.exception.NotFoundException;
import fr.insee.survey.datacollectionmanagement.exception.NotMatchException;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/SurveyController.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/SurveyController.java
similarity index 98%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/SurveyController.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/SurveyController.java
index 744def65..e15e8253 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/SurveyController.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/controller/SurveyController.java
@@ -1,6 +1,6 @@
package fr.insee.survey.datacollectionmanagement.metadata.controller;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityPrivileges;
+import fr.insee.survey.datacollectionmanagement.configuration.auth.user.AuthorityPrivileges;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import fr.insee.survey.datacollectionmanagement.exception.NotFoundException;
import fr.insee.survey.datacollectionmanagement.exception.NotMatchException;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/CheckHabilitationController.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/CheckHabilitationController.java
similarity index 95%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/CheckHabilitationController.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/CheckHabilitationController.java
index b9366663..8c9fa42a 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/CheckHabilitationController.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/CheckHabilitationController.java
@@ -1,6 +1,6 @@
package fr.insee.survey.datacollectionmanagement.query.controller;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityPrivileges;
+import fr.insee.survey.datacollectionmanagement.configuration.auth.user.AuthorityPrivileges;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import fr.insee.survey.datacollectionmanagement.query.dto.HabilitationDto;
import fr.insee.survey.datacollectionmanagement.query.service.CheckHabilitationService;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/MonitoringController.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/MonitoringController.java
similarity index 94%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/MonitoringController.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/MonitoringController.java
index 14ecd5b1..5100e17e 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/MonitoringController.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/MonitoringController.java
@@ -1,7 +1,7 @@
package fr.insee.survey.datacollectionmanagement.query.controller;
-import fr.insee.survey.datacollectionmanagement.config.JSONCollectionWrapper;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityPrivileges;
+import fr.insee.survey.datacollectionmanagement.util.JSONCollectionWrapper;
+import fr.insee.survey.datacollectionmanagement.configuration.auth.user.AuthorityPrivileges;
import fr.insee.survey.datacollectionmanagement.metadata.domain.Campaign;
import fr.insee.survey.datacollectionmanagement.metadata.domain.Partitioning;
import fr.insee.survey.datacollectionmanagement.metadata.service.CampaignService;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/MoogController.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/MoogController.java
similarity index 97%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/MoogController.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/MoogController.java
index 556a6ccf..ff3bf42d 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/MoogController.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/MoogController.java
@@ -1,7 +1,7 @@
package fr.insee.survey.datacollectionmanagement.query.controller;
-import fr.insee.survey.datacollectionmanagement.config.JSONCollectionWrapper;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityPrivileges;
+import fr.insee.survey.datacollectionmanagement.util.JSONCollectionWrapper;
+import fr.insee.survey.datacollectionmanagement.configuration.auth.user.AuthorityPrivileges;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import fr.insee.survey.datacollectionmanagement.contact.domain.Contact;
import fr.insee.survey.datacollectionmanagement.contact.service.ContactService;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/MyQuestioningsController.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/MyQuestioningsController.java
similarity index 91%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/MyQuestioningsController.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/MyQuestioningsController.java
index 79c27ac0..189c7f3b 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/MyQuestioningsController.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/MyQuestioningsController.java
@@ -1,35 +1,35 @@
-package fr.insee.survey.datacollectionmanagement.query.controller;
-
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityPrivileges;
-import fr.insee.survey.datacollectionmanagement.constants.Constants;
-import fr.insee.survey.datacollectionmanagement.query.dto.MyQuestioningDto;
-import fr.insee.survey.datacollectionmanagement.query.service.MySurveysService;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import lombok.RequiredArgsConstructor;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.security.core.annotation.CurrentSecurityContext;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.List;
-
-@RestController
-@Tag(name = "1 - Contacts", description = "Endpoints to create, update, delete and find contacts")
-@RequiredArgsConstructor
-public class MyQuestioningsController {
-
- private final MySurveysService mySurveysService;
-
-
- @GetMapping(value = Constants.API_MY_QUESTIONINGS_ID)
- @PreAuthorize(AuthorityPrivileges.HAS_REPONDENT_PRIVILEGES)
- public List findById(@CurrentSecurityContext(expression = "authentication.name")
- String idec) {
-
-
- List listSurveys = mySurveysService.getListMySurveys(idec.toUpperCase());
-
- return listSurveys;
-
- }
-}
+package fr.insee.survey.datacollectionmanagement.query.controller;
+
+import fr.insee.survey.datacollectionmanagement.configuration.auth.user.AuthorityPrivileges;
+import fr.insee.survey.datacollectionmanagement.constants.Constants;
+import fr.insee.survey.datacollectionmanagement.query.dto.MyQuestioningDto;
+import fr.insee.survey.datacollectionmanagement.query.service.MySurveysService;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import lombok.RequiredArgsConstructor;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.security.core.annotation.CurrentSecurityContext;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@RestController
+@Tag(name = "1 - Contacts", description = "Endpoints to create, update, delete and find contacts")
+@RequiredArgsConstructor
+public class MyQuestioningsController {
+
+ private final MySurveysService mySurveysService;
+
+
+ @GetMapping(value = Constants.API_MY_QUESTIONINGS_ID)
+ @PreAuthorize(AuthorityPrivileges.HAS_REPONDENT_PRIVILEGES)
+ public List findById(@CurrentSecurityContext(expression = "authentication.name")
+ String idec) {
+
+
+ List listSurveys = mySurveysService.getListMySurveys(idec.toUpperCase());
+
+ return listSurveys;
+
+ }
+}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/QuestioningAccreditationController.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/QuestioningAccreditationController.java
similarity index 98%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/QuestioningAccreditationController.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/QuestioningAccreditationController.java
index 18fcff75..42245c65 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/QuestioningAccreditationController.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/QuestioningAccreditationController.java
@@ -1,6 +1,6 @@
package fr.insee.survey.datacollectionmanagement.query.controller;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityPrivileges;
+import fr.insee.survey.datacollectionmanagement.configuration.auth.user.AuthorityPrivileges;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import fr.insee.survey.datacollectionmanagement.contact.service.ContactService;
import fr.insee.survey.datacollectionmanagement.metadata.domain.Partitioning;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/QuestioningController.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/QuestioningController.java
similarity index 96%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/QuestioningController.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/QuestioningController.java
index 0bbc1e1c..891ff4cc 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/QuestioningController.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/QuestioningController.java
@@ -1,9 +1,10 @@
package fr.insee.survey.datacollectionmanagement.query.controller;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityPrivileges;
+import fr.insee.survey.datacollectionmanagement.configuration.auth.user.AuthorityPrivileges;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import fr.insee.survey.datacollectionmanagement.metadata.domain.Parameters;
import fr.insee.survey.datacollectionmanagement.metadata.domain.Partitioning;
+import fr.insee.survey.datacollectionmanagement.metadata.enums.ParameterEnum;
import fr.insee.survey.datacollectionmanagement.metadata.service.PartitioningService;
import fr.insee.survey.datacollectionmanagement.query.dto.AssistanceDto;
import fr.insee.survey.datacollectionmanagement.questioning.domain.Questioning;
@@ -103,7 +104,7 @@ public ResponseEntity> getQuestioningsBySurveyUnit(@PathVariable("id") String
public AssistanceDto getAssistanceQuestioning(@PathVariable("id") Long questioningId) {
Questioning questioning = questioningService.findbyId(questioningId);
Partitioning part = partitioningService.findById(questioning.getIdPartitioning());
- String mail = partitioningService.findSuitableParameterValue(part, Parameters.ParameterEnum.MAIL_ASSISTANCE);
+ String mail = partitioningService.findSuitableParameterValue(part, ParameterEnum.MAIL_ASSISTANCE);
return new AssistanceDto(mail, questioning.getSurveyUnit().getIdSu());
}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/QuestioningInformationsController.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/QuestioningInformationsController.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/QuestioningInformationsController.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/QuestioningInformationsController.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/SearchSurveyUnitController.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/SearchSurveyUnitController.java
similarity index 96%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/SearchSurveyUnitController.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/SearchSurveyUnitController.java
index 58888867..65137a41 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/SearchSurveyUnitController.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/SearchSurveyUnitController.java
@@ -1,6 +1,6 @@
package fr.insee.survey.datacollectionmanagement.query.controller;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityPrivileges;
+import fr.insee.survey.datacollectionmanagement.configuration.auth.user.AuthorityPrivileges;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import fr.insee.survey.datacollectionmanagement.contact.domain.Contact;
import fr.insee.survey.datacollectionmanagement.contact.service.ContactService;
@@ -12,9 +12,9 @@
import fr.insee.survey.datacollectionmanagement.questioning.domain.Questioning;
import fr.insee.survey.datacollectionmanagement.questioning.domain.QuestioningAccreditation;
import fr.insee.survey.datacollectionmanagement.questioning.domain.QuestioningEvent;
+import fr.insee.survey.datacollectionmanagement.questioning.enums.TypeQuestioningEvent;
import fr.insee.survey.datacollectionmanagement.questioning.service.QuestioningEventService;
import fr.insee.survey.datacollectionmanagement.questioning.service.QuestioningService;
-import fr.insee.survey.datacollectionmanagement.questioning.util.TypeQuestioningEvent;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/WebclientController.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/WebclientController.java
similarity index 99%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/WebclientController.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/WebclientController.java
index b8892406..400f02da 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/WebclientController.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/query/controller/WebclientController.java
@@ -3,7 +3,7 @@
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityPrivileges;
+import fr.insee.survey.datacollectionmanagement.configuration.auth.user.AuthorityPrivileges;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import fr.insee.survey.datacollectionmanagement.contact.domain.Contact;
import fr.insee.survey.datacollectionmanagement.contact.dto.ContactDto;
@@ -23,11 +23,11 @@
import fr.insee.survey.datacollectionmanagement.questioning.domain.QuestioningEvent;
import fr.insee.survey.datacollectionmanagement.questioning.domain.SurveyUnit;
import fr.insee.survey.datacollectionmanagement.questioning.dto.SurveyUnitDto;
+import fr.insee.survey.datacollectionmanagement.questioning.enums.TypeQuestioningEvent;
import fr.insee.survey.datacollectionmanagement.questioning.service.QuestioningAccreditationService;
import fr.insee.survey.datacollectionmanagement.questioning.service.QuestioningEventService;
import fr.insee.survey.datacollectionmanagement.questioning.service.QuestioningService;
import fr.insee.survey.datacollectionmanagement.questioning.service.SurveyUnitService;
-import fr.insee.survey.datacollectionmanagement.questioning.util.TypeQuestioningEvent;
import fr.insee.survey.datacollectionmanagement.view.service.ViewService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/controller/QuestioningCommunicationController.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/controller/QuestioningCommunicationController.java
similarity index 96%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/controller/QuestioningCommunicationController.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/controller/QuestioningCommunicationController.java
index 37fa5d9a..1a3be49d 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/controller/QuestioningCommunicationController.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/controller/QuestioningCommunicationController.java
@@ -1,6 +1,6 @@
package fr.insee.survey.datacollectionmanagement.questioning.controller;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityPrivileges;
+import fr.insee.survey.datacollectionmanagement.configuration.auth.user.AuthorityPrivileges;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import fr.insee.survey.datacollectionmanagement.questioning.domain.Questioning;
import fr.insee.survey.datacollectionmanagement.questioning.domain.QuestioningCommunication;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/controller/QuestioningEventController.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/controller/QuestioningEventController.java
similarity index 98%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/controller/QuestioningEventController.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/controller/QuestioningEventController.java
index 1c26f3c9..e6276eb8 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/controller/QuestioningEventController.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/controller/QuestioningEventController.java
@@ -1,6 +1,6 @@
package fr.insee.survey.datacollectionmanagement.questioning.controller;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityPrivileges;
+import fr.insee.survey.datacollectionmanagement.configuration.auth.user.AuthorityPrivileges;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import fr.insee.survey.datacollectionmanagement.questioning.domain.Questioning;
import fr.insee.survey.datacollectionmanagement.questioning.domain.QuestioningEvent;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/controller/SurveyUnitCommentController.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/controller/SurveyUnitCommentController.java
similarity index 92%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/controller/SurveyUnitCommentController.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/controller/SurveyUnitCommentController.java
index 4d1d032b..539efcf6 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/controller/SurveyUnitCommentController.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/controller/SurveyUnitCommentController.java
@@ -1,6 +1,6 @@
package fr.insee.survey.datacollectionmanagement.questioning.controller;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityPrivileges;
+import fr.insee.survey.datacollectionmanagement.configuration.auth.user.AuthorityPrivileges;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import fr.insee.survey.datacollectionmanagement.questioning.domain.SurveyUnit;
import fr.insee.survey.datacollectionmanagement.questioning.domain.SurveyUnitComment;
@@ -17,13 +17,10 @@
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.modelmapper.ModelMapper;
-import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
-import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
import java.util.Date;
import java.util.Set;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/controller/SurveyUnitController.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/controller/SurveyUnitController.java
similarity index 98%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/controller/SurveyUnitController.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/controller/SurveyUnitController.java
index 430e34cc..a32e72f3 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/controller/SurveyUnitController.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/controller/SurveyUnitController.java
@@ -1,6 +1,6 @@
package fr.insee.survey.datacollectionmanagement.questioning.controller;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityPrivileges;
+import fr.insee.survey.datacollectionmanagement.configuration.auth.user.AuthorityPrivileges;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import fr.insee.survey.datacollectionmanagement.exception.ImpossibleToDeleteException;
import fr.insee.survey.datacollectionmanagement.exception.NotFoundException;
@@ -9,8 +9,8 @@
import fr.insee.survey.datacollectionmanagement.questioning.dto.SearchSurveyUnitDto;
import fr.insee.survey.datacollectionmanagement.questioning.dto.SurveyUnitDetailsDto;
import fr.insee.survey.datacollectionmanagement.questioning.dto.SurveyUnitDto;
+import fr.insee.survey.datacollectionmanagement.questioning.enums.SurveyUnitParamEnum;
import fr.insee.survey.datacollectionmanagement.questioning.service.SurveyUnitService;
-import fr.insee.survey.datacollectionmanagement.questioning.util.SurveyUnitParamEnum;
import fr.insee.survey.datacollectionmanagement.questioning.validation.ValidSurveyUnitParam;
import fr.insee.survey.datacollectionmanagement.view.service.ViewService;
import io.swagger.v3.oas.annotations.Operation;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/controller/UploadController.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/controller/UploadController.java
similarity index 94%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/controller/UploadController.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/controller/UploadController.java
index c19219df..a4131832 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/controller/UploadController.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/controller/UploadController.java
@@ -1,7 +1,7 @@
package fr.insee.survey.datacollectionmanagement.questioning.controller;
-import fr.insee.survey.datacollectionmanagement.config.JSONCollectionWrapper;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityPrivileges;
+import fr.insee.survey.datacollectionmanagement.util.JSONCollectionWrapper;
+import fr.insee.survey.datacollectionmanagement.configuration.auth.user.AuthorityPrivileges;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import fr.insee.survey.datacollectionmanagement.exception.RessourceNotValidatedException;
import fr.insee.survey.datacollectionmanagement.query.domain.ResultUpload;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/validation/SurveyUnitParamValidator.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/validation/SurveyUnitParamValidator.java
similarity index 89%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/validation/SurveyUnitParamValidator.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/validation/SurveyUnitParamValidator.java
index bca32070..08fe5a79 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/validation/SurveyUnitParamValidator.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/validation/SurveyUnitParamValidator.java
@@ -1,6 +1,6 @@
package fr.insee.survey.datacollectionmanagement.questioning.validation;
-import fr.insee.survey.datacollectionmanagement.questioning.util.SurveyUnitParamEnum;
+import fr.insee.survey.datacollectionmanagement.questioning.enums.SurveyUnitParamEnum;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/validation/ValidSurveyUnitParam.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/validation/ValidSurveyUnitParam.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/validation/ValidSurveyUnitParam.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/validation/ValidSurveyUnitParam.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/user/controller/SourceAccreditationController.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/user/controller/SourceAccreditationController.java
similarity index 98%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/user/controller/SourceAccreditationController.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/user/controller/SourceAccreditationController.java
index e53d51a1..9686b64a 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/user/controller/SourceAccreditationController.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/user/controller/SourceAccreditationController.java
@@ -1,7 +1,7 @@
package fr.insee.survey.datacollectionmanagement.user.controller;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityPrivileges;
+import fr.insee.survey.datacollectionmanagement.configuration.auth.user.AuthorityPrivileges;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import fr.insee.survey.datacollectionmanagement.metadata.domain.Source;
import fr.insee.survey.datacollectionmanagement.metadata.service.SourceService;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/user/controller/UserController.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/user/controller/UserController.java
similarity index 96%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/user/controller/UserController.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/user/controller/UserController.java
index 834bc23c..dfe54895 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/user/controller/UserController.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/user/controller/UserController.java
@@ -1,6 +1,6 @@
package fr.insee.survey.datacollectionmanagement.user.controller;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityPrivileges;
+import fr.insee.survey.datacollectionmanagement.configuration.auth.user.AuthorityPrivileges;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import fr.insee.survey.datacollectionmanagement.exception.NotFoundException;
import fr.insee.survey.datacollectionmanagement.exception.NotMatchException;
@@ -9,6 +9,7 @@
import fr.insee.survey.datacollectionmanagement.user.domain.SourceAccreditation;
import fr.insee.survey.datacollectionmanagement.user.domain.User;
import fr.insee.survey.datacollectionmanagement.user.dto.UserDto;
+import fr.insee.survey.datacollectionmanagement.user.enums.UserRoleTypeEnum;
import fr.insee.survey.datacollectionmanagement.user.service.SourceAccreditationService;
import fr.insee.survey.datacollectionmanagement.user.service.UserService;
import io.swagger.v3.oas.annotations.Operation;
@@ -171,7 +172,7 @@ private User convertToEntity(UserDto userDto) throws ParseException {
User oldUser = userService.findByIdentifier(userDto.getIdentifier());
User user = modelMapper.map(userDto, User.class);
- user.setRole(User.UserRoleType.valueOf(userDto.getRole()));
+ user.setRole(UserRoleTypeEnum.valueOf(userDto.getRole()));
user.setUserEvents(oldUser.getUserEvents());
return user;
@@ -179,7 +180,7 @@ private User convertToEntity(UserDto userDto) throws ParseException {
private User convertToEntityNewUser(UserDto userDto) {
User user = modelMapper.map(userDto, User.class);
- user.setRole(User.UserRoleType.valueOf(userDto.getRole()));
+ user.setRole(UserRoleTypeEnum.valueOf(userDto.getRole()));
return user;
}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/user/controller/UserEventController.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/user/controller/UserEventController.java
similarity index 98%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/user/controller/UserEventController.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/user/controller/UserEventController.java
index ea6fc1ec..b91b2e38 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/user/controller/UserEventController.java
+++ b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/user/controller/UserEventController.java
@@ -1,7 +1,7 @@
package fr.insee.survey.datacollectionmanagement.user.controller;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityPrivileges;
+import fr.insee.survey.datacollectionmanagement.configuration.auth.user.AuthorityPrivileges;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import fr.insee.survey.datacollectionmanagement.user.domain.User;
import fr.insee.survey.datacollectionmanagement.user.domain.UserEvent;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/util/EmailValidatorRegex.java b/platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/util/EmailValidatorRegex.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/util/EmailValidatorRegex.java
rename to platine-management-api/src/main/java/fr/insee/survey/datacollectionmanagement/util/EmailValidatorRegex.java
diff --git a/src/main/resources/application.properties b/platine-management-api/src/main/resources/application.properties
similarity index 100%
rename from src/main/resources/application.properties
rename to platine-management-api/src/main/resources/application.properties
diff --git a/src/main/resources/banner.txt b/platine-management-api/src/main/resources/banner.txt
similarity index 100%
rename from src/main/resources/banner.txt
rename to platine-management-api/src/main/resources/banner.txt
diff --git a/src/test/java/fr/insee/survey/datacollectionmanagement/DatacollectionManagementApplicationTests.java b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/DatacollectionManagementApplicationTests.java
similarity index 100%
rename from src/test/java/fr/insee/survey/datacollectionmanagement/DatacollectionManagementApplicationTests.java
rename to platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/DatacollectionManagementApplicationTests.java
diff --git a/src/test/java/fr/insee/survey/datacollectionmanagement/config/AuthenticationUserProvider.java b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/configuration/AuthenticationUserProvider.java
similarity index 91%
rename from src/test/java/fr/insee/survey/datacollectionmanagement/config/AuthenticationUserProvider.java
rename to platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/configuration/AuthenticationUserProvider.java
index 1bf86718..2f7db5b7 100644
--- a/src/test/java/fr/insee/survey/datacollectionmanagement/config/AuthenticationUserProvider.java
+++ b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/configuration/AuthenticationUserProvider.java
@@ -1,6 +1,6 @@
-package fr.insee.survey.datacollectionmanagement.config;
+package fr.insee.survey.datacollectionmanagement.configuration;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityRoleEnum;
+import fr.insee.survey.datacollectionmanagement.constants.AuthorityRoleEnum;
import lombok.AllArgsConstructor;
import org.springframework.security.authentication.AnonymousAuthenticationToken;
import org.springframework.security.core.GrantedAuthority;
diff --git a/src/test/java/fr/insee/survey/datacollectionmanagement/contacts/controller/AddressControllerTest.java b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/contact/controller/AddressControllerTest.java
similarity index 96%
rename from src/test/java/fr/insee/survey/datacollectionmanagement/contacts/controller/AddressControllerTest.java
rename to platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/contact/controller/AddressControllerTest.java
index 9a27dc60..08c1a6fa 100644
--- a/src/test/java/fr/insee/survey/datacollectionmanagement/contacts/controller/AddressControllerTest.java
+++ b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/contact/controller/AddressControllerTest.java
@@ -1,7 +1,7 @@
-package fr.insee.survey.datacollectionmanagement.contacts.controller;
+package fr.insee.survey.datacollectionmanagement.contact.controller;
-import fr.insee.survey.datacollectionmanagement.config.AuthenticationUserProvider;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityRoleEnum;
+import fr.insee.survey.datacollectionmanagement.configuration.AuthenticationUserProvider;
+import fr.insee.survey.datacollectionmanagement.constants.AuthorityRoleEnum;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import fr.insee.survey.datacollectionmanagement.contact.domain.Address;
import fr.insee.survey.datacollectionmanagement.contact.domain.Contact;
diff --git a/src/test/java/fr/insee/survey/datacollectionmanagement/contacts/controller/ContactControllerTest.java b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/contact/controller/ContactControllerTest.java
similarity index 94%
rename from src/test/java/fr/insee/survey/datacollectionmanagement/contacts/controller/ContactControllerTest.java
rename to platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/contact/controller/ContactControllerTest.java
index 7752dc02..c181e7bc 100644
--- a/src/test/java/fr/insee/survey/datacollectionmanagement/contacts/controller/ContactControllerTest.java
+++ b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/contact/controller/ContactControllerTest.java
@@ -1,12 +1,13 @@
-package fr.insee.survey.datacollectionmanagement.contacts.controller;
+package fr.insee.survey.datacollectionmanagement.contact.controller;
-import fr.insee.survey.datacollectionmanagement.config.AuthenticationUserProvider;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityRoleEnum;
+import fr.insee.survey.datacollectionmanagement.configuration.AuthenticationUserProvider;
+import fr.insee.survey.datacollectionmanagement.constants.AuthorityRoleEnum;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import fr.insee.survey.datacollectionmanagement.contact.domain.Address;
import fr.insee.survey.datacollectionmanagement.contact.domain.Contact;
import fr.insee.survey.datacollectionmanagement.contact.domain.ContactEvent;
-import fr.insee.survey.datacollectionmanagement.contact.domain.ContactEvent.ContactEventType;
+import fr.insee.survey.datacollectionmanagement.contact.enums.ContactEventTypeEnum;
+import fr.insee.survey.datacollectionmanagement.contact.enums.GenderEnum;
import fr.insee.survey.datacollectionmanagement.contact.repository.ContactRepository;
import fr.insee.survey.datacollectionmanagement.contact.service.ContactEventService;
import fr.insee.survey.datacollectionmanagement.contact.service.ContactService;
@@ -104,7 +105,7 @@ void putContactCreateUpdateDelete() throws Exception {
List list = new ArrayList<>(contactEventService.findContactEventsByContact(contactFound));
// List list = new ArrayList<>(contactFound.getContactEvents());
assertEquals(1, list.size());
- assertEquals(ContactEventType.create, list.get(0).getType());
+ assertEquals(ContactEventTypeEnum.create, list.get(0).getType());
// update contact - status ok
contact.setLastName("lastNameUpdate");
@@ -119,7 +120,7 @@ void putContactCreateUpdateDelete() throws Exception {
List listUpdate = new ArrayList<>(
contactEventService.findContactEventsByContact(contactFoundAfterUpdate));
assertEquals(2, listUpdate.size());
- assertEquals(ContactEventType.update, listUpdate.get(1).getType());
+ assertEquals(ContactEventTypeEnum.update, listUpdate.get(1).getType());
// delete contact
mockMvc.perform(delete(Constants.API_CONTACTS_ID, identifier).contentType(MediaType.APPLICATION_JSON))
@@ -183,7 +184,7 @@ private Contact initContact(String identifier) {
contactMock.setEmail("test@insee.fr");
contactMock.setFirstName("firstName" + identifier);
contactMock.setLastName("lastName" + identifier);
- contactMock.setGender(Contact.Gender.Male);
+ contactMock.setGender(GenderEnum.Male);
return contactMock;
}
diff --git a/src/test/java/fr/insee/survey/datacollectionmanagement/contacts/controller/ContactEventControllerTest.java b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/contact/controller/ContactEventControllerTest.java
similarity index 91%
rename from src/test/java/fr/insee/survey/datacollectionmanagement/contacts/controller/ContactEventControllerTest.java
rename to platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/contact/controller/ContactEventControllerTest.java
index 141ef215..2934a58b 100644
--- a/src/test/java/fr/insee/survey/datacollectionmanagement/contacts/controller/ContactEventControllerTest.java
+++ b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/contact/controller/ContactEventControllerTest.java
@@ -1,7 +1,7 @@
-package fr.insee.survey.datacollectionmanagement.contacts.controller;
+package fr.insee.survey.datacollectionmanagement.contact.controller;
-import fr.insee.survey.datacollectionmanagement.config.AuthenticationUserProvider;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityRoleEnum;
+import fr.insee.survey.datacollectionmanagement.configuration.AuthenticationUserProvider;
+import fr.insee.survey.datacollectionmanagement.constants.AuthorityRoleEnum;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import org.json.JSONArray;
import org.json.JSONException;
diff --git a/src/test/java/fr/insee/survey/datacollectionmanagement/dataloader/DataloaderTest.java b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/dataloader/DataloaderTest.java
similarity index 95%
rename from src/test/java/fr/insee/survey/datacollectionmanagement/dataloader/DataloaderTest.java
rename to platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/dataloader/DataloaderTest.java
index db45fa7c..f80afd13 100644
--- a/src/test/java/fr/insee/survey/datacollectionmanagement/dataloader/DataloaderTest.java
+++ b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/dataloader/DataloaderTest.java
@@ -7,18 +7,20 @@
import fr.insee.survey.datacollectionmanagement.contact.domain.Address;
import fr.insee.survey.datacollectionmanagement.contact.domain.Contact;
import fr.insee.survey.datacollectionmanagement.contact.domain.ContactEvent;
-import fr.insee.survey.datacollectionmanagement.contact.domain.ContactEvent.ContactEventType;
+import fr.insee.survey.datacollectionmanagement.contact.enums.ContactEventTypeEnum;
+import fr.insee.survey.datacollectionmanagement.contact.enums.GenderEnum;
import fr.insee.survey.datacollectionmanagement.contact.repository.AddressRepository;
import fr.insee.survey.datacollectionmanagement.contact.repository.ContactEventRepository;
import fr.insee.survey.datacollectionmanagement.contact.repository.ContactRepository;
import fr.insee.survey.datacollectionmanagement.metadata.domain.*;
+import fr.insee.survey.datacollectionmanagement.metadata.enums.PeriodEnum;
+import fr.insee.survey.datacollectionmanagement.metadata.enums.PeriodicityEnum;
import fr.insee.survey.datacollectionmanagement.metadata.repository.*;
-import fr.insee.survey.datacollectionmanagement.metadata.util.PeriodEnum;
-import fr.insee.survey.datacollectionmanagement.metadata.util.PeriodicityEnum;
import fr.insee.survey.datacollectionmanagement.questioning.domain.*;
+import fr.insee.survey.datacollectionmanagement.questioning.enums.TypeQuestioningEvent;
import fr.insee.survey.datacollectionmanagement.questioning.repository.*;
-import fr.insee.survey.datacollectionmanagement.questioning.util.TypeQuestioningEvent;
import fr.insee.survey.datacollectionmanagement.user.domain.User;
+import fr.insee.survey.datacollectionmanagement.user.enums.UserRoleTypeEnum;
import fr.insee.survey.datacollectionmanagement.user.service.UserService;
import fr.insee.survey.datacollectionmanagement.view.domain.View;
import fr.insee.survey.datacollectionmanagement.view.repository.ViewRepository;
@@ -105,7 +107,7 @@ public void init() throws ParseException {
private void initUser() {
User user = new User();
user.setIdentifier("USER1");
- user.setRole(User.UserRoleType.ASSISTANCE);
+ user.setRole(UserRoleTypeEnum.ASSISTANCE);
userService.createUser(user, null);
}
@@ -158,7 +160,7 @@ private void createContactAddressAndEvents(int i) {
private void createContactEvent(Contact contact) {
ContactEvent contactEvent = new ContactEvent();
contactRepository.save(contact);
- contactEvent.setType(ContactEventType.create);
+ contactEvent.setType(ContactEventTypeEnum.create);
contactEvent.setEventDate(new Date());
contactEvent.setContact(contact);
String json = "{\"contact_identifier\":\"" + contact.getIdentifier() + "\",\"name\":\"" + contact.getLastName()
@@ -195,9 +197,9 @@ private Contact createContact(int i) {
contact.setLastName("lastName" + i);
contact.setEmail(contact.getFirstName() + contact.getLastName() + "@test.com");
if (i % 2 == 0)
- contact.setGender(Contact.Gender.Female);
+ contact.setGender(GenderEnum.Female);
if (i % 2 != 0)
- contact.setGender(Contact.Gender.Male);
+ contact.setGender(GenderEnum.Male);
return contact;
}
diff --git a/src/test/java/fr/insee/survey/datacollectionmanagement/integration/CucumberTest.java b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/integration/CucumberTest.java
similarity index 100%
rename from src/test/java/fr/insee/survey/datacollectionmanagement/integration/CucumberTest.java
rename to platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/integration/CucumberTest.java
diff --git a/src/test/java/fr/insee/survey/datacollectionmanagement/integration/QuestioningInformationsSteps.java b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/integration/QuestioningInformationsSteps.java
similarity index 97%
rename from src/test/java/fr/insee/survey/datacollectionmanagement/integration/QuestioningInformationsSteps.java
rename to platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/integration/QuestioningInformationsSteps.java
index 95dc9a6d..f26981cf 100644
--- a/src/test/java/fr/insee/survey/datacollectionmanagement/integration/QuestioningInformationsSteps.java
+++ b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/integration/QuestioningInformationsSteps.java
@@ -1,10 +1,11 @@
package fr.insee.survey.datacollectionmanagement.integration;
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
-import fr.insee.survey.datacollectionmanagement.config.AuthenticationUserProvider;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityRoleEnum;
+import fr.insee.survey.datacollectionmanagement.configuration.AuthenticationUserProvider;
+import fr.insee.survey.datacollectionmanagement.constants.AuthorityRoleEnum;
import fr.insee.survey.datacollectionmanagement.contact.domain.Address;
import fr.insee.survey.datacollectionmanagement.contact.domain.Contact;
+import fr.insee.survey.datacollectionmanagement.contact.enums.GenderEnum;
import fr.insee.survey.datacollectionmanagement.contact.repository.AddressRepository;
import fr.insee.survey.datacollectionmanagement.contact.repository.ContactRepository;
import fr.insee.survey.datacollectionmanagement.metadata.domain.Campaign;
@@ -142,7 +143,7 @@ public void createContact(String contactId, String firstName, String lastName, S
c.setIdentifier(contactId);
c.setFirstName(firstName);
c.setLastName(lastName);
- c.setGender(Contact.Gender.valueOf(gender));
+ c.setGender(GenderEnum.valueOf(gender));
Address address = new Address();
address.setStreetNumber(streetNumber);
addressRepository.save(address);
diff --git a/src/test/java/fr/insee/survey/datacollectionmanagement/integration/SearchContactSteps.java b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/integration/SearchContactSteps.java
similarity index 96%
rename from src/test/java/fr/insee/survey/datacollectionmanagement/integration/SearchContactSteps.java
rename to platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/integration/SearchContactSteps.java
index c6a163c2..9d738ed8 100644
--- a/src/test/java/fr/insee/survey/datacollectionmanagement/integration/SearchContactSteps.java
+++ b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/integration/SearchContactSteps.java
@@ -2,13 +2,13 @@
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
-import fr.insee.survey.datacollectionmanagement.config.AuthenticationUserProvider;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityRoleEnum;
+import fr.insee.survey.datacollectionmanagement.configuration.AuthenticationUserProvider;
+import fr.insee.survey.datacollectionmanagement.constants.AuthorityRoleEnum;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import fr.insee.survey.datacollectionmanagement.contact.domain.Contact;
import fr.insee.survey.datacollectionmanagement.contact.dto.SearchContactDtoImpl;
+import fr.insee.survey.datacollectionmanagement.contact.enums.ContactParamEnum;
import fr.insee.survey.datacollectionmanagement.contact.repository.ContactRepository;
-import fr.insee.survey.datacollectionmanagement.contact.util.ContactParamEnum;
import io.cucumber.datatable.DataTable;
import io.cucumber.java.en.Given;
import io.cucumber.java.en.Then;
diff --git a/src/test/java/fr/insee/survey/datacollectionmanagement/integration/SearchSurveyUnitSteps.java b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/integration/SearchSurveyUnitSteps.java
similarity index 95%
rename from src/test/java/fr/insee/survey/datacollectionmanagement/integration/SearchSurveyUnitSteps.java
rename to platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/integration/SearchSurveyUnitSteps.java
index 9a045e3f..972867f6 100644
--- a/src/test/java/fr/insee/survey/datacollectionmanagement/integration/SearchSurveyUnitSteps.java
+++ b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/integration/SearchSurveyUnitSteps.java
@@ -2,13 +2,13 @@
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
-import fr.insee.survey.datacollectionmanagement.config.AuthenticationUserProvider;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityRoleEnum;
+import fr.insee.survey.datacollectionmanagement.configuration.AuthenticationUserProvider;
+import fr.insee.survey.datacollectionmanagement.constants.AuthorityRoleEnum;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import fr.insee.survey.datacollectionmanagement.questioning.domain.SurveyUnit;
import fr.insee.survey.datacollectionmanagement.questioning.dto.SearchSurveyUnitDtoImpl;
+import fr.insee.survey.datacollectionmanagement.questioning.enums.SurveyUnitParamEnum;
import fr.insee.survey.datacollectionmanagement.questioning.repository.SurveyUnitRepository;
-import fr.insee.survey.datacollectionmanagement.questioning.util.SurveyUnitParamEnum;
import io.cucumber.datatable.DataTable;
import io.cucumber.java.en.Given;
import io.cucumber.java.en.Then;
diff --git a/src/test/java/fr/insee/survey/datacollectionmanagement/metadata/controller/CampaignControllerTest.java b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/metadata/controller/CampaignControllerTest.java
similarity index 97%
rename from src/test/java/fr/insee/survey/datacollectionmanagement/metadata/controller/CampaignControllerTest.java
rename to platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/metadata/controller/CampaignControllerTest.java
index c83d4f3e..36700637 100644
--- a/src/test/java/fr/insee/survey/datacollectionmanagement/metadata/controller/CampaignControllerTest.java
+++ b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/metadata/controller/CampaignControllerTest.java
@@ -1,13 +1,13 @@
package fr.insee.survey.datacollectionmanagement.metadata.controller;
-import fr.insee.survey.datacollectionmanagement.config.AuthenticationUserProvider;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityRoleEnum;
+import fr.insee.survey.datacollectionmanagement.configuration.AuthenticationUserProvider;
+import fr.insee.survey.datacollectionmanagement.constants.AuthorityRoleEnum;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import fr.insee.survey.datacollectionmanagement.metadata.domain.Campaign;
import fr.insee.survey.datacollectionmanagement.metadata.domain.Partitioning;
+import fr.insee.survey.datacollectionmanagement.metadata.enums.PeriodEnum;
import fr.insee.survey.datacollectionmanagement.metadata.service.CampaignService;
-import fr.insee.survey.datacollectionmanagement.metadata.util.PeriodEnum;
import fr.insee.survey.datacollectionmanagement.util.JsonUtil;
import net.minidev.json.JSONObject;
import org.assertj.core.util.DateUtil;
diff --git a/src/test/java/fr/insee/survey/datacollectionmanagement/metadata/controller/SourceControllerTest.java b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/metadata/controller/SourceControllerTest.java
similarity index 96%
rename from src/test/java/fr/insee/survey/datacollectionmanagement/metadata/controller/SourceControllerTest.java
rename to platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/metadata/controller/SourceControllerTest.java
index 8e49cf6b..809bc05b 100644
--- a/src/test/java/fr/insee/survey/datacollectionmanagement/metadata/controller/SourceControllerTest.java
+++ b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/metadata/controller/SourceControllerTest.java
@@ -1,13 +1,13 @@
package fr.insee.survey.datacollectionmanagement.metadata.controller;
-import fr.insee.survey.datacollectionmanagement.config.AuthenticationUserProvider;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityRoleEnum;
+import fr.insee.survey.datacollectionmanagement.configuration.AuthenticationUserProvider;
+import fr.insee.survey.datacollectionmanagement.constants.AuthorityRoleEnum;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import fr.insee.survey.datacollectionmanagement.exception.NotFoundException;
import fr.insee.survey.datacollectionmanagement.metadata.domain.Source;
+import fr.insee.survey.datacollectionmanagement.metadata.enums.PeriodicityEnum;
import fr.insee.survey.datacollectionmanagement.metadata.repository.SourceRepository;
import fr.insee.survey.datacollectionmanagement.metadata.service.SourceService;
-import fr.insee.survey.datacollectionmanagement.metadata.util.PeriodicityEnum;
import fr.insee.survey.datacollectionmanagement.util.JsonUtil;
import org.json.JSONException;
import org.json.JSONObject;
diff --git a/src/test/java/fr/insee/survey/datacollectionmanagement/metadata/controller/SurveyControllerTest.java b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/metadata/controller/SurveyControllerTest.java
similarity index 97%
rename from src/test/java/fr/insee/survey/datacollectionmanagement/metadata/controller/SurveyControllerTest.java
rename to platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/metadata/controller/SurveyControllerTest.java
index 0f330c09..e4cf7c7a 100644
--- a/src/test/java/fr/insee/survey/datacollectionmanagement/metadata/controller/SurveyControllerTest.java
+++ b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/metadata/controller/SurveyControllerTest.java
@@ -1,7 +1,7 @@
package fr.insee.survey.datacollectionmanagement.metadata.controller;
-import fr.insee.survey.datacollectionmanagement.config.AuthenticationUserProvider;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityRoleEnum;
+import fr.insee.survey.datacollectionmanagement.configuration.AuthenticationUserProvider;
+import fr.insee.survey.datacollectionmanagement.constants.AuthorityRoleEnum;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import fr.insee.survey.datacollectionmanagement.exception.NotFoundException;
import fr.insee.survey.datacollectionmanagement.metadata.domain.Survey;
diff --git a/src/test/java/fr/insee/survey/datacollectionmanagement/query/controller/MoogControllerTest.java b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/query/controller/MoogControllerTest.java
similarity index 93%
rename from src/test/java/fr/insee/survey/datacollectionmanagement/query/controller/MoogControllerTest.java
rename to platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/query/controller/MoogControllerTest.java
index 55a26f24..b1c88355 100644
--- a/src/test/java/fr/insee/survey/datacollectionmanagement/query/controller/MoogControllerTest.java
+++ b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/query/controller/MoogControllerTest.java
@@ -1,7 +1,7 @@
package fr.insee.survey.datacollectionmanagement.query.controller;
-import fr.insee.survey.datacollectionmanagement.config.AuthenticationUserProvider;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityRoleEnum;
+import fr.insee.survey.datacollectionmanagement.configuration.AuthenticationUserProvider;
+import fr.insee.survey.datacollectionmanagement.constants.AuthorityRoleEnum;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
diff --git a/src/test/java/fr/insee/survey/datacollectionmanagement/query/controller/MyQuestioningsControllerTest.java b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/query/controller/MyQuestioningsControllerTest.java
similarity index 93%
rename from src/test/java/fr/insee/survey/datacollectionmanagement/query/controller/MyQuestioningsControllerTest.java
rename to platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/query/controller/MyQuestioningsControllerTest.java
index 42cdb355..aeba0487 100644
--- a/src/test/java/fr/insee/survey/datacollectionmanagement/query/controller/MyQuestioningsControllerTest.java
+++ b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/query/controller/MyQuestioningsControllerTest.java
@@ -1,8 +1,8 @@
package fr.insee.survey.datacollectionmanagement.query.controller;
import com.fasterxml.jackson.databind.ObjectMapper;
-import fr.insee.survey.datacollectionmanagement.config.AuthenticationUserProvider;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityRoleEnum;
+import fr.insee.survey.datacollectionmanagement.configuration.AuthenticationUserProvider;
+import fr.insee.survey.datacollectionmanagement.constants.AuthorityRoleEnum;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import fr.insee.survey.datacollectionmanagement.query.dto.MyQuestioningDto;
import fr.insee.survey.datacollectionmanagement.query.service.CheckHabilitationService;
diff --git a/src/test/java/fr/insee/survey/datacollectionmanagement/questioning/controller/QuestionningAccreditationControllerTest.java b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/questioning/controller/QuestionningAccreditationControllerTest.java
similarity index 97%
rename from src/test/java/fr/insee/survey/datacollectionmanagement/questioning/controller/QuestionningAccreditationControllerTest.java
rename to platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/questioning/controller/QuestionningAccreditationControllerTest.java
index bcee0a30..071c1e0e 100644
--- a/src/test/java/fr/insee/survey/datacollectionmanagement/questioning/controller/QuestionningAccreditationControllerTest.java
+++ b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/questioning/controller/QuestionningAccreditationControllerTest.java
@@ -1,7 +1,7 @@
package fr.insee.survey.datacollectionmanagement.questioning.controller;
-import fr.insee.survey.datacollectionmanagement.config.AuthenticationUserProvider;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityRoleEnum;
+import fr.insee.survey.datacollectionmanagement.configuration.AuthenticationUserProvider;
+import fr.insee.survey.datacollectionmanagement.constants.AuthorityRoleEnum;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import fr.insee.survey.datacollectionmanagement.questioning.domain.Questioning;
import fr.insee.survey.datacollectionmanagement.questioning.domain.QuestioningAccreditation;
diff --git a/src/test/java/fr/insee/survey/datacollectionmanagement/questioning/controller/QuestionningControllerTest.java b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/questioning/controller/QuestionningControllerTest.java
similarity index 95%
rename from src/test/java/fr/insee/survey/datacollectionmanagement/questioning/controller/QuestionningControllerTest.java
rename to platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/questioning/controller/QuestionningControllerTest.java
index 514ee4b3..f4d3074a 100644
--- a/src/test/java/fr/insee/survey/datacollectionmanagement/questioning/controller/QuestionningControllerTest.java
+++ b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/questioning/controller/QuestionningControllerTest.java
@@ -1,7 +1,7 @@
package fr.insee.survey.datacollectionmanagement.questioning.controller;
-import fr.insee.survey.datacollectionmanagement.config.AuthenticationUserProvider;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityRoleEnum;
+import fr.insee.survey.datacollectionmanagement.configuration.AuthenticationUserProvider;
+import fr.insee.survey.datacollectionmanagement.constants.AuthorityRoleEnum;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import fr.insee.survey.datacollectionmanagement.questioning.domain.Questioning;
import fr.insee.survey.datacollectionmanagement.questioning.service.QuestioningService;
diff --git a/src/test/java/fr/insee/survey/datacollectionmanagement/questioning/controller/QuestionningEventControllerTest.java b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/questioning/controller/QuestionningEventControllerTest.java
similarity index 94%
rename from src/test/java/fr/insee/survey/datacollectionmanagement/questioning/controller/QuestionningEventControllerTest.java
rename to platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/questioning/controller/QuestionningEventControllerTest.java
index 3afe65c9..1c7adf0e 100644
--- a/src/test/java/fr/insee/survey/datacollectionmanagement/questioning/controller/QuestionningEventControllerTest.java
+++ b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/questioning/controller/QuestionningEventControllerTest.java
@@ -1,7 +1,7 @@
package fr.insee.survey.datacollectionmanagement.questioning.controller;
-import fr.insee.survey.datacollectionmanagement.config.AuthenticationUserProvider;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityRoleEnum;
+import fr.insee.survey.datacollectionmanagement.configuration.AuthenticationUserProvider;
+import fr.insee.survey.datacollectionmanagement.constants.AuthorityRoleEnum;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import fr.insee.survey.datacollectionmanagement.questioning.domain.Questioning;
import fr.insee.survey.datacollectionmanagement.questioning.service.QuestioningService;
diff --git a/src/test/java/fr/insee/survey/datacollectionmanagement/questioning/controller/SurveyUnitControllerTest.java b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/questioning/controller/SurveyUnitControllerTest.java
similarity index 98%
rename from src/test/java/fr/insee/survey/datacollectionmanagement/questioning/controller/SurveyUnitControllerTest.java
rename to platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/questioning/controller/SurveyUnitControllerTest.java
index 0d15aa7a..5244b083 100644
--- a/src/test/java/fr/insee/survey/datacollectionmanagement/questioning/controller/SurveyUnitControllerTest.java
+++ b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/questioning/controller/SurveyUnitControllerTest.java
@@ -1,7 +1,7 @@
package fr.insee.survey.datacollectionmanagement.questioning.controller;
-import fr.insee.survey.datacollectionmanagement.config.AuthenticationUserProvider;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityRoleEnum;
+import fr.insee.survey.datacollectionmanagement.configuration.AuthenticationUserProvider;
+import fr.insee.survey.datacollectionmanagement.constants.AuthorityRoleEnum;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import fr.insee.survey.datacollectionmanagement.exception.NotFoundException;
import fr.insee.survey.datacollectionmanagement.questioning.domain.SurveyUnit;
diff --git a/src/test/java/fr/insee/survey/datacollectionmanagement/user/controller/controller/UserControllerTest.java b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/user/controller/UserControllerTest.java
similarity index 90%
rename from src/test/java/fr/insee/survey/datacollectionmanagement/user/controller/controller/UserControllerTest.java
rename to platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/user/controller/UserControllerTest.java
index 0f05fc3b..9dd3e584 100644
--- a/src/test/java/fr/insee/survey/datacollectionmanagement/user/controller/controller/UserControllerTest.java
+++ b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/user/controller/UserControllerTest.java
@@ -1,12 +1,13 @@
-package fr.insee.survey.datacollectionmanagement.user.controller.controller;
+package fr.insee.survey.datacollectionmanagement.user.controller;
-import fr.insee.survey.datacollectionmanagement.config.AuthenticationUserProvider;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityRoleEnum;
+import fr.insee.survey.datacollectionmanagement.configuration.AuthenticationUserProvider;
+import fr.insee.survey.datacollectionmanagement.constants.AuthorityRoleEnum;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import fr.insee.survey.datacollectionmanagement.exception.NotFoundException;
import fr.insee.survey.datacollectionmanagement.user.domain.User;
import fr.insee.survey.datacollectionmanagement.user.domain.UserEvent;
-import fr.insee.survey.datacollectionmanagement.user.domain.UserEvent.UserEventType;
+import fr.insee.survey.datacollectionmanagement.user.enums.UserEventTypeEnum;
+import fr.insee.survey.datacollectionmanagement.user.enums.UserRoleTypeEnum;
import fr.insee.survey.datacollectionmanagement.user.repository.UserRepository;
import fr.insee.survey.datacollectionmanagement.user.service.UserEventService;
import fr.insee.survey.datacollectionmanagement.user.service.UserService;
@@ -101,17 +102,17 @@ void putUserCreateUpdateDelete() throws Exception {
assertEquals(user.getRole(), userFound.getRole());
// update user - status ok
- user.setRole(User.UserRoleType.ASSISTANCE);
+ user.setRole(UserRoleTypeEnum.ASSISTANCE);
String jsonUserUpdate = createJson(user);
mockMvc.perform(put(Constants.API_USERS_ID, identifier).content(jsonUserUpdate)
.contentType(MediaType.APPLICATION_JSON)).andExpect(status().isOk())
.andExpect(content().json(jsonUserUpdate.toString(), false));
User userFoundAfterUpdate = userService.findByIdentifier(identifier);
- assertEquals(User.UserRoleType.ASSISTANCE, userFoundAfterUpdate.getRole());
+ assertEquals(UserRoleTypeEnum.ASSISTANCE, userFoundAfterUpdate.getRole());
List listUpdate = new ArrayList<>(
userEventService.findUserEventsByUser(userFoundAfterUpdate));
assertEquals(2, listUpdate.size());
- assertEquals(UserEventType.UPDATE, listUpdate.get(1).getType());
+ assertEquals(UserEventTypeEnum.UPDATE, listUpdate.get(1).getType());
// delete user
mockMvc.perform(delete(Constants.API_USERS_ID, identifier).contentType(MediaType.APPLICATION_JSON))
@@ -140,10 +141,10 @@ void putUsersErrorId() throws Exception {
}
private User initGestionnaire(String identifier) {
- return initUser(identifier, User.UserRoleType.GESTIONNAIRE);
+ return initUser(identifier, UserRoleTypeEnum.GESTIONNAIRE);
}
- private User initUser(String identifier, User.UserRoleType role) {
+ private User initUser(String identifier, UserRoleTypeEnum role) {
User userMock = new User();
userMock.setIdentifier(identifier);
userMock.setRole(role);
diff --git a/src/test/java/fr/insee/survey/datacollectionmanagement/user/controller/controller/UserEventControllerTest.java b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/user/controller/UserEventControllerTest.java
similarity index 89%
rename from src/test/java/fr/insee/survey/datacollectionmanagement/user/controller/controller/UserEventControllerTest.java
rename to platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/user/controller/UserEventControllerTest.java
index a4a8e15c..8ec9e06b 100644
--- a/src/test/java/fr/insee/survey/datacollectionmanagement/user/controller/controller/UserEventControllerTest.java
+++ b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/user/controller/UserEventControllerTest.java
@@ -1,9 +1,10 @@
-package fr.insee.survey.datacollectionmanagement.user.controller.controller;
+package fr.insee.survey.datacollectionmanagement.user.controller;
-import fr.insee.survey.datacollectionmanagement.config.AuthenticationUserProvider;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityRoleEnum;
+import fr.insee.survey.datacollectionmanagement.configuration.AuthenticationUserProvider;
+import fr.insee.survey.datacollectionmanagement.constants.AuthorityRoleEnum;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
import fr.insee.survey.datacollectionmanagement.user.domain.UserEvent;
+import fr.insee.survey.datacollectionmanagement.user.enums.UserEventTypeEnum;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
@@ -59,7 +60,7 @@ private String createJsonUserEvent(String identifier, JSONObject payload) throws
JSONObject jo = new JSONObject();
JSONObject joPayload = new JSONObject();
joPayload.put("identifier", identifier);
- joPayload.put("type", UserEvent.UserEventType.CREATE.name());
+ joPayload.put("type", UserEventTypeEnum.CREATE.name());
jo.put("payload", payload);
JSONArray ja = new JSONArray();
ja.put(jo);
diff --git a/src/test/java/fr/insee/survey/datacollectionmanagement/util/EmailValidatorTest.java b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/util/EmailValidatorRegexTest.java
similarity index 98%
rename from src/test/java/fr/insee/survey/datacollectionmanagement/util/EmailValidatorTest.java
rename to platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/util/EmailValidatorRegexTest.java
index a5b8208d..c9e18670 100644
--- a/src/test/java/fr/insee/survey/datacollectionmanagement/util/EmailValidatorTest.java
+++ b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/util/EmailValidatorRegexTest.java
@@ -6,7 +6,7 @@
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
-class EmailValidatorTest {
+class EmailValidatorRegexTest {
@Test
@DisplayName("Check valid email")
diff --git a/src/test/java/fr/insee/survey/datacollectionmanagement/util/JsonUtil.java b/platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/util/JsonUtil.java
similarity index 100%
rename from src/test/java/fr/insee/survey/datacollectionmanagement/util/JsonUtil.java
rename to platine-management-api/src/test/java/fr/insee/survey/datacollectionmanagement/util/JsonUtil.java
diff --git a/src/test/resources/application.properties b/platine-management-api/src/test/resources/application.properties
similarity index 100%
rename from src/test/resources/application.properties
rename to platine-management-api/src/test/resources/application.properties
diff --git a/src/test/resources/data.sql b/platine-management-api/src/test/resources/data.sql
similarity index 100%
rename from src/test/resources/data.sql
rename to platine-management-api/src/test/resources/data.sql
diff --git a/src/test/resources/integration/query/get_questioning_informations.feature b/platine-management-api/src/test/resources/integration/query/get_questioning_informations.feature
similarity index 100%
rename from src/test/resources/integration/query/get_questioning_informations.feature
rename to platine-management-api/src/test/resources/integration/query/get_questioning_informations.feature
diff --git a/src/test/resources/integration/query/search_contact.feature b/platine-management-api/src/test/resources/integration/query/search_contact.feature
similarity index 100%
rename from src/test/resources/integration/query/search_contact.feature
rename to platine-management-api/src/test/resources/integration/query/search_contact.feature
diff --git a/src/test/resources/integration/query/search_survey_unit.feature b/platine-management-api/src/test/resources/integration/query/search_survey_unit.feature
similarity index 100%
rename from src/test/resources/integration/query/search_survey_unit.feature
rename to platine-management-api/src/test/resources/integration/query/search_survey_unit.feature
diff --git a/platine-management-db/pom.xml b/platine-management-db/pom.xml
new file mode 100644
index 00000000..1ce2efe2
--- /dev/null
+++ b/platine-management-db/pom.xml
@@ -0,0 +1,36 @@
+
+
+ 4.0.0
+
+ fr.insee.survey
+ platine-management
+ ${revision}${changelist}
+
+
+ platine-management-db
+
+
+ 42.7.3
+
+
+
+
+ fr.insee.survey
+ platine-management-shared
+ ${project.version}
+
+
+
+ org.springframework.boot
+ spring-boot-starter-data-jpa
+
+
+
+ org.postgresql
+ postgresql
+ ${postgres-version}
+
+
+
\ No newline at end of file
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/domain/Address.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/contact/domain/Address.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/contact/domain/Address.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/contact/domain/Address.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/domain/Contact.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/contact/domain/Contact.java
similarity index 92%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/contact/domain/Contact.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/contact/domain/Contact.java
index 1f46a1e2..6c6b67c1 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/domain/Contact.java
+++ b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/contact/domain/Contact.java
@@ -1,5 +1,6 @@
package fr.insee.survey.datacollectionmanagement.contact.domain;
+import fr.insee.survey.datacollectionmanagement.contact.enums.GenderEnum;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
@@ -18,10 +19,6 @@
@Setter
public class Contact {
- public enum Gender {
- Female, Male, Undefined
- }
-
@Id
private String identifier;
@@ -45,6 +42,6 @@ public enum Gender {
private Set contactEvents;
@Enumerated(EnumType.STRING)
- private Gender gender;
+ private GenderEnum gender;
}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/domain/ContactEvent.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/contact/domain/ContactEvent.java
similarity index 86%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/contact/domain/ContactEvent.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/contact/domain/ContactEvent.java
index 8acd1999..01703fa5 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/domain/ContactEvent.java
+++ b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/contact/domain/ContactEvent.java
@@ -1,6 +1,7 @@
package fr.insee.survey.datacollectionmanagement.contact.domain;
import com.fasterxml.jackson.databind.JsonNode;
+import fr.insee.survey.datacollectionmanagement.contact.enums.ContactEventTypeEnum;
import jakarta.persistence.*;
import lombok.*;
import org.hibernate.annotations.JdbcTypeCode;
@@ -14,10 +15,6 @@
@NoArgsConstructor
public class ContactEvent {
- public enum ContactEventType {
- create, update, merged, firstConnect, reinitPassword
- }
-
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "contact_event_seq")
private Long id;
@@ -25,7 +22,7 @@ public enum ContactEventType {
@JdbcTypeCode(SqlTypes.INTEGER)
@Enumerated(EnumType.ORDINAL)
- private ContactEventType type;
+ private ContactEventTypeEnum type;
@ManyToOne
private Contact contact;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/repository/AddressRepository.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/contact/repository/AddressRepository.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/contact/repository/AddressRepository.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/contact/repository/AddressRepository.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/repository/ContactEventRepository.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/contact/repository/ContactEventRepository.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/contact/repository/ContactEventRepository.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/contact/repository/ContactEventRepository.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/repository/ContactRepository.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/contact/repository/ContactRepository.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/contact/repository/ContactRepository.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/contact/repository/ContactRepository.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/Campaign.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/Campaign.java
similarity index 92%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/Campaign.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/Campaign.java
index 9f533506..d880e9a3 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/Campaign.java
+++ b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/Campaign.java
@@ -1,6 +1,6 @@
package fr.insee.survey.datacollectionmanagement.metadata.domain;
-import fr.insee.survey.datacollectionmanagement.metadata.util.PeriodEnum;
+import fr.insee.survey.datacollectionmanagement.metadata.enums.PeriodEnum;
import jakarta.persistence.*;
import lombok.*;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/CampaignEvent.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/CampaignEvent.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/CampaignEvent.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/CampaignEvent.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/Owner.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/Owner.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/Owner.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/Owner.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/Parameters.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/Parameters.java
similarity index 79%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/Parameters.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/Parameters.java
index 449580d4..2a0b0f04 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/Parameters.java
+++ b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/Parameters.java
@@ -1,22 +1,17 @@
package fr.insee.survey.datacollectionmanagement.metadata.domain;
+import fr.insee.survey.datacollectionmanagement.metadata.enums.ParameterEnum;
import jakarta.persistence.Entity;
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import jakarta.persistence.Id;
import jakarta.persistence.*;
import lombok.Data;
-import lombok.Getter;
@Entity
@Data
public class Parameters {
- @Getter
- public enum ParameterEnum {
- URL_REDIRECTION,URL_TYPE, MAIL_ASSISTANCE;
- }
-
@Id
private String metadataId;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/Partitioning.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/Partitioning.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/Partitioning.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/Partitioning.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/Source.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/Source.java
similarity index 93%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/Source.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/Source.java
index 4b238000..5df06555 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/Source.java
+++ b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/Source.java
@@ -1,6 +1,6 @@
package fr.insee.survey.datacollectionmanagement.metadata.domain;
-import fr.insee.survey.datacollectionmanagement.metadata.util.PeriodicityEnum;
+import fr.insee.survey.datacollectionmanagement.metadata.enums.PeriodicityEnum;
import fr.insee.survey.datacollectionmanagement.user.domain.SourceAccreditation;
import jakarta.persistence.*;
import lombok.*;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/Support.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/Support.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/Support.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/Support.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/Survey.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/Survey.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/Survey.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/domain/Survey.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/repository/CampaignEventRepository.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/repository/CampaignEventRepository.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/repository/CampaignEventRepository.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/repository/CampaignEventRepository.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/repository/CampaignRepository.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/repository/CampaignRepository.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/repository/CampaignRepository.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/repository/CampaignRepository.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/repository/OwnerRepository.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/repository/OwnerRepository.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/repository/OwnerRepository.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/repository/OwnerRepository.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/repository/PartitioningRepository.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/repository/PartitioningRepository.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/repository/PartitioningRepository.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/repository/PartitioningRepository.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/repository/SourceRepository.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/repository/SourceRepository.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/repository/SourceRepository.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/repository/SourceRepository.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/repository/SupportRepository.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/repository/SupportRepository.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/repository/SupportRepository.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/repository/SupportRepository.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/repository/SurveyRepository.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/repository/SurveyRepository.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/repository/SurveyRepository.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/repository/SurveyRepository.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/domain/MoogCampaign.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/query/domain/MoogCampaign.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/domain/MoogCampaign.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/query/domain/MoogCampaign.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/domain/QuestioningInformations.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/query/domain/QuestioningInformations.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/domain/QuestioningInformations.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/query/domain/QuestioningInformations.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/domain/ResultUpload.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/query/domain/ResultUpload.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/domain/ResultUpload.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/query/domain/ResultUpload.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/repository/InformationsRepository.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/query/repository/InformationsRepository.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/repository/InformationsRepository.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/query/repository/InformationsRepository.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/repository/MonitoringRepository.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/query/repository/MonitoringRepository.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/repository/MonitoringRepository.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/query/repository/MonitoringRepository.java
diff --git a/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/query/repository/MoogRepository.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/query/repository/MoogRepository.java
new file mode 100644
index 00000000..1bebe48b
--- /dev/null
+++ b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/query/repository/MoogRepository.java
@@ -0,0 +1,211 @@
+package fr.insee.survey.datacollectionmanagement.query.repository;
+
+import fr.insee.survey.datacollectionmanagement.contact.repository.AddressRepository;
+import fr.insee.survey.datacollectionmanagement.query.dto.MoogExtractionRowDto;
+import fr.insee.survey.datacollectionmanagement.query.dto.MoogQuestioningEventDto;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.jdbc.core.RowMapper;
+import org.springframework.stereotype.Repository;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.List;
+
+@Repository
+@RequiredArgsConstructor
+@Slf4j
+public class MoogRepository {
+
+ private final JdbcTemplate jdbcTemplate;
+
+ private final AddressRepository addressRepository;
+
+ final String getEventsQuery = "SELECT qe.id, date, type, survey_unit_id_su, campaign_id "
+ + " FROM questioning_event qe join questioning q on qe.questioning_id=q.id join partitioning p on q.id_partitioning=p.id "
+ + " WHERE survey_unit_id_su=? AND campaign_id=? ";
+
+
+ public List getEventsByIdSuByCampaign(String idCampaign, String idSu) {
+ return jdbcTemplate.query(getEventsQuery, new RowMapper() {
+ public MoogQuestioningEventDto mapRow(ResultSet rs, int rowNum) throws SQLException {
+ MoogQuestioningEventDto moogEvent = new MoogQuestioningEventDto();
+ moogEvent.setIdManagementMonitoringInfo(rs.getString("id"));
+ moogEvent.setStatus(rs.getString("type"));
+ moogEvent.setDateInfo(rs.getTimestamp("date").getTime());
+ return moogEvent;
+ }
+ }, new Object[]{idSu, idCampaign});
+ }
+
+ final String extractionQuery =
+ """
+ select
+ id_su,
+ identifier as id_contact,
+ first_name as firstname,
+ last_name as lastname,
+ address_id as address,
+ date as dateinfo,
+ type as status,
+ batch_num
+ from
+ (
+ select
+ id,
+ campaign_id,
+ A.id_su,
+ A.identifier,
+ first_name,
+ last_name,
+ address_id,
+ id_partitioning as batch_num
+ from
+ (
+ select
+ campaign_id,
+ id_su,
+ contact.identifier,
+ first_name,
+ last_name,
+ address_id
+ from
+ view
+ left join contact on
+ contact.identifier = view.identifier
+ where
+ campaign_id = ?
+ ) as A
+ left join questioning q on
+ A.id_su = q.survey_unit_id_su
+ and q.id_partitioning in (
+ select
+ id
+ from
+ partitioning p
+ where
+ p.campaign_id = ?)
+ ) as B
+ left join questioning_event on
+ B.id = questioning_event.questioning_id
+ """;
+
+
+ public List getExtraction(String idCampaign) {
+ return jdbcTemplate.query(extractionQuery, new RowMapper() {
+
+ public MoogExtractionRowDto mapRow(ResultSet rs, int rowNum) throws SQLException {
+ MoogExtractionRowDto ev = new MoogExtractionRowDto();
+
+ ev.setAddress("addresse non connue");
+
+ ev.setStatus(rs.getString("status"));
+ ev.setDateInfo(rs.getString("dateinfo"));
+ ev.setIdSu(rs.getString("id_su"));
+ ev.setIdContact(rs.getString("id_contact"));
+ ev.setLastname(rs.getString("lastname"));
+ ev.setFirstname(rs.getString("firstname"));
+ addressRepository
+ .findById(rs.getLong("address"))
+ .ifPresentOrElse(
+ address -> ev.setAddress(address.toStringMoog()),
+ () -> log.info("Address not found")
+ );
+
+ ev.setBatchNumber(rs.getString("batch_num"));
+
+ return ev;
+ }
+ }, new Object[]{idCampaign, idCampaign});
+ }
+
+ final String surveyUnitFollowUpQuery = """
+ select
+ distinct on
+ (id_su) id_su,
+ batch_num,
+ case
+ when type in ('PND') then 1
+ else 0
+ end as PND
+ from
+ (
+ select
+ A.id_su,
+ A.identifier,
+ q.id,
+ q.id_partitioning as batch_num
+ from
+ (
+ select
+ id_su,
+ identifier
+ from
+ public.view v
+ where
+ campaign_id = ?)as A
+ left join questioning q on
+ q.survey_unit_id_su = A.id_su
+ and q.id_partitioning in (
+ select
+ id
+ from
+ partitioning p
+ where
+ p.campaign_id = ?)) as B
+ left join questioning_event qe on
+ B.id = qe.questioning_id
+ where
+ B.id_su not in (
+ select
+ distinct on
+ (id_su) id_su
+ from
+ (
+ select
+ id_su,
+ identifier,
+ id,
+ id_partitioning as batch_num
+ from
+ (
+ select
+ id_su,
+ identifier
+ from
+ public.view
+ where
+ campaign_id = ?)as A
+ left join questioning q on
+ q.survey_unit_id_su = A.id_su
+ and q.id_partitioning in (
+ select
+ id
+ from
+ partitioning p
+ where
+ p.campaign_id = ?)) as B
+ left join questioning_event on
+ B.id = questioning_event.questioning_id
+ where
+ type in ('VALINT', 'VALPAP', 'HC', 'REFUSAL', 'WASTE'))
+ order by
+ id_su,
+ pnd desc;
+ """;
+
+ public List getSurveyUnitToFollowUp(String idCampaign) {
+ return jdbcTemplate.query(surveyUnitFollowUpQuery,
+ new RowMapper() {
+ public MoogExtractionRowDto mapRow(ResultSet rs, int rowNum) throws SQLException {
+ MoogExtractionRowDto er = new MoogExtractionRowDto();
+ er.setIdSu(rs.getString("id_su"));
+ er.setPnd(rs.getInt("PND"));
+ er.setBatchNumber(rs.getString("batch_num"));
+
+ return er;
+ }
+ }, new Object[]{idCampaign, idCampaign, idCampaign, idCampaign});
+ }
+}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/EventOrder.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/EventOrder.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/EventOrder.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/EventOrder.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/Operator.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/Operator.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/Operator.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/Operator.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/OperatorService.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/OperatorService.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/OperatorService.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/OperatorService.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/Questioning.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/Questioning.java
similarity index 96%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/Questioning.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/Questioning.java
index a9b088e6..7465e316 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/Questioning.java
+++ b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/Questioning.java
@@ -1,40 +1,40 @@
-package fr.insee.survey.datacollectionmanagement.questioning.domain;
-
-import jakarta.persistence.*;
-import lombok.*;
-
-import java.util.Set;
-
-@Entity
-@Getter
-@Setter@NoArgsConstructor
-@Table(indexes = {
- @Index(name = "idPartitioning_index", columnList = "idPartitioning"),
- @Index(name = "surveyUnitId_index", columnList = "survey_unit_id_su")
-
-})
-public class Questioning {
-
- @Id
- @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "questioning_seq")
- private Long id;
-
- @NonNull
- private String modelName;
- @NonNull
- private String idPartitioning;
-
- @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
- private Set questioningAccreditations;
-
- @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
- private Set questioningEvents;
-
- @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
- private Set questioningCommunications;
-
- @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
- @NonNull
- private SurveyUnit surveyUnit;
-
-}
+package fr.insee.survey.datacollectionmanagement.questioning.domain;
+
+import jakarta.persistence.*;
+import lombok.*;
+
+import java.util.Set;
+
+@Entity
+@Getter
+@Setter@NoArgsConstructor
+@Table(indexes = {
+ @Index(name = "idPartitioning_index", columnList = "idPartitioning"),
+ @Index(name = "surveyUnitId_index", columnList = "survey_unit_id_su")
+
+})
+public class Questioning {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "questioning_seq")
+ private Long id;
+
+ @NonNull
+ private String modelName;
+ @NonNull
+ private String idPartitioning;
+
+ @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+ private Set questioningAccreditations;
+
+ @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+ private Set questioningEvents;
+
+ @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+ private Set questioningCommunications;
+
+ @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+ @NonNull
+ private SurveyUnit surveyUnit;
+
+}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/QuestioningAccreditation.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/QuestioningAccreditation.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/QuestioningAccreditation.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/QuestioningAccreditation.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/QuestioningCommunication.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/QuestioningCommunication.java
similarity index 79%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/QuestioningCommunication.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/QuestioningCommunication.java
index ef75832f..654d99ef 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/QuestioningCommunication.java
+++ b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/QuestioningCommunication.java
@@ -1,7 +1,7 @@
package fr.insee.survey.datacollectionmanagement.questioning.domain;
-import fr.insee.survey.datacollectionmanagement.questioning.util.StatusCommunication;
-import fr.insee.survey.datacollectionmanagement.questioning.util.TypeCommunicationEvent;
+import fr.insee.survey.datacollectionmanagement.questioning.enums.StatusCommunication;
+import fr.insee.survey.datacollectionmanagement.questioning.enums.TypeCommunicationEvent;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/QuestioningEvent.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/QuestioningEvent.java
similarity index 90%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/QuestioningEvent.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/QuestioningEvent.java
index aac2ce8f..06e16a88 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/QuestioningEvent.java
+++ b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/QuestioningEvent.java
@@ -1,57 +1,57 @@
-package fr.insee.survey.datacollectionmanagement.questioning.domain;
-
-import com.fasterxml.jackson.annotation.JsonManagedReference;
-import com.fasterxml.jackson.databind.JsonNode;
-import fr.insee.survey.datacollectionmanagement.questioning.util.TypeQuestioningEvent;
-import jakarta.persistence.*;
-import lombok.Getter;
-import lombok.Setter;
-import org.hibernate.annotations.JdbcTypeCode;
-import org.hibernate.type.SqlTypes;
-
-import java.util.Date;
-
-@Entity
-@Getter
-@Setter
-@Table(indexes = {
- @Index(name = "idQuestioning_index", columnList = "questioning_id")
-})
-public class QuestioningEvent {
-
- @Id
- @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "questioning_event_seq")
- private Long id;
-
- private Date date;
- @Enumerated(EnumType.STRING)
- private TypeQuestioningEvent type;
-
- @ManyToOne
- private Questioning questioning;
-
- @ManyToOne(fetch = FetchType.EAGER)
- @JoinColumn(name = "id_upload")
- @JsonManagedReference
- private Upload upload;
-
- @JdbcTypeCode(SqlTypes.JSON)
- @Column(columnDefinition = "jsonb")
- private JsonNode payload;
-
- public QuestioningEvent(Date date, TypeQuestioningEvent type, Questioning questioning) {
- this.date = date;
- this.type = type;
- this.questioning = questioning;
- }
-
- public QuestioningEvent() {
- }
-
- @Override
- public String toString() {
- return "QuestioningEvent [id=" + id + ", date=" + date + ", type=" + type + ", payload=" + payload
- + "]";
- }
-
-}
+package fr.insee.survey.datacollectionmanagement.questioning.domain;
+
+import com.fasterxml.jackson.annotation.JsonManagedReference;
+import com.fasterxml.jackson.databind.JsonNode;
+import fr.insee.survey.datacollectionmanagement.questioning.enums.TypeQuestioningEvent;
+import jakarta.persistence.*;
+import lombok.Getter;
+import lombok.Setter;
+import org.hibernate.annotations.JdbcTypeCode;
+import org.hibernate.type.SqlTypes;
+
+import java.util.Date;
+
+@Entity
+@Getter
+@Setter
+@Table(indexes = {
+ @Index(name = "idQuestioning_index", columnList = "questioning_id")
+})
+public class QuestioningEvent {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "questioning_event_seq")
+ private Long id;
+
+ private Date date;
+ @Enumerated(EnumType.STRING)
+ private TypeQuestioningEvent type;
+
+ @ManyToOne
+ private Questioning questioning;
+
+ @ManyToOne(fetch = FetchType.EAGER)
+ @JoinColumn(name = "id_upload")
+ @JsonManagedReference
+ private Upload upload;
+
+ @JdbcTypeCode(SqlTypes.JSON)
+ @Column(columnDefinition = "jsonb")
+ private JsonNode payload;
+
+ public QuestioningEvent(Date date, TypeQuestioningEvent type, Questioning questioning) {
+ this.date = date;
+ this.type = type;
+ this.questioning = questioning;
+ }
+
+ public QuestioningEvent() {
+ }
+
+ @Override
+ public String toString() {
+ return "QuestioningEvent [id=" + id + ", date=" + date + ", type=" + type + ", payload=" + payload
+ + "]";
+ }
+
+}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/SurveyUnit.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/SurveyUnit.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/SurveyUnit.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/SurveyUnit.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/SurveyUnitAddress.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/SurveyUnitAddress.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/SurveyUnitAddress.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/SurveyUnitAddress.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/SurveyUnitComment.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/SurveyUnitComment.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/SurveyUnitComment.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/SurveyUnitComment.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/Upload.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/Upload.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/Upload.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/domain/Upload.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/EventOrderRepository.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/EventOrderRepository.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/EventOrderRepository.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/EventOrderRepository.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/OperatorRepository.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/OperatorRepository.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/OperatorRepository.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/OperatorRepository.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/OperatorServiceRepository.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/OperatorServiceRepository.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/OperatorServiceRepository.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/OperatorServiceRepository.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/QuestioningAccreditationRepository.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/QuestioningAccreditationRepository.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/QuestioningAccreditationRepository.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/QuestioningAccreditationRepository.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/QuestioningEventRepository.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/QuestioningEventRepository.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/QuestioningEventRepository.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/QuestioningEventRepository.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/QuestioningRepository.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/QuestioningRepository.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/QuestioningRepository.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/QuestioningRepository.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/SurveyUnitAddressRepository.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/SurveyUnitAddressRepository.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/SurveyUnitAddressRepository.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/SurveyUnitAddressRepository.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/SurveyUnitCommentRepository.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/SurveyUnitCommentRepository.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/SurveyUnitCommentRepository.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/SurveyUnitCommentRepository.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/SurveyUnitRepository.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/SurveyUnitRepository.java
similarity index 97%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/SurveyUnitRepository.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/SurveyUnitRepository.java
index a82a9646..c5692d29 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/SurveyUnitRepository.java
+++ b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/SurveyUnitRepository.java
@@ -1,47 +1,47 @@
-package fr.insee.survey.datacollectionmanagement.questioning.repository;
-
-import fr.insee.survey.datacollectionmanagement.questioning.domain.SurveyUnit;
-import fr.insee.survey.datacollectionmanagement.questioning.dto.SearchSurveyUnitDto;
-import org.springframework.data.domain.Page;
-import org.springframework.data.domain.Pageable;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.Query;
-
-import java.util.List;
-
-public interface SurveyUnitRepository extends JpaRepository {
-
- List findAllByIdentificationCode(String identificationCode);
-
- @Query(nativeQuery = true, value = """
- SELECT
- *
- FROM
- survey_unit su
- WHERE
- UPPER(su.id_su) LIKE CONCAT(UPPER(:param), '%')
- """)
- Page findByIdentifier(String param, Pageable pageable);
-
- @Query(nativeQuery = true, value = """
- SELECT
- *
- FROM
- survey_unit su
- WHERE
- UPPER(su.identification_code) LIKE CONCAT(UPPER(:param), '%')
-
- """)
- Page findByIdentificationCode(String param, Pageable pageable);
-
- @Query(nativeQuery = true, value = """
- SELECT
- *
- FROM
- survey_unit su
- WHERE
- UPPER(su.identification_name) LIKE CONCAT(UPPER(:param), '%')
-
- """)
- Page findByIdentificationName(String param, Pageable pageable);
-}
+package fr.insee.survey.datacollectionmanagement.questioning.repository;
+
+import fr.insee.survey.datacollectionmanagement.questioning.domain.SurveyUnit;
+import fr.insee.survey.datacollectionmanagement.questioning.dto.SearchSurveyUnitDto;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Query;
+
+import java.util.List;
+
+public interface SurveyUnitRepository extends JpaRepository {
+
+ List findAllByIdentificationCode(String identificationCode);
+
+ @Query(nativeQuery = true, value = """
+ SELECT
+ *
+ FROM
+ survey_unit su
+ WHERE
+ UPPER(su.id_su) LIKE CONCAT(UPPER(:param), '%')
+ """)
+ Page findByIdentifier(String param, Pageable pageable);
+
+ @Query(nativeQuery = true, value = """
+ SELECT
+ *
+ FROM
+ survey_unit su
+ WHERE
+ UPPER(su.identification_code) LIKE CONCAT(UPPER(:param), '%')
+
+ """)
+ Page findByIdentificationCode(String param, Pageable pageable);
+
+ @Query(nativeQuery = true, value = """
+ SELECT
+ *
+ FROM
+ survey_unit su
+ WHERE
+ UPPER(su.identification_name) LIKE CONCAT(UPPER(:param), '%')
+
+ """)
+ Page findByIdentificationName(String param, Pageable pageable);
+}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/UploadRepository.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/UploadRepository.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/UploadRepository.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/repository/UploadRepository.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/user/domain/SourceAccreditation.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/user/domain/SourceAccreditation.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/user/domain/SourceAccreditation.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/user/domain/SourceAccreditation.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/user/domain/User.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/user/domain/User.java
similarity index 84%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/user/domain/User.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/user/domain/User.java
index 102d04aa..de2fcb99 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/user/domain/User.java
+++ b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/user/domain/User.java
@@ -1,5 +1,6 @@
package fr.insee.survey.datacollectionmanagement.user.domain;
+import fr.insee.survey.datacollectionmanagement.user.enums.UserRoleTypeEnum;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
@@ -15,11 +16,6 @@
@Table(name = "InternalUsers")
public class User {
- public enum UserRoleType {
- ADMINISTRATEUR, RESPONSABLE, GESTIONNAIRE, ASSISTANCE
- }
-
-
@Id
private String identifier;
private String name;
@@ -30,7 +26,7 @@ public enum UserRoleType {
@JdbcTypeCode(SqlTypes.INTEGER)
@Enumerated(EnumType.ORDINAL)
- private UserRoleType role;
+ private UserRoleTypeEnum role;
@OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
private Set userEvents;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/user/domain/UserEvent.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/user/domain/UserEvent.java
similarity index 89%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/user/domain/UserEvent.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/user/domain/UserEvent.java
index 178b78c4..0009baf5 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/user/domain/UserEvent.java
+++ b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/user/domain/UserEvent.java
@@ -1,6 +1,7 @@
package fr.insee.survey.datacollectionmanagement.user.domain;
import com.fasterxml.jackson.databind.JsonNode;
+import fr.insee.survey.datacollectionmanagement.user.enums.UserEventTypeEnum;
import jakarta.persistence.*;
import lombok.*;
import org.hibernate.annotations.JdbcTypeCode;
@@ -14,10 +15,6 @@
@NoArgsConstructor
public class UserEvent {
- public enum UserEventType {
- CREATE, UPDATE, DELETE
- }
-
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "user_event_seq")
private Long id;
@@ -27,7 +24,7 @@ public enum UserEventType {
@NonNull
@Enumerated(EnumType.ORDINAL)
@JdbcTypeCode(SqlTypes.INTEGER)
- private UserEventType type;
+ private UserEventTypeEnum type;
@ManyToOne
private User user;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/user/repository/SourceAccreditationRepository.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/user/repository/SourceAccreditationRepository.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/user/repository/SourceAccreditationRepository.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/user/repository/SourceAccreditationRepository.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/user/repository/UserEventRepository.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/user/repository/UserEventRepository.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/user/repository/UserEventRepository.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/user/repository/UserEventRepository.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/user/repository/UserRepository.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/user/repository/UserRepository.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/user/repository/UserRepository.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/user/repository/UserRepository.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/view/domain/View.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/view/domain/View.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/view/domain/View.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/view/domain/View.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/view/repository/ViewRepository.java b/platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/view/repository/ViewRepository.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/view/repository/ViewRepository.java
rename to platine-management-db/src/main/java/fr/insee/survey/datacollectionmanagement/view/repository/ViewRepository.java
diff --git a/platine-management-service/pom.xml b/platine-management-service/pom.xml
new file mode 100644
index 00000000..f6f62eb4
--- /dev/null
+++ b/platine-management-service/pom.xml
@@ -0,0 +1,62 @@
+
+
+ 4.0.0
+
+ fr.insee.survey
+ platine-management
+ ${revision}${changelist}
+
+
+ platine-management-service
+
+
+ 1.0.2
+ 5.0.0
+
+
+
+
+ fr.insee.survey
+ platine-management-shared
+ ${project.version}
+
+
+
+ fr.insee.survey
+ platine-management-db
+ ${project.version}
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+
+
+ org.jeasy
+ easy-random-core
+ ${easy-version}
+
+
+
+ com.github.javafaker
+ javafaker
+ ${javafaker-version}
+
+
+ org.yaml
+ snakeyaml
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/service/AddressService.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/contact/service/AddressService.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/contact/service/AddressService.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/contact/service/AddressService.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/service/ContactEventService.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/contact/service/ContactEventService.java
similarity index 87%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/contact/service/ContactEventService.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/contact/service/ContactEventService.java
index 4e39b430..46c89998 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/service/ContactEventService.java
+++ b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/contact/service/ContactEventService.java
@@ -3,7 +3,7 @@
import com.fasterxml.jackson.databind.JsonNode;
import fr.insee.survey.datacollectionmanagement.contact.domain.Contact;
import fr.insee.survey.datacollectionmanagement.contact.domain.ContactEvent;
-import fr.insee.survey.datacollectionmanagement.contact.domain.ContactEvent.ContactEventType;
+import fr.insee.survey.datacollectionmanagement.contact.enums.ContactEventTypeEnum;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
@@ -23,6 +23,6 @@ public interface ContactEventService {
public Set findContactEventsByContact (Contact contact);
- ContactEvent createContactEvent(Contact contact, ContactEventType type, JsonNode payload);
+ ContactEvent createContactEvent(Contact contact, ContactEventTypeEnum type, JsonNode payload);
}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/service/ContactService.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/contact/service/ContactService.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/contact/service/ContactService.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/contact/service/ContactService.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/service/impl/AddressServiceImpl.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/contact/service/impl/AddressServiceImpl.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/contact/service/impl/AddressServiceImpl.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/contact/service/impl/AddressServiceImpl.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/service/impl/ContactEventServiceImpl.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/contact/service/impl/ContactEventServiceImpl.java
similarity index 93%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/contact/service/impl/ContactEventServiceImpl.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/contact/service/impl/ContactEventServiceImpl.java
index 63d15226..a851fd96 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/service/impl/ContactEventServiceImpl.java
+++ b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/contact/service/impl/ContactEventServiceImpl.java
@@ -3,7 +3,7 @@
import com.fasterxml.jackson.databind.JsonNode;
import fr.insee.survey.datacollectionmanagement.contact.domain.Contact;
import fr.insee.survey.datacollectionmanagement.contact.domain.ContactEvent;
-import fr.insee.survey.datacollectionmanagement.contact.domain.ContactEvent.ContactEventType;
+import fr.insee.survey.datacollectionmanagement.contact.enums.ContactEventTypeEnum;
import fr.insee.survey.datacollectionmanagement.contact.repository.ContactEventRepository;
import fr.insee.survey.datacollectionmanagement.contact.service.ContactEventService;
import fr.insee.survey.datacollectionmanagement.exception.NotFoundException;
@@ -47,7 +47,7 @@ public Set findContactEventsByContact(Contact contact) {
}
@Override
- public ContactEvent createContactEvent(Contact contact, ContactEventType type, JsonNode payload) {
+ public ContactEvent createContactEvent(Contact contact, ContactEventTypeEnum type, JsonNode payload) {
ContactEvent contactEventCreate = new ContactEvent();
contactEventCreate.setContact(contact);
contactEventCreate.setType(type);
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/service/impl/ContactServiceImpl.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/contact/service/impl/ContactServiceImpl.java
similarity index 95%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/contact/service/impl/ContactServiceImpl.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/contact/service/impl/ContactServiceImpl.java
index 076f901b..a8a7066f 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/service/impl/ContactServiceImpl.java
+++ b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/contact/service/impl/ContactServiceImpl.java
@@ -3,8 +3,8 @@
import com.fasterxml.jackson.databind.JsonNode;
import fr.insee.survey.datacollectionmanagement.contact.domain.Contact;
import fr.insee.survey.datacollectionmanagement.contact.domain.ContactEvent;
-import fr.insee.survey.datacollectionmanagement.contact.domain.ContactEvent.ContactEventType;
import fr.insee.survey.datacollectionmanagement.contact.dto.SearchContactDto;
+import fr.insee.survey.datacollectionmanagement.contact.enums.ContactEventTypeEnum;
import fr.insee.survey.datacollectionmanagement.contact.repository.ContactRepository;
import fr.insee.survey.datacollectionmanagement.contact.service.AddressService;
import fr.insee.survey.datacollectionmanagement.contact.service.ContactEventService;
@@ -79,7 +79,7 @@ public Contact createContactAddressEvent(Contact contact, JsonNode payload) {
if (contact.getAddress() != null) {
addressService.saveAddress(contact.getAddress());
}
- ContactEvent newContactEvent = contactEventService.createContactEvent(contact, ContactEventType.create,
+ ContactEvent newContactEvent = contactEventService.createContactEvent(contact, ContactEventTypeEnum.create,
payload);
contact.setContactEvents(new HashSet<>(Collections.singletonList(newContactEvent)));
return saveContact(contact);
@@ -98,7 +98,7 @@ public Contact updateContactAddressEvent(Contact contact, JsonNode payload) thro
}
Set setContactEventsContact = existingContact.getContactEvents();
- ContactEvent contactEventUpdate = contactEventService.createContactEvent(contact, ContactEventType.update,
+ ContactEvent contactEventUpdate = contactEventService.createContactEvent(contact, ContactEventTypeEnum.update,
payload);
setContactEventsContact.add(contactEventUpdate);
contact.setContactEvents(setContactEventsContact);
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/dataloader/Dataloader.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/dataloader/Dataloader.java
similarity index 95%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/dataloader/Dataloader.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/dataloader/Dataloader.java
index e75d8095..ca0f244d 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/dataloader/Dataloader.java
+++ b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/dataloader/Dataloader.java
@@ -2,7 +2,7 @@
import fr.insee.survey.datacollectionmanagement.questioning.domain.EventOrder;
import fr.insee.survey.datacollectionmanagement.questioning.repository.EventOrderRepository;
-import fr.insee.survey.datacollectionmanagement.questioning.util.TypeQuestioningEvent;
+import fr.insee.survey.datacollectionmanagement.questioning.enums.TypeQuestioningEvent;
import jakarta.annotation.PostConstruct;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/dataloader/DataloaderPoc.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/dataloader/DataloaderPoc.java
similarity index 97%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/dataloader/DataloaderPoc.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/dataloader/DataloaderPoc.java
index f6cb3160..08452168 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/dataloader/DataloaderPoc.java
+++ b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/dataloader/DataloaderPoc.java
@@ -4,19 +4,19 @@
import com.github.javafaker.Name;
import fr.insee.survey.datacollectionmanagement.contact.domain.Address;
import fr.insee.survey.datacollectionmanagement.contact.domain.Contact;
-import fr.insee.survey.datacollectionmanagement.contact.domain.Contact.Gender;
import fr.insee.survey.datacollectionmanagement.contact.domain.ContactEvent;
-import fr.insee.survey.datacollectionmanagement.contact.domain.ContactEvent.ContactEventType;
+import fr.insee.survey.datacollectionmanagement.contact.enums.ContactEventTypeEnum;
+import fr.insee.survey.datacollectionmanagement.contact.enums.GenderEnum;
import fr.insee.survey.datacollectionmanagement.contact.repository.AddressRepository;
import fr.insee.survey.datacollectionmanagement.contact.repository.ContactEventRepository;
import fr.insee.survey.datacollectionmanagement.contact.repository.ContactRepository;
import fr.insee.survey.datacollectionmanagement.metadata.domain.*;
import fr.insee.survey.datacollectionmanagement.metadata.repository.*;
-import fr.insee.survey.datacollectionmanagement.metadata.util.PeriodEnum;
-import fr.insee.survey.datacollectionmanagement.metadata.util.PeriodicityEnum;
+import fr.insee.survey.datacollectionmanagement.metadata.enums.PeriodEnum;
+import fr.insee.survey.datacollectionmanagement.metadata.enums.PeriodicityEnum;
import fr.insee.survey.datacollectionmanagement.questioning.domain.*;
import fr.insee.survey.datacollectionmanagement.questioning.repository.*;
-import fr.insee.survey.datacollectionmanagement.questioning.util.TypeQuestioningEvent;
+import fr.insee.survey.datacollectionmanagement.questioning.enums.TypeQuestioningEvent;
import fr.insee.survey.datacollectionmanagement.view.domain.View;
import fr.insee.survey.datacollectionmanagement.view.repository.ViewRepository;
import jakarta.annotation.PostConstruct;
@@ -239,7 +239,7 @@ private void initContact(Faker faker) {
for (Long j = nbContactEvents; j < 300; j++) {
Contact contact = contactRepository.findRandomContact();
ContactEvent contactEvent = new ContactEvent();
- contactEvent.setType(ContactEventType.create);
+ contactEvent.setType(ContactEventTypeEnum.create);
contactEvent.setEventDate(new Date());
contactEvent.setContact(contact);
contactEventRepository.save(contactEvent);
@@ -273,7 +273,7 @@ private Contact initOneContact(Faker faker) {
c.setLastName(name);
c.setFirstName(firstName);
c.setPhone(faker.phoneNumber().phoneNumber());
- c.setGender(Gender.valueOf(faker.demographic().sex()));
+ c.setGender(GenderEnum.valueOf(faker.demographic().sex()));
c.setFunction(faker.job().title());
c.setComment(faker.beer().name());
c.setEmail(firstName.toLowerCase() + "." + name.toLowerCase() + "@cocorico.fr");
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/exception/EventException.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/exception/EventException.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/exception/EventException.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/exception/EventException.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/exception/ForbiddenAccessException.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/exception/ForbiddenAccessException.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/exception/ForbiddenAccessException.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/exception/ForbiddenAccessException.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/exception/ImpossibleToDeleteException.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/exception/ImpossibleToDeleteException.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/exception/ImpossibleToDeleteException.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/exception/ImpossibleToDeleteException.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/exception/NotFoundException.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/exception/NotFoundException.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/exception/NotFoundException.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/exception/NotFoundException.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/exception/NotMatchException.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/exception/NotMatchException.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/exception/NotMatchException.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/exception/NotMatchException.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/exception/RessourceNotValidatedException.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/exception/RessourceNotValidatedException.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/exception/RessourceNotValidatedException.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/exception/RessourceNotValidatedException.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/CampaignService.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/CampaignService.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/CampaignService.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/CampaignService.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/OwnerService.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/OwnerService.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/OwnerService.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/OwnerService.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/PartitioningService.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/PartitioningService.java
similarity index 79%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/PartitioningService.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/PartitioningService.java
index 60bbea05..c7d3ca71 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/PartitioningService.java
+++ b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/PartitioningService.java
@@ -1,22 +1,22 @@
-package fr.insee.survey.datacollectionmanagement.metadata.service;
-
-import fr.insee.survey.datacollectionmanagement.metadata.domain.Parameters;
-import fr.insee.survey.datacollectionmanagement.metadata.domain.Partitioning;
-
-import java.util.Date;
-
-public interface PartitioningService {
-
- Partitioning findById(String id);
-
- Partitioning insertOrUpdatePartitioning(Partitioning partitioning);
-
- void deletePartitioningById(String id);
-
- boolean isOnGoing(Partitioning part, Date date);
-
- String findSuitableParameterValue(Partitioning part, Parameters.ParameterEnum paramValue);
-
-
-
-}
+package fr.insee.survey.datacollectionmanagement.metadata.service;
+
+import fr.insee.survey.datacollectionmanagement.metadata.domain.Partitioning;
+import fr.insee.survey.datacollectionmanagement.metadata.enums.ParameterEnum;
+
+import java.util.Date;
+
+public interface PartitioningService {
+
+ Partitioning findById(String id);
+
+ Partitioning insertOrUpdatePartitioning(Partitioning partitioning);
+
+ void deletePartitioningById(String id);
+
+ boolean isOnGoing(Partitioning part, Date date);
+
+ String findSuitableParameterValue(Partitioning part, ParameterEnum paramValue);
+
+
+
+}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/SourceService.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/SourceService.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/SourceService.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/SourceService.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/SupportService.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/SupportService.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/SupportService.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/SupportService.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/SurveyService.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/SurveyService.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/SurveyService.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/SurveyService.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/impl/CampaignServiceImpl.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/impl/CampaignServiceImpl.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/impl/CampaignServiceImpl.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/impl/CampaignServiceImpl.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/impl/OwnerServiceImpl.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/impl/OwnerServiceImpl.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/impl/OwnerServiceImpl.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/impl/OwnerServiceImpl.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/impl/PartioningServiceImpl.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/impl/PartioningServiceImpl.java
similarity index 93%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/impl/PartioningServiceImpl.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/impl/PartioningServiceImpl.java
index c643451f..6c91cbcc 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/impl/PartioningServiceImpl.java
+++ b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/impl/PartioningServiceImpl.java
@@ -1,65 +1,66 @@
-package fr.insee.survey.datacollectionmanagement.metadata.service.impl;
-
-import fr.insee.survey.datacollectionmanagement.exception.NotFoundException;
-import fr.insee.survey.datacollectionmanagement.metadata.domain.Parameters;
-import fr.insee.survey.datacollectionmanagement.metadata.domain.Partitioning;
-import fr.insee.survey.datacollectionmanagement.metadata.repository.PartitioningRepository;
-import fr.insee.survey.datacollectionmanagement.metadata.service.PartitioningService;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Service;
-
-import java.util.Date;
-import java.util.Optional;
-import java.util.Set;
-
-@Service
-@Slf4j
-@RequiredArgsConstructor
-public class PartioningServiceImpl implements PartitioningService {
-
- private final PartitioningRepository partitioningRepository;
-
- @Override
- public Partitioning findById(String id) {
- return partitioningRepository.findById(id).
- orElseThrow(() -> new NotFoundException(String.format("Partitioning %s not found", id)));
-
- }
-
- @Override
- public Partitioning insertOrUpdatePartitioning(Partitioning partitioning) {
- return partitioningRepository.save(partitioning);
-
- }
-
-
- @Override
- public void deletePartitioningById(String id) {
- partitioningRepository.deleteById(id);
- }
-
- @Override
- public boolean isOnGoing(Partitioning part, Date date) {
- return part.getClosingDate().compareTo(date) > 0 && part.getOpeningDate().compareTo(date) < 0;
- }
-
- @Override
- public String findSuitableParameterValue(Partitioning part, Parameters.ParameterEnum paramValue) {
- return findParameterValueInSet(part.getParams(), paramValue)
- .orElse(findParameterValueInSet(part.getCampaign().getParams(), paramValue)
- .orElse(findParameterValueInSet(part.getCampaign().getSurvey().getParams(), paramValue)
- .orElse(findParameterValueInSet(part.getCampaign().getSurvey().getSource().getParams(), paramValue)
- .orElse(""))));
- }
-
- private Optional findParameterValueInSet(Set params, Parameters.ParameterEnum paramValue) {
- return params.stream()
- .filter(param -> param.getParamId().equals(paramValue))
- .map(Parameters::getParamValue)
- .findFirst();
- }
-
-
-
-}
+package fr.insee.survey.datacollectionmanagement.metadata.service.impl;
+
+import fr.insee.survey.datacollectionmanagement.exception.NotFoundException;
+import fr.insee.survey.datacollectionmanagement.metadata.domain.Parameters;
+import fr.insee.survey.datacollectionmanagement.metadata.domain.Partitioning;
+import fr.insee.survey.datacollectionmanagement.metadata.enums.ParameterEnum;
+import fr.insee.survey.datacollectionmanagement.metadata.repository.PartitioningRepository;
+import fr.insee.survey.datacollectionmanagement.metadata.service.PartitioningService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+import java.util.Optional;
+import java.util.Set;
+
+@Service
+@Slf4j
+@RequiredArgsConstructor
+public class PartioningServiceImpl implements PartitioningService {
+
+ private final PartitioningRepository partitioningRepository;
+
+ @Override
+ public Partitioning findById(String id) {
+ return partitioningRepository.findById(id).
+ orElseThrow(() -> new NotFoundException(String.format("Partitioning %s not found", id)));
+
+ }
+
+ @Override
+ public Partitioning insertOrUpdatePartitioning(Partitioning partitioning) {
+ return partitioningRepository.save(partitioning);
+
+ }
+
+
+ @Override
+ public void deletePartitioningById(String id) {
+ partitioningRepository.deleteById(id);
+ }
+
+ @Override
+ public boolean isOnGoing(Partitioning part, Date date) {
+ return part.getClosingDate().compareTo(date) > 0 && part.getOpeningDate().compareTo(date) < 0;
+ }
+
+ @Override
+ public String findSuitableParameterValue(Partitioning part, ParameterEnum paramValue) {
+ return findParameterValueInSet(part.getParams(), paramValue)
+ .orElse(findParameterValueInSet(part.getCampaign().getParams(), paramValue)
+ .orElse(findParameterValueInSet(part.getCampaign().getSurvey().getParams(), paramValue)
+ .orElse(findParameterValueInSet(part.getCampaign().getSurvey().getSource().getParams(), paramValue)
+ .orElse(""))));
+ }
+
+ private Optional findParameterValueInSet(Set params, ParameterEnum paramValue) {
+ return params.stream()
+ .filter(param -> param.getParamId().equals(paramValue))
+ .map(Parameters::getParamValue)
+ .findFirst();
+ }
+
+
+
+}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/impl/SourceServiceImpl.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/impl/SourceServiceImpl.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/impl/SourceServiceImpl.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/impl/SourceServiceImpl.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/impl/SupportServiceImpl.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/impl/SupportServiceImpl.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/impl/SupportServiceImpl.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/impl/SupportServiceImpl.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/impl/SurveyServiceImpl.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/impl/SurveyServiceImpl.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/impl/SurveyServiceImpl.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/service/impl/SurveyServiceImpl.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/CheckHabilitationService.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/CheckHabilitationService.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/service/CheckHabilitationService.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/CheckHabilitationService.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/MonitoringService.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/MonitoringService.java
similarity index 85%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/service/MonitoringService.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/MonitoringService.java
index c2ae6d96..b40a458c 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/MonitoringService.java
+++ b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/MonitoringService.java
@@ -1,8 +1,8 @@
package fr.insee.survey.datacollectionmanagement.query.service;
+import fr.insee.survey.datacollectionmanagement.util.JSONCollectionWrapper;
import org.springframework.stereotype.Service;
-import fr.insee.survey.datacollectionmanagement.config.JSONCollectionWrapper;
import fr.insee.survey.datacollectionmanagement.query.dto.MoogFollowUpDto;
import fr.insee.survey.datacollectionmanagement.query.dto.MoogProgressDto;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/MoogService.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/MoogService.java
similarity index 93%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/service/MoogService.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/MoogService.java
index e4b9482c..598f518b 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/MoogService.java
+++ b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/MoogService.java
@@ -1,10 +1,10 @@
package fr.insee.survey.datacollectionmanagement.query.service;
-import fr.insee.survey.datacollectionmanagement.config.JSONCollectionWrapper;
import fr.insee.survey.datacollectionmanagement.exception.NotFoundException;
import fr.insee.survey.datacollectionmanagement.query.dto.MoogExtractionRowDto;
import fr.insee.survey.datacollectionmanagement.query.dto.MoogQuestioningEventDto;
import fr.insee.survey.datacollectionmanagement.query.dto.MoogSearchDto;
+import fr.insee.survey.datacollectionmanagement.util.JSONCollectionWrapper;
import fr.insee.survey.datacollectionmanagement.view.domain.View;
import org.springframework.stereotype.Service;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/MySurveysService.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/MySurveysService.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/service/MySurveysService.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/MySurveysService.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/QuestioningInformationsService.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/QuestioningInformationsService.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/service/QuestioningInformationsService.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/QuestioningInformationsService.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/impl/CheckHabilitationServiceImplNoAuth.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/impl/CheckHabilitationServiceImplNoAuth.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/service/impl/CheckHabilitationServiceImplNoAuth.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/impl/CheckHabilitationServiceImplNoAuth.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/impl/CheckHabilitationServiceImplOidc.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/impl/CheckHabilitationServiceImplOidc.java
similarity index 93%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/service/impl/CheckHabilitationServiceImplOidc.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/impl/CheckHabilitationServiceImplOidc.java
index b1019bba..5bc8d80b 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/impl/CheckHabilitationServiceImplOidc.java
+++ b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/impl/CheckHabilitationServiceImplOidc.java
@@ -1,11 +1,12 @@
package fr.insee.survey.datacollectionmanagement.query.service.impl;
-import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityRoleEnum;
import fr.insee.survey.datacollectionmanagement.constants.AuthConstants;
+import fr.insee.survey.datacollectionmanagement.constants.AuthorityRoleEnum;
import fr.insee.survey.datacollectionmanagement.constants.UserRoles;
import fr.insee.survey.datacollectionmanagement.exception.NotFoundException;
import fr.insee.survey.datacollectionmanagement.query.service.CheckHabilitationService;
import fr.insee.survey.datacollectionmanagement.user.domain.User;
+import fr.insee.survey.datacollectionmanagement.user.enums.UserRoleTypeEnum;
import fr.insee.survey.datacollectionmanagement.user.service.UserService;
import fr.insee.survey.datacollectionmanagement.view.service.ViewService;
import lombok.RequiredArgsConstructor;
@@ -63,7 +64,7 @@ public boolean checkHabilitation(String role, String idSu, String campaignId, Li
if (isUserInRole(userRoles, AuthorityRoleEnum.INTERNAL_USER.securityRole())) {
String userRole = user.getRole().toString();
- if (userRole.equals(User.UserRoleType.ASSISTANCE.toString())) {
+ if (userRole.equals(UserRoleTypeEnum.ASSISTANCE.toString())) {
log.warn("User '{}' has assistance profile - check habilitation: false", userId);
return false;
}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/impl/MonitoringServiceImpl.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/impl/MonitoringServiceImpl.java
similarity index 97%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/service/impl/MonitoringServiceImpl.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/impl/MonitoringServiceImpl.java
index e02d7fee..22d101b0 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/impl/MonitoringServiceImpl.java
+++ b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/impl/MonitoringServiceImpl.java
@@ -1,11 +1,11 @@
package fr.insee.survey.datacollectionmanagement.query.service.impl;
-import fr.insee.survey.datacollectionmanagement.config.JSONCollectionWrapper;
import fr.insee.survey.datacollectionmanagement.query.dto.MoogFollowUpDto;
import fr.insee.survey.datacollectionmanagement.query.dto.MoogProgressDto;
import fr.insee.survey.datacollectionmanagement.query.dto.MoogRowProgressDto;
import fr.insee.survey.datacollectionmanagement.query.repository.MonitoringRepository;
import fr.insee.survey.datacollectionmanagement.query.service.MonitoringService;
+import fr.insee.survey.datacollectionmanagement.util.JSONCollectionWrapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/impl/MoogServiceImpl.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/impl/MoogServiceImpl.java
similarity index 93%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/service/impl/MoogServiceImpl.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/impl/MoogServiceImpl.java
index 7332602d..6d39e86a 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/impl/MoogServiceImpl.java
+++ b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/impl/MoogServiceImpl.java
@@ -1,17 +1,16 @@
package fr.insee.survey.datacollectionmanagement.query.service.impl;
-import fr.insee.survey.datacollectionmanagement.config.JSONCollectionWrapper;
import fr.insee.survey.datacollectionmanagement.constants.UserRoles;
import fr.insee.survey.datacollectionmanagement.contact.domain.Address;
import fr.insee.survey.datacollectionmanagement.contact.domain.Contact;
import fr.insee.survey.datacollectionmanagement.contact.service.ContactService;
import fr.insee.survey.datacollectionmanagement.exception.NotFoundException;
import fr.insee.survey.datacollectionmanagement.metadata.domain.Campaign;
-import fr.insee.survey.datacollectionmanagement.metadata.domain.Parameters;
import fr.insee.survey.datacollectionmanagement.metadata.domain.Partitioning;
+import fr.insee.survey.datacollectionmanagement.metadata.enums.ParameterEnum;
import fr.insee.survey.datacollectionmanagement.metadata.service.CampaignService;
import fr.insee.survey.datacollectionmanagement.metadata.service.PartitioningService;
-import fr.insee.survey.datacollectionmanagement.query.domain.MoogCampaign;
+import fr.insee.survey.datacollectionmanagement.query.dto.MoogCampaignDto;
import fr.insee.survey.datacollectionmanagement.query.dto.MoogExtractionRowDto;
import fr.insee.survey.datacollectionmanagement.query.dto.MoogQuestioningEventDto;
import fr.insee.survey.datacollectionmanagement.query.dto.MoogSearchDto;
@@ -19,6 +18,7 @@
import fr.insee.survey.datacollectionmanagement.query.service.MoogService;
import fr.insee.survey.datacollectionmanagement.questioning.domain.Questioning;
import fr.insee.survey.datacollectionmanagement.questioning.service.QuestioningService;
+import fr.insee.survey.datacollectionmanagement.util.JSONCollectionWrapper;
import fr.insee.survey.datacollectionmanagement.view.domain.View;
import fr.insee.survey.datacollectionmanagement.view.service.ViewService;
import lombok.RequiredArgsConstructor;
@@ -65,7 +65,7 @@ public List transformListViewToListMoogSearchDto(List listV
MoogSearchDto moogSearchDto = new MoogSearchDto();
Contact c = contactService.findByIdentifier(view.getIdentifier());
Campaign camp = campaignService.findById(view.getCampaignId());
- MoogCampaign moogCampaign = new MoogCampaign();
+ MoogCampaignDto moogCampaign = new MoogCampaignDto();
moogCampaign.setId(view.getCampaignId());
moogCampaign.setLabel(camp.getCampaignWording());
moogCampaign
@@ -101,7 +101,7 @@ public List getMoogEvents(String campaign, String idSu)
List moogEvents = moogRepository.getEventsByIdSuByCampaign(campaign, idSu);
Campaign camp = campaignService.findById(campaign);
- MoogCampaign moogCampaign = new MoogCampaign();
+ MoogCampaignDto moogCampaign = new MoogCampaignDto();
moogCampaign.setId(campaign);
moogCampaign.setLabel(camp.getCampaignWording());
moogCampaign.setCollectionEndDate(camp.getPartitionings().iterator().next().getClosingDate().getTime());
@@ -129,8 +129,8 @@ public String getReadOnlyUrl(String idCampaign, String surveyUnitId) throws NotF
for (Partitioning part : setParts) {
Questioning questioning = questioningService.findByIdPartitioningAndSurveyUnitIdSu(part.getId(), surveyUnitId);
if (questioning != null) {
- String accessBaseUrl = partitioningService.findSuitableParameterValue(part, Parameters.ParameterEnum.URL_REDIRECTION);
- String typeUrl = partitioningService.findSuitableParameterValue(part, Parameters.ParameterEnum.URL_TYPE);
+ String accessBaseUrl = partitioningService.findSuitableParameterValue(part, ParameterEnum.URL_REDIRECTION);
+ String typeUrl = partitioningService.findSuitableParameterValue(part, ParameterEnum.URL_TYPE);
String sourceId = campaign.getSurvey().getSource().getId().toLowerCase();
return questioningService.getAccessUrl(accessBaseUrl, typeUrl, UserRoles.REVIEWER, questioning, surveyUnitId, sourceId);
}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/impl/MySurveysServiceImpl.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/impl/MySurveysServiceImpl.java
similarity index 91%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/service/impl/MySurveysServiceImpl.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/impl/MySurveysServiceImpl.java
index c2755375..7505088d 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/impl/MySurveysServiceImpl.java
+++ b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/impl/MySurveysServiceImpl.java
@@ -1,83 +1,83 @@
-package fr.insee.survey.datacollectionmanagement.query.service.impl;
-
-import fr.insee.survey.datacollectionmanagement.constants.UserRoles;
-import fr.insee.survey.datacollectionmanagement.metadata.domain.Parameters;
-import fr.insee.survey.datacollectionmanagement.metadata.domain.Partitioning;
-import fr.insee.survey.datacollectionmanagement.metadata.domain.Survey;
-import fr.insee.survey.datacollectionmanagement.metadata.service.PartitioningService;
-import fr.insee.survey.datacollectionmanagement.query.dto.MyQuestioningDto;
-import fr.insee.survey.datacollectionmanagement.query.service.MySurveysService;
-import fr.insee.survey.datacollectionmanagement.questioning.domain.Questioning;
-import fr.insee.survey.datacollectionmanagement.questioning.domain.QuestioningAccreditation;
-import fr.insee.survey.datacollectionmanagement.questioning.domain.QuestioningEvent;
-import fr.insee.survey.datacollectionmanagement.questioning.service.QuestioningAccreditationService;
-import fr.insee.survey.datacollectionmanagement.questioning.service.QuestioningEventService;
-import fr.insee.survey.datacollectionmanagement.questioning.service.QuestioningService;
-import fr.insee.survey.datacollectionmanagement.questioning.util.TypeQuestioningEvent;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Service;
-
-import java.sql.Timestamp;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Optional;
-
-@Service
-@Slf4j
-@RequiredArgsConstructor
-public class MySurveysServiceImpl implements MySurveysService {
-
- private final QuestioningAccreditationService questioningAccreditationService;
-
- private final PartitioningService partitioningService;
-
- private final QuestioningEventService questioningEventService;
-
- private final QuestioningService questioningService;
-
-
- @Override
- public List getListMySurveys(String id) {
- List listSurveys = new ArrayList<>();
- List accreditations = questioningAccreditationService.findByContactIdentifier(id);
-
- for (QuestioningAccreditation questioningAccreditation : accreditations) {
- MyQuestioningDto surveyDto = new MyQuestioningDto();
- Questioning questioning = questioningAccreditation.getQuestioning();
- Partitioning part = partitioningService.findById(questioning.getIdPartitioning());
- Survey survey = part.getCampaign().getSurvey();
- String surveyUnitId = questioning.getSurveyUnit().getIdSu();
- surveyDto.setSurveyWording(survey.getLongWording());
- surveyDto.setSurveyObjectives(survey.getLongObjectives());
- String accessBaseUrl = partitioningService.findSuitableParameterValue(part, Parameters.ParameterEnum.URL_REDIRECTION);
- String typeUrl = partitioningService.findSuitableParameterValue(part, Parameters.ParameterEnum.URL_TYPE);
- String sourceId = survey.getSource().getId().toLowerCase();
- surveyDto.setAccessUrl(
- questioningService.getAccessUrl(accessBaseUrl,typeUrl, UserRoles.INTERVIEWER, questioning, surveyUnitId, sourceId));
- surveyDto.setIdentificationCode(surveyUnitId);
- surveyDto.setOpeningDate(new Timestamp(part.getOpeningDate().getTime()));
- surveyDto.setClosingDate(new Timestamp(part.getClosingDate().getTime()));
- surveyDto.setReturnDate(new Timestamp(part.getReturnDate().getTime()));
- surveyDto.setMandatoryMySurveys(part.getCampaign().getSurvey().getSource().getMandatoryMySurveys());
-
- Optional questioningEvent = questioningEventService.getLastQuestioningEvent(
- questioning, TypeQuestioningEvent.MY_QUESTIONINGS_EVENTS);
- if (questioningEvent.isPresent()) {
- surveyDto.setQuestioningStatus(questioningEvent.get().getType().name());
- surveyDto.setQuestioningDate(new Timestamp(questioningEvent.get().getDate().getTime()));
- } else {
- log.debug("No questioningEvents found for questioning {} for identifier {}",
- questioning.getId(), id);
-
-
- }
- listSurveys.add(surveyDto);
-
- }
- log.info("Get my questionings for id {} - nb results: {}", id, listSurveys.size());
- return listSurveys;
- }
-
-
-}
+package fr.insee.survey.datacollectionmanagement.query.service.impl;
+
+import fr.insee.survey.datacollectionmanagement.constants.UserRoles;
+import fr.insee.survey.datacollectionmanagement.metadata.domain.Partitioning;
+import fr.insee.survey.datacollectionmanagement.metadata.domain.Survey;
+import fr.insee.survey.datacollectionmanagement.metadata.enums.ParameterEnum;
+import fr.insee.survey.datacollectionmanagement.metadata.service.PartitioningService;
+import fr.insee.survey.datacollectionmanagement.query.dto.MyQuestioningDto;
+import fr.insee.survey.datacollectionmanagement.query.service.MySurveysService;
+import fr.insee.survey.datacollectionmanagement.questioning.domain.Questioning;
+import fr.insee.survey.datacollectionmanagement.questioning.domain.QuestioningAccreditation;
+import fr.insee.survey.datacollectionmanagement.questioning.domain.QuestioningEvent;
+import fr.insee.survey.datacollectionmanagement.questioning.enums.TypeQuestioningEvent;
+import fr.insee.survey.datacollectionmanagement.questioning.service.QuestioningAccreditationService;
+import fr.insee.survey.datacollectionmanagement.questioning.service.QuestioningEventService;
+import fr.insee.survey.datacollectionmanagement.questioning.service.QuestioningService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Optional;
+
+@Service
+@Slf4j
+@RequiredArgsConstructor
+public class MySurveysServiceImpl implements MySurveysService {
+
+ private final QuestioningAccreditationService questioningAccreditationService;
+
+ private final PartitioningService partitioningService;
+
+ private final QuestioningEventService questioningEventService;
+
+ private final QuestioningService questioningService;
+
+
+ @Override
+ public List getListMySurveys(String id) {
+ List listSurveys = new ArrayList<>();
+ List accreditations = questioningAccreditationService.findByContactIdentifier(id);
+
+ for (QuestioningAccreditation questioningAccreditation : accreditations) {
+ MyQuestioningDto surveyDto = new MyQuestioningDto();
+ Questioning questioning = questioningAccreditation.getQuestioning();
+ Partitioning part = partitioningService.findById(questioning.getIdPartitioning());
+ Survey survey = part.getCampaign().getSurvey();
+ String surveyUnitId = questioning.getSurveyUnit().getIdSu();
+ surveyDto.setSurveyWording(survey.getLongWording());
+ surveyDto.setSurveyObjectives(survey.getLongObjectives());
+ String accessBaseUrl = partitioningService.findSuitableParameterValue(part, ParameterEnum.URL_REDIRECTION);
+ String typeUrl = partitioningService.findSuitableParameterValue(part, ParameterEnum.URL_TYPE);
+ String sourceId = survey.getSource().getId().toLowerCase();
+ surveyDto.setAccessUrl(
+ questioningService.getAccessUrl(accessBaseUrl,typeUrl, UserRoles.INTERVIEWER, questioning, surveyUnitId, sourceId));
+ surveyDto.setIdentificationCode(surveyUnitId);
+ surveyDto.setOpeningDate(new Timestamp(part.getOpeningDate().getTime()));
+ surveyDto.setClosingDate(new Timestamp(part.getClosingDate().getTime()));
+ surveyDto.setReturnDate(new Timestamp(part.getReturnDate().getTime()));
+ surveyDto.setMandatoryMySurveys(part.getCampaign().getSurvey().getSource().getMandatoryMySurveys());
+
+ Optional questioningEvent = questioningEventService.getLastQuestioningEvent(
+ questioning, TypeQuestioningEvent.MY_QUESTIONINGS_EVENTS);
+ if (questioningEvent.isPresent()) {
+ surveyDto.setQuestioningStatus(questioningEvent.get().getType().name());
+ surveyDto.setQuestioningDate(new Timestamp(questioningEvent.get().getDate().getTime()));
+ } else {
+ log.debug("No questioningEvents found for questioning {} for identifier {}",
+ questioning.getId(), id);
+
+
+ }
+ listSurveys.add(surveyDto);
+
+ }
+ log.info("Get my questionings for id {} - nb results: {}", id, listSurveys.size());
+ return listSurveys;
+ }
+
+
+}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/impl/QuestioningInformationsServiceImpl.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/impl/QuestioningInformationsServiceImpl.java
similarity index 94%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/service/impl/QuestioningInformationsServiceImpl.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/impl/QuestioningInformationsServiceImpl.java
index 7b7ff6cd..ef685acc 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/impl/QuestioningInformationsServiceImpl.java
+++ b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/query/service/impl/QuestioningInformationsServiceImpl.java
@@ -1,6 +1,7 @@
package fr.insee.survey.datacollectionmanagement.query.service.impl;
import fr.insee.survey.datacollectionmanagement.contact.domain.Contact;
+import fr.insee.survey.datacollectionmanagement.contact.enums.GenderEnum;
import fr.insee.survey.datacollectionmanagement.exception.NotFoundException;
import fr.insee.survey.datacollectionmanagement.metadata.domain.Partitioning;
import fr.insee.survey.datacollectionmanagement.metadata.service.CampaignService;
@@ -95,7 +96,7 @@ private QuestioningInformationsDto mapQuestioningInformationsDto(QuestioningInfo
return questioningInformationsDto;
}
- protected String getFormattedPhone(String phone, String phone2) {
+ public String getFormattedPhone(String phone, String phone2) {
if (phone != null && StringUtils.isNotBlank(phone)) {
return phone;
}
@@ -119,16 +120,16 @@ private static AddressInformationsDto getAddressInformationsDto(QuestioningInfor
return addressDto;
}
- protected static String getFormattedCivility(String gender, String firstName, String lastName) {
+ public static String getFormattedCivility(String gender, String firstName, String lastName) {
String formattedGender = "";
String formattedFirstName = "";
String formattedLastName = "";
if (gender != null) {
- if (gender.equalsIgnoreCase(Contact.Gender.Male.name())) {
+ if (gender.equalsIgnoreCase(GenderEnum.Male.name())) {
formattedGender = "M.";
}
- if (gender.equalsIgnoreCase((Contact.Gender.Female.name()))) {
+ if (gender.equalsIgnoreCase((GenderEnum.Female.name()))) {
formattedGender = "Mme";
}
}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/util/LastQuestioningEventComparator.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/comparator/LastQuestioningEventComparator.java
similarity index 90%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/util/LastQuestioningEventComparator.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/comparator/LastQuestioningEventComparator.java
index 8ba70685..bd64e7af 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/util/LastQuestioningEventComparator.java
+++ b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/comparator/LastQuestioningEventComparator.java
@@ -1,25 +1,25 @@
-package fr.insee.survey.datacollectionmanagement.questioning.util;
-
-import fr.insee.survey.datacollectionmanagement.questioning.domain.EventOrder;
-import fr.insee.survey.datacollectionmanagement.questioning.domain.QuestioningEvent;
-import fr.insee.survey.datacollectionmanagement.questioning.service.EventOrderService;
-import lombok.RequiredArgsConstructor;
-import org.springframework.stereotype.Component;
-
-import java.util.Comparator;
-
-@Component
-@RequiredArgsConstructor
-public class LastQuestioningEventComparator implements Comparator {
-
- private final EventOrderService eventOrderService;
-
- @Override
- public int compare(QuestioningEvent o1, QuestioningEvent o2) {
- EventOrder eventOrder1 = eventOrderService.findByStatus(o1.getType().name());
- EventOrder eventOrder2 = eventOrderService.findByStatus(o2.getType().name());
-
- return Integer.compare(eventOrder2.getEventOrder(), eventOrder1.getEventOrder());
- }
-
-}
+package fr.insee.survey.datacollectionmanagement.questioning.comparator;
+
+import fr.insee.survey.datacollectionmanagement.questioning.domain.EventOrder;
+import fr.insee.survey.datacollectionmanagement.questioning.domain.QuestioningEvent;
+import fr.insee.survey.datacollectionmanagement.questioning.service.EventOrderService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Component;
+
+import java.util.Comparator;
+
+@Component
+@RequiredArgsConstructor
+public class LastQuestioningEventComparator implements Comparator {
+
+ private final EventOrderService eventOrderService;
+
+ @Override
+ public int compare(QuestioningEvent o1, QuestioningEvent o2) {
+ EventOrder eventOrder1 = eventOrderService.findByStatus(o1.getType().name());
+ EventOrder eventOrder2 = eventOrderService.findByStatus(o2.getType().name());
+
+ return Integer.compare(eventOrder2.getEventOrder(), eventOrder1.getEventOrder());
+ }
+
+}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/EventOrderService.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/EventOrderService.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/EventOrderService.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/EventOrderService.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/QuestioningAccreditationService.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/QuestioningAccreditationService.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/QuestioningAccreditationService.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/QuestioningAccreditationService.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/QuestioningEventService.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/QuestioningEventService.java
similarity index 89%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/QuestioningEventService.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/QuestioningEventService.java
index 040172ef..110ae389 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/QuestioningEventService.java
+++ b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/QuestioningEventService.java
@@ -1,31 +1,31 @@
-package fr.insee.survey.datacollectionmanagement.questioning.service;
-
-import fr.insee.survey.datacollectionmanagement.questioning.domain.Questioning;
-import fr.insee.survey.datacollectionmanagement.questioning.domain.QuestioningEvent;
-import fr.insee.survey.datacollectionmanagement.questioning.util.TypeQuestioningEvent;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-import java.util.Optional;
-
-@Service
-public interface QuestioningEventService {
-
- public QuestioningEvent findbyId(Long id);
-
- public QuestioningEvent saveQuestioningEvent(QuestioningEvent questioningEvent);
-
- public void deleteQuestioningEvent(Long id);
-
- /**
- * Get the last event sorted by order of importance among the event types
- * (TypeQuestioningEvent) passed in parameter
- *
- * @param questioning
- * @param events list of events to be considered
- * @return optional last Questioning event in order of importance
- */
- Optional getLastQuestioningEvent(Questioning questioning, List events);
-
- Long countIdUploadInEvents(Long idupload);
-}
+package fr.insee.survey.datacollectionmanagement.questioning.service;
+
+import fr.insee.survey.datacollectionmanagement.questioning.domain.Questioning;
+import fr.insee.survey.datacollectionmanagement.questioning.domain.QuestioningEvent;
+import fr.insee.survey.datacollectionmanagement.questioning.enums.TypeQuestioningEvent;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Optional;
+
+@Service
+public interface QuestioningEventService {
+
+ public QuestioningEvent findbyId(Long id);
+
+ public QuestioningEvent saveQuestioningEvent(QuestioningEvent questioningEvent);
+
+ public void deleteQuestioningEvent(Long id);
+
+ /**
+ * Get the last event sorted by order of importance among the event types
+ * (TypeQuestioningEvent) passed in parameter
+ *
+ * @param questioning
+ * @param events list of events to be considered
+ * @return optional last Questioning event in order of importance
+ */
+ Optional getLastQuestioningEvent(Questioning questioning, List events);
+
+ Long countIdUploadInEvents(Long idupload);
+}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/QuestioningService.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/QuestioningService.java
similarity index 97%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/QuestioningService.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/QuestioningService.java
index 26b250d7..bc4c14de 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/QuestioningService.java
+++ b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/QuestioningService.java
@@ -1,37 +1,37 @@
-package fr.insee.survey.datacollectionmanagement.questioning.service;
-
-import fr.insee.survey.datacollectionmanagement.metadata.domain.Partitioning;
-import fr.insee.survey.datacollectionmanagement.questioning.domain.Questioning;
-import org.springframework.data.domain.Page;
-import org.springframework.data.domain.Pageable;
-
-import java.util.Set;
-
-public interface QuestioningService {
-
- public Page findAll(Pageable pageable);
-
- public Questioning findbyId(Long id);
-
- public Questioning saveQuestioning(Questioning questioning);
-
- public void deleteQuestioning(Long id);
-
- public Set findByIdPartitioning(String idPartitioning);
-
- public Questioning findByIdPartitioningAndSurveyUnitIdSu(String idPartitioning, String surveyUnitIdSu);
-
- /**
- * Delete questionings attached to one partitioning
- *
- * @param partitioning
- * @return nb questioning deleted
- */
- public int deleteQuestioningsOfOnePartitioning(Partitioning partitioning);
-
- public Set findBySurveyUnitIdSu(String idSu);
-
- public String getAccessUrl(String baseUrl, String typeUrl, String role, Questioning questioning, String surveyUnitId, String sourceId);
-
-
-}
+package fr.insee.survey.datacollectionmanagement.questioning.service;
+
+import fr.insee.survey.datacollectionmanagement.metadata.domain.Partitioning;
+import fr.insee.survey.datacollectionmanagement.questioning.domain.Questioning;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+
+import java.util.Set;
+
+public interface QuestioningService {
+
+ public Page findAll(Pageable pageable);
+
+ public Questioning findbyId(Long id);
+
+ public Questioning saveQuestioning(Questioning questioning);
+
+ public void deleteQuestioning(Long id);
+
+ public Set findByIdPartitioning(String idPartitioning);
+
+ public Questioning findByIdPartitioningAndSurveyUnitIdSu(String idPartitioning, String surveyUnitIdSu);
+
+ /**
+ * Delete questionings attached to one partitioning
+ *
+ * @param partitioning
+ * @return nb questioning deleted
+ */
+ public int deleteQuestioningsOfOnePartitioning(Partitioning partitioning);
+
+ public Set findBySurveyUnitIdSu(String idSu);
+
+ public String getAccessUrl(String baseUrl, String typeUrl, String role, Questioning questioning, String surveyUnitId, String sourceId);
+
+
+}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/SurveyUnitCommentService.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/SurveyUnitCommentService.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/SurveyUnitCommentService.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/SurveyUnitCommentService.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/SurveyUnitService.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/SurveyUnitService.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/SurveyUnitService.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/SurveyUnitService.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/UploadService.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/UploadService.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/UploadService.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/UploadService.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/EventOrderServiceImpl.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/EventOrderServiceImpl.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/EventOrderServiceImpl.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/EventOrderServiceImpl.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/QuestioningAccreditationServiceImpl.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/QuestioningAccreditationServiceImpl.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/QuestioningAccreditationServiceImpl.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/QuestioningAccreditationServiceImpl.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/QuestioningEventServiceImpl.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/QuestioningEventServiceImpl.java
similarity index 91%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/QuestioningEventServiceImpl.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/QuestioningEventServiceImpl.java
index 36b7d773..b07cc22b 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/QuestioningEventServiceImpl.java
+++ b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/QuestioningEventServiceImpl.java
@@ -1,12 +1,12 @@
package fr.insee.survey.datacollectionmanagement.questioning.service.impl;
import fr.insee.survey.datacollectionmanagement.exception.NotFoundException;
+import fr.insee.survey.datacollectionmanagement.questioning.comparator.LastQuestioningEventComparator;
import fr.insee.survey.datacollectionmanagement.questioning.domain.Questioning;
import fr.insee.survey.datacollectionmanagement.questioning.domain.QuestioningEvent;
+import fr.insee.survey.datacollectionmanagement.questioning.enums.TypeQuestioningEvent;
import fr.insee.survey.datacollectionmanagement.questioning.repository.QuestioningEventRepository;
import fr.insee.survey.datacollectionmanagement.questioning.service.QuestioningEventService;
-import fr.insee.survey.datacollectionmanagement.questioning.util.LastQuestioningEventComparator;
-import fr.insee.survey.datacollectionmanagement.questioning.util.TypeQuestioningEvent;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/QuestioningServiceImpl.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/QuestioningServiceImpl.java
similarity index 90%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/QuestioningServiceImpl.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/QuestioningServiceImpl.java
index 9a69690a..278649d5 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/QuestioningServiceImpl.java
+++ b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/QuestioningServiceImpl.java
@@ -1,188 +1,187 @@
-package fr.insee.survey.datacollectionmanagement.questioning.service.impl;
-
-import fr.insee.survey.datacollectionmanagement.config.ApplicationConfig;
-import fr.insee.survey.datacollectionmanagement.constants.UserRoles;
-import fr.insee.survey.datacollectionmanagement.exception.NotFoundException;
-import fr.insee.survey.datacollectionmanagement.metadata.domain.Partitioning;
-import fr.insee.survey.datacollectionmanagement.questioning.domain.Questioning;
-import fr.insee.survey.datacollectionmanagement.questioning.domain.SurveyUnit;
-import fr.insee.survey.datacollectionmanagement.questioning.repository.QuestioningRepository;
-import fr.insee.survey.datacollectionmanagement.questioning.service.QuestioningAccreditationService;
-import fr.insee.survey.datacollectionmanagement.questioning.service.QuestioningEventService;
-import fr.insee.survey.datacollectionmanagement.questioning.service.QuestioningService;
-import fr.insee.survey.datacollectionmanagement.questioning.service.SurveyUnitService;
-import lombok.RequiredArgsConstructor;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.data.domain.Page;
-import org.springframework.data.domain.Pageable;
-import org.springframework.stereotype.Service;
-import org.springframework.web.util.UriComponentsBuilder;
-
-import java.net.URLEncoder;
-import java.nio.charset.StandardCharsets;
-import java.util.Set;
-
-import static fr.insee.survey.datacollectionmanagement.questioning.util.UrlTypeEnum.*;
-
-@Service
-@RequiredArgsConstructor
-public class QuestioningServiceImpl implements QuestioningService {
-
- private final QuestioningRepository questioningRepository;
-
- private final SurveyUnitService surveyUnitService;
-
- private final QuestioningEventService questioningEventService;
-
- private final QuestioningAccreditationService questioningAccreditationService;
-
- private final ApplicationConfig applicationConfig;
-
- private static final String PATH_LOGOUT = "pathLogout";
- private static final String PATH_ASSISTANCE = "pathAssistance";
-
- @Override
- public Page findAll(Pageable pageable) {
- return questioningRepository.findAll(pageable);
- }
-
- @Override
- public Questioning findbyId(Long id) {
- return questioningRepository.findById(id).orElseThrow(() -> new NotFoundException(String.format("Questioning %s not found", id)));
- }
-
- @Override
- public Questioning saveQuestioning(Questioning questioning) {
- return questioningRepository.save(questioning);
- }
-
- @Override
- public void deleteQuestioning(Long id) {
- questioningRepository.deleteById(id);
- }
-
- @Override
- public Set findByIdPartitioning(String idPartitioning) {
- return questioningRepository.findByIdPartitioning(idPartitioning);
- }
-
- @Override
- public Questioning findByIdPartitioningAndSurveyUnitIdSu(String idPartitioning,
- String surveyUnitIdSu) {
- return questioningRepository.findByIdPartitioningAndSurveyUnitIdSu(idPartitioning,
- surveyUnitIdSu);
- }
-
- @Override
- public int deleteQuestioningsOfOnePartitioning(Partitioning partitioning) {
- int nbQuestioningDeleted = 0;
- Set setQuestionings = findByIdPartitioning(partitioning.getId());
- for (Questioning q : setQuestionings) {
- SurveyUnit su = q.getSurveyUnit();
- su.getQuestionings().remove(q);
- surveyUnitService.saveSurveyUnit(su);
- q.getQuestioningEvents().forEach(qe -> questioningEventService.deleteQuestioningEvent(qe.getId()));
- q.getQuestioningAccreditations().forEach(questioningAccreditationService::deleteAccreditation);
- deleteQuestioning(q.getId());
- nbQuestioningDeleted++;
- }
- return nbQuestioningDeleted;
- }
-
- @Override
- public Set findBySurveyUnitIdSu(String idSu) {
- return questioningRepository.findBySurveyUnitIdSu(idSu);
- }
-
-
- /**
- * Generates an access URL based on the provided parameters.
- *
- * @param baseUrl The base URL for the access.
- * @param typeUrl The type of URL (V1 or V2).
- * @param role The user role (REVIEWER or INTERVIEWER).
- * @param questioning The questioning object.
- * @param surveyUnitId The survey unit ID.
- * @return The generated access URL.
- */
- public String getAccessUrl(String baseUrl, String typeUrl, String role, Questioning questioning, String surveyUnitId, String sourceId) {
- // Set default values if baseUrl or typeUrl is empty
- baseUrl = StringUtils.defaultIfEmpty(baseUrl, applicationConfig.getQuestioningUrl());
- typeUrl = StringUtils.defaultIfEmpty(typeUrl, V3.name());
-
- if (typeUrl.equalsIgnoreCase(V1.name())) {
- return buildV1Url(baseUrl, role, questioning.getModelName(), surveyUnitId);
- }
- if (typeUrl.equalsIgnoreCase(V2.name())) {
- return buildV2Url(baseUrl, role, questioning.getModelName(), surveyUnitId);
- }
- if (typeUrl.equalsIgnoreCase(V3.name())) {
- return buildV3Url(baseUrl, role, questioning.getModelName(), surveyUnitId, sourceId, questioning.getId());
- }
-
- return "";
- }
-
-
- /**
- * Builds a V1 access URL based on the provided parameters.
- *
- * @param baseUrl The base URL for the access.
- * @param role The user role (REVIEWER or INTERVIEWER).
- * @param campaignId The campaign ID.
- * @param surveyUnitId The survey unit ID.
- * @return The generated V1 access URL.
- */
- protected String buildV1Url(String baseUrl, String role, String campaignId, String surveyUnitId) {
- if (role.equalsIgnoreCase(UserRoles.REVIEWER)) {
- return String.format("%s/visualiser/%s/%s", baseUrl, campaignId, surveyUnitId);
- }
- if (role.equalsIgnoreCase(UserRoles.INTERVIEWER)) {
- return String.format("%s/repondre/%s/%s", baseUrl, campaignId, surveyUnitId);
- }
- return "";
- }
-
- /**
- * Builds a V3 access URL based on the provided parameters
- *
- * @param baseUrl The base URL for the access.
- * @param role The user role (REVIEWER or INTERVIEWER).
- * @param modelName The model ID.
- * @param surveyUnitId The survey unit ID.
- * @return The generated V3 access URL.
- */
-
- protected String buildV2Url(String baseUrl, String role, String modelName, String surveyUnitId) {
- if (UserRoles.REVIEWER.equalsIgnoreCase(role)) {
- return String.format("%s/readonly/questionnaire/%s/unite-enquetee/%s", baseUrl, modelName, surveyUnitId);
- }
- if (UserRoles.INTERVIEWER.equalsIgnoreCase(role)) {
- return String.format("%s/questionnaire/%s/unite-enquetee/%s", baseUrl, modelName, surveyUnitId);
- }
- return "";
- }
-
- /**
- * Builds a V3 access URL based on the provided parameters
- *
- * @param baseUrl The base URL for the access.
- * @param role The user role (REVIEWER or INTERVIEWER).
- * @param modelName The model ID.
- * @param surveyUnitId The survey unit ID.
- * @return The generated V3 access URL.
- */
- protected String buildV3Url(String baseUrl, String role, String modelName, String surveyUnitId, String sourceId, Long questioningId) {
- if (UserRoles.REVIEWER.equalsIgnoreCase(role)) {
- return UriComponentsBuilder.fromHttpUrl(String.format("%s/v3/review/questionnaire/%s/unite-enquetee/%s", baseUrl, modelName, surveyUnitId)).toUriString();
- }
- if (UserRoles.INTERVIEWER.equalsIgnoreCase(role)) {
- return UriComponentsBuilder.fromHttpUrl(String.format("%s/v3/questionnaire/%s/unite-enquetee/%s", baseUrl, modelName, surveyUnitId))
- .queryParam(PATH_LOGOUT, URLEncoder.encode("/" + sourceId, StandardCharsets.UTF_8))
- .queryParam(PATH_ASSISTANCE, URLEncoder.encode("/" + sourceId + "/contacter-assistance/auth?questioningId=" + questioningId, StandardCharsets.UTF_8))
- .build().toUriString();
- }
- return "";
- }
-
-}
+package fr.insee.survey.datacollectionmanagement.questioning.service.impl;
+
+import fr.insee.survey.datacollectionmanagement.constants.UserRoles;
+import fr.insee.survey.datacollectionmanagement.exception.NotFoundException;
+import fr.insee.survey.datacollectionmanagement.metadata.domain.Partitioning;
+import fr.insee.survey.datacollectionmanagement.questioning.domain.Questioning;
+import fr.insee.survey.datacollectionmanagement.questioning.domain.SurveyUnit;
+import fr.insee.survey.datacollectionmanagement.questioning.repository.QuestioningRepository;
+import fr.insee.survey.datacollectionmanagement.questioning.service.QuestioningAccreditationService;
+import fr.insee.survey.datacollectionmanagement.questioning.service.QuestioningEventService;
+import fr.insee.survey.datacollectionmanagement.questioning.service.QuestioningService;
+import fr.insee.survey.datacollectionmanagement.questioning.service.SurveyUnitService;
+import lombok.RequiredArgsConstructor;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+import org.springframework.stereotype.Service;
+import org.springframework.web.util.UriComponentsBuilder;
+
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
+import java.util.Set;
+
+import static fr.insee.survey.datacollectionmanagement.questioning.enums.UrlTypeEnum.*;
+
+@Service
+@RequiredArgsConstructor
+public class QuestioningServiceImpl implements QuestioningService {
+
+ private final QuestioningRepository questioningRepository;
+
+ private final SurveyUnitService surveyUnitService;
+
+ private final QuestioningEventService questioningEventService;
+
+ private final QuestioningAccreditationService questioningAccreditationService;
+
+ private final String questioningUrl;
+
+ private static final String PATH_LOGOUT = "pathLogout";
+ private static final String PATH_ASSISTANCE = "pathAssistance";
+
+ @Override
+ public Page findAll(Pageable pageable) {
+ return questioningRepository.findAll(pageable);
+ }
+
+ @Override
+ public Questioning findbyId(Long id) {
+ return questioningRepository.findById(id).orElseThrow(() -> new NotFoundException(String.format("Questioning %s not found", id)));
+ }
+
+ @Override
+ public Questioning saveQuestioning(Questioning questioning) {
+ return questioningRepository.save(questioning);
+ }
+
+ @Override
+ public void deleteQuestioning(Long id) {
+ questioningRepository.deleteById(id);
+ }
+
+ @Override
+ public Set findByIdPartitioning(String idPartitioning) {
+ return questioningRepository.findByIdPartitioning(idPartitioning);
+ }
+
+ @Override
+ public Questioning findByIdPartitioningAndSurveyUnitIdSu(String idPartitioning,
+ String surveyUnitIdSu) {
+ return questioningRepository.findByIdPartitioningAndSurveyUnitIdSu(idPartitioning,
+ surveyUnitIdSu);
+ }
+
+ @Override
+ public int deleteQuestioningsOfOnePartitioning(Partitioning partitioning) {
+ int nbQuestioningDeleted = 0;
+ Set setQuestionings = findByIdPartitioning(partitioning.getId());
+ for (Questioning q : setQuestionings) {
+ SurveyUnit su = q.getSurveyUnit();
+ su.getQuestionings().remove(q);
+ surveyUnitService.saveSurveyUnit(su);
+ q.getQuestioningEvents().forEach(qe -> questioningEventService.deleteQuestioningEvent(qe.getId()));
+ q.getQuestioningAccreditations().forEach(questioningAccreditationService::deleteAccreditation);
+ deleteQuestioning(q.getId());
+ nbQuestioningDeleted++;
+ }
+ return nbQuestioningDeleted;
+ }
+
+ @Override
+ public Set findBySurveyUnitIdSu(String idSu) {
+ return questioningRepository.findBySurveyUnitIdSu(idSu);
+ }
+
+
+ /**
+ * Generates an access URL based on the provided parameters.
+ *
+ * @param baseUrl The base URL for the access.
+ * @param typeUrl The type of URL (V1 or V2).
+ * @param role The user role (REVIEWER or INTERVIEWER).
+ * @param questioning The questioning object.
+ * @param surveyUnitId The survey unit ID.
+ * @return The generated access URL.
+ */
+ public String getAccessUrl(String baseUrl, String typeUrl, String role, Questioning questioning, String surveyUnitId, String sourceId) {
+ // Set default values if baseUrl or typeUrl is empty
+ baseUrl = StringUtils.defaultIfEmpty(baseUrl, questioningUrl);
+ typeUrl = StringUtils.defaultIfEmpty(typeUrl, V3.name());
+
+ if (typeUrl.equalsIgnoreCase(V1.name())) {
+ return buildV1Url(baseUrl, role, questioning.getModelName(), surveyUnitId);
+ }
+ if (typeUrl.equalsIgnoreCase(V2.name())) {
+ return buildV2Url(baseUrl, role, questioning.getModelName(), surveyUnitId);
+ }
+ if (typeUrl.equalsIgnoreCase(V3.name())) {
+ return buildV3Url(baseUrl, role, questioning.getModelName(), surveyUnitId, sourceId, questioning.getId());
+ }
+
+ return "";
+ }
+
+
+ /**
+ * Builds a V1 access URL based on the provided parameters.
+ *
+ * @param baseUrl The base URL for the access.
+ * @param role The user role (REVIEWER or INTERVIEWER).
+ * @param campaignId The campaign ID.
+ * @param surveyUnitId The survey unit ID.
+ * @return The generated V1 access URL.
+ */
+ public String buildV1Url(String baseUrl, String role, String campaignId, String surveyUnitId) {
+ if (role.equalsIgnoreCase(UserRoles.REVIEWER)) {
+ return String.format("%s/visualiser/%s/%s", baseUrl, campaignId, surveyUnitId);
+ }
+ if (role.equalsIgnoreCase(UserRoles.INTERVIEWER)) {
+ return String.format("%s/repondre/%s/%s", baseUrl, campaignId, surveyUnitId);
+ }
+ return "";
+ }
+
+ /**
+ * Builds a V3 access URL based on the provided parameters
+ *
+ * @param baseUrl The base URL for the access.
+ * @param role The user role (REVIEWER or INTERVIEWER).
+ * @param modelName The model ID.
+ * @param surveyUnitId The survey unit ID.
+ * @return The generated V3 access URL.
+ */
+
+ public String buildV2Url(String baseUrl, String role, String modelName, String surveyUnitId) {
+ if (UserRoles.REVIEWER.equalsIgnoreCase(role)) {
+ return String.format("%s/readonly/questionnaire/%s/unite-enquetee/%s", baseUrl, modelName, surveyUnitId);
+ }
+ if (UserRoles.INTERVIEWER.equalsIgnoreCase(role)) {
+ return String.format("%s/questionnaire/%s/unite-enquetee/%s", baseUrl, modelName, surveyUnitId);
+ }
+ return "";
+ }
+
+ /**
+ * Builds a V3 access URL based on the provided parameters
+ *
+ * @param baseUrl The base URL for the access.
+ * @param role The user role (REVIEWER or INTERVIEWER).
+ * @param modelName The model ID.
+ * @param surveyUnitId The survey unit ID.
+ * @return The generated V3 access URL.
+ */
+ public String buildV3Url(String baseUrl, String role, String modelName, String surveyUnitId, String sourceId, Long questioningId) {
+ if (UserRoles.REVIEWER.equalsIgnoreCase(role)) {
+ return UriComponentsBuilder.fromHttpUrl(String.format("%s/v3/review/questionnaire/%s/unite-enquetee/%s", baseUrl, modelName, surveyUnitId)).toUriString();
+ }
+ if (UserRoles.INTERVIEWER.equalsIgnoreCase(role)) {
+ return UriComponentsBuilder.fromHttpUrl(String.format("%s/v3/questionnaire/%s/unite-enquetee/%s", baseUrl, modelName, surveyUnitId))
+ .queryParam(PATH_LOGOUT, URLEncoder.encode("/" + sourceId, StandardCharsets.UTF_8))
+ .queryParam(PATH_ASSISTANCE, URLEncoder.encode("/" + sourceId + "/contacter-assistance/auth?questioningId=" + questioningId, StandardCharsets.UTF_8))
+ .build().toUriString();
+ }
+ return "";
+ }
+
+}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/SurveyUnitCommentServiceImpl.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/SurveyUnitCommentServiceImpl.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/SurveyUnitCommentServiceImpl.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/SurveyUnitCommentServiceImpl.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/SurveyUnitServiceImpl.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/SurveyUnitServiceImpl.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/SurveyUnitServiceImpl.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/SurveyUnitServiceImpl.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/UploadServiceImpl.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/UploadServiceImpl.java
similarity index 93%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/UploadServiceImpl.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/UploadServiceImpl.java
index 22eec767..95d09785 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/UploadServiceImpl.java
+++ b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/UploadServiceImpl.java
@@ -1,6 +1,7 @@
package fr.insee.survey.datacollectionmanagement.questioning.service.impl;
-import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.JsonNodeFactory;
+import com.fasterxml.jackson.databind.node.ObjectNode;
import fr.insee.survey.datacollectionmanagement.exception.NotFoundException;
import fr.insee.survey.datacollectionmanagement.exception.RessourceNotValidatedException;
import fr.insee.survey.datacollectionmanagement.metadata.domain.Campaign;
@@ -12,14 +13,13 @@
import fr.insee.survey.datacollectionmanagement.questioning.domain.QuestioningEvent;
import fr.insee.survey.datacollectionmanagement.questioning.domain.Upload;
import fr.insee.survey.datacollectionmanagement.questioning.dto.UploadDto;
+import fr.insee.survey.datacollectionmanagement.questioning.enums.TypeQuestioningEvent;
import fr.insee.survey.datacollectionmanagement.questioning.repository.UploadRepository;
import fr.insee.survey.datacollectionmanagement.questioning.service.QuestioningEventService;
import fr.insee.survey.datacollectionmanagement.questioning.service.QuestioningService;
import fr.insee.survey.datacollectionmanagement.questioning.service.UploadService;
-import fr.insee.survey.datacollectionmanagement.questioning.util.TypeQuestioningEvent;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
-import net.minidev.json.JSONObject;
import org.springframework.stereotype.Service;
import java.util.*;
@@ -73,11 +73,11 @@ public ResultUpload save(String idCampaign, UploadDto uploadDto) throws Ressourc
qe.setUpload(up);
qe.setType(TypeQuestioningEvent.valueOf(mmDto.getStatus()));
qe.setQuestioning(quest.get());
- JSONObject jo = new JSONObject();
- jo.put("source", "Moog IHM - Post Event by upload");
- jo.put("author", mmDto.getIdContact());
- ObjectMapper objectMapper = new ObjectMapper();
- qe.setPayload(objectMapper.readTree(jo.toString()));
+ ObjectNode payload = JsonNodeFactory.instance.objectNode();
+
+ payload.put("source", "Moog IHM - Post Event by upload");
+ payload.put("author", mmDto.getIdContact());
+ qe.setPayload(payload);
qe.setDate(today);
liste.add(questioningEventService.saveQuestioningEvent(qe));
if (quest.isPresent()) {
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/user/exception/RoleException.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/user/exception/RoleException.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/user/exception/RoleException.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/user/exception/RoleException.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/user/service/SourceAccreditationService.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/user/service/SourceAccreditationService.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/user/service/SourceAccreditationService.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/user/service/SourceAccreditationService.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/user/service/UserEventService.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/user/service/UserEventService.java
similarity index 81%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/user/service/UserEventService.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/user/service/UserEventService.java
index 8fd8898e..b5dd18aa 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/user/service/UserEventService.java
+++ b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/user/service/UserEventService.java
@@ -4,6 +4,7 @@
import com.fasterxml.jackson.databind.JsonNode;
import fr.insee.survey.datacollectionmanagement.user.domain.User;
import fr.insee.survey.datacollectionmanagement.user.domain.UserEvent;
+import fr.insee.survey.datacollectionmanagement.user.enums.UserEventTypeEnum;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
@@ -23,7 +24,7 @@ public interface UserEventService {
public Set findUserEventsByUser (User user);
- UserEvent createUserEvent(User user, UserEvent.UserEventType type, JsonNode payload);
+ UserEvent createUserEvent(User user, UserEventTypeEnum type, JsonNode payload);
}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/user/service/UserService.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/user/service/UserService.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/user/service/UserService.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/user/service/UserService.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/user/service/impl/SourceAccreditationServiceImpl.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/user/service/impl/SourceAccreditationServiceImpl.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/user/service/impl/SourceAccreditationServiceImpl.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/user/service/impl/SourceAccreditationServiceImpl.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/user/service/impl/UserEventServiceImpl.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/user/service/impl/UserEventServiceImpl.java
similarity index 91%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/user/service/impl/UserEventServiceImpl.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/user/service/impl/UserEventServiceImpl.java
index b5f323bd..19054b85 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/user/service/impl/UserEventServiceImpl.java
+++ b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/user/service/impl/UserEventServiceImpl.java
@@ -5,6 +5,7 @@
import fr.insee.survey.datacollectionmanagement.exception.NotFoundException;
import fr.insee.survey.datacollectionmanagement.user.domain.User;
import fr.insee.survey.datacollectionmanagement.user.domain.UserEvent;
+import fr.insee.survey.datacollectionmanagement.user.enums.UserEventTypeEnum;
import fr.insee.survey.datacollectionmanagement.user.repository.UserEventRepository;
import fr.insee.survey.datacollectionmanagement.user.service.UserEventService;
import lombok.RequiredArgsConstructor;
@@ -47,7 +48,7 @@ public Set findUserEventsByUser(User user) {
}
@Override
- public UserEvent createUserEvent(User user, UserEvent.UserEventType type, JsonNode payload) {
+ public UserEvent createUserEvent(User user, UserEventTypeEnum type, JsonNode payload) {
UserEvent userEventCreate = new UserEvent();
userEventCreate.setUser(user);
userEventCreate.setType(type);
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/user/service/impl/UserServiceImpl.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/user/service/impl/UserServiceImpl.java
similarity index 95%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/user/service/impl/UserServiceImpl.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/user/service/impl/UserServiceImpl.java
index c18071bd..2cb54695 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/user/service/impl/UserServiceImpl.java
+++ b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/user/service/impl/UserServiceImpl.java
@@ -6,6 +6,7 @@
import fr.insee.survey.datacollectionmanagement.user.domain.SourceAccreditation;
import fr.insee.survey.datacollectionmanagement.user.domain.User;
import fr.insee.survey.datacollectionmanagement.user.domain.UserEvent;
+import fr.insee.survey.datacollectionmanagement.user.enums.UserEventTypeEnum;
import fr.insee.survey.datacollectionmanagement.user.repository.UserRepository;
import fr.insee.survey.datacollectionmanagement.user.service.SourceAccreditationService;
import fr.insee.survey.datacollectionmanagement.user.service.UserEventService;
@@ -56,7 +57,7 @@ public void deleteUser(String identifier) {
@Override
public User createUser(User user, JsonNode payload) {
- UserEvent newUserEvent = userEventService.createUserEvent(user, UserEvent.UserEventType.CREATE,
+ UserEvent newUserEvent = userEventService.createUserEvent(user, UserEventTypeEnum.CREATE,
payload);
user.setUserEvents(new HashSet<>(Arrays.asList(newUserEvent)));
return saveUser(user);
@@ -68,7 +69,7 @@ public User updateUser(User user, JsonNode payload) {
User existingUser = findByIdentifier(user.getIdentifier());
Set setUserEventsUser = existingUser.getUserEvents();
- UserEvent userEventUpdate = userEventService.createUserEvent(user, UserEvent.UserEventType.UPDATE,
+ UserEvent userEventUpdate = userEventService.createUserEvent(user, UserEventTypeEnum.UPDATE,
payload);
setUserEventsUser.add(userEventUpdate);
user.setUserEvents(setUserEventsUser);
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/view/service/ViewService.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/view/service/ViewService.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/view/service/ViewService.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/view/service/ViewService.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/view/serviceImpl/ViewServiceImpl.java b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/view/service/impl/ViewServiceImpl.java
similarity index 97%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/view/serviceImpl/ViewServiceImpl.java
rename to platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/view/service/impl/ViewServiceImpl.java
index 768ff10c..d0667c8d 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/view/serviceImpl/ViewServiceImpl.java
+++ b/platine-management-service/src/main/java/fr/insee/survey/datacollectionmanagement/view/service/impl/ViewServiceImpl.java
@@ -1,4 +1,4 @@
-package fr.insee.survey.datacollectionmanagement.view.serviceImpl;
+package fr.insee.survey.datacollectionmanagement.view.service.impl;
import fr.insee.survey.datacollectionmanagement.metadata.domain.Campaign;
import fr.insee.survey.datacollectionmanagement.view.domain.View;
diff --git a/src/test/java/fr/insee/survey/datacollectionmanagement/query/service/impl/QuestioningInformationsServiceImplTest.java b/platine-management-service/src/test/java/datacollectionmanagement/query/service/impl/QuestioningInformationsServiceImplTest.java
similarity index 97%
rename from src/test/java/fr/insee/survey/datacollectionmanagement/query/service/impl/QuestioningInformationsServiceImplTest.java
rename to platine-management-service/src/test/java/datacollectionmanagement/query/service/impl/QuestioningInformationsServiceImplTest.java
index a81758c2..c5ecb9c6 100644
--- a/src/test/java/fr/insee/survey/datacollectionmanagement/query/service/impl/QuestioningInformationsServiceImplTest.java
+++ b/platine-management-service/src/test/java/datacollectionmanagement/query/service/impl/QuestioningInformationsServiceImplTest.java
@@ -1,5 +1,6 @@
-package fr.insee.survey.datacollectionmanagement.query.service.impl;
+package datacollectionmanagement.query.service.impl;
+import fr.insee.survey.datacollectionmanagement.query.service.impl.QuestioningInformationsServiceImpl;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
diff --git a/src/test/java/fr/insee/survey/datacollectionmanagement/questioning/repository/dummy/QuestioningRepositoryDummy.java b/platine-management-service/src/test/java/datacollectionmanagement/questioning/repository/dummy/QuestioningRepositoryDummy.java
similarity index 98%
rename from src/test/java/fr/insee/survey/datacollectionmanagement/questioning/repository/dummy/QuestioningRepositoryDummy.java
rename to platine-management-service/src/test/java/datacollectionmanagement/questioning/repository/dummy/QuestioningRepositoryDummy.java
index 625976e1..a415e676 100644
--- a/src/test/java/fr/insee/survey/datacollectionmanagement/questioning/repository/dummy/QuestioningRepositoryDummy.java
+++ b/platine-management-service/src/test/java/datacollectionmanagement/questioning/repository/dummy/QuestioningRepositoryDummy.java
@@ -1,4 +1,4 @@
-package fr.insee.survey.datacollectionmanagement.questioning.repository.dummy;
+package datacollectionmanagement.questioning.repository.dummy;
import fr.insee.survey.datacollectionmanagement.questioning.domain.Questioning;
import fr.insee.survey.datacollectionmanagement.questioning.repository.QuestioningRepository;
diff --git a/src/test/java/fr/insee/survey/datacollectionmanagement/questioning/service/dummy/QuestioningAccreditationServiceDummy.java b/platine-management-service/src/test/java/datacollectionmanagement/questioning/service/dummy/QuestioningAccreditationServiceDummy.java
similarity index 92%
rename from src/test/java/fr/insee/survey/datacollectionmanagement/questioning/service/dummy/QuestioningAccreditationServiceDummy.java
rename to platine-management-service/src/test/java/datacollectionmanagement/questioning/service/dummy/QuestioningAccreditationServiceDummy.java
index f67d5670..109a6fc3 100644
--- a/src/test/java/fr/insee/survey/datacollectionmanagement/questioning/service/dummy/QuestioningAccreditationServiceDummy.java
+++ b/platine-management-service/src/test/java/datacollectionmanagement/questioning/service/dummy/QuestioningAccreditationServiceDummy.java
@@ -1,4 +1,4 @@
-package fr.insee.survey.datacollectionmanagement.questioning.service.dummy;
+package datacollectionmanagement.questioning.service.dummy;
import fr.insee.survey.datacollectionmanagement.questioning.domain.QuestioningAccreditation;
import fr.insee.survey.datacollectionmanagement.questioning.service.QuestioningAccreditationService;
diff --git a/src/test/java/fr/insee/survey/datacollectionmanagement/questioning/service/dummy/QuestioningEventServiceDummy.java b/platine-management-service/src/test/java/datacollectionmanagement/questioning/service/dummy/QuestioningEventServiceDummy.java
similarity index 85%
rename from src/test/java/fr/insee/survey/datacollectionmanagement/questioning/service/dummy/QuestioningEventServiceDummy.java
rename to platine-management-service/src/test/java/datacollectionmanagement/questioning/service/dummy/QuestioningEventServiceDummy.java
index 4070e0d2..0e009205 100644
--- a/src/test/java/fr/insee/survey/datacollectionmanagement/questioning/service/dummy/QuestioningEventServiceDummy.java
+++ b/platine-management-service/src/test/java/datacollectionmanagement/questioning/service/dummy/QuestioningEventServiceDummy.java
@@ -1,9 +1,9 @@
-package fr.insee.survey.datacollectionmanagement.questioning.service.dummy;
+package datacollectionmanagement.questioning.service.dummy;
import fr.insee.survey.datacollectionmanagement.questioning.domain.Questioning;
import fr.insee.survey.datacollectionmanagement.questioning.domain.QuestioningEvent;
+import fr.insee.survey.datacollectionmanagement.questioning.enums.TypeQuestioningEvent;
import fr.insee.survey.datacollectionmanagement.questioning.service.QuestioningEventService;
-import fr.insee.survey.datacollectionmanagement.questioning.util.TypeQuestioningEvent;
import java.util.List;
import java.util.Optional;
diff --git a/src/test/java/fr/insee/survey/datacollectionmanagement/questioning/service/dummy/SurveyUnitServiceDummy.java b/platine-management-service/src/test/java/datacollectionmanagement/questioning/service/dummy/SurveyUnitServiceDummy.java
similarity index 94%
rename from src/test/java/fr/insee/survey/datacollectionmanagement/questioning/service/dummy/SurveyUnitServiceDummy.java
rename to platine-management-service/src/test/java/datacollectionmanagement/questioning/service/dummy/SurveyUnitServiceDummy.java
index c48331dd..22c50f0f 100644
--- a/src/test/java/fr/insee/survey/datacollectionmanagement/questioning/service/dummy/SurveyUnitServiceDummy.java
+++ b/platine-management-service/src/test/java/datacollectionmanagement/questioning/service/dummy/SurveyUnitServiceDummy.java
@@ -1,4 +1,4 @@
-package fr.insee.survey.datacollectionmanagement.questioning.service.dummy;
+package datacollectionmanagement.questioning.service.dummy;
import fr.insee.survey.datacollectionmanagement.questioning.domain.SurveyUnit;
import fr.insee.survey.datacollectionmanagement.questioning.dto.SearchSurveyUnitDto;
diff --git a/src/test/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/QuestioningServiceImplTest.java b/platine-management-service/src/test/java/datacollectionmanagement/questioning/service/impl/QuestioningServiceImplTest.java
similarity index 87%
rename from src/test/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/QuestioningServiceImplTest.java
rename to platine-management-service/src/test/java/datacollectionmanagement/questioning/service/impl/QuestioningServiceImplTest.java
index ad9c13ad..d13563e4 100644
--- a/src/test/java/fr/insee/survey/datacollectionmanagement/questioning/service/impl/QuestioningServiceImplTest.java
+++ b/platine-management-service/src/test/java/datacollectionmanagement/questioning/service/impl/QuestioningServiceImplTest.java
@@ -1,15 +1,15 @@
-package fr.insee.survey.datacollectionmanagement.questioning.service.impl;
+package datacollectionmanagement.questioning.service.impl;
-import fr.insee.survey.datacollectionmanagement.config.ApplicationConfig;
+import datacollectionmanagement.questioning.repository.dummy.QuestioningRepositoryDummy;
+import datacollectionmanagement.questioning.service.dummy.QuestioningAccreditationServiceDummy;
+import datacollectionmanagement.questioning.service.dummy.QuestioningEventServiceDummy;
+import datacollectionmanagement.questioning.service.dummy.SurveyUnitServiceDummy;
import fr.insee.survey.datacollectionmanagement.constants.UserRoles;
import fr.insee.survey.datacollectionmanagement.questioning.repository.QuestioningRepository;
-import fr.insee.survey.datacollectionmanagement.questioning.repository.dummy.QuestioningRepositoryDummy;
import fr.insee.survey.datacollectionmanagement.questioning.service.QuestioningAccreditationService;
import fr.insee.survey.datacollectionmanagement.questioning.service.QuestioningEventService;
import fr.insee.survey.datacollectionmanagement.questioning.service.SurveyUnitService;
-import fr.insee.survey.datacollectionmanagement.questioning.service.dummy.QuestioningAccreditationServiceDummy;
-import fr.insee.survey.datacollectionmanagement.questioning.service.dummy.QuestioningEventServiceDummy;
-import fr.insee.survey.datacollectionmanagement.questioning.service.dummy.SurveyUnitServiceDummy;
+import fr.insee.survey.datacollectionmanagement.questioning.service.impl.QuestioningServiceImpl;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
@@ -26,8 +26,8 @@ void init() {
SurveyUnitService surveyUnitService = new SurveyUnitServiceDummy();
QuestioningEventService questioningEventService = new QuestioningEventServiceDummy();
QuestioningAccreditationService questioningAccreditationService = new QuestioningAccreditationServiceDummy();
- ApplicationConfig applicationConfig = new ApplicationConfig();
- questioningService = new QuestioningServiceImpl(questioningRepository, surveyUnitService, questioningEventService, questioningAccreditationService, applicationConfig);
+ String questioningUrl = "questioning-url";
+ questioningService = new QuestioningServiceImpl(questioningRepository, surveyUnitService, questioningEventService, questioningAccreditationService, questioningUrl);
}
@Test
diff --git a/platine-management-shared/pom.xml b/platine-management-shared/pom.xml
new file mode 100644
index 00000000..168bbf36
--- /dev/null
+++ b/platine-management-shared/pom.xml
@@ -0,0 +1,13 @@
+
+
+ 4.0.0
+
+ fr.insee.survey
+ platine-management
+ ${revision}${changelist}
+
+
+ platine-management-shared
+
\ No newline at end of file
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/constants/AuthConstants.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/constants/AuthConstants.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/constants/AuthConstants.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/constants/AuthConstants.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/config/auth/user/AuthorityRoleEnum.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/constants/AuthorityRoleEnum.java
similarity index 78%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/config/auth/user/AuthorityRoleEnum.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/constants/AuthorityRoleEnum.java
index 1e150106..e09f81fb 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/config/auth/user/AuthorityRoleEnum.java
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/constants/AuthorityRoleEnum.java
@@ -1,4 +1,4 @@
-package fr.insee.survey.datacollectionmanagement.config.auth.user;
+package fr.insee.survey.datacollectionmanagement.constants;
public enum AuthorityRoleEnum {
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/constants/UserRoles.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/constants/UserRoles.java
similarity index 99%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/constants/UserRoles.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/constants/UserRoles.java
index df7c0020..e79e9581 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/constants/UserRoles.java
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/constants/UserRoles.java
@@ -1,10 +1,10 @@
package fr.insee.survey.datacollectionmanagement.constants;
public class UserRoles {
-
private UserRoles() {
throw new IllegalStateException("Utility class");
}
+
public static final String INTERVIEWER = "interviewer";
public static final String REVIEWER = "reviewer";
-}
+}
\ No newline at end of file
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/dto/AddressDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/dto/AddressDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/contact/dto/AddressDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/dto/AddressDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/dto/ContactDetailsDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/dto/ContactDetailsDto.java
similarity index 85%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/contact/dto/ContactDetailsDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/dto/ContactDetailsDto.java
index f9a26fd6..5571263d 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/dto/ContactDetailsDto.java
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/dto/ContactDetailsDto.java
@@ -1,6 +1,6 @@
package fr.insee.survey.datacollectionmanagement.contact.dto;
-import fr.insee.survey.datacollectionmanagement.contact.domain.Contact;
+import fr.insee.survey.datacollectionmanagement.contact.enums.GenderEnum;
import fr.insee.survey.datacollectionmanagement.contact.validation.ContactGenderValid;
import lombok.Getter;
import lombok.Setter;
@@ -14,7 +14,7 @@ public class ContactDetailsDto {
private String identifier;
private String externalId;
@ContactGenderValid
- private Contact.Gender civility;
+ private GenderEnum civility;
private String lastName;
private String firstName;
private String function;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/dto/ContactDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/dto/ContactDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/contact/dto/ContactDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/dto/ContactDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/dto/ContactEventDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/dto/ContactEventDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/contact/dto/ContactEventDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/dto/ContactEventDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/dto/SearchContactDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/dto/SearchContactDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/contact/dto/SearchContactDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/dto/SearchContactDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/dto/SearchContactDtoImpl.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/dto/SearchContactDtoImpl.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/contact/dto/SearchContactDtoImpl.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/dto/SearchContactDtoImpl.java
diff --git a/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/enums/ContactEventTypeEnum.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/enums/ContactEventTypeEnum.java
new file mode 100644
index 00000000..ae810cc1
--- /dev/null
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/enums/ContactEventTypeEnum.java
@@ -0,0 +1,5 @@
+package fr.insee.survey.datacollectionmanagement.contact.enums;
+
+public enum ContactEventTypeEnum {
+ create, update, merged, firstConnect, reinitPassword
+}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/util/ContactParamEnum.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/enums/ContactParamEnum.java
similarity index 89%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/contact/util/ContactParamEnum.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/enums/ContactParamEnum.java
index 7558230d..aa774986 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/util/ContactParamEnum.java
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/enums/ContactParamEnum.java
@@ -1,4 +1,4 @@
-package fr.insee.survey.datacollectionmanagement.contact.util;
+package fr.insee.survey.datacollectionmanagement.contact.enums;
import lombok.Getter;
diff --git a/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/enums/GenderEnum.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/enums/GenderEnum.java
new file mode 100644
index 00000000..d834eabf
--- /dev/null
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/enums/GenderEnum.java
@@ -0,0 +1,5 @@
+package fr.insee.survey.datacollectionmanagement.contact.enums;
+
+public enum GenderEnum {
+ Female, Male, Undefined
+}
\ No newline at end of file
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/validation/ContactEventTypeValid.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/validation/ContactEventTypeValid.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/contact/validation/ContactEventTypeValid.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/validation/ContactEventTypeValid.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/validation/ContactEventTypeValidator.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/validation/ContactEventTypeValidator.java
similarity index 76%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/contact/validation/ContactEventTypeValidator.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/validation/ContactEventTypeValidator.java
index f2de33f6..c5f7181d 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/validation/ContactEventTypeValidator.java
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/validation/ContactEventTypeValidator.java
@@ -1,6 +1,6 @@
package fr.insee.survey.datacollectionmanagement.contact.validation;
-import fr.insee.survey.datacollectionmanagement.contact.domain.ContactEvent;
+import fr.insee.survey.datacollectionmanagement.contact.enums.ContactEventTypeEnum;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;
@@ -18,6 +18,6 @@ public void initialize(ContactEventTypeValid constraintAnnotation) {
public boolean isValid(String value, ConstraintValidatorContext context) {
if (value == null)
return false;
- return Arrays.stream(ContactEvent.ContactEventType.values()).anyMatch(v -> value.equalsIgnoreCase(v.name()));
+ return Arrays.stream(ContactEventTypeEnum.values()).anyMatch(v -> value.equalsIgnoreCase(v.name()));
}
}
\ No newline at end of file
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/validation/ContactGenderValid.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/validation/ContactGenderValid.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/contact/validation/ContactGenderValid.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/validation/ContactGenderValid.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/validation/ContactGenderValidator.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/validation/ContactGenderValidator.java
similarity index 78%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/contact/validation/ContactGenderValidator.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/validation/ContactGenderValidator.java
index d82bd99c..a309ea59 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/validation/ContactGenderValidator.java
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/validation/ContactGenderValidator.java
@@ -1,6 +1,6 @@
package fr.insee.survey.datacollectionmanagement.contact.validation;
-import fr.insee.survey.datacollectionmanagement.contact.domain.Contact;
+import fr.insee.survey.datacollectionmanagement.contact.enums.GenderEnum;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;
@@ -18,6 +18,6 @@ public void initialize(ContactGenderValid constraintAnnotation) {
public boolean isValid(String value, ConstraintValidatorContext context) {
if (value == null)
return false;
- return Arrays.stream(Contact.Gender.values()).anyMatch(v -> value.equals(v.name()));
+ return Arrays.stream(GenderEnum.values()).anyMatch(v -> value.equals(v.name()));
}
}
\ No newline at end of file
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/validation/ContactParamValidator.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/validation/ContactParamValidator.java
similarity index 90%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/contact/validation/ContactParamValidator.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/validation/ContactParamValidator.java
index f3c36398..ee26c6b0 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/validation/ContactParamValidator.java
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/validation/ContactParamValidator.java
@@ -1,6 +1,6 @@
package fr.insee.survey.datacollectionmanagement.contact.validation;
-import fr.insee.survey.datacollectionmanagement.contact.util.ContactParamEnum;
+import fr.insee.survey.datacollectionmanagement.contact.enums.ContactParamEnum;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/contact/validation/ValidContactParam.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/validation/ValidContactParam.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/contact/validation/ValidContactParam.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/contact/validation/ValidContactParam.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/heathcheck/dto/HealthcheckDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/healthcheck/dto/HealthcheckDto.java
similarity index 57%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/heathcheck/dto/HealthcheckDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/healthcheck/dto/HealthcheckDto.java
index 237f679f..6e50d96e 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/heathcheck/dto/HealthcheckDto.java
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/healthcheck/dto/HealthcheckDto.java
@@ -1,4 +1,4 @@
-package fr.insee.survey.datacollectionmanagement.heathcheck.dto;
+package fr.insee.survey.datacollectionmanagement.healthcheck.dto;
import lombok.Data;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/CampaignDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/CampaignDto.java
similarity index 78%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/CampaignDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/CampaignDto.java
index 67a1f4c6..462218e9 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/CampaignDto.java
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/CampaignDto.java
@@ -1,16 +1,16 @@
-package fr.insee.survey.datacollectionmanagement.metadata.dto;
-
-import fr.insee.survey.datacollectionmanagement.metadata.util.PeriodEnum;
-import jakarta.validation.constraints.NotBlank;
-import lombok.Data;
-
-@Data
-public class CampaignDto {
-
- @NotBlank
- private String id;
- private String surveyId;
- private int year;
- private String campaignWording;
- private PeriodEnum period;
-}
+package fr.insee.survey.datacollectionmanagement.metadata.dto;
+
+import fr.insee.survey.datacollectionmanagement.metadata.enums.PeriodEnum;
+import jakarta.validation.constraints.NotBlank;
+import lombok.Data;
+
+@Data
+public class CampaignDto {
+
+ @NotBlank
+ private String id;
+ private String surveyId;
+ private int year;
+ private String campaignWording;
+ private PeriodEnum period;
+}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/CampaignEventDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/CampaignEventDto.java
similarity index 94%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/CampaignEventDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/CampaignEventDto.java
index ef7d8b91..9448734c 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/CampaignEventDto.java
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/CampaignEventDto.java
@@ -1,13 +1,13 @@
-package fr.insee.survey.datacollectionmanagement.metadata.dto;
-
-import java.util.Date;
-
-import lombok.Data;
-
-@Data
-public class CampaignEventDto {
-
- private Long id;
- private String type;
- private Date date;
-}
+package fr.insee.survey.datacollectionmanagement.metadata.dto;
+
+import java.util.Date;
+
+import lombok.Data;
+
+@Data
+public class CampaignEventDto {
+
+ private Long id;
+ private String type;
+ private Date date;
+}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/CampaignMoogDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/CampaignMoogDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/CampaignMoogDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/CampaignMoogDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/CampaignPartitioningsDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/CampaignPartitioningsDto.java
similarity index 84%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/CampaignPartitioningsDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/CampaignPartitioningsDto.java
index 7ba74db9..511f14f7 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/CampaignPartitioningsDto.java
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/CampaignPartitioningsDto.java
@@ -1,6 +1,6 @@
package fr.insee.survey.datacollectionmanagement.metadata.dto;
-import fr.insee.survey.datacollectionmanagement.metadata.util.PeriodEnum;
+import fr.insee.survey.datacollectionmanagement.metadata.enums.PeriodEnum;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/MetadataDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/MetadataDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/MetadataDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/MetadataDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/OnGoingDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/OnGoingDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/OnGoingDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/OnGoingDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/OpenDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/OpenDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/OpenDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/OpenDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/OwnerDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/OwnerDto.java
similarity index 94%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/OwnerDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/OwnerDto.java
index 3c4ecc6f..d3f29f8b 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/OwnerDto.java
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/OwnerDto.java
@@ -1,17 +1,17 @@
-package fr.insee.survey.datacollectionmanagement.metadata.dto;
-
-import jakarta.validation.constraints.NotBlank;
-import lombok.Getter;
-import lombok.Setter;
-
-@Getter
-@Setter
-public class OwnerDto {
-
- @NotBlank
- private String id;
- private String label;
- private String ministry;
- private String logo;
-
-}
+package fr.insee.survey.datacollectionmanagement.metadata.dto;
+
+import jakarta.validation.constraints.NotBlank;
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class OwnerDto {
+
+ @NotBlank
+ private String id;
+ private String label;
+ private String ministry;
+ private String logo;
+
+}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/ParamsDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/ParamsDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/ParamsDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/ParamsDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/PartitioningDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/PartitioningDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/PartitioningDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/PartitioningDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/PeriodDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/PeriodDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/PeriodDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/PeriodDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/PeriodicityDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/PeriodicityDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/PeriodicityDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/PeriodicityDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/SourceDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/SourceDto.java
similarity index 77%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/SourceDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/SourceDto.java
index 9c9da516..83786fa1 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/SourceDto.java
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/SourceDto.java
@@ -1,17 +1,17 @@
-package fr.insee.survey.datacollectionmanagement.metadata.dto;
-
-import fr.insee.survey.datacollectionmanagement.metadata.util.PeriodicityEnum;
-import lombok.Getter;
-import lombok.Setter;
-
-@Getter
-@Setter
-public class SourceDto {
-
- private String id;
- private String longWording;
- private String shortWording;
- private PeriodicityEnum periodicity;
- private boolean mandatoryMySurveys;
-
-}
+package fr.insee.survey.datacollectionmanagement.metadata.dto;
+
+import fr.insee.survey.datacollectionmanagement.metadata.enums.PeriodicityEnum;
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class SourceDto {
+
+ private String id;
+ private String longWording;
+ private String shortWording;
+ private PeriodicityEnum periodicity;
+ private boolean mandatoryMySurveys;
+
+}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/SourceOnlineStatusDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/SourceOnlineStatusDto.java
similarity index 63%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/SourceOnlineStatusDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/SourceOnlineStatusDto.java
index d3b4d5c5..f38c7e6d 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/SourceOnlineStatusDto.java
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/SourceOnlineStatusDto.java
@@ -1,7 +1,6 @@
package fr.insee.survey.datacollectionmanagement.metadata.dto;
-import fr.insee.survey.datacollectionmanagement.metadata.util.PeriodicityEnum;
-import io.swagger.v3.oas.annotations.media.Schema;
+import fr.insee.survey.datacollectionmanagement.metadata.enums.PeriodicityEnum;
import jakarta.validation.constraints.NotBlank;
import lombok.Getter;
import lombok.Setter;
@@ -15,9 +14,7 @@ public class SourceOnlineStatusDto {
private String longWording;
private String shortWording;
private PeriodicityEnum periodicity;
- @Schema(description = "Indicates whether or not you need to use the my surveys portal", defaultValue = "false")
private boolean mandatoryMySurveys = false;
- @Schema(description = "Indicates if the source should be force closed", defaultValue = "false")
private boolean forceClose = false;
private String messageInfoSurveyOffline = "";
private String messageSurveyOffline = "";
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/SupportDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/SupportDto.java
similarity index 95%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/SupportDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/SupportDto.java
index 8ae7c2e0..1aa2abf6 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/SupportDto.java
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/SupportDto.java
@@ -1,22 +1,22 @@
-package fr.insee.survey.datacollectionmanagement.metadata.dto;
-
-import jakarta.validation.constraints.NotBlank;
-import lombok.Getter;
-import lombok.Setter;
-
-@Getter
-@Setter
-public class SupportDto {
-
- @NotBlank
- private String id;
- private String label;
- private String phoneNumber;
- private String mail;
- private String countryName;
- private String streetNumber;
- private String streetName;
- private String city;
- private String zipCode;
-
-}
+package fr.insee.survey.datacollectionmanagement.metadata.dto;
+
+import jakarta.validation.constraints.NotBlank;
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class SupportDto {
+
+ @NotBlank
+ private String id;
+ private String label;
+ private String phoneNumber;
+ private String mail;
+ private String countryName;
+ private String streetNumber;
+ private String streetName;
+ private String city;
+ private String zipCode;
+
+}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/SurveyDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/SurveyDto.java
similarity index 96%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/SurveyDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/SurveyDto.java
index a408b27a..d91ae83c 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/SurveyDto.java
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/dto/SurveyDto.java
@@ -1,27 +1,27 @@
-package fr.insee.survey.datacollectionmanagement.metadata.dto;
-
-import jakarta.validation.constraints.NotBlank;
-import lombok.Getter;
-import lombok.Setter;
-
-@Getter
-@Setter
-public class SurveyDto {
-
- @NotBlank
- private String id;
- @NotBlank
- private String sourceId;
- private Integer year;
- private Integer sampleSize;
- private String longWording;
- private String shortWording;
- private String shortObjectives;
- private String longObjectives;
- private String visaNumber;
- private String cnisUrl;
- private String diffusionUrl;
- private String noticeUrl;
- private String specimenUrl;
- private String communication;
-}
+package fr.insee.survey.datacollectionmanagement.metadata.dto;
+
+import jakarta.validation.constraints.NotBlank;
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class SurveyDto {
+
+ @NotBlank
+ private String id;
+ @NotBlank
+ private String sourceId;
+ private Integer year;
+ private Integer sampleSize;
+ private String longWording;
+ private String shortWording;
+ private String shortObjectives;
+ private String longObjectives;
+ private String visaNumber;
+ private String cnisUrl;
+ private String diffusionUrl;
+ private String noticeUrl;
+ private String specimenUrl;
+ private String communication;
+}
diff --git a/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/enums/ParameterEnum.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/enums/ParameterEnum.java
new file mode 100644
index 00000000..c672001e
--- /dev/null
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/enums/ParameterEnum.java
@@ -0,0 +1,5 @@
+package fr.insee.survey.datacollectionmanagement.metadata.enums;
+
+public enum ParameterEnum {
+ URL_REDIRECTION,URL_TYPE, MAIL_ASSISTANCE;
+}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/util/PartitioningStatusEnum.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/enums/PartitioningStatusEnum.java
similarity index 91%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/util/PartitioningStatusEnum.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/enums/PartitioningStatusEnum.java
index 5ccc401b..d4564d43 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/util/PartitioningStatusEnum.java
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/enums/PartitioningStatusEnum.java
@@ -1,4 +1,4 @@
-package fr.insee.survey.datacollectionmanagement.metadata.util;
+package fr.insee.survey.datacollectionmanagement.metadata.enums;
public enum PartitioningStatusEnum {
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/util/PeriodEnum.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/enums/PeriodEnum.java
similarity index 98%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/util/PeriodEnum.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/enums/PeriodEnum.java
index 2db05522..56e72a3f 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/util/PeriodEnum.java
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/enums/PeriodEnum.java
@@ -1,4 +1,4 @@
-package fr.insee.survey.datacollectionmanagement.metadata.util;
+package fr.insee.survey.datacollectionmanagement.metadata.enums;
import lombok.Getter;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/util/PeriodicityEnum.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/enums/PeriodicityEnum.java
similarity index 80%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/util/PeriodicityEnum.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/enums/PeriodicityEnum.java
index 134c733e..a01c2091 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/util/PeriodicityEnum.java
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/enums/PeriodicityEnum.java
@@ -1,4 +1,4 @@
-package fr.insee.survey.datacollectionmanagement.metadata.util;
+package fr.insee.survey.datacollectionmanagement.metadata.enums;
import lombok.Getter;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/validation/ParameterEnumValid.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/validation/ParameterEnumValid.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/validation/ParameterEnumValid.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/validation/ParameterEnumValid.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/validation/ParameterEnumValidator.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/validation/ParameterEnumValidator.java
similarity index 77%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/metadata/validation/ParameterEnumValidator.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/validation/ParameterEnumValidator.java
index 57b11b57..e09d416f 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/validation/ParameterEnumValidator.java
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/metadata/validation/ParameterEnumValidator.java
@@ -1,6 +1,6 @@
package fr.insee.survey.datacollectionmanagement.metadata.validation;
-import fr.insee.survey.datacollectionmanagement.metadata.domain.Parameters;
+import fr.insee.survey.datacollectionmanagement.metadata.enums.ParameterEnum;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;
@@ -18,6 +18,6 @@ public void initialize(ParameterEnumValid constraintAnnotation) {
public boolean isValid(String value, ConstraintValidatorContext context) {
if (value == null)
return false;
- return Arrays.stream(Parameters.ParameterEnum.values()).anyMatch(v -> value.equals(v.name()));
+ return Arrays.stream(ParameterEnum.values()).anyMatch(v -> value.equals(v.name()));
}
}
\ No newline at end of file
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/AccreditationDetailDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/AccreditationDetailDto.java
similarity index 81%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/AccreditationDetailDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/AccreditationDetailDto.java
index 840bb164..18a868bd 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/AccreditationDetailDto.java
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/AccreditationDetailDto.java
@@ -1,7 +1,8 @@
package fr.insee.survey.datacollectionmanagement.query.dto;
-import fr.insee.survey.datacollectionmanagement.metadata.util.PeriodEnum;
-import fr.insee.survey.datacollectionmanagement.questioning.util.TypeQuestioningEvent;
+
+import fr.insee.survey.datacollectionmanagement.metadata.enums.PeriodEnum;
+import fr.insee.survey.datacollectionmanagement.questioning.enums.TypeQuestioningEvent;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/AddressInformationsDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/AddressInformationsDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/AddressInformationsDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/AddressInformationsDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/AssistanceDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/AssistanceDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/AssistanceDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/AssistanceDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/ContactAccreditationDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/ContactAccreditationDto.java
similarity index 81%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/ContactAccreditationDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/ContactAccreditationDto.java
index 0b0bd19e..a30be6f4 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/ContactAccreditationDto.java
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/ContactAccreditationDto.java
@@ -1,7 +1,7 @@
package fr.insee.survey.datacollectionmanagement.query.dto;
-import fr.insee.survey.datacollectionmanagement.contact.domain.Contact;
import fr.insee.survey.datacollectionmanagement.contact.dto.AddressDto;
+import fr.insee.survey.datacollectionmanagement.contact.enums.GenderEnum;
import lombok.Data;
@Data
@@ -10,7 +10,7 @@ public class ContactAccreditationDto {
private String identifier;
private String externalId;
private boolean isMain;
- private Contact.Gender civility;
+ private GenderEnum civility;
private String lastName;
private String firstName;
private String function;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/ContactInformationsDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/ContactInformationsDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/ContactInformationsDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/ContactInformationsDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/EligibleDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/EligibleDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/EligibleDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/EligibleDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/HabilitationDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/HabilitationDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/HabilitationDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/HabilitationDto.java
diff --git a/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MoogCampaignDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MoogCampaignDto.java
new file mode 100644
index 00000000..8fd25f66
--- /dev/null
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MoogCampaignDto.java
@@ -0,0 +1,14 @@
+package fr.insee.survey.datacollectionmanagement.query.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class MoogCampaignDto {
+ private String id;
+ private String label;
+ private Long collectionStartDate;
+ private Long collectionEndDate;
+
+}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MoogExtractionRowDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MoogExtractionRowDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MoogExtractionRowDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MoogExtractionRowDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MoogFollowUpDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MoogFollowUpDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MoogFollowUpDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MoogFollowUpDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MoogProgressDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MoogProgressDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MoogProgressDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MoogProgressDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MoogQuestioningEventDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MoogQuestioningEventDto.java
similarity index 95%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MoogQuestioningEventDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MoogQuestioningEventDto.java
index 507bc6af..6d6df928 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MoogQuestioningEventDto.java
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MoogQuestioningEventDto.java
@@ -1,17 +1,17 @@
-package fr.insee.survey.datacollectionmanagement.query.dto;
-
-import java.io.Serializable;
-
-import lombok.Getter;
-import lombok.Setter;
-
-@Getter
-@Setter
-public class MoogQuestioningEventDto implements Serializable {
-
- private String idManagementMonitoringInfo;
- private MoogSearchDto surveyUnit;
- private String status;
- private String upload;
- private Long dateInfo;
-}
+package fr.insee.survey.datacollectionmanagement.query.dto;
+
+import java.io.Serializable;
+
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class MoogQuestioningEventDto implements Serializable {
+
+ private String idManagementMonitoringInfo;
+ private MoogSearchDto surveyUnit;
+ private String status;
+ private String upload;
+ private Long dateInfo;
+}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MoogRowProgressDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MoogRowProgressDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MoogRowProgressDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MoogRowProgressDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MoogSearchDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MoogSearchDto.java
similarity index 81%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MoogSearchDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MoogSearchDto.java
index 39b64e05..f5821e77 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MoogSearchDto.java
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MoogSearchDto.java
@@ -2,7 +2,6 @@
import java.io.Serializable;
-import fr.insee.survey.datacollectionmanagement.query.domain.MoogCampaign;
import lombok.Getter;
import lombok.Setter;
@@ -14,7 +13,7 @@ public class MoogSearchDto implements Serializable {
private String idContact;
private String idSu;
private String address;
- private MoogCampaign campaign;
+ private MoogCampaignDto campaign;
private String firstName;
private String lastname;
private String batchNumber;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MoogUploadQuestioningEventDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MoogUploadQuestioningEventDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MoogUploadQuestioningEventDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MoogUploadQuestioningEventDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MyQuestioningDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MyQuestioningDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MyQuestioningDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/MyQuestioningDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/QuestioningInformationsDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/QuestioningInformationsDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/QuestioningInformationsDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/QuestioningInformationsDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/QuestioningWebclientDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/QuestioningWebclientDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/QuestioningWebclientDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/QuestioningWebclientDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/SearchSurveyUnitContactDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/SearchSurveyUnitContactDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/SearchSurveyUnitContactDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/SearchSurveyUnitContactDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/StateDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/StateDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/StateDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/StateDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/SurveyUnitInformationsDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/SurveyUnitInformationsDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/SurveyUnitInformationsDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/SurveyUnitInformationsDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/SurveyUnitPartitioningDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/SurveyUnitPartitioningDto.java
similarity index 73%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/SurveyUnitPartitioningDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/SurveyUnitPartitioningDto.java
index b14fec4a..332d9bb4 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/SurveyUnitPartitioningDto.java
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/dto/SurveyUnitPartitioningDto.java
@@ -1,7 +1,7 @@
package fr.insee.survey.datacollectionmanagement.query.dto;
-import fr.insee.survey.datacollectionmanagement.metadata.util.PeriodEnum;
-import fr.insee.survey.datacollectionmanagement.questioning.util.TypeQuestioningEvent;
+import fr.insee.survey.datacollectionmanagement.metadata.enums.PeriodEnum;
+import fr.insee.survey.datacollectionmanagement.questioning.enums.TypeQuestioningEvent;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/validation/UserRoleValidator.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/validation/UserRoleValidator.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/validation/UserRoleValidator.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/validation/UserRoleValidator.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/validation/ValidUserRole.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/validation/ValidUserRole.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/query/validation/ValidUserRole.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/query/validation/ValidUserRole.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/QuestioningAccreditationDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/QuestioningAccreditationDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/QuestioningAccreditationDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/QuestioningAccreditationDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/QuestioningCommunicationDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/QuestioningCommunicationDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/QuestioningCommunicationDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/QuestioningCommunicationDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/QuestioningDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/QuestioningDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/QuestioningDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/QuestioningDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/QuestioningEventDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/QuestioningEventDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/QuestioningEventDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/QuestioningEventDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/SearchSurveyUnitDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/SearchSurveyUnitDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/SearchSurveyUnitDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/SearchSurveyUnitDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/SearchSurveyUnitDtoImpl.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/SearchSurveyUnitDtoImpl.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/SearchSurveyUnitDtoImpl.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/SearchSurveyUnitDtoImpl.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/SurveyUnitAddressDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/SurveyUnitAddressDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/SurveyUnitAddressDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/SurveyUnitAddressDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/SurveyUnitCommentInputDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/SurveyUnitCommentInputDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/SurveyUnitCommentInputDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/SurveyUnitCommentInputDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/SurveyUnitCommentOutputDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/SurveyUnitCommentOutputDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/SurveyUnitCommentOutputDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/SurveyUnitCommentOutputDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/SurveyUnitDetailsDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/SurveyUnitDetailsDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/SurveyUnitDetailsDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/SurveyUnitDetailsDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/SurveyUnitDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/SurveyUnitDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/SurveyUnitDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/SurveyUnitDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/UploadDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/UploadDto.java
similarity index 79%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/UploadDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/UploadDto.java
index 2a9f6e75..f37af748 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/UploadDto.java
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/dto/UploadDto.java
@@ -1,7 +1,6 @@
package fr.insee.survey.datacollectionmanagement.questioning.dto;
import fr.insee.survey.datacollectionmanagement.query.dto.MoogUploadQuestioningEventDto;
-import fr.insee.survey.datacollectionmanagement.questioning.domain.QuestioningEvent;
import lombok.Getter;
import lombok.Setter;
diff --git a/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/enums/StatusCommunication.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/enums/StatusCommunication.java
new file mode 100644
index 00000000..32f137b7
--- /dev/null
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/enums/StatusCommunication.java
@@ -0,0 +1,5 @@
+package fr.insee.survey.datacollectionmanagement.questioning.enums;
+
+public enum StatusCommunication {
+ AUTOMATIC, MANUAL
+}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/util/SurveyUnitParamEnum.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/enums/SurveyUnitParamEnum.java
similarity index 89%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/util/SurveyUnitParamEnum.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/enums/SurveyUnitParamEnum.java
index 062494c3..b19b908f 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/util/SurveyUnitParamEnum.java
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/enums/SurveyUnitParamEnum.java
@@ -1,4 +1,4 @@
-package fr.insee.survey.datacollectionmanagement.questioning.util;
+package fr.insee.survey.datacollectionmanagement.questioning.enums;
import lombok.Getter;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/util/TypeCommunicationEvent.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/enums/TypeCommunicationEvent.java
similarity index 67%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/util/TypeCommunicationEvent.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/enums/TypeCommunicationEvent.java
index 3eac83a8..5c0d5caf 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/util/TypeCommunicationEvent.java
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/enums/TypeCommunicationEvent.java
@@ -1,4 +1,4 @@
-package fr.insee.survey.datacollectionmanagement.questioning.util;
+package fr.insee.survey.datacollectionmanagement.questioning.enums;
public enum TypeCommunicationEvent {
COURRIER_OUVERTURE, MAIL_OUVERTURE, COURRIER_RELANCE, MAIL_RELANCE, COURRIER_MED, COURRIER_CNR;
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/util/TypeQuestioningEvent.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/enums/TypeQuestioningEvent.java
similarity index 89%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/questioning/util/TypeQuestioningEvent.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/enums/TypeQuestioningEvent.java
index b27b32c3..ba78e4b7 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/util/TypeQuestioningEvent.java
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/enums/TypeQuestioningEvent.java
@@ -1,44 +1,44 @@
-package fr.insee.survey.datacollectionmanagement.questioning.util;
-
-import java.util.Arrays;
-import java.util.List;
-
-public enum TypeQuestioningEvent {
- INITLA,
- FOLLOWUP,
- PND,
- WASTE,
- PARTIELINT,
- HC,
- VALPAP,
- VALINT,
- REFUSAL;
-
- public static final List STATE_EVENTS = Arrays.asList(
- VALINT,
- VALPAP,
- REFUSAL,
- WASTE,
- HC,
- INITLA,
- PARTIELINT,
- PND);
-
- public static final List FOLLOWUP_EVENTS = Arrays.asList(
- VALINT,
- VALPAP,
- REFUSAL,
- WASTE,
- HC);
-
- public static final List EXTRACT_EVENTS = Arrays.asList(
- VALINT,
- PARTIELINT);
-
- public static final List MY_QUESTIONINGS_EVENTS = Arrays.asList(
- PARTIELINT,
- HC,
- VALPAP,
- VALINT,
- REFUSAL);
-}
+package fr.insee.survey.datacollectionmanagement.questioning.enums;
+
+import java.util.Arrays;
+import java.util.List;
+
+public enum TypeQuestioningEvent {
+ INITLA,
+ FOLLOWUP,
+ PND,
+ WASTE,
+ PARTIELINT,
+ HC,
+ VALPAP,
+ VALINT,
+ REFUSAL;
+
+ public static final List STATE_EVENTS = Arrays.asList(
+ VALINT,
+ VALPAP,
+ REFUSAL,
+ WASTE,
+ HC,
+ INITLA,
+ PARTIELINT,
+ PND);
+
+ public static final List FOLLOWUP_EVENTS = Arrays.asList(
+ VALINT,
+ VALPAP,
+ REFUSAL,
+ WASTE,
+ HC);
+
+ public static final List EXTRACT_EVENTS = Arrays.asList(
+ VALINT,
+ PARTIELINT);
+
+ public static final List MY_QUESTIONINGS_EVENTS = Arrays.asList(
+ PARTIELINT,
+ HC,
+ VALPAP,
+ VALINT,
+ REFUSAL);
+}
diff --git a/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/enums/UrlTypeEnum.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/enums/UrlTypeEnum.java
new file mode 100644
index 00000000..2a3780ff
--- /dev/null
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/enums/UrlTypeEnum.java
@@ -0,0 +1,7 @@
+package fr.insee.survey.datacollectionmanagement.questioning.enums;
+
+public enum UrlTypeEnum {
+ V1,
+ V2,
+ V3,
+}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/user/dto/SourceAccreditationDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/user/dto/SourceAccreditationDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/user/dto/SourceAccreditationDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/user/dto/SourceAccreditationDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/user/dto/UserDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/user/dto/UserDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/user/dto/UserDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/user/dto/UserDto.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/user/dto/UserEventDto.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/user/dto/UserEventDto.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/user/dto/UserEventDto.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/user/dto/UserEventDto.java
diff --git a/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/user/enums/UserEventTypeEnum.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/user/enums/UserEventTypeEnum.java
new file mode 100644
index 00000000..17e5efd4
--- /dev/null
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/user/enums/UserEventTypeEnum.java
@@ -0,0 +1,5 @@
+package fr.insee.survey.datacollectionmanagement.user.enums;
+
+public enum UserEventTypeEnum {
+ CREATE, UPDATE, DELETE
+}
diff --git a/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/user/enums/UserRoleTypeEnum.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/user/enums/UserRoleTypeEnum.java
new file mode 100644
index 00000000..82e71813
--- /dev/null
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/user/enums/UserRoleTypeEnum.java
@@ -0,0 +1,5 @@
+package fr.insee.survey.datacollectionmanagement.user.enums;
+
+public enum UserRoleTypeEnum {
+ ADMINISTRATEUR, RESPONSABLE, GESTIONNAIRE, ASSISTANCE
+}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/user/validation/InternalUserRoleValid.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/user/validation/InternalUserRoleValid.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/user/validation/InternalUserRoleValid.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/user/validation/InternalUserRoleValid.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/user/validation/InternalUserRoleValidator.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/user/validation/InternalUserRoleValidator.java
similarity index 77%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/user/validation/InternalUserRoleValidator.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/user/validation/InternalUserRoleValidator.java
index 8c3a168c..9fdc4d66 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/user/validation/InternalUserRoleValidator.java
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/user/validation/InternalUserRoleValidator.java
@@ -1,6 +1,6 @@
package fr.insee.survey.datacollectionmanagement.user.validation;
-import fr.insee.survey.datacollectionmanagement.user.domain.User;
+import fr.insee.survey.datacollectionmanagement.user.enums.UserRoleTypeEnum;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;
@@ -18,6 +18,6 @@ public void initialize(InternalUserRoleValid constraintAnnotation) {
public boolean isValid(String value, ConstraintValidatorContext context) {
if(value == null)
return false;
- return Arrays.stream(User.UserRoleType.values()).anyMatch(v -> value.equalsIgnoreCase(v.name()));
+ return Arrays.stream(UserRoleTypeEnum.values()).anyMatch(v -> value.equalsIgnoreCase(v.name()));
}
}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/user/validation/UserEventTypeValid.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/user/validation/UserEventTypeValid.java
similarity index 100%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/user/validation/UserEventTypeValid.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/user/validation/UserEventTypeValid.java
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/user/validation/UserEventTypeValidator.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/user/validation/UserEventTypeValidator.java
similarity index 76%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/user/validation/UserEventTypeValidator.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/user/validation/UserEventTypeValidator.java
index dac2ba8f..66b39bb7 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/user/validation/UserEventTypeValidator.java
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/user/validation/UserEventTypeValidator.java
@@ -1,6 +1,6 @@
package fr.insee.survey.datacollectionmanagement.user.validation;
-import fr.insee.survey.datacollectionmanagement.user.domain.UserEvent;
+import fr.insee.survey.datacollectionmanagement.user.enums.UserEventTypeEnum;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;
@@ -18,6 +18,6 @@ public void initialize(UserEventTypeValid constraintAnnotation) {
public boolean isValid(String value, ConstraintValidatorContext context) {
if (value == null)
return false;
- return Arrays.stream(UserEvent.UserEventType.values()).anyMatch(v -> value.equalsIgnoreCase(v.name()));
+ return Arrays.stream(UserEventTypeEnum.values()).anyMatch(v -> value.equalsIgnoreCase(v.name()));
}
}
\ No newline at end of file
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/config/JSONCollectionWrapper.java b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/util/JSONCollectionWrapper.java
similarity index 86%
rename from src/main/java/fr/insee/survey/datacollectionmanagement/config/JSONCollectionWrapper.java
rename to platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/util/JSONCollectionWrapper.java
index 2dfd13a9..91fe597c 100644
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/config/JSONCollectionWrapper.java
+++ b/platine-management-shared/src/main/java/fr/insee/survey/datacollectionmanagement/util/JSONCollectionWrapper.java
@@ -1,4 +1,4 @@
-package fr.insee.survey.datacollectionmanagement.config;
+package fr.insee.survey.datacollectionmanagement.util;
import java.util.Collection;
diff --git a/pom.xml b/pom.xml
index b0a05a97..331cd898 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,42 +3,46 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
+ pom
+ fr.insee.survey
+ platine-management
+ ${revision}${changelist}
+ platine-management
+ Modules for platine management back office
+
org.springframework.boot
spring-boot-starter-parent
3.3.5
-
+
- fr.insee.survey
- platine-management
- 2.6.2
- platine-management
- REST API for communication between DB and Platine-Management UI and Platine-My-Surveys UI
-
+
+
+ platine-management-service
+ platine-management-shared
+ platine-management-db
+ platine-management-api
+
+
+ 2.6.3
+
21
- 2.6.0
- 3.2.0
- 3.1.0
- 5.0.0
- 42.7.3
- 1.0.2
+ 21
+ 21
+ UTF-8
+ UTF-8
+
+ -Dfile.encoding=UTF-8
inseefr
https://sonarcloud.io
- 7.18.0
+ target
+ ${project.basedir}/../pilotage-api/target/site/jacoco-aggregate/jacoco.xml
+ 3.2.0
+
-
- org.springframework.boot
- spring-boot-starter-web
-
-
- org.springframework.boot
- spring-boot-starter-tomcat
-
-
- org.springframework.boot
- spring-boot-starter-data-jpa
-
org.springframework.boot
spring-boot-starter-validation
@@ -48,137 +52,17 @@
modelmapper
${modelmapper-version}
-
- org.springframework.boot
- spring-boot-devtools
- runtime
- true
-
-
- org.springframework.boot
- spring-boot-starter-mail
-
org.projectlombok
lombok
true
- org.springdoc
- springdoc-openapi-starter-webmvc-ui
- ${springdoc-version}
-
-
-
- jakarta.ws.rs
- jakarta.ws.rs-api
- ${jakarta-version}
-
-
-
- com.fasterxml.jackson.dataformat
- jackson-dataformat-xml
-
-
- jakarta.xml.bind
- jakarta.xml.bind-api
-
-
-
- org.postgresql
- postgresql
- ${postgres-version}
-
-
-
- org.springframework.boot
- spring-boot-starter-oauth2-resource-server
-
-
- org.springframework.boot
- spring-boot-starter-security
-
-
- org.springframework.security
- spring-security-oauth2-client
-
-
-
-
- org.junit.platform
- junit-platform-suite
- test
-
-
- io.cucumber
- cucumber-java
- ${cucumber.version}
- test
-
-
- io.cucumber
- cucumber-spring
- ${cucumber.version}
-
-
- io.cucumber
- cucumber-junit-platform-engine
- ${cucumber.version}
-
-
-
-
-
-
- org.jeasy
- easy-random-core
- ${easy-version}
-
-
- com.github.javafaker
- javafaker
- ${javafaker-version}
-
-
- org.yaml
- snakeyaml
-
-
-
-
-
-
- org.springframework.security
- spring-security-test
- test
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
- com.h2database
- h2
- test
-
-
-
-
-
-
- org.springframework.boot
- spring-boot-starter-actuator
-
-
-
-
- io.micrometer
- micrometer-registry-prometheus
+ com.fasterxml.jackson.core
+ jackson-databind
-
coverage
@@ -200,11 +84,6 @@
report
-
-
- XML
-
-
@@ -216,27 +95,37 @@
- org.springframework.boot
- spring-boot-maven-plugin
+ org.codehaus.mojo
+ flatten-maven-plugin
+ 1.6.0
+
+ true
+
- build-info
+ flatten
+ process-resources
- build-info
+ flatten
+
+
+
+ flatten.clean
+ clean
+
+ clean
-
-
-
- org.projectlombok
- lombok
-
-
-
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+
+
+
-
-
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/query/repository/MoogRepository.java b/src/main/java/fr/insee/survey/datacollectionmanagement/query/repository/MoogRepository.java
deleted file mode 100644
index 01bc3f14..00000000
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/query/repository/MoogRepository.java
+++ /dev/null
@@ -1,225 +0,0 @@
-package fr.insee.survey.datacollectionmanagement.query.repository;
-
-import fr.insee.survey.datacollectionmanagement.contact.domain.Address;
-import fr.insee.survey.datacollectionmanagement.contact.service.AddressService;
-import fr.insee.survey.datacollectionmanagement.exception.NotFoundException;
-import fr.insee.survey.datacollectionmanagement.query.dto.MoogExtractionRowDto;
-import fr.insee.survey.datacollectionmanagement.query.dto.MoogQuestioningEventDto;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.jdbc.core.RowMapper;
-import org.springframework.stereotype.Repository;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.List;
-
-@Repository
-@RequiredArgsConstructor
-@Slf4j
-public class MoogRepository {
-
- private final JdbcTemplate jdbcTemplate;
-
- private final AddressService addressService;
-
- final String getEventsQuery = "SELECT qe.id, date, type, survey_unit_id_su, campaign_id "
- + " FROM questioning_event qe join questioning q on qe.questioning_id=q.id join partitioning p on q.id_partitioning=p.id "
- + " WHERE survey_unit_id_su=? AND campaign_id=? ";
-
-
- public List getEventsByIdSuByCampaign(String idCampaign, String idSu) {
- List progress = jdbcTemplate.query(getEventsQuery, new RowMapper() {
- public MoogQuestioningEventDto mapRow(ResultSet rs, int rowNum) throws SQLException {
- MoogQuestioningEventDto moogEvent = new MoogQuestioningEventDto();
- moogEvent.setIdManagementMonitoringInfo(rs.getString("id"));
- moogEvent.setStatus(rs.getString("type"));
- moogEvent.setDateInfo(rs.getTimestamp("date").getTime());
- return moogEvent;
- }
- }, new Object[]{idSu, idCampaign});
-
- return progress;
- }
-
- final String extractionQuery =
- """
- select
- id_su,
- identifier as id_contact,
- first_name as firstname,
- last_name as lastname,
- address_id as address,
- date as dateinfo,
- type as status,
- batch_num
- from
- (
- select
- id,
- campaign_id,
- A.id_su,
- A.identifier,
- first_name,
- last_name,
- address_id,
- id_partitioning as batch_num
- from
- (
- select
- campaign_id,
- id_su,
- contact.identifier,
- first_name,
- last_name,
- address_id
- from
- view
- left join contact on
- contact.identifier = view.identifier
- where
- campaign_id = ?
- ) as A
- left join questioning q on
- A.id_su = q.survey_unit_id_su
- and q.id_partitioning in (
- select
- id
- from
- partitioning p
- where
- p.campaign_id = ?)
- ) as B
- left join questioning_event on
- B.id = questioning_event.questioning_id
- """;
-
-
- public List getExtraction(String idCampaign) {
- List extraction = jdbcTemplate.query(extractionQuery, new RowMapper() {
-
- public MoogExtractionRowDto mapRow(ResultSet rs, int rowNum) throws SQLException {
- MoogExtractionRowDto ev = new MoogExtractionRowDto();
-
- ev.setAddress("addresse non connue");
-
- ev.setStatus(rs.getString("status"));
- ev.setDateInfo(rs.getString("dateinfo"));
- ev.setIdSu(rs.getString("id_su"));
- ev.setIdContact(rs.getString("id_contact"));
- ev.setLastname(rs.getString("lastname"));
- ev.setFirstname(rs.getString("firstname"));
- try {
- Address address = addressService.findById(rs.getLong("address"));
- ev.setAddress(address.toStringMoog());
- }
- catch (NotFoundException e){
- log.info("Address not found");
- }
-
-
- ev.setBatchNumber(rs.getString("batch_num"));
-
- return ev;
- }
- }, new Object[]{idCampaign, idCampaign});
-
- return extraction;
- }
-
- final String surveyUnitFollowUpQuery = """
- select
- distinct on
- (id_su) id_su,
- batch_num,
- case
- when type in ('PND') then 1
- else 0
- end as PND
- from
- (
- select
- A.id_su,
- A.identifier,
- q.id,
- q.id_partitioning as batch_num
- from
- (
- select
- id_su,
- identifier
- from
- public.view v
- where
- campaign_id = ?)as A
- left join questioning q on
- q.survey_unit_id_su = A.id_su
- and q.id_partitioning in (
- select
- id
- from
- partitioning p
- where
- p.campaign_id = ?)) as B
- left join questioning_event qe on
- B.id = qe.questioning_id
- where
- B.id_su not in (
- select
- distinct on
- (id_su) id_su
- from
- (
- select
- id_su,
- identifier,
- id,
- id_partitioning as batch_num
- from
- (
- select
- id_su,
- identifier
- from
- public.view
- where
- campaign_id = ?)as A
- left join questioning q on
- q.survey_unit_id_su = A.id_su
- and q.id_partitioning in (
- select
- id
- from
- partitioning p
- where
- p.campaign_id = ?)) as B
- left join questioning_event on
- B.id = questioning_event.questioning_id
- where
- type in ('VALINT', 'VALPAP', 'HC', 'REFUSAL', 'WASTE'))
- order by
- id_su,
- pnd desc;
-
- """;
- ;
-
- public List getSurveyUnitToFollowUp(String idCampaign) {
-
- List followUp = jdbcTemplate.query(surveyUnitFollowUpQuery,
- new RowMapper() {
- public MoogExtractionRowDto mapRow(ResultSet rs, int rowNum) throws SQLException {
- MoogExtractionRowDto er = new MoogExtractionRowDto();
- er.setIdSu(rs.getString("id_su"));
- er.setPnd(rs.getInt("PND"));
- er.setBatchNumber(rs.getString("batch_num"));
-
- return er;
- }
- }, new Object[]{idCampaign, idCampaign, idCampaign, idCampaign});
-
- return followUp;
-
- }
-}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/util/StatusCommunication.java b/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/util/StatusCommunication.java
deleted file mode 100644
index 2ed15a0b..00000000
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/util/StatusCommunication.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package fr.insee.survey.datacollectionmanagement.questioning.util;
-
-public enum StatusCommunication {
- AUTOMATIC, MANUAL
-}
diff --git a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/util/UrlTypeEnum.java b/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/util/UrlTypeEnum.java
deleted file mode 100644
index fe2251cf..00000000
--- a/src/main/java/fr/insee/survey/datacollectionmanagement/questioning/util/UrlTypeEnum.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package fr.insee.survey.datacollectionmanagement.questioning.util;
-
-public enum UrlTypeEnum {
- V1,
- V2,
- V3,
-}