add all project files
This commit is contained in:
parent
cfb7b687b4
commit
4d7bed4fe8
|
|
@ -0,0 +1,66 @@
|
||||||
|
# User properties #
|
||||||
|
**/src/main/resources/application-i*.yml
|
||||||
|
|
||||||
|
**/src/main/resources/rebel-remote.xml
|
||||||
|
**/src/main/resources/rebel.xml
|
||||||
|
|
||||||
|
# Compiled class file #
|
||||||
|
*.class
|
||||||
|
target/
|
||||||
|
.factorypath
|
||||||
|
.ipynb_checkpoints/
|
||||||
|
.apt_generated/
|
||||||
|
.apt_generated_tests/
|
||||||
|
|
||||||
|
# Log file #
|
||||||
|
*.log
|
||||||
|
|
||||||
|
# Frontend
|
||||||
|
**/src-frontend/node/
|
||||||
|
**/src-frontend/node_modules/
|
||||||
|
**/src-frontend/mix-manifest.json
|
||||||
|
|
||||||
|
# BlueJ files #
|
||||||
|
*.ctxt
|
||||||
|
|
||||||
|
# Mobile Tools for Java (J2ME) #
|
||||||
|
.mtj.tmp/
|
||||||
|
|
||||||
|
# Package Files #
|
||||||
|
*.jar
|
||||||
|
*.war
|
||||||
|
*.nar
|
||||||
|
*.ear
|
||||||
|
*.zip
|
||||||
|
*.tar.gz
|
||||||
|
*.rar
|
||||||
|
|
||||||
|
# Eclipse Files #
|
||||||
|
.eclipse/
|
||||||
|
.project
|
||||||
|
.settings/
|
||||||
|
.classpath
|
||||||
|
.metadata/
|
||||||
|
|
||||||
|
# IntelliJ Files #
|
||||||
|
.idea/
|
||||||
|
*.iml
|
||||||
|
*.iws
|
||||||
|
|
||||||
|
# OsX Files #
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
|
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml #
|
||||||
|
hs_err_pid*
|
||||||
|
|
||||||
|
# Misc #
|
||||||
|
*.vpp.bak*
|
||||||
|
*.vpp.lck*
|
||||||
|
~\$*.pptx
|
||||||
|
*.sh
|
||||||
|
bin/
|
||||||
|
pom.xml.versionsBackup
|
||||||
|
|
||||||
|
|
||||||
|
/.run/
|
||||||
|
|
||||||
|
|
@ -0,0 +1,458 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>eu.europa.eeas</groupId>
|
||||||
|
<artifactId>e-rights</artifactId>
|
||||||
|
<version>5.0.1</version>
|
||||||
|
<relativePath>../pom.xml</relativePath>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>e-rights-back-office</artifactId>
|
||||||
|
<version>${e-rights.version}</version>
|
||||||
|
<packaging>war</packaging>
|
||||||
|
|
||||||
|
<name>e-RIGHTS - Back Office</name>
|
||||||
|
<description>EEAS' e-RIGHTS - Back Office</description>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>eu.europa.eeas</groupId>
|
||||||
|
<artifactId>e-rights-common</artifactId>
|
||||||
|
<version>${e-rights.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- ******************* -->
|
||||||
|
<!-- * Ananke Starters * -->
|
||||||
|
<!-- ******************* -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>eu.europa.eeas</groupId>
|
||||||
|
<artifactId>ananke-core-starter-scheduler</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!-- <dependency>-->
|
||||||
|
<!-- <groupId>eu.europa.eeas</groupId>-->
|
||||||
|
<!-- <artifactId>ananke-tools-starter-abac-connector-legalentity-4</artifactId>-->
|
||||||
|
<!-- </dependency>-->
|
||||||
|
|
||||||
|
<!-- <dependency>-->
|
||||||
|
<!-- <groupId>eu.europa.eeas</groupId>-->
|
||||||
|
<!-- <artifactId>ananke-tools-starter-abac-connector-bankaccount-4</artifactId>-->
|
||||||
|
<!-- </dependency>-->
|
||||||
|
|
||||||
|
<!-- <dependency>-->
|
||||||
|
<!-- <groupId>eu.europa.eeas</groupId>-->
|
||||||
|
<!-- <artifactId>ananke-tools-starter-abac-connector-invoice-3</artifactId>-->
|
||||||
|
<!-- </dependency>-->
|
||||||
|
|
||||||
|
<!-- <dependency>-->
|
||||||
|
<!-- <groupId>eu.europa.eeas</groupId>-->
|
||||||
|
<!-- <artifactId>ananke-tools-starter-abac-connector-paymentrequest-3</artifactId>-->
|
||||||
|
<!-- </dependency>-->
|
||||||
|
|
||||||
|
<!-- <dependency>-->
|
||||||
|
<!-- <groupId>eu.europa.eeas</groupId>-->
|
||||||
|
<!-- <artifactId>ananke-tools-starter-abac-connector-paymentorder-1</artifactId>-->
|
||||||
|
<!-- </dependency>-->
|
||||||
|
|
||||||
|
<!-- ***************** -->
|
||||||
|
<!-- * Third Parties * -->
|
||||||
|
<!-- ***************** -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.tomcat.embed</groupId>
|
||||||
|
<artifactId>tomcat-embed-jasper</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>eu.europa.ec.digit.iam.ecas.client</groupId>
|
||||||
|
<artifactId>ecas-tomcat-8.0</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.logging.log4j</groupId>
|
||||||
|
<artifactId>log4j-1.2-api</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.activemq</groupId>
|
||||||
|
<artifactId>activemq-core</artifactId>
|
||||||
|
<version>5.7.0</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-devtools</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.security</groupId>
|
||||||
|
<artifactId>spring-security-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-cache</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.cache</groupId>
|
||||||
|
<artifactId>cache-api</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.ehcache</groupId>
|
||||||
|
<artifactId>ehcache</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--- JMS -->
|
||||||
|
<!-- <dependency>-->
|
||||||
|
<!-- <groupId>eu.europa.eeas</groupId>-->
|
||||||
|
<!-- <artifactId>ananke-core-starter-locale-provider-connector-jms</artifactId>-->
|
||||||
|
<!-- </dependency>-->
|
||||||
|
|
||||||
|
<!-- <dependency>-->
|
||||||
|
<!-- <groupId>eu.europa.eeas</groupId>-->
|
||||||
|
<!-- <artifactId>ananke-core-starter-connector-provider-jms</artifactId>-->
|
||||||
|
<!-- </dependency>-->
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.oracle.weblogic</groupId>
|
||||||
|
<artifactId>wlthint3client</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.crypto.tink</groupId>
|
||||||
|
<artifactId>tink</artifactId>
|
||||||
|
<version>1.6.1</version>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.serenity-bdd</groupId>
|
||||||
|
<artifactId>serenity-core</artifactId>
|
||||||
|
<version>${serenity.version}</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.serenity-bdd</groupId>
|
||||||
|
<artifactId>serenity-cucumber</artifactId>
|
||||||
|
<version>${serenity.version}</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.serenity-bdd</groupId>
|
||||||
|
<artifactId>serenity-screenplay</artifactId>
|
||||||
|
<version>${serenity.version}</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.serenity-bdd</groupId>
|
||||||
|
<artifactId>serenity-screenplay-webdriver</artifactId>
|
||||||
|
<version>${serenity.version}</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.serenity-bdd</groupId>
|
||||||
|
<artifactId>serenity-ensure</artifactId>
|
||||||
|
<version>${serenity.version}</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.junit.jupiter</groupId>
|
||||||
|
<artifactId>junit-jupiter-api</artifactId>
|
||||||
|
<version>5.8.2</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- JUnit Jupiter Engine -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.junit.jupiter</groupId>
|
||||||
|
<artifactId>junit-jupiter-engine</artifactId>
|
||||||
|
<version>5.8.2</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<finalName>${project.artifactId}</finalName>
|
||||||
|
<plugins>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<useFile>false</useFile>
|
||||||
|
<includes>
|
||||||
|
<include>**/*Spec.java</include>
|
||||||
|
<include>**/*Test.java</include>
|
||||||
|
<include>**/*UT.java</include>
|
||||||
|
<include>**/*IT.java</include>
|
||||||
|
</includes>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>e-rights-back-office</id>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
<configuration>
|
||||||
|
<excludes>
|
||||||
|
<exclude>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
</exclude>
|
||||||
|
</excludes>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>it.ninjatech</groupId>
|
||||||
|
<artifactId>swagger-codegen-maven-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>e-rights-back-office</id>
|
||||||
|
<goals>
|
||||||
|
<goal>generate-api</goal>
|
||||||
|
<goal>generate-model</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<id>e-rights-back-office</id>
|
||||||
|
<outputFolder>${project.build.directory}/generated-sources</outputFolder>
|
||||||
|
<apiPackage>eu.europa.eeas.erights.backoffice.api.http.rest.api.internal</apiPackage>
|
||||||
|
<modelPackage>eu.europa.eeas.erights.backoffice.api.http.rest.transferobject.internal</modelPackage>
|
||||||
|
<apiSuffix>RestApi</apiSuffix>
|
||||||
|
<modelNameSuffix>TransferObject</modelNameSuffix>
|
||||||
|
<sourceFiles>
|
||||||
|
<param>${urlPrefix}${basedir}/src/main/resources/swagger/internal/e-rights-back-office.yml</param>
|
||||||
|
<param>${urlPrefix}${basedir}/src/main/resources/swagger/internal/e-rights-back-office-abac.yml</param>
|
||||||
|
<param>${urlPrefix}${basedir}/src/main/resources/swagger/internal/e-rights-back-office-summa.yml</param>
|
||||||
|
|
||||||
|
</sourceFiles>
|
||||||
|
|
||||||
|
|
||||||
|
<dataTypeMapping>
|
||||||
|
<directMap>
|
||||||
|
<!-- Primitives -->
|
||||||
|
<CurrencyUnit>javax.money.CurrencyUnit</CurrencyUnit>
|
||||||
|
<Money>org.javamoney.moneta.Money</Money>
|
||||||
|
<!-- e-Rights Common -->
|
||||||
|
<City>eu.europa.eeas.erights.common.api.http.rest.transferobject.internal.CityTransferObject</City>
|
||||||
|
<Country>eu.europa.eeas.erights.common.api.http.rest.transferobject.internal.CountryTransferObject</Country>
|
||||||
|
<MovementFile>eu.europa.eeas.erights.common.api.http.rest.transferobject.internal.MovementFileTransferObject</MovementFile>
|
||||||
|
<MovementFileState>eu.europa.eeas.erights.common.tools.statemachine.MovementFileState</MovementFileState>
|
||||||
|
<MovementType>eu.europa.eeas.erights.common.api.http.rest.transferobject.internal.MovementTypeTransferObject</MovementType>
|
||||||
|
<NotificationTemplateCode>eu.europa.eeas.erights.common.tools.notification.NotificationTemplateCode</NotificationTemplateCode>
|
||||||
|
<VJob>eu.europa.eeas.erights.common.api.http.rest.transferobject.internal.VJobTransferObject</VJob>
|
||||||
|
<VPerson>eu.europa.eeas.erights.common.api.http.rest.transferobject.internal.VPersonTransferObject</VPerson>
|
||||||
|
<VReportMovementFile>eu.europa.eeas.erights.common.api.http.rest.transferobject.internal.VReportMovementFileTransferObject</VReportMovementFile>
|
||||||
|
<VAllowancesTransferObject>eu.europa.eeas.erights.common.api.http.rest.transferobject.internal.VAllowancesTransferObject</VAllowancesTransferObject>
|
||||||
|
<MovementContext>eu.europa.eeas.erights.common.api.http.rest.transferobject.internal.MovementContextTransferObject</MovementContext>
|
||||||
|
<FunctionCode>eu.europa.eeas.erights.common.api.http.rest.transferobject.internal.FunctionCodeTransferObject</FunctionCode>
|
||||||
|
<StatutoryLinkCode>eu.europa.eeas.erights.common.api.http.rest.transferobject.internal.StatutoryLinkCodeTransferObject</StatutoryLinkCode>
|
||||||
|
<InstitutionCode>eu.europa.eeas.erights.common.api.http.rest.transferobject.internal.InstitutionCodeTransferObject</InstitutionCode>
|
||||||
|
<PersonnelType>eu.europa.eeas.erights.common.api.http.rest.transferobject.internal.PersonnelTypeTransferObject</PersonnelType>
|
||||||
|
<IataAirport>eu.europa.eeas.erights.common.api.http.rest.transferobject.internal.IataAirportTransferObject</IataAirport>
|
||||||
|
<TravelAllowanceState>eu.europa.eeas.erights.common.tools.statemachine.TravelAllowanceState</TravelAllowanceState>
|
||||||
|
<PostingAllowance>eu.europa.eeas.erights.common.api.http.rest.transferobject.internal.PostingAllowanceTransferObject</PostingAllowance>
|
||||||
|
<VReportPostingAllowance>eu.europa.eeas.erights.common.api.http.rest.transferobject.internal.VReportPostingAllowanceTransferObject</VReportPostingAllowance>
|
||||||
|
<!-- Ananke -->
|
||||||
|
<NotificationStatus>eu.europa.eeas.ananke.tools.edms.connector.service.model.enums.Status</NotificationStatus>
|
||||||
|
<TransferObject>eu.europa.eeas.ananke.core.api.transferobject.AbstractTransferObject</TransferObject>
|
||||||
|
<AuditableTransferObject>eu.europa.eeas.ananke.core.audit.provider.api.transferobject.AbstractAuditableTransferObject</AuditableTransferObject>
|
||||||
|
<BusinessPartnerResponse>eu.europa.eeas.erights.web.p2phub.client.transferobject.BusinessPartnerResponseTransferObject</BusinessPartnerResponse>
|
||||||
|
<AllowanceRequest>eu.europa.eeas.erights.backoffice.api.http.rest.transferobject.AllowanceRequestInternalTransferObject</AllowanceRequest>
|
||||||
|
<OrderResponseInternal>eu.europa.eeas.erights.backoffice.api.http.rest.transferobject.OrderResponseInternalTransferObject</OrderResponseInternal>
|
||||||
|
<OrderStatusResponse>eu.europa.eeas.erights.web.p2phub.client.transferobject.OrderStatusResponseTransferObject</OrderStatusResponse>
|
||||||
|
<SummaFundSource>eu.europa.eeas.erights.backoffice.api.http.rest.transferobject.internal.SummaFundSourceTransferObject</SummaFundSource>
|
||||||
|
<Request>eu.europa.eeas.erights.common.api.http.rest.transferobject.internal.RequestTransferObject</Request>
|
||||||
|
</directMap>
|
||||||
|
<packages />
|
||||||
|
<externalResources />
|
||||||
|
</dataTypeMapping>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.openapitools</groupId>
|
||||||
|
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||||
|
<version>7.6.0</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>p2p-hub-client</id>
|
||||||
|
<goals>
|
||||||
|
<goal>generate</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<apiNameSuffix>RestApi</apiNameSuffix>
|
||||||
|
<modelNameSuffix>TransferObject</modelNameSuffix>
|
||||||
|
<inputSpec>e-rights-back-office/src/main/resources/swagger/clients/p2p-hub.json</inputSpec>
|
||||||
|
<generatorName>java</generatorName>
|
||||||
|
<output>${project.build.directory}/generated-sources</output>
|
||||||
|
<generateApiTests>false</generateApiTests>
|
||||||
|
<generateModelTests>false</generateModelTests>
|
||||||
|
<addCompileSourceRoot>false</addCompileSourceRoot>
|
||||||
|
<addTestCompileSourceRoot>false</addTestCompileSourceRoot>
|
||||||
|
<templateDirectory>${project.basedir}/src/main/resources/openapi-templates</templateDirectory>
|
||||||
|
<globalProperties>
|
||||||
|
|
||||||
|
<apiTests>false</apiTests>
|
||||||
|
<modelTests>false</modelTests>
|
||||||
|
<skipValidateSpec>true</skipValidateSpec>
|
||||||
|
</globalProperties>
|
||||||
|
<configOptions>
|
||||||
|
|
||||||
|
<generateTests>false</generateTests>
|
||||||
|
<generateModelTests>false</generateModelTests>
|
||||||
|
<generateApiTests>false</generateApiTests>
|
||||||
|
<sourceFolder>src/main/java</sourceFolder>
|
||||||
|
<apiPackage>eu.europa.eeas.erights.web.p2phub.client</apiPackage>
|
||||||
|
<modelPackage>eu.europa.eeas.erights.web.p2phub.client.transferobject</modelPackage>
|
||||||
|
<dateLibrary>java8-localdatetime</dateLibrary>
|
||||||
|
<reactive>false</reactive>
|
||||||
|
<java8>true</java8>
|
||||||
|
<useJakartaEe>false</useJakartaEe>
|
||||||
|
<library>resttemplate</library>
|
||||||
|
<useOptional>false</useOptional>
|
||||||
|
<openApiNullable>false</openApiNullable>
|
||||||
|
<useBeanValidation>true</useBeanValidation>
|
||||||
|
<serializationLibrary>jackson</serializationLibrary>
|
||||||
|
<modelPropertyNaming>camelCase</modelPropertyNaming>
|
||||||
|
<modelNameConvention>camelCase</modelNameConvention>
|
||||||
|
|
||||||
|
<!-- Optional: for enum style -->
|
||||||
|
<enumPropertyNaming>camelCase</enumPropertyNaming>
|
||||||
|
|
||||||
|
<parentModel>AbstractTransferObject</parentModel>
|
||||||
|
<parentModelName>AbstractTransferObject</parentModelName>
|
||||||
|
<parentModelPackage>eu.europa.eeas.ananke.core.api.transferobject</parentModelPackage>
|
||||||
|
</configOptions>
|
||||||
|
<additionalProperties>
|
||||||
|
<additionalProperty>modelPropertyNaming=camelCase</additionalProperty>
|
||||||
|
</additionalProperties>
|
||||||
|
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-enforcer-plugin</artifactId>
|
||||||
|
<version>3.0.0</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>enforce-versions</id>
|
||||||
|
<goals>
|
||||||
|
<goal>enforce</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<rules>
|
||||||
|
<bannedDependencies>
|
||||||
|
<excludes>
|
||||||
|
<exclude>org.apache.logging.log4j:*:2.0.0</exclude>
|
||||||
|
</excludes>
|
||||||
|
<includes>
|
||||||
|
<include>org.apache.logging.log4j:*:2.16.0</include>
|
||||||
|
</includes>
|
||||||
|
</bannedDependencies>
|
||||||
|
</rules>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.zeroturnaround</groupId>
|
||||||
|
<artifactId>jrebel-maven-plugin</artifactId>
|
||||||
|
<version>1.1.10</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>generate-rebel-xml</id>
|
||||||
|
<phase>process-resources</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>generate</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
|
<artifactId>build-helper-maven-plugin</artifactId>
|
||||||
|
<version>3.5.0</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>add-test-source</id>
|
||||||
|
<phase>generate-test-sources</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>add-test-source</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<sources>
|
||||||
|
<source>${project.build.directory}/target/generated-sources/src/test</source>
|
||||||
|
<source>${project.build.directory}/target/generated-sources/src/test/java</source>
|
||||||
|
<source>${project.build.directory}/generated-sources/src/test</source>
|
||||||
|
<source>${project.build.directory}/generated-sources/src/test/java</source>
|
||||||
|
</sources>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
<profiles>
|
||||||
|
<profile>
|
||||||
|
<id>add-webapp-as-resource</id>
|
||||||
|
<activation>
|
||||||
|
<activeByDefault>true</activeByDefault>
|
||||||
|
</activation>
|
||||||
|
<build>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
<filtering>true</filtering>
|
||||||
|
<includes>
|
||||||
|
<include>**/*.properties</include>
|
||||||
|
<include>**/*.yml</include>
|
||||||
|
<include>**/*.yaml</include>
|
||||||
|
<include>**/*.xml</include>
|
||||||
|
</includes>
|
||||||
|
</resource>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
<filtering>false</filtering>
|
||||||
|
<includes>
|
||||||
|
<include>certs/**</include>
|
||||||
|
<include>**/*.p12</include>
|
||||||
|
<include>**/*.pfx</include>
|
||||||
|
<include>**/*.jks</include>
|
||||||
|
</includes>
|
||||||
|
</resource>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/webapp</directory><!-- to fix Ananke NPE which expects to find the web.xml -->
|
||||||
|
<filtering>true</filtering>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
|
|
||||||
|
</project>
|
||||||
|
|
@ -0,0 +1,196 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.mvc.controller;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.mvc.AbstractMvcController;
|
||||||
|
import eu.europa.eeas.ananke.core.base.exception.AuthorizationRuntimeException;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.model.RequestPaymentAbacInfoModel;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.provider.abac.AbacBankAccountServiceProvider;
|
||||||
|
import eu.europa.eeas.erights.common.boot.configuration.ERightsBeanNames;
|
||||||
|
import eu.europa.eeas.erights.common.exceptionhandling.ERightsExceptionCode;
|
||||||
|
import eu.europa.eeas.erights.common.security.MovementFileSecurityChecker;
|
||||||
|
import eu.europa.eeas.erights.common.security.PostingAllowancePermission;
|
||||||
|
import eu.europa.eeas.erights.common.security.PostingAllowanceSecurityChecker;
|
||||||
|
import eu.europa.eeas.erights.common.service.data.provider.entitlement.request.RequestJpaServiceProvider;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
import static eu.europa.eeas.erights.common.security.PostingAllowancePermission.ACCOMMODATION_PAYMENT_PAY;
|
||||||
|
import static java.lang.Long.valueOf;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/abac")
|
||||||
|
public class AbacController extends AbstractMvcController {
|
||||||
|
|
||||||
|
public static final String WELCOME = "welcome";
|
||||||
|
|
||||||
|
public static final String YOU_ARE_NOT_AUTHORIZED_TO_CONSULT_THE_REQUEST = "You are not authorized to consult the request: ";
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
@Qualifier(ERightsBeanNames.MOVEMENT_FILE_SECURITY_CHECKER)
|
||||||
|
private MovementFileSecurityChecker securityChecker;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
@Qualifier(ERightsBeanNames.POSTING_ALLOWANCE_SECURITY_CHECKER)
|
||||||
|
private PostingAllowanceSecurityChecker postingAllowanceSecurityChecker;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RequestJpaServiceProvider requestJpaServiceProvider;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AbacBankAccountServiceProvider abacBankAccountServiceProvider;
|
||||||
|
|
||||||
|
@GetMapping(path = "/abac-payments-details.do")
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public String abacPaymentDetailsRem(@RequestParam(required = true) String requestId, @RequestParam(required = true) String requestType, @RequestParam(required = true) String movementFileId, Model model) {
|
||||||
|
|
||||||
|
// TODO This condition does not cause problems but does no make sense. It's not "TUD", its "TudRequest"
|
||||||
|
// Might be related to RIGD-1877
|
||||||
|
if ((!requestType.equals("TUD") && securityChecker.canPayRemRequestAbac(requestJpaServiceProvider.getMovementFileId(valueOf(requestId)))) ||
|
||||||
|
(requestType.equals("TUD") && securityChecker.canPayTudRequestAbac(requestJpaServiceProvider.getMovementFileId(valueOf(requestId))))) {
|
||||||
|
|
||||||
|
model.addAttribute("requestId", requestId);
|
||||||
|
model.addAttribute("requestType", requestType);
|
||||||
|
model.addAttribute("movementFileId", movementFileId);
|
||||||
|
|
||||||
|
return "abac-payments/abac.details.form";
|
||||||
|
}
|
||||||
|
throw new AuthorizationRuntimeException(ERightsExceptionCode.ER008, YOU_ARE_NOT_AUTHORIZED_TO_CONSULT_THE_REQUEST + requestId);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/abac-payments-details-accommodation.do")
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public String abacPaymentDetailsAccommodation(@RequestParam(required = true) String postingAllowanceId, @RequestParam(required = true) String requestType, Model model) {
|
||||||
|
if (requestType.equals("AccommodationPayment") && postingAllowanceSecurityChecker.hasOrganisationIndependentAuthority(ACCOMMODATION_PAYMENT_PAY)) {
|
||||||
|
|
||||||
|
model.addAttribute("postingAllowanceId", postingAllowanceId);
|
||||||
|
model.addAttribute("requestType", requestType);
|
||||||
|
|
||||||
|
return "abac-payments/abac.details.accommodation";
|
||||||
|
}
|
||||||
|
throw new AuthorizationRuntimeException(ERightsExceptionCode.ER008, YOU_ARE_NOT_AUTHORIZED_TO_CONSULT_THE_REQUEST + postingAllowanceId);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/send-to-abac.do")
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public String sendToAbac(@RequestParam(required = true) Long requestId, @RequestParam(required = true) String requestType, @RequestParam(required = true) String movementFileId, Model model) {
|
||||||
|
|
||||||
|
// TODO This condition does not cause problems but does no make sense. It's not "TUD", its "TudRequest"
|
||||||
|
// Might be related to RIGD-1877
|
||||||
|
|
||||||
|
if ((!requestType.equals("TUD") && securityChecker.canPayRemRequestAbac(requestJpaServiceProvider.getMovementFileId(valueOf(requestId)))) ||
|
||||||
|
(requestType.equals("TUD") && securityChecker.canPayTudRequestAbac(requestJpaServiceProvider.getMovementFileId(valueOf(requestId))))) {
|
||||||
|
RequestPaymentAbacInfoModel requestPaymentAbacInfoModel = new RequestPaymentAbacInfoModel();
|
||||||
|
|
||||||
|
|
||||||
|
return "abac-payments/abac.details.form";
|
||||||
|
}
|
||||||
|
throw new AuthorizationRuntimeException(ERightsExceptionCode.ER008, YOU_ARE_NOT_AUTHORIZED_TO_CONSULT_THE_REQUEST + requestId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/response-from-abac.do")
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public String responseFromAbac(@RequestParam(required = true) Long requestId, @RequestParam(required = true) String requestType, @RequestParam(required = true) String movementFileId, Model model) throws InterruptedException {
|
||||||
|
|
||||||
|
if ((!requestType.equals("TUD") && securityChecker.canPayRemRequestAbac(requestJpaServiceProvider.getMovementFileId(requestId))) ||
|
||||||
|
(requestType.equals("TUD") && securityChecker.canPayTudRequestAbac(requestJpaServiceProvider.getMovementFileId(requestId)))) {
|
||||||
|
|
||||||
|
model.addAttribute("requestId", requestId);
|
||||||
|
model.addAttribute("isBackOffice", true);
|
||||||
|
|
||||||
|
Thread.sleep(10000);
|
||||||
|
|
||||||
|
switch (requestType) {
|
||||||
|
case "ClearingRequest":
|
||||||
|
// in common
|
||||||
|
return "e-rights-common:request/edit.clr.rem.request";
|
||||||
|
case "AdvanceRequest":
|
||||||
|
// not in common
|
||||||
|
return "request/edit.adv.rem.request";
|
||||||
|
case "TotalRemRequest":
|
||||||
|
// in common
|
||||||
|
return "e-rights-common:request/edit.total.rem.request";
|
||||||
|
case "TudRequest":
|
||||||
|
// not in common
|
||||||
|
return "request/edit.tud.request";
|
||||||
|
case "TopUpRequest":
|
||||||
|
// not in common
|
||||||
|
return "e-rights-common:request/edit.topup.request";
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new AuthorizationRuntimeException(ERightsExceptionCode.ER008, YOU_ARE_NOT_AUTHORIZED_TO_CONSULT_THE_REQUEST + requestId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/abac-info.do")
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_CONSULT_ENTITLEMENTS)
|
||||||
|
public String abacInfo(@RequestParam(required = true) String requestId, @RequestParam(required = true) String requestType, @RequestParam(required = true) String movementFileId, Model model) {
|
||||||
|
model.addAttribute("requestId", requestId);
|
||||||
|
model.addAttribute("requestType", requestType);
|
||||||
|
model.addAttribute("movementFileId", movementFileId);
|
||||||
|
|
||||||
|
return "abac-payments/abac.info";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping(path = "/refresh-all-bank-accounts.do")
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_CONSULT_ENTITLEMENTS)
|
||||||
|
public String refreshAllBankAccountsNup(){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return WELCOME;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/refresh-all-bank-accounts-per-id.do")
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_CONSULT_ENTITLEMENTS)
|
||||||
|
public String refreshAllBankAccountsPerId(){
|
||||||
|
|
||||||
|
return WELCOME;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/refresh-bank.do")
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_CONSULT_ENTITLEMENTS)
|
||||||
|
public String refreshPerIdBankAccountsNup(@RequestParam(required = true) Long perId){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return WELCOME;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/refresh-bank-per-id.do")
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_CONSULT_ENTITLEMENTS)
|
||||||
|
public String refreshPerIdBankAccountsPerId(@RequestParam(required = true) Long perId){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return WELCOME;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping(path = "/continueWithAbacProcess.do")
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_CONSULT_ENTITLEMENTS)
|
||||||
|
public String refreshAbacStatus(@RequestParam(required = true) Long requestId){
|
||||||
|
|
||||||
|
return WELCOME;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/continueWithAbacProcessUUID.do")
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_CONSULT_ENTITLEMENTS)
|
||||||
|
public String refreshAbacStatus(@RequestParam(required = true) String uuid){
|
||||||
|
// Thread thread = new Thread(() -> this.abacItemServiceProvider.restartAbacProcessUuid(uuid));
|
||||||
|
// thread.start();
|
||||||
|
return WELCOME;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.mvc.controller;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.mvc.AbstractMvcController;
|
||||||
|
import eu.europa.eeas.ananke.tools.web.breadcrumbs.annotation.Breadcrumb;
|
||||||
|
import eu.europa.eeas.ananke.tools.web.breadcrumbs.annotation.CascadingBreadcrumb;
|
||||||
|
import eu.europa.eeas.erights.common.security.MovementFileSecurityChecker;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/list")
|
||||||
|
public class ListControllerBackOffice extends AbstractMvcController {
|
||||||
|
|
||||||
|
@GetMapping(path = {"/movement-files.do"})
|
||||||
|
@CascadingBreadcrumb(label = @Breadcrumb.Label(key = "e_rights.breadcrumbs.list.movement_files"))
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_LIST)
|
||||||
|
public String listMovementFiles() {
|
||||||
|
|
||||||
|
return "e-rights-common:list/list.file";
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/allowances.do")
|
||||||
|
@CascadingBreadcrumb(label = @Breadcrumb.Label(key = "e_rights.breadcrumbs.requests.view"))
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public String listRequest(Model model) {
|
||||||
|
model.addAttribute("isBackOffice", true);
|
||||||
|
|
||||||
|
return "reports/allowances";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping(path = "/posting-allowances.do")
|
||||||
|
@CascadingBreadcrumb(label = @Breadcrumb.Label(key = "e_rights.breadcrumbs.list.posting_allowances"))
|
||||||
|
public String listPostingAllowances(Model model) {
|
||||||
|
|
||||||
|
model.addAttribute("isBackOffice", true);
|
||||||
|
model.addAttribute("isShowYearDropDown", true);
|
||||||
|
return "reports/posting.allowances";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.mvc.controller;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.mvc.AbstractMvcController;
|
||||||
|
import eu.europa.eeas.ananke.tools.web.breadcrumbs.annotation.Breadcrumb;
|
||||||
|
import eu.europa.eeas.ananke.tools.web.breadcrumbs.annotation.CascadingBreadcrumb;
|
||||||
|
import eu.europa.eeas.erights.common.security.MovementFileSecurityChecker;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by tapiafo on 15/03/2021; e-rights.
|
||||||
|
*
|
||||||
|
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:Fernando.TAPIA@ext.eeas.europa.eu">Fernando Tapia</a>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/movement-docs")
|
||||||
|
public class MovementDocsControllerBackOffice extends AbstractMvcController {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Edit information Setion for staff member
|
||||||
|
*
|
||||||
|
* @param model s
|
||||||
|
* @return s
|
||||||
|
*/
|
||||||
|
@GetMapping(path = "/edit.do")
|
||||||
|
@CascadingBreadcrumb(label = @Breadcrumb.Label(key = "e_rights.breadcrumbs.movement-docs.edit"))
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_MANGE_GUIDELINES)
|
||||||
|
public String editMovementFileCommon(Model model) {
|
||||||
|
|
||||||
|
return "movement-docs/edit";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,153 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.mvc.controller;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.mvc.AbstractMvcController;
|
||||||
|
import eu.europa.eeas.ananke.core.base.exception.AuthorizationRuntimeException;
|
||||||
|
import eu.europa.eeas.ananke.tools.web.breadcrumbs.annotation.Breadcrumb;
|
||||||
|
import eu.europa.eeas.ananke.tools.web.breadcrumbs.annotation.CascadingBreadcrumb;
|
||||||
|
import eu.europa.eeas.erights.backoffice.tools.MovementFileFieldNames;
|
||||||
|
import eu.europa.eeas.erights.common.boot.configuration.ERightsBeanNames;
|
||||||
|
import eu.europa.eeas.erights.common.boot.configuration.data.ERightsRootConfiguration;
|
||||||
|
import eu.europa.eeas.erights.common.exceptionhandling.ERightsExceptionCode;
|
||||||
|
import eu.europa.eeas.erights.common.security.MovementFileSecurityChecker;
|
||||||
|
import eu.europa.eeas.erights.common.service.provider.ProceduresForMovementFileServiceProvider;
|
||||||
|
import org.apache.http.client.utils.URIBuilder;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||||
|
import org.springframework.web.servlet.view.RedirectView;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by iliessu on 19/11/2019; e-rights.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* TODO : comment class !
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:Silviu.ILIE@ext.eeas.europa.eu">Silviu Ilie</a>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/movement-files")
|
||||||
|
public class MovementFileControllerBackOffice extends AbstractMvcController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ProceduresForMovementFileServiceProvider proceduresForMovementFileServiceProvider;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ERightsRootConfiguration eRightsRootConfiguration;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
@Qualifier(ERightsBeanNames.MOVEMENT_FILE_SECURITY_CHECKER)
|
||||||
|
private MovementFileSecurityChecker securityChecker;
|
||||||
|
|
||||||
|
@GetMapping(path = "/create-details.do")
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_CREATE)
|
||||||
|
public String createMovementFileDetails(Model model, @RequestParam(required = false, defaultValue = "0") Long jobId,
|
||||||
|
@RequestParam(required = false, defaultValue = "0") Long perId, @RequestParam(required = false, defaultValue = "0") Long jobIdTo) {
|
||||||
|
|
||||||
|
model.addAttribute(MovementFileFieldNames.JOB_ID, jobId);
|
||||||
|
model.addAttribute(MovementFileFieldNames.PERSON_ID, perId);
|
||||||
|
|
||||||
|
return "movement-file/file.details";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping(path = "/create-details-no-job.do")
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_CREATE)
|
||||||
|
public String createMovementFileDetailsNoJob(Model model, @RequestParam(required = false, defaultValue = "0") Long jobId,
|
||||||
|
@RequestParam(required = false, defaultValue = "0") Long perId,
|
||||||
|
@RequestParam(required = false, defaultValue = "0") Long jobIdTo,
|
||||||
|
@RequestParam(required = false) String movementContext) {
|
||||||
|
|
||||||
|
model.addAttribute(MovementFileFieldNames.JOB_ID, jobId);
|
||||||
|
model.addAttribute(MovementFileFieldNames.PERSON_ID, perId);
|
||||||
|
model.addAttribute(MovementFileFieldNames.MOVEMENT_CONTEXT, movementContext);
|
||||||
|
return "movement-file/file.details-no-job";
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/create-job-holder.do")
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_CREATE)
|
||||||
|
@CascadingBreadcrumb(label = @Breadcrumb.Label(key = "e_rights.breadcrumbs.movement_files.add_new"))
|
||||||
|
public String createMovementFileJobHolder(Model model) {
|
||||||
|
|
||||||
|
return "movement-file/file.job-holder";
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/create-future-assignment.do")
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_CREATE)
|
||||||
|
public String createMovementFileFutureAssignment(Model model, @RequestParam(required = false, defaultValue = "0") Long jobId) {
|
||||||
|
|
||||||
|
model.addAttribute(MovementFileFieldNames.JOB_ID, jobId);
|
||||||
|
|
||||||
|
return "movement-file/file.future-assignment";
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/staff-member-data.do")
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_CREATE)
|
||||||
|
public String staffMemberData(@RequestParam(required = false, defaultValue = "0") Long perId, Model model) {
|
||||||
|
|
||||||
|
model.addAttribute(MovementFileFieldNames.PERSON_ID, perId);
|
||||||
|
|
||||||
|
return "movement-file/file.staff-member-data";
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/summary.do")
|
||||||
|
@CascadingBreadcrumb(label = @Breadcrumb.Label(key = "e_rights.breadcrumbs.movement_files.view"))
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_CREATE)
|
||||||
|
public String summaryMovementFile(Model model) {
|
||||||
|
|
||||||
|
return "movement-file/file.summary";
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/view.do")
|
||||||
|
@CascadingBreadcrumb(label = @Breadcrumb.Label(key = "e_rights.breadcrumbs.movement_files.view"))
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public String editMovementFileCommon(@RequestParam(required = true) String id, @RequestParam(required = false, defaultValue = "false") Boolean fromWizard, Model model) {
|
||||||
|
if (this.securityChecker.canView(Long.valueOf(id))) {
|
||||||
|
model.addAttribute("fileId", id);
|
||||||
|
model.addAttribute("fromWizard", fromWizard);
|
||||||
|
|
||||||
|
return "e-rights-common:movement-file/edit/file";
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new AuthorizationRuntimeException(ERightsExceptionCode.ER008);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/goToFrontOffice.do")
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public RedirectView redirectWithUsingRedirectView(RedirectAttributes attributes, @RequestParam String id, @RequestParam String path, @RequestParam String goToTab) {
|
||||||
|
//Generate URL for movement file
|
||||||
|
String frontOfficeUrl = eRightsRootConfiguration.getHostName();
|
||||||
|
if (eRightsRootConfiguration.getFrontOfficeHostName() != null) {
|
||||||
|
frontOfficeUrl = eRightsRootConfiguration.getFrontOfficeHostName();
|
||||||
|
}
|
||||||
|
|
||||||
|
URIBuilder builder = new URIBuilder()
|
||||||
|
.setScheme(eRightsRootConfiguration.getProtocol())
|
||||||
|
.setHost(frontOfficeUrl)
|
||||||
|
.setPath(path);
|
||||||
|
|
||||||
|
attributes.addAttribute("id", id);
|
||||||
|
attributes.addAttribute("gototab", goToTab);
|
||||||
|
return new RedirectView(builder.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
//TODO Delete after running first time
|
||||||
|
@GetMapping(path = "/deleteMovemntFiles.do")
|
||||||
|
@CascadingBreadcrumb(label = @Breadcrumb.Label(key = "e_rights.breadcrumbs.movement_files.view"))
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public String updateVolumeAndKg(@RequestParam Long movementFileId) {
|
||||||
|
proceduresForMovementFileServiceProvider.removeMovementFiles(movementFileId);
|
||||||
|
return null;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,92 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.mvc.controller;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.mvc.AbstractMvcController;
|
||||||
|
import eu.europa.eeas.ananke.core.base.exception.AuthorizationRuntimeException;
|
||||||
|
import eu.europa.eeas.ananke.tools.web.breadcrumbs.annotation.Breadcrumb;
|
||||||
|
import eu.europa.eeas.ananke.tools.web.breadcrumbs.annotation.CascadingBreadcrumb;
|
||||||
|
import eu.europa.eeas.erights.common.boot.configuration.ERightsBeanNames;
|
||||||
|
import eu.europa.eeas.erights.common.exceptionhandling.ERightsExceptionCode;
|
||||||
|
import eu.europa.eeas.erights.common.security.MovementFileSecurityChecker;
|
||||||
|
import eu.europa.eeas.erights.common.security.PostingAllowanceSecurityChecker;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by tapiafo on 15/03/2021; e-rights.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* TODO : comment class !
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:Fernando.TAPIA@ext.eeas.europa.eu">Fernando Tapia</a>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/posting-allowances")
|
||||||
|
public class PostingAllowanceControllerBackOffice extends AbstractMvcController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
@Qualifier(ERightsBeanNames.POSTING_ALLOWANCE_SECURITY_CHECKER)
|
||||||
|
private PostingAllowanceSecurityChecker postingAllowanceSecurityChecker;
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping(path = "/view-tar.do")
|
||||||
|
@CascadingBreadcrumb(label = @Breadcrumb.Label(key = "e_rights.breadcrumbs.posting_allowances.view"))
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public String editTarRequestBackOffice(@RequestParam(required = true) String postingAllowanceId, Model model) {
|
||||||
|
model.addAttribute("postingAllowanceId", postingAllowanceId);
|
||||||
|
model.addAttribute("isBackOffice", true);
|
||||||
|
|
||||||
|
return "e-rights-common:posting-allowance/view.tar";
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/regularization-view-tar.do")
|
||||||
|
@CascadingBreadcrumb(label = @Breadcrumb.Label(key = "e_rights.breadcrumbs.posting_allowances.view"))
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public String editTarRegularizationRequestBackOffice(@RequestParam(required = true) String postingAllowanceId, Model model) {
|
||||||
|
model.addAttribute("postingAllowanceId", postingAllowanceId);
|
||||||
|
model.addAttribute("isBackOffice", true);
|
||||||
|
return "e-rights-common:posting-allowance/regularization-view.tar";
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/accommodation-declaration-view.do")
|
||||||
|
@CascadingBreadcrumb(label = @Breadcrumb.Label(key = "e_rights.breadcrumbs.posting_allowances.view"))
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public String editAccommodationDeclarationBackOffice(
|
||||||
|
@RequestParam(required = true) String postingAllowanceId, Model model) {
|
||||||
|
if(Boolean.TRUE.equals(postingAllowanceSecurityChecker.canViewAccommodationDeclaration(Long.valueOf(postingAllowanceId)))){
|
||||||
|
model.addAttribute("postingAllowanceId", postingAllowanceId);
|
||||||
|
model.addAttribute("isBackOffice", true);
|
||||||
|
return "e-rights-common:posting-allowance/accommodation-declaration-view";
|
||||||
|
}
|
||||||
|
throw new AuthorizationRuntimeException(ERightsExceptionCode.ER008);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/accommodation-declaration-create.do")
|
||||||
|
@PreAuthorize(PostingAllowanceSecurityChecker.CAN_CREATE_ACCOMMODATION_DECLARATION)
|
||||||
|
@CascadingBreadcrumb(label = @Breadcrumb.Label(key = "e_rights.breadcrumbs.accommodation_declarations.add_new"))
|
||||||
|
public String createAccDeclarationJobHolder(Model model) {
|
||||||
|
|
||||||
|
return "accommodation/declaration.job-holder";
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/accommodation-payment-view.do")
|
||||||
|
@CascadingBreadcrumb(label = @Breadcrumb.Label(key = "e_rights.breadcrumbs.posting_allowances.view"))
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public String editAccommodationPaymentBackOffice(
|
||||||
|
@RequestParam(required = true) String postingAllowanceId, Model model) {
|
||||||
|
if(Boolean.TRUE.equals(postingAllowanceSecurityChecker.canViewAccommodationDeclaration(Long.valueOf(postingAllowanceId)))){
|
||||||
|
model.addAttribute("postingAllowanceId", postingAllowanceId);
|
||||||
|
model.addAttribute("isBackOffice", true);
|
||||||
|
return "e-rights-common:posting-allowance/accommodation-payment-view";
|
||||||
|
}
|
||||||
|
throw new AuthorizationRuntimeException(ERightsExceptionCode.ER008);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,49 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.mvc.controller;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.mvc.AbstractMvcController;
|
||||||
|
import eu.europa.eeas.ananke.tools.web.breadcrumbs.annotation.Breadcrumb;
|
||||||
|
import eu.europa.eeas.ananke.tools.web.breadcrumbs.annotation.CascadingBreadcrumb;
|
||||||
|
import eu.europa.eeas.erights.common.security.MovementFileSecurityChecker;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/reports")
|
||||||
|
public class ReportingBackOffice extends AbstractMvcController {
|
||||||
|
|
||||||
|
@GetMapping(path = {"/empty-rates-entitlements.do"})
|
||||||
|
@CascadingBreadcrumb(label = @Breadcrumb.Label(key = "e_rights.breadcrumbs.reports.empty_rates_entitlements"))
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_VIEW_REPORTS)
|
||||||
|
public String listMovementFiles() {
|
||||||
|
|
||||||
|
return "reports/empty.rates.entitlements";
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = {"/entitlement-max-default.do"})
|
||||||
|
@CascadingBreadcrumb(label = @Breadcrumb.Label(key = "e_rights.breadcrumbs.reports.empty_rates_entitlements"))
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_VIEW_REPORTS)
|
||||||
|
public String entitlementMaxDefault() {
|
||||||
|
|
||||||
|
return "reports/entitlement.max.default";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping(path = {"/iata-routes-calculation.do"})
|
||||||
|
@CascadingBreadcrumb(label = @Breadcrumb.Label(key = "e_rights.breadcrumbs.reports.empty_rates_entitlements"))
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_CALCULATE_ROUTE_PRICE)
|
||||||
|
public String iataRoutesCalculation() {
|
||||||
|
|
||||||
|
return "admin/iata-routes-calculation";
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = {"/it-admin.do"})
|
||||||
|
@CascadingBreadcrumb(label = @Breadcrumb.Label(key = "e_rights.breadcrumbs.admin.it_support"))
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_ADMIN_IT_SUPPORT)
|
||||||
|
public String itAdmin() {
|
||||||
|
|
||||||
|
return "admin/it-admin";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,148 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.mvc.controller;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.mvc.AbstractMvcController;
|
||||||
|
import eu.europa.eeas.ananke.core.base.exception.AuthorizationRuntimeException;
|
||||||
|
import eu.europa.eeas.ananke.tools.web.breadcrumbs.annotation.Breadcrumb;
|
||||||
|
import eu.europa.eeas.ananke.tools.web.breadcrumbs.annotation.CascadingBreadcrumb;
|
||||||
|
import eu.europa.eeas.erights.common.boot.configuration.ERightsBeanNames;
|
||||||
|
import eu.europa.eeas.erights.common.exceptionhandling.ERightsExceptionCode;
|
||||||
|
import eu.europa.eeas.erights.common.security.MovementFileSecurityChecker;
|
||||||
|
import eu.europa.eeas.erights.common.service.data.provider.entitlement.request.RequestJpaServiceProvider;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by tapiafo on 15/03/2021; e-rights.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* TODO : comment class !
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:Fernando.TAPIA@ext.eeas.europa.eu">Fernando Tapia</a>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/requests")
|
||||||
|
public class RequestsControllerBackOffice extends AbstractMvcController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
@Qualifier(ERightsBeanNames.MOVEMENT_FILE_SECURITY_CHECKER)
|
||||||
|
private MovementFileSecurityChecker securityChecker;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RequestJpaServiceProvider requestJpaServiceProvider;
|
||||||
|
|
||||||
|
@GetMapping(path = "/view-tud.do")
|
||||||
|
@CascadingBreadcrumb(label = @Breadcrumb.Label(key = "e_rights.breadcrumbs.requests.view"))
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public String editTudRequestBackOffice(@RequestParam(required = true) String requestId, Model model) {
|
||||||
|
if (securityChecker.canView(requestJpaServiceProvider.getMovementFileId(Long.valueOf(requestId))) &&
|
||||||
|
securityChecker.canConsultEntitlements(requestJpaServiceProvider.getMovementFileId(Long.valueOf(requestId)))) {
|
||||||
|
model.addAttribute("requestId", requestId);
|
||||||
|
|
||||||
|
return "request/edit.tud.request";
|
||||||
|
}
|
||||||
|
throw new AuthorizationRuntimeException(ERightsExceptionCode.ER008, "You are not authorized to consult the TUD request: " + requestId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/view-adv-rem.do")
|
||||||
|
@CascadingBreadcrumb(label = @Breadcrumb.Label(key = "e_rights.breadcrumbs.requests.view"))
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public String editAdvanceRequestBackOffice(@RequestParam(required = true) String requestId, Model model) {
|
||||||
|
|
||||||
|
if (securityChecker.canView(requestJpaServiceProvider.getMovementFileId(Long.valueOf(requestId))) &&
|
||||||
|
securityChecker.canConsultEntitlements(requestJpaServiceProvider.getMovementFileId(Long.valueOf(requestId)))) {
|
||||||
|
model.addAttribute("requestId", requestId);
|
||||||
|
|
||||||
|
return "request/edit.adv.rem.request";
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new AuthorizationRuntimeException(ERightsExceptionCode.ER008, "You are not authorized to consult the Advance request: " + requestId);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/view-total-rem.do")
|
||||||
|
@CascadingBreadcrumb(label = @Breadcrumb.Label(key = "e_rights.breadcrumbs.requests.view"))
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public String editTotalRemRequestBackOffice(@RequestParam(required = true) String requestId, Model model) {
|
||||||
|
if (securityChecker.canView(requestJpaServiceProvider.getMovementFileId(Long.valueOf(requestId)))) {
|
||||||
|
model.addAttribute("requestId", requestId);
|
||||||
|
model.addAttribute("isBackOffice", true);
|
||||||
|
return "e-rights-common:request/edit.total.rem.request";
|
||||||
|
}
|
||||||
|
throw new AuthorizationRuntimeException(ERightsExceptionCode.ER008, "You are not authorized to consult the Total REM request: " + requestId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/view-clr-rem.do")
|
||||||
|
@CascadingBreadcrumb(label = @Breadcrumb.Label(key = "e_rights.breadcrumbs.requests.view"))
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public String editClrRemRequestBackOffice(@RequestParam(required = true) String requestId, Model model) {
|
||||||
|
if (securityChecker.canView(requestJpaServiceProvider.getMovementFileId(Long.valueOf(requestId)))) {
|
||||||
|
model.addAttribute("requestId", requestId);
|
||||||
|
model.addAttribute("isBackOffice", true);
|
||||||
|
return "e-rights-common:request/edit.clr.rem.request";
|
||||||
|
}
|
||||||
|
throw new AuthorizationRuntimeException(ERightsExceptionCode.ER008, "You are not authorized to consult the Clearing request: " + requestId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/view-installation.do")
|
||||||
|
@CascadingBreadcrumb(label = @Breadcrumb.Label(key = "e_rights.breadcrumbs.requests.view"))
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public String viewInstallationBackOffice(@RequestParam(required = true) String requestId, Model model) {
|
||||||
|
if (securityChecker.canView(requestJpaServiceProvider.getMovementFileId(Long.valueOf(requestId)))) {
|
||||||
|
model.addAttribute("requestId", requestId);
|
||||||
|
model.addAttribute("isBackOffice", true);
|
||||||
|
return "e-rights-common:request/edit.install.request";
|
||||||
|
}
|
||||||
|
throw new AuthorizationRuntimeException(ERightsExceptionCode.ER008, "You are not authorized to consult the Installation request: " + requestId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/view-topup.do")
|
||||||
|
@CascadingBreadcrumb(label = @Breadcrumb.Label(key = "e_rights.breadcrumbs.requests.view"))
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public String viewTopupBackOffice(
|
||||||
|
// We'll use one of the two:
|
||||||
|
// If 'requestId' is used, it means that the Topup request already exists
|
||||||
|
// If 'parentRequestId' are 'parentRequestType' are used, it means that the Topup request is being created
|
||||||
|
@RequestParam(required = false) String requestId,
|
||||||
|
@RequestParam(required = false) String parentRequestId,
|
||||||
|
@RequestParam(required = false) String parentRequestType,
|
||||||
|
Model model) {
|
||||||
|
if (canView(requestId, parentRequestId)) {
|
||||||
|
model.addAttribute("requestId", requestId);
|
||||||
|
model.addAttribute("parentRequestId", parentRequestId);
|
||||||
|
model.addAttribute("parentRequestType", parentRequestType);
|
||||||
|
model.addAttribute("isBackOffice", true);
|
||||||
|
return "e-rights-common:request/edit.topup.request";
|
||||||
|
}
|
||||||
|
throw new AuthorizationRuntimeException(ERightsExceptionCode.ER008, "You are not authorized to consult the TopUp request: " + requestId);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Boolean canView(String requestId, String parentRequestId) {
|
||||||
|
if (requestId != null) {
|
||||||
|
return securityChecker.canView(requestJpaServiceProvider.getMovementFileId(Long.valueOf(requestId)));
|
||||||
|
} else if (parentRequestId != null) {
|
||||||
|
return securityChecker.canView(requestJpaServiceProvider.getMovementFileId(Long.valueOf(parentRequestId)));
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/view-resettlement.do")
|
||||||
|
@CascadingBreadcrumb(label = @Breadcrumb.Label(key = "e_rights.breadcrumbs.requests.view"))
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public String viewResettlementBackOffice(@RequestParam(required = true) String requestId, Model model) {
|
||||||
|
if (securityChecker.canView(requestJpaServiceProvider.getMovementFileId(Long.valueOf(requestId)))) {
|
||||||
|
model.addAttribute("requestId", requestId);
|
||||||
|
model.addAttribute("isBackOffice", true);
|
||||||
|
return "e-rights-common:request/edit.resettlement.request";
|
||||||
|
}
|
||||||
|
throw new AuthorizationRuntimeException(ERightsExceptionCode.ER008, "You are not authorized to consult the Resettlement request: " + requestId);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,158 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.mvc.controller;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.mvc.AbstractMvcController;
|
||||||
|
import eu.europa.eeas.ananke.core.base.exception.AuthorizationRuntimeException;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.provider.abac.AbacBankAccountServiceProvider;
|
||||||
|
import eu.europa.eeas.erights.common.boot.configuration.ERightsBeanNames;
|
||||||
|
import eu.europa.eeas.erights.common.exceptionhandling.ERightsExceptionCode;
|
||||||
|
import eu.europa.eeas.erights.common.security.MovementFileSecurityChecker;
|
||||||
|
import eu.europa.eeas.erights.common.service.data.provider.entitlement.request.RequestJpaServiceProvider;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
import static java.lang.Long.valueOf;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/summa")
|
||||||
|
public class SummaController extends AbstractMvcController {
|
||||||
|
|
||||||
|
public static final String WELCOME = "welcome";
|
||||||
|
|
||||||
|
public static final String YOU_ARE_NOT_AUTHORIZED_TO_CONSULT_THE_REQUEST = "You are not authorized to consult the request: ";
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
@Qualifier(ERightsBeanNames.MOVEMENT_FILE_SECURITY_CHECKER)
|
||||||
|
private MovementFileSecurityChecker securityChecker;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RequestJpaServiceProvider requestJpaServiceProvider;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AbacBankAccountServiceProvider abacBankAccountServiceProvider;
|
||||||
|
|
||||||
|
@GetMapping(path = "/p2p-payments-details.do")
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public String summaPaymentDetailsRem(@RequestParam(required = true) String requestId, @RequestParam(required = true) String requestType, @RequestParam(required = true) String movementFileId, Model model) {
|
||||||
|
|
||||||
|
// TODO This condition does not cause problems but does no make sense. It's not "TUD", its "TudRequest"
|
||||||
|
// Might be related to RIGD-1877
|
||||||
|
if ((!requestType.equals("TUD") && securityChecker.canPayRemRequestAbac(requestJpaServiceProvider.getMovementFileId(valueOf(requestId)))) ||
|
||||||
|
(requestType.equals("TUD") && securityChecker.canPayTudRequestAbac(requestJpaServiceProvider.getMovementFileId(valueOf(requestId))))) {
|
||||||
|
|
||||||
|
model.addAttribute("requestId", requestId);
|
||||||
|
model.addAttribute("requestType", requestType);
|
||||||
|
model.addAttribute("movementFileId", movementFileId);
|
||||||
|
|
||||||
|
return "abac-payments/abac.details.form";
|
||||||
|
}
|
||||||
|
throw new AuthorizationRuntimeException(ERightsExceptionCode.ER008, YOU_ARE_NOT_AUTHORIZED_TO_CONSULT_THE_REQUEST + requestId);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping(path = "/response-from-p2p.do")
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public String responseFromAbac(@RequestParam(required = true) Long requestId, @RequestParam(required = true) String requestType, @RequestParam(required = true) String movementFileId, Model model) throws InterruptedException {
|
||||||
|
|
||||||
|
if ((!requestType.equals("TUD") && securityChecker.canPayRemRequestAbac(requestJpaServiceProvider.getMovementFileId(requestId))) ||
|
||||||
|
(requestType.equals("TUD") && securityChecker.canPayTudRequestAbac(requestJpaServiceProvider.getMovementFileId(requestId)))) {
|
||||||
|
|
||||||
|
model.addAttribute("requestId", requestId);
|
||||||
|
model.addAttribute("isBackOffice", true);
|
||||||
|
|
||||||
|
Thread.sleep(10000);
|
||||||
|
|
||||||
|
switch (requestType) {
|
||||||
|
case "ClearingRequest":
|
||||||
|
// in common
|
||||||
|
return "e-rights-common:request/edit.clr.rem.request";
|
||||||
|
case "AdvanceRequest":
|
||||||
|
// not in common
|
||||||
|
return "request/edit.adv.rem.request";
|
||||||
|
case "TotalRemRequest":
|
||||||
|
// in common
|
||||||
|
return "e-rights-common:request/edit.total.rem.request";
|
||||||
|
case "TudRequest":
|
||||||
|
// not in common
|
||||||
|
return "request/edit.tud.request";
|
||||||
|
case "TopUpRequest":
|
||||||
|
// not in common
|
||||||
|
return "e-rights-common:request/edit.topup.request";
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new AuthorizationRuntimeException(ERightsExceptionCode.ER008, YOU_ARE_NOT_AUTHORIZED_TO_CONSULT_THE_REQUEST + requestId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/abac-info.do")
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_CONSULT_ENTITLEMENTS)
|
||||||
|
public String abacInfo(@RequestParam(required = true) String requestId, @RequestParam(required = true) String requestType, @RequestParam(required = true) String movementFileId, Model model) {
|
||||||
|
model.addAttribute("requestId", requestId);
|
||||||
|
model.addAttribute("requestType", requestType);
|
||||||
|
model.addAttribute("movementFileId", movementFileId);
|
||||||
|
|
||||||
|
return "abac-payments/abac.info";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping(path = "/refresh-all-bank-accounts.do")
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_CONSULT_ENTITLEMENTS)
|
||||||
|
public String refreshAllBankAccountsNup(){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return WELCOME;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/refresh-all-bank-accounts-per-id.do")
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_CONSULT_ENTITLEMENTS)
|
||||||
|
public String refreshAllBankAccountsPerId(){
|
||||||
|
|
||||||
|
return WELCOME;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/refresh-bank.do")
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_CONSULT_ENTITLEMENTS)
|
||||||
|
public String refreshPerIdBankAccountsNup(@RequestParam(required = true) Long perId){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return WELCOME;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/refresh-bank-per-id.do")
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_CONSULT_ENTITLEMENTS)
|
||||||
|
public String refreshPerIdBankAccountsPerId(@RequestParam(required = true) Long perId){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return WELCOME;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping(path = "/continueWithAbacProcess.do")
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_CONSULT_ENTITLEMENTS)
|
||||||
|
public String refreshAbacStatus(@RequestParam(required = true) Long requestId){
|
||||||
|
|
||||||
|
return WELCOME;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/continueWithAbacProcessUUID.do")
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_CONSULT_ENTITLEMENTS)
|
||||||
|
public String refreshAbacStatus(@RequestParam(required = true) String uuid){
|
||||||
|
// Thread thread = new Thread(() -> this.abacItemServiceProvider.restartAbacProcessUuid(uuid));
|
||||||
|
// thread.start();
|
||||||
|
return WELCOME;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,156 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.controller.internal;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.rest.AbstractRestController;
|
||||||
|
import eu.europa.eeas.ananke.core.base.user.AbstractUserHandler;
|
||||||
|
import eu.europa.eeas.ananke.core.service.provider.data.DataServiceProviderRegistry;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.api.internal.AbacInfoRestApi;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.transferobject.internal.*;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.data.provider.*;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.model.*;
|
||||||
|
import eu.europa.eeas.erights.common.security.MovementFileSecurityChecker;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static java.util.Objects.nonNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rest controller to retrieve Abac info about Budget Lines, Budgdel delegations, etc.
|
||||||
|
*
|
||||||
|
* @author idominju
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
public class AbacInfoRestController extends AbstractRestController implements AbacInfoRestApi {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DataServiceProviderRegistry dataServiceProviderRegistry;
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AbstractUserHandler<?> userHandler;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public ResponseEntity<List<BudgetLineInfoTransferObject>> findBudgetLineInfos(@NotNull @Valid String budgetPosition,
|
||||||
|
@Valid String delegation, @Valid Integer exerciseId) {
|
||||||
|
|
||||||
|
BudgetLineInfoJpaServiceProvider budgetInfoProvider = (BudgetLineInfoJpaServiceProvider) this.dataServiceProviderRegistry.getDataServiceProviderFor(BudgetLineInfoModel.class);
|
||||||
|
|
||||||
|
List<BudgetLineInfoModel> modelList = budgetInfoProvider.findByBudgetPositionAndDelegationAndExerciseId(
|
||||||
|
budgetPosition, delegation, exerciseId);
|
||||||
|
|
||||||
|
return ResponseEntity.ok(getBeanMapper().mapAsList(modelList, BudgetLineInfoTransferObject.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public ResponseEntity<List<DelegationCodesTransferObject>> findDelegationCodes(@NotNull @Valid Integer exerciseId) {
|
||||||
|
|
||||||
|
DelegationCodesJpaServiceProvider provider = (DelegationCodesJpaServiceProvider) this.dataServiceProviderRegistry.getDataServiceProviderFor(DelegationCodesModel.class);
|
||||||
|
|
||||||
|
List<DelegationCodesModel> modelList = provider.findByOrgExerciseId(exerciseId);
|
||||||
|
|
||||||
|
return ResponseEntity.ok(getBeanMapper().mapAsList(modelList, DelegationCodesTransferObject.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public ResponseEntity<PersonAbacInfoTransferObject> findAbacInfoPersonById(Long personId) {
|
||||||
|
|
||||||
|
PersonAbacCriteriaInfoJpaServiceProvider provider = (PersonAbacCriteriaInfoJpaServiceProvider) this.dataServiceProviderRegistry.getDataServiceProviderFor(
|
||||||
|
PersonAbacInfoModel.class);
|
||||||
|
|
||||||
|
List<PersonAbacInfoModel> personAbacInfoModels = provider.findPersonAbacInfoByPersonId(
|
||||||
|
personId);
|
||||||
|
if (CollectionUtils.isEmpty(personAbacInfoModels)) {
|
||||||
|
return ResponseEntity.noContent().build();
|
||||||
|
} else if (personAbacInfoModels.size() > 1) {
|
||||||
|
return ResponseEntity.status(HttpStatus.CONFLICT).build();
|
||||||
|
}
|
||||||
|
PersonAbacInfoModel personAbacInfoModel = personAbacInfoModels.get(0);
|
||||||
|
return nonNull(personAbacInfoModel.getCriteriaCode()) ?
|
||||||
|
ResponseEntity.ok(
|
||||||
|
getBeanMapper().map(personAbacInfoModel, PersonAbacInfoTransferObject.class))
|
||||||
|
: ResponseEntity.noContent().build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public ResponseEntity<List<String>> findBudgetLineForErights(String movementContext) {
|
||||||
|
BudgetLineSubpostJpaServiceProvider provider = (BudgetLineSubpostJpaServiceProvider) this.dataServiceProviderRegistry.getDataServiceProviderFor(BudgetLineSubpostModel.class);
|
||||||
|
|
||||||
|
List<String> listOfBudgetLines = provider.findBudgetLineForErights(movementContext);
|
||||||
|
return ResponseEntity.ok(listOfBudgetLines);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public ResponseEntity<List<BudgetLineSubpostTransferObject>> findBudgetLineSubposts(
|
||||||
|
@Valid String budgetPositionBudgdel,
|
||||||
|
@Valid String budgetPositionErights,
|
||||||
|
@Valid String requestType,
|
||||||
|
@Valid String lstCd,
|
||||||
|
@Valid String subpostType,
|
||||||
|
@Valid Integer personnelTypeId) {
|
||||||
|
|
||||||
|
BudgetLineSubpostJpaServiceProvider provider = (BudgetLineSubpostJpaServiceProvider) this.dataServiceProviderRegistry.getDataServiceProviderFor(BudgetLineSubpostModel.class);
|
||||||
|
|
||||||
|
List<BudgetLineSubpostModel> modelList = provider.findBudgetLineSubpostsUsingOptionalFilters(budgetPositionBudgdel,
|
||||||
|
budgetPositionErights, requestType, lstCd, subpostType, personnelTypeId);
|
||||||
|
|
||||||
|
return ResponseEntity.ok(getBeanMapper().mapAsList(modelList, BudgetLineSubpostTransferObject.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public ResponseEntity<List<RequestSubpostTransferObject>> findRequestSubposts(@Valid Long requestId, @Valid Long requestPaymentAbacInfoId) {
|
||||||
|
|
||||||
|
RequestSubpostJpaServiceProvider provider = (RequestSubpostJpaServiceProvider) this.dataServiceProviderRegistry.getDataServiceProviderFor(RequestSubpostModel.class);
|
||||||
|
List<RequestSubpostModel> modelList = null;
|
||||||
|
if (requestPaymentAbacInfoId == null) {
|
||||||
|
modelList = provider.findRequestSubpostByRequestPaymentAbacInfoId(requestPaymentAbacInfoId);
|
||||||
|
} else {
|
||||||
|
modelList = provider.findRequestSubpostByRequestId(requestId);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ResponseEntity.ok(getBeanMapper().mapAsList(modelList, RequestSubpostTransferObject.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public ResponseEntity<RequestPaymentAbacInfoTransferObject> findRequestPersonAbacInfoByRequestId(Long requestId) {
|
||||||
|
|
||||||
|
RequestPaymentAbacInfoJpaServiceProvider provider = (RequestPaymentAbacInfoJpaServiceProvider) this.dataServiceProviderRegistry.getDataServiceProviderFor(RequestPaymentAbacInfoModel.class);
|
||||||
|
|
||||||
|
RequestPaymentAbacInfoModel modelList = provider.findRequestPaymentAbacInfoByRequestId(requestId);
|
||||||
|
|
||||||
|
return ResponseEntity.ok(getBeanMapper().map(modelList, RequestPaymentAbacInfoTransferObject.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public ResponseEntity<Long> createAbacEntitiesForRequest(@Valid RequestPaymentAbacInfoTransferObject data) {
|
||||||
|
Long result;
|
||||||
|
|
||||||
|
//Create
|
||||||
|
data.setAgentName(userHandler.getUser().getUid().toUpperCase());
|
||||||
|
RequestPaymentAbacInfoJpaServiceProvider service = (RequestPaymentAbacInfoJpaServiceProvider) this.dataServiceProviderRegistry.getDataServiceProviderFor(RequestPaymentAbacInfoModel.class);
|
||||||
|
RequestPaymentAbacInfoModel requestPaymentAbacInfoModel = service.create(getBeanMapper().map(data, RequestPaymentAbacInfoModel.class));
|
||||||
|
result = requestPaymentAbacInfoModel.getId();
|
||||||
|
|
||||||
|
//Send to ABAC
|
||||||
|
// Thread thread = new Thread(() -> abacInvoiceServiceProvider.create(requestPaymentAbacInfoModel));
|
||||||
|
// thread.start();
|
||||||
|
|
||||||
|
return ResponseEntity.ok(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,85 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.controller.internal;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.rest.AbstractRestController;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.api.internal.AbacRestApi;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.transferobject.internal.AbacCommunicationTransferObject;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.transferobject.internal.AbacItemTransferObject;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.transferobject.internal.RequestAbacPaymentReferenceTransferObject;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.provider.abac.AbacItemServiceProvider;
|
||||||
|
import eu.europa.eeas.erights.common.data.jpa.dto.AbacCommunicationDTO;
|
||||||
|
import eu.europa.eeas.erights.common.security.MovementFileSecurityChecker;
|
||||||
|
import eu.europa.eeas.erights.common.service.data.provider.entitlement.request.RequestJpaServiceProvider;
|
||||||
|
import eu.europa.eeas.erights.common.service.model.AbacItemModel;
|
||||||
|
import eu.europa.eeas.erights.common.service.model.entitlement.request.RequestModel;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
public class AbacRestController extends AbstractRestController implements AbacRestApi {
|
||||||
|
|
||||||
|
public static final Logger logger = LoggerFactory.getLogger(AbacRestController.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RequestJpaServiceProvider requestJpaServiceProvider;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AbacItemServiceProvider abacItemServiceProvider;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public ResponseEntity<List<AbacCommunicationTransferObject>> getAbacCommunicationItems(Long requestId) {
|
||||||
|
List<AbacCommunicationDTO> modelList = abacItemServiceProvider.getAbacCommunicationItemsByRequestId(requestId);
|
||||||
|
return ResponseEntity.ok(getBeanMapper().mapAsList(modelList, AbacCommunicationTransferObject.class));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public ResponseEntity<List<AbacItemTransferObject>> getAbacItems(Long requestId) {
|
||||||
|
List<AbacItemModel> modelList = abacItemServiceProvider.getItemsByRequestId(requestId);
|
||||||
|
return ResponseEntity.ok(getBeanMapper().mapAsList(modelList, AbacItemTransferObject.class));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public ResponseEntity<String> updatePaymentReference(Long requestId, RequestAbacPaymentReferenceTransferObject requestAbacPaymentReference) {
|
||||||
|
//
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public ResponseEntity<String> updateWorkFlow(Long requestId) {
|
||||||
|
|
||||||
|
logger.info("Updating workflow for request ID: {} ...", requestId);
|
||||||
|
|
||||||
|
RequestModel requestModel = requestJpaServiceProvider.read(requestId);
|
||||||
|
String abacPaymentOrderId = requestModel.getPaymentOrder();
|
||||||
|
|
||||||
|
logger.info("Updating workflow: abacPaymentOrder = {}", abacPaymentOrderId);
|
||||||
|
|
||||||
|
|
||||||
|
logger.info("Updating workflow: abacPaymentOrder is NULL. Returning OK with empty body.");
|
||||||
|
|
||||||
|
return ResponseEntity.ok("");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseEntity<Boolean> validatePaymentOrder(String abacId) {
|
||||||
|
// return ResponseEntity.ok(abacPaymentOrderServiceProvider.isPaymentOrderValid(abacId));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseEntity<String> updateAccommodationPaymentWorkFlow(Long postingAllowanceId) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,112 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.controller.internal;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.rest.AbstractRestController;
|
||||||
|
import eu.europa.eeas.ananke.core.service.provider.data.DataServiceProviderRegistry;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.api.internal.AllowancesFilterRestApi;
|
||||||
|
import eu.europa.eeas.erights.common.tools.allowances.AllowancePage;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.transferobject.internal.InlineResponse200TransferObject;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.provider.SessionDataCollectorServiceProvider;
|
||||||
|
import eu.europa.eeas.erights.common.api.http.rest.transferobject.internal.VAllowancesTransferObject;
|
||||||
|
import eu.europa.eeas.erights.common.service.data.provider.VAllowanceJpaServiceProvider;
|
||||||
|
import eu.europa.eeas.erights.common.service.model.VAllowanceModel;
|
||||||
|
import eu.europa.eeas.erights.common.tools.utils.KendoParamConverter;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import org.springframework.web.context.request.RequestContextHolder;
|
||||||
|
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
public class AllowancesFilterRestController extends AbstractRestController implements AllowancesFilterRestApi {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public SessionDataCollectorServiceProvider sessionCollectorService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DataServiceProviderRegistry dataServiceProviderRegistry;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseEntity<InlineResponse200TransferObject> getAllowancesBackOfficeFiltered(
|
||||||
|
String additionalQueryParams) {
|
||||||
|
|
||||||
|
// 1️⃣ Get all real query parameters sent by Kendo
|
||||||
|
Map<String, String> params = extractAllQueryParams();
|
||||||
|
|
||||||
|
// 2️⃣ Extract pagination
|
||||||
|
int page = params.containsKey("page") ? Integer.parseInt(params.get("page")) : 1;
|
||||||
|
int pageSize = params.containsKey("pageSize") ? Integer.parseInt(params.get("pageSize")) : 25;
|
||||||
|
|
||||||
|
// 3️⃣ Convert Kendo nested params → JSON
|
||||||
|
String sortJson = KendoParamConverter.extractSortJson(params);
|
||||||
|
String filterJson = KendoParamConverter.extractFilterJson(params);
|
||||||
|
|
||||||
|
VAllowanceJpaServiceProvider service =
|
||||||
|
(VAllowanceJpaServiceProvider) this.dataServiceProviderRegistry
|
||||||
|
.getDataServiceProviderFor(VAllowanceModel.class);
|
||||||
|
|
||||||
|
// 4️⃣ Query backend
|
||||||
|
AllowancePage pageResult =
|
||||||
|
service.getAllowancesBackOfficeFiltered(page, pageSize, sortJson, filterJson);
|
||||||
|
|
||||||
|
// 5️⃣ Convert entity results to DTOs
|
||||||
|
List<VAllowancesTransferObject> dtoList =
|
||||||
|
getBeanMapper().mapAsList(pageResult.getData(), VAllowancesTransferObject.class);
|
||||||
|
|
||||||
|
// 6️⃣ Build the Kendo response object
|
||||||
|
InlineResponse200TransferObject response =
|
||||||
|
new InlineResponse200TransferObject()
|
||||||
|
.data(dtoList)
|
||||||
|
.total((int) pageResult.getTotal());
|
||||||
|
|
||||||
|
return ResponseEntity.ok(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map<String, String> extractAllQueryParams() {
|
||||||
|
HttpServletRequest request =
|
||||||
|
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
||||||
|
.getRequest();
|
||||||
|
|
||||||
|
Map<String, String> map = new HashMap<>();
|
||||||
|
|
||||||
|
request.getParameterMap().forEach((key, values) -> {
|
||||||
|
if (values != null && values.length > 0) {
|
||||||
|
map.put(key, values[0]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map<String, String> parseQueryParams(String query) throws UnsupportedEncodingException {
|
||||||
|
Map<String, String> map = new HashMap<>();
|
||||||
|
|
||||||
|
if (query == null || query.isEmpty()) {
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
String[] pairs = query.split("&");
|
||||||
|
for (String pair : pairs) {
|
||||||
|
int idx = pair.indexOf('=');
|
||||||
|
if (idx > -1) {
|
||||||
|
String key = URLDecoder.decode(pair.substring(0, idx), "UTF-8");
|
||||||
|
String value = URLDecoder.decode(pair.substring(idx + 1), "UTF-8");
|
||||||
|
map.put(key, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,60 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.controller.internal;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.rest.AbstractRestController;
|
||||||
|
import eu.europa.eeas.ananke.core.service.provider.data.DataServiceProviderRegistry;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.api.internal.AllowancesRestApi;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.provider.SessionDataCollectorServiceProvider;
|
||||||
|
import eu.europa.eeas.erights.common.api.http.rest.transferobject.internal.VAllowancesTransferObject;
|
||||||
|
import eu.europa.eeas.erights.common.security.MovementFileSecurityChecker;
|
||||||
|
import eu.europa.eeas.erights.common.service.data.provider.VAllowanceJpaServiceProvider;
|
||||||
|
import eu.europa.eeas.erights.common.service.model.VAllowanceModel;
|
||||||
|
import eu.europa.eeas.erights.common.service.model.allowances.TravelAllowanceModel;
|
||||||
|
import eu.europa.eeas.erights.common.service.provider.allowances.TravelAllowanceServiceProvider;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
public class AllowancesRestController extends AbstractRestController implements AllowancesRestApi {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public SessionDataCollectorServiceProvider sessionCollectorService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DataServiceProviderRegistry dataServiceProviderRegistry;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseEntity<Long> createAllAsDraftNumberRequest(Integer numberRequests) {
|
||||||
|
|
||||||
|
|
||||||
|
TravelAllowanceServiceProvider service = (TravelAllowanceServiceProvider) this.dataServiceProviderRegistry.getDataServiceProviderFor(
|
||||||
|
TravelAllowanceModel.class);
|
||||||
|
Long allTravelAllowances = service.createAllTravelAllowances(numberRequests);
|
||||||
|
return ResponseEntity.ok(allTravelAllowances);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseEntity<List<Long>> createTravelAllowanceAsDraft(Long personId) {
|
||||||
|
|
||||||
|
TravelAllowanceServiceProvider service = (TravelAllowanceServiceProvider) this.dataServiceProviderRegistry.getDataServiceProviderFor(
|
||||||
|
TravelAllowanceModel.class);
|
||||||
|
List<Long> createdResourceIds = service.createTravelAllowanceFromVNewTravelPostingAllowance(personId);
|
||||||
|
return ResponseEntity.ok(createdResourceIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_CONSULT_ENTITLEMENTS)
|
||||||
|
public ResponseEntity<List<VAllowancesTransferObject>> getAllowancesBackOffice() {
|
||||||
|
VAllowanceJpaServiceProvider service = (VAllowanceJpaServiceProvider) this.dataServiceProviderRegistry.getDataServiceProviderFor(
|
||||||
|
VAllowanceModel.class);
|
||||||
|
List<VAllowancesTransferObject> transferObject = getBeanMapper().mapAsList(service.getAllowancesBackOffice(), VAllowancesTransferObject.class);
|
||||||
|
return ResponseEntity.ok(transferObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,54 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.controller.internal;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.rest.AbstractRestController;
|
||||||
|
import eu.europa.eeas.ananke.core.service.provider.data.DataServiceProviderRegistry;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.api.internal.AuditMovementFilesRestApi;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.transferobject.internal.AuditMovementFileTransferObject;
|
||||||
|
import eu.europa.eeas.erights.common.security.MovementFileSecurityChecker;
|
||||||
|
import eu.europa.eeas.erights.common.service.data.provider.AuditMovementFileJpaServiceProvider;
|
||||||
|
import eu.europa.eeas.erights.common.service.model.AuditMovementFileModel;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
public class AuditMovementFilesRestController extends AbstractRestController implements AuditMovementFilesRestApi {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DataServiceProviderRegistry dataServiceProviderRegistry;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public ResponseEntity<List<AuditMovementFileTransferObject>> getAuditMovementFiles() {
|
||||||
|
ResponseEntity<List<AuditMovementFileTransferObject>> result;
|
||||||
|
|
||||||
|
AuditMovementFileJpaServiceProvider reportMovementFileProvider = (AuditMovementFileJpaServiceProvider) this.dataServiceProviderRegistry
|
||||||
|
.getDataServiceProviderFor(AuditMovementFileModel.class);
|
||||||
|
List<AuditMovementFileModel> models = reportMovementFileProvider.getActiveMovementFiles();
|
||||||
|
List<AuditMovementFileTransferObject> transferObjects = getBeanMapper().mapAsList(models, AuditMovementFileTransferObject.class);
|
||||||
|
result = ResponseEntity.ok(transferObjects);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public ResponseEntity<List<AuditMovementFileTransferObject>> getAuditMovementFilesByFileId(Long id) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResponseEntity<List<AuditMovementFileTransferObject>> getAuditMovementFilesByFileId(String fileId) {
|
||||||
|
ResponseEntity<List<AuditMovementFileTransferObject>> result;
|
||||||
|
|
||||||
|
AuditMovementFileJpaServiceProvider auditMovementFileProvider = (AuditMovementFileJpaServiceProvider) this.dataServiceProviderRegistry
|
||||||
|
.getDataServiceProviderFor(AuditMovementFileModel.class);
|
||||||
|
List<AuditMovementFileModel> auditMovementFileModel = auditMovementFileProvider.getAuditMovementFilesByFileID(fileId);
|
||||||
|
List<AuditMovementFileTransferObject> transferObjects = getBeanMapper().mapAsList(auditMovementFileModel, AuditMovementFileTransferObject.class);
|
||||||
|
result = ResponseEntity.ok(transferObjects);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.controller.internal;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.rest.AbstractRestController;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.api.internal.EntitlementsMaxDefaultRestApi;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.transferobject.internal.EntitlementMaxDefaultTransferObject;
|
||||||
|
import eu.europa.eeas.erights.common.security.MovementFileSecurityChecker;
|
||||||
|
import eu.europa.eeas.erights.common.service.data.provider.entitlement.EntitlementMaxDefaultJpaServiceProvider;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
public class EntitlementMaxDefaultController extends AbstractRestController implements EntitlementsMaxDefaultRestApi {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private final EntitlementMaxDefaultJpaServiceProvider entitlementMaxDefaultJpaServiceProvider;
|
||||||
|
|
||||||
|
public EntitlementMaxDefaultController(EntitlementMaxDefaultJpaServiceProvider entitlementMaxDefaultJpaServiceProvider) {
|
||||||
|
this.entitlementMaxDefaultJpaServiceProvider = entitlementMaxDefaultJpaServiceProvider;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public ResponseEntity<String> newEntitlementMaxDefault(EntitlementMaxDefaultTransferObject entitlementMaxDefault) {
|
||||||
|
entitlementMaxDefaultJpaServiceProvider.newEntitlementMaxDefault(entitlementMaxDefault.getYear(),
|
||||||
|
entitlementMaxDefault.getAmount(),
|
||||||
|
entitlementMaxDefault.getCountryFrom(),
|
||||||
|
entitlementMaxDefault.getCountryTo(),
|
||||||
|
entitlementMaxDefault.getRateType());
|
||||||
|
return ResponseEntity.status(HttpStatus.OK).build();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.controller.internal;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.rest.AbstractRestController;
|
||||||
|
import eu.europa.eeas.ananke.core.base.exception.ResourceNotFoundRuntimeException;
|
||||||
|
import eu.europa.eeas.ananke.core.service.provider.data.DataServiceProviderRegistry;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.api.internal.JobsRestApi;
|
||||||
|
import eu.europa.eeas.erights.backoffice.exceptionhandling.ERightsBackOfficeExceptionCode;
|
||||||
|
import eu.europa.eeas.erights.common.api.http.rest.transferobject.internal.VJobTransferObject;
|
||||||
|
import eu.europa.eeas.erights.common.security.MovementFileSecurityChecker;
|
||||||
|
import eu.europa.eeas.erights.common.service.data.provider.PostingTravelAllowanceTransitionService;
|
||||||
|
import eu.europa.eeas.erights.common.service.data.provider.VJobJpaServiceProvider;
|
||||||
|
import eu.europa.eeas.erights.common.service.model.VJobModel;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
public class JobsRestController extends AbstractRestController implements JobsRestApi {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DataServiceProviderRegistry dataServiceProviderRegistry;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PostingTravelAllowanceTransitionService postingTravelAllowanceTransitionService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public ResponseEntity<VJobTransferObject> getJob(Long jobId) {
|
||||||
|
VJobJpaServiceProvider jobJpaServiceProvider = (VJobJpaServiceProvider) this.dataServiceProviderRegistry
|
||||||
|
.getDataServiceProviderFor(VJobModel.class);
|
||||||
|
VJobModel jobModel = jobJpaServiceProvider.get(jobId);
|
||||||
|
if (jobModel == null) {
|
||||||
|
throw new ResourceNotFoundRuntimeException(ERightsBackOfficeExceptionCode.ERBO001, jobId.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
return ResponseEntity.ok(getBeanMapper().map(jobModel, VJobTransferObject.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public ResponseEntity<Void> postingTravelAllowanceTransitionJob() {
|
||||||
|
//postingTravelAllowanceTransitionService.execute();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,103 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.controller.internal;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.rest.AbstractRestController;
|
||||||
|
import eu.europa.eeas.ananke.core.service.provider.data.DataServiceProviderRegistry;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.api.internal.MovementFilesRestApi;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.provider.SessionDataCollectorServiceProvider;
|
||||||
|
import eu.europa.eeas.erights.common.api.http.rest.transferobject.internal.MovementFileTransferObject;
|
||||||
|
import eu.europa.eeas.erights.common.security.MovementFileSecurityChecker;
|
||||||
|
import eu.europa.eeas.erights.common.service.data.provider.MovementFileJpaServiceProvider;
|
||||||
|
import eu.europa.eeas.erights.common.service.model.MovementFileModel;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
|
||||||
|
@RestController("BackOfficeMovementFilesRestController")
|
||||||
|
public class MovementFilesRestController extends AbstractRestController implements MovementFilesRestApi {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public SessionDataCollectorServiceProvider sessionCollectorService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DataServiceProviderRegistry dataServiceProviderRegistry;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public ResponseEntity<Long> createMovementFile(@Valid MovementFileTransferObject data) {
|
||||||
|
Long result;
|
||||||
|
|
||||||
|
MovementFileJpaServiceProvider service = (MovementFileJpaServiceProvider) this.dataServiceProviderRegistry.getDataServiceProviderFor(MovementFileModel.class);
|
||||||
|
MovementFileModel movementFile = service.create(getBeanMapper().map(data, MovementFileModel.class));
|
||||||
|
result = movementFile.getId();
|
||||||
|
|
||||||
|
return ResponseEntity.ok(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public ResponseEntity<Void> delete(Long id) {
|
||||||
|
MovementFileJpaServiceProvider movementFileProvider = (MovementFileJpaServiceProvider) this.dataServiceProviderRegistry
|
||||||
|
.getDataServiceProviderFor(MovementFileModel.class);
|
||||||
|
movementFileProvider.deleteMovementFile(id);
|
||||||
|
return ResponseEntity.ok().build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public ResponseEntity<Long> createAsDraft(@Valid MovementFileTransferObject data) {
|
||||||
|
MovementFileJpaServiceProvider service = (MovementFileJpaServiceProvider) this.dataServiceProviderRegistry.getDataServiceProviderFor(MovementFileModel.class);
|
||||||
|
Long id = service.createDraft(getBeanMapper().map(data, MovementFileModel.class));
|
||||||
|
sessionCollectorService.clearDataFromSession();
|
||||||
|
return ResponseEntity.ok(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public ResponseEntity<Long> updateDraft(@Valid MovementFileTransferObject data) {
|
||||||
|
MovementFileJpaServiceProvider service = (MovementFileJpaServiceProvider) this.dataServiceProviderRegistry.getDataServiceProviderFor(MovementFileModel.class);
|
||||||
|
Long id = service.updateDraft(getBeanMapper().map(data, MovementFileModel.class));
|
||||||
|
sessionCollectorService.clearDataFromSession();
|
||||||
|
return ResponseEntity.ok(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public ResponseEntity<Long> createAsPending(@Valid MovementFileTransferObject data) {
|
||||||
|
MovementFileJpaServiceProvider service = (MovementFileJpaServiceProvider) this.dataServiceProviderRegistry.getDataServiceProviderFor(MovementFileModel.class);
|
||||||
|
Long id = service.createPending(getBeanMapper().map(data, MovementFileModel.class));
|
||||||
|
sessionCollectorService.clearDataFromSession();
|
||||||
|
return ResponseEntity.ok(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public ResponseEntity<Long> draftToPending(@Valid MovementFileTransferObject data) {
|
||||||
|
MovementFileJpaServiceProvider service = (MovementFileJpaServiceProvider) this.dataServiceProviderRegistry.getDataServiceProviderFor(MovementFileModel.class);
|
||||||
|
Long id = service.draftToPending((getBeanMapper().map(data, MovementFileModel.class)));
|
||||||
|
sessionCollectorService.clearDataFromSession();
|
||||||
|
return ResponseEntity.ok(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public ResponseEntity<MovementFileTransferObject> getMovementFile(Long id) {
|
||||||
|
ResponseEntity<MovementFileTransferObject> result;
|
||||||
|
|
||||||
|
MovementFileJpaServiceProvider movementFileProvider = (MovementFileJpaServiceProvider) this.dataServiceProviderRegistry
|
||||||
|
.getDataServiceProviderFor(MovementFileModel.class);
|
||||||
|
MovementFileModel movementFileModel = movementFileProvider.get(id);
|
||||||
|
result = ResponseEntity.ok(getBeanMapper().map(movementFileModel, MovementFileTransferObject.class));
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,211 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.controller.internal;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.rest.AbstractRestController;
|
||||||
|
import eu.europa.eeas.ananke.core.service.provider.data.DataServiceProviderRegistry;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.api.internal.SummaRestApi;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.transferobject.AllowanceRequestInternalTransferObject;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.transferobject.OrderResponseInternalTransferObject;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.transferobject.internal.SummaFundSourceTransferObject;
|
||||||
|
import eu.europa.eeas.erights.backoffice.boot.configuration.p2phub.P2pHubRestClientConfiguration;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.data.provider.AllowancePaymentJpaServiceProvider;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.data.provider.SummaFundSourceJpaServiceProvider;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.data.provider.p2phub.OrderResponseJpaServiceProvider;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.model.SummaFundSourceModel;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.model.p2phub.AllowancePaymentModel;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.model.p2phub.OrderResponseModel;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.provider.p2p.AllowanceOrderConsumerServiceProvider;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.provider.p2p.AuthTokenProviderServiceProvider;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.provider.p2p.BusinessPartnerConsumerServiceProvider;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.provider.p2p.P2pOrderUpdaterServiceProvider;
|
||||||
|
import eu.europa.eeas.erights.common.api.http.rest.transferobject.internal.RequestTransferObject;
|
||||||
|
import eu.europa.eeas.erights.common.security.MovementFileSecurityChecker;
|
||||||
|
import eu.europa.eeas.erights.common.service.data.provider.AppParameterJpaServiceProvider;
|
||||||
|
import eu.europa.eeas.erights.common.service.model.entitlement.request.RequestModel;
|
||||||
|
import eu.europa.eeas.erights.common.tools.app.AppParamType;
|
||||||
|
import eu.europa.eeas.erights.web.p2phub.client.transferobject.BusinessPartnerResponseTransferObject;
|
||||||
|
import eu.europa.eeas.erights.web.p2phub.client.transferobject.OrderStatusResponseTransferObject;
|
||||||
|
import org.apache.coyote.Request;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
public class P2pHubRestController extends AbstractRestController implements SummaRestApi {
|
||||||
|
|
||||||
|
|
||||||
|
public static final Logger logger = LoggerFactory.getLogger(P2pHubRestController.class);
|
||||||
|
|
||||||
|
private final DataServiceProviderRegistry dataServiceProviderRegistry;
|
||||||
|
|
||||||
|
private final BusinessPartnerConsumerServiceProvider businessPartnerConsumerServiceProvider;
|
||||||
|
private final AllowanceOrderConsumerServiceProvider allowanceOrderConsumerServiceProvider;
|
||||||
|
private final AllowancePaymentJpaServiceProvider allowancePaymentJpaServiceProvider;
|
||||||
|
private final OrderResponseJpaServiceProvider orderResponseJpaServiceProvider ;
|
||||||
|
private final AppParameterJpaServiceProvider appParameterService;
|
||||||
|
private final AuthTokenProviderServiceProvider authTokenProviderServiceProvider;
|
||||||
|
private final P2pOrderUpdaterServiceProvider p2pOrderUpdaterServiceProvider;
|
||||||
|
|
||||||
|
|
||||||
|
public P2pHubRestController(DataServiceProviderRegistry dataServiceProviderRegistry, BusinessPartnerConsumerServiceProvider businessPartnerConsumerServiceProvider, AllowancePaymentJpaServiceProvider allowancePaymentJpaServiceProvider, AppParameterJpaServiceProvider appParameterService, AuthTokenProviderServiceProvider authTokenProviderServiceProvider, AllowanceOrderConsumerServiceProvider allowanceOrderConsumerServiceProvider, OrderResponseJpaServiceProvider orderResponseJpaServiceProvider, P2pOrderUpdaterServiceProvider p2pOrderUpdaterServiceProvider) {
|
||||||
|
this.dataServiceProviderRegistry = dataServiceProviderRegistry;
|
||||||
|
|
||||||
|
this.businessPartnerConsumerServiceProvider = businessPartnerConsumerServiceProvider;
|
||||||
|
this.allowancePaymentJpaServiceProvider = allowancePaymentJpaServiceProvider;
|
||||||
|
this.appParameterService = appParameterService;
|
||||||
|
this.authTokenProviderServiceProvider = authTokenProviderServiceProvider;
|
||||||
|
this.allowanceOrderConsumerServiceProvider = allowanceOrderConsumerServiceProvider;
|
||||||
|
this.orderResponseJpaServiceProvider = orderResponseJpaServiceProvider;
|
||||||
|
this.p2pOrderUpdaterServiceProvider = p2pOrderUpdaterServiceProvider;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public ResponseEntity<List<SummaFundSourceTransferObject>> getFundSources() {
|
||||||
|
ResponseEntity<List<SummaFundSourceTransferObject>> result = null;
|
||||||
|
|
||||||
|
SummaFundSourceJpaServiceProvider service = (SummaFundSourceJpaServiceProvider) this.dataServiceProviderRegistry.getDataServiceProviderFor(SummaFundSourceModel.class);
|
||||||
|
List<SummaFundSourceModel> summaFundSource = service.findAll();
|
||||||
|
result = ResponseEntity.ok(getBeanMapper().mapAsList(summaFundSource, SummaFundSourceTransferObject.class));
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseEntity<BusinessPartnerResponseTransferObject> getBusinessPartnerFromSumma(Long perid) {
|
||||||
|
|
||||||
|
BusinessPartnerResponseTransferObject BusinessPartnerResponseTransferObject = businessPartnerConsumerServiceProvider.getBusinessPartnerResponseTransferObjectByPerId(perid);
|
||||||
|
return ResponseEntity.ok(BusinessPartnerResponseTransferObject);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseEntity<String> refreshFromSummaPerIdBankAccountsPerId(String perId) {
|
||||||
|
|
||||||
|
if (perId == null || perId.trim().isEmpty()) {
|
||||||
|
return ResponseEntity.badRequest().body("Invalid perId");
|
||||||
|
}
|
||||||
|
|
||||||
|
String[] parts = perId.split(",");
|
||||||
|
|
||||||
|
for (String part : parts) {
|
||||||
|
String trimmed = part.trim();
|
||||||
|
if (trimmed.isEmpty()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
Long id = Long.valueOf(trimmed);
|
||||||
|
this.businessPartnerConsumerServiceProvider
|
||||||
|
.saveOrUpdateBankAccountsFromSummaByPerId(id);
|
||||||
|
} catch (NumberFormatException ex) {
|
||||||
|
return ResponseEntity.badRequest()
|
||||||
|
.body("Invalid perId value: " + trimmed);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ResponseEntity.ok("OK");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseEntity<Void> refreshAllBankAccountsFromSumma() {
|
||||||
|
this.businessPartnerConsumerServiceProvider.saveOrUpdateBankAccountsForAllMovementFilesBankAccountsFromSumma();
|
||||||
|
return ResponseEntity.ok(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseEntity<Void> refreshAllOldBankAccountsFromSumma() {
|
||||||
|
this.businessPartnerConsumerServiceProvider.saveOrUpdateOldBankAccountsForAllMovementFilesBankAccountsFromSumma();
|
||||||
|
return ResponseEntity.ok(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseEntity<String> getPopToken() {
|
||||||
|
return ResponseEntity.ok(authTokenProviderServiceProvider.getSystemPoPToken());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseEntity<OrderResponseInternalTransferObject> createSummaPayment(AllowanceRequestInternalTransferObject allowanceRequest) {
|
||||||
|
|
||||||
|
ResponseEntity<OrderResponseInternalTransferObject> responseEntity = allowanceOrderConsumerServiceProvider.submitAllowanceCreation(allowanceRequest);
|
||||||
|
return responseEntity;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseEntity<List<AllowanceRequestInternalTransferObject>> getAllowanceRequestByRequestId(Long requestId) {
|
||||||
|
List<AllowancePaymentModel> allowancePaymentModel = this.allowancePaymentJpaServiceProvider.getAllowancePaymentModelByRequestId(requestId);
|
||||||
|
|
||||||
|
return ResponseEntity.ok(getBeanMapper().mapAsList(allowancePaymentModel, AllowanceRequestInternalTransferObject.class));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseEntity<AllowanceRequestInternalTransferObject> getAllowanceRequestEmptyByRequestId(Long requestId) {
|
||||||
|
ResponseEntity<AllowanceRequestInternalTransferObject> responseEntity = null;
|
||||||
|
String clientId = this.appParameterService.getAppParametersByTypeAndKey(AppParamType.SUMMA, "CLIENT_ID").get(0).getValue();
|
||||||
|
AllowancePaymentModel allowancePaymentModel = this.allowancePaymentJpaServiceProvider.createAllowancePaymentModel(requestId);
|
||||||
|
//allowancePaymentModel.getHeader().set
|
||||||
|
responseEntity = ResponseEntity.ok(getBeanMapper().map(allowancePaymentModel, AllowanceRequestInternalTransferObject.class));
|
||||||
|
return responseEntity;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseEntity<List<OrderResponseInternalTransferObject>> getOrderResponseInternalByRequestId(Long requestId) {
|
||||||
|
List<OrderResponseModel> orderResponseModels = this.orderResponseJpaServiceProvider.findAllByRequestId(requestId);
|
||||||
|
|
||||||
|
return ResponseEntity.ok(getBeanMapper().mapAsList(orderResponseModels, OrderResponseInternalTransferObject.class));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseEntity<OrderStatusResponseTransferObject> getOrderIdStatus(Long orderId) {
|
||||||
|
OrderStatusResponseTransferObject orderStatusResponseTransferObject = this.allowanceOrderConsumerServiceProvider.getOrderStatus(orderId);
|
||||||
|
return ResponseEntity.ok(orderStatusResponseTransferObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseEntity<RequestTransferObject> refreshAllowanceP2pOrderStatus(Long requestId) {
|
||||||
|
RequestModel requestModel = p2pOrderUpdaterServiceProvider.updateRequestP2pOrderStatusById(requestId);
|
||||||
|
return ResponseEntity.ok(getBeanMapper().map(requestModel, RequestTransferObject.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseEntity<Boolean> validateOrder(Long orderId) {
|
||||||
|
try {
|
||||||
|
OrderStatusResponseTransferObject orderStatus =
|
||||||
|
allowanceOrderConsumerServiceProvider.getOrderStatus(orderId);
|
||||||
|
|
||||||
|
// If no response returned → invalid
|
||||||
|
if (orderStatus == null) {
|
||||||
|
logger.warn("No status returned for order {}", orderId);
|
||||||
|
return ResponseEntity.ok(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Compare String orderId from response with Long input
|
||||||
|
|
||||||
|
if (Objects.equals(orderId, Long.valueOf(orderStatus.getOrderId()))) {
|
||||||
|
return ResponseEntity.ok(true);
|
||||||
|
} else {
|
||||||
|
logger.warn("Order ID mismatch. Expected {}, got {}", orderId, orderStatus.getOrderId());
|
||||||
|
return ResponseEntity.ok(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception ex) {
|
||||||
|
logger.error("Error validating order {}: {}", orderId, ex.getMessage());
|
||||||
|
return ResponseEntity.ok(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.controller.internal;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.rest.AbstractRestController;
|
||||||
|
import eu.europa.eeas.ananke.core.service.provider.data.DataServiceProviderRegistry;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.api.internal.PersonsRestApi;
|
||||||
|
import eu.europa.eeas.erights.common.api.http.rest.transferobject.internal.VPersonTransferObject;
|
||||||
|
import eu.europa.eeas.erights.common.security.MovementFileSecurityChecker;
|
||||||
|
import eu.europa.eeas.erights.common.service.data.provider.VPersonJpaServiceProvider;
|
||||||
|
import eu.europa.eeas.erights.common.service.model.VPersonModel;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
public class PersonsRestController extends AbstractRestController implements PersonsRestApi {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DataServiceProviderRegistry dataServiceProviderRegistry;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public ResponseEntity<List<VPersonTransferObject>> getPersons(@Valid Long perId, @Valid String firstName, @Valid String lastName,
|
||||||
|
@Valid String orgName) {
|
||||||
|
ResponseEntity<List<VPersonTransferObject>> result = null;
|
||||||
|
|
||||||
|
VPersonJpaServiceProvider service = (VPersonJpaServiceProvider) this.dataServiceProviderRegistry
|
||||||
|
.getDataServiceProviderFor(VPersonModel.class);
|
||||||
|
List<VPersonModel> persons = service.findPersonsBy(perId, firstName, lastName, orgName);
|
||||||
|
result = ResponseEntity.ok(getBeanMapper().mapAsList(persons, VPersonTransferObject.class));
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public ResponseEntity<VPersonTransferObject> getPerson(Long perId) {
|
||||||
|
ResponseEntity<VPersonTransferObject> result = null;
|
||||||
|
|
||||||
|
VPersonJpaServiceProvider service = (VPersonJpaServiceProvider) this.dataServiceProviderRegistry
|
||||||
|
.getDataServiceProviderFor(VPersonModel.class);
|
||||||
|
VPersonModel person = service.findById(perId);
|
||||||
|
result = ResponseEntity.ok(getBeanMapper().map(person, VPersonTransferObject.class));
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,58 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.controller.internal;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.rest.AbstractRestController;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.api.internal.PlaceOriginAirportRestApi;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.transferobject.internal.PlaceOriginAirportTransferObject;
|
||||||
|
import eu.europa.eeas.erights.common.security.MovementFileSecurityChecker;
|
||||||
|
import eu.europa.eeas.erights.common.service.data.provider.PlaceOriginAirportJpaServiceProvider;
|
||||||
|
import eu.europa.eeas.erights.common.service.model.PlaceOriginAirportModel;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
public class PlaceOriginAirportRestController extends AbstractRestController implements PlaceOriginAirportRestApi {
|
||||||
|
|
||||||
|
public static final Logger logger = LoggerFactory.getLogger(PlaceOriginAirportRestController.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PlaceOriginAirportJpaServiceProvider placeOriginAirportJpaServiceProvider;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public ResponseEntity<PlaceOriginAirportTransferObject> placeOriginAirportByCityNameAndCountryCode(String cityName, String countryCode) {
|
||||||
|
PlaceOriginAirportModel placeOriginAirportModel = placeOriginAirportJpaServiceProvider.findIataCodeByCityNameAndCountryCode(cityName, countryCode);
|
||||||
|
if(countryCode == null){
|
||||||
|
return ResponseEntity.noContent().build();
|
||||||
|
}
|
||||||
|
return ResponseEntity.ok(getBeanMapper().map(placeOriginAirportModel, PlaceOriginAirportTransferObject.class));
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseEntity<PlaceOriginAirportTransferObject> savePlaceOriginAirportByCityNameAndCountryCode(PlaceOriginAirportTransferObject placeOriginAirport) {
|
||||||
|
PlaceOriginAirportModel placeOriginAirportModel = getBeanMapper().map(placeOriginAirport, PlaceOriginAirportModel.class);
|
||||||
|
if(!placeOriginAirportJpaServiceProvider.checkIfPlaceOriginExists(placeOriginAirportModel)){
|
||||||
|
placeOriginAirportModel=placeOriginAirportJpaServiceProvider.create(placeOriginAirportModel);
|
||||||
|
return ResponseEntity.ok(getBeanMapper().map(placeOriginAirportJpaServiceProvider.read(placeOriginAirportModel.getId()), PlaceOriginAirportTransferObject.class));
|
||||||
|
}else{
|
||||||
|
return ResponseEntity
|
||||||
|
.status(HttpStatus.CONFLICT)
|
||||||
|
.body(placeOriginAirport);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.controller.internal;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.rest.AbstractRestController;
|
||||||
|
import eu.europa.eeas.ananke.core.service.provider.data.DataServiceProviderRegistry;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.api.internal.ReportRestApi;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.api.internal.VReportPostingAllowancesRestApi;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.data.provider.VReportMovementFileJpaServiceProvider;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.data.provider.allowance.VReportPostingAllowanceServiceProvider;
|
||||||
|
import eu.europa.eeas.erights.common.api.http.rest.transferobject.internal.VReportMovementFileTransferObject;
|
||||||
|
import eu.europa.eeas.erights.common.api.http.rest.transferobject.internal.VReportPostingAllowanceTransferObject;
|
||||||
|
import eu.europa.eeas.erights.common.boot.configuration.ERightsBeanNames;
|
||||||
|
import eu.europa.eeas.erights.common.security.MovementFileSecurityChecker;
|
||||||
|
import eu.europa.eeas.erights.common.security.PostingAllowanceSecurityChecker;
|
||||||
|
import eu.europa.eeas.erights.common.service.model.VReportMovementFileModel;
|
||||||
|
import eu.europa.eeas.erights.common.service.model.allowances.VReportPostingAllowanceModel;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
public class ReportRestController extends AbstractRestController implements ReportRestApi, VReportPostingAllowancesRestApi {
|
||||||
|
|
||||||
|
private final DataServiceProviderRegistry dataServiceProviderRegistry;
|
||||||
|
private final VReportPostingAllowanceServiceProvider vReportPostingAllowanceServiceProvider;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
@Qualifier(ERightsBeanNames.POSTING_ALLOWANCE_SECURITY_CHECKER)
|
||||||
|
private PostingAllowanceSecurityChecker postingAllowanceSecurityChecker;
|
||||||
|
|
||||||
|
public ReportRestController(DataServiceProviderRegistry dataServiceProviderRegistry,
|
||||||
|
VReportPostingAllowanceServiceProvider vReportPostingAllowanceServiceProvider) {
|
||||||
|
this.dataServiceProviderRegistry = dataServiceProviderRegistry;
|
||||||
|
this.vReportPostingAllowanceServiceProvider = vReportPostingAllowanceServiceProvider;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public ResponseEntity<List<VReportMovementFileTransferObject>> getReportMovementFiles() {
|
||||||
|
ResponseEntity<List<VReportMovementFileTransferObject>> result;
|
||||||
|
|
||||||
|
VReportMovementFileJpaServiceProvider reportMovementFileProvider = (VReportMovementFileJpaServiceProvider) this.dataServiceProviderRegistry
|
||||||
|
.getDataServiceProviderFor(VReportMovementFileModel.class);
|
||||||
|
List<VReportMovementFileModel> models = reportMovementFileProvider.getAllMovementFiles();
|
||||||
|
List<VReportMovementFileTransferObject> transferObjects = getBeanMapper().mapAsList(models, VReportMovementFileTransferObject.class);
|
||||||
|
result = ResponseEntity.ok(transferObjects);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseEntity<List<VReportPostingAllowanceTransferObject>> getVReportPostingAllowances(Long personId, Integer year) {
|
||||||
|
|
||||||
|
if (postingAllowanceSecurityChecker.hasOrganisationIndependentListAuthority()
|
||||||
|
|| postingAllowanceSecurityChecker.hasOrganisationsWithListAuthority()) {
|
||||||
|
List<VReportPostingAllowanceModel> reportPostingAllowanceModels = vReportPostingAllowanceServiceProvider.getVReportPostingAllowances(personId, year);
|
||||||
|
return ResponseEntity.ok(getBeanMapper().mapAsList(reportPostingAllowanceModels, VReportPostingAllowanceTransferObject.class));
|
||||||
|
}
|
||||||
|
return ResponseEntity.status(HttpStatus.FORBIDDEN).build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,82 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.controller.internal;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.rest.AbstractRestController;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.api.internal.SessionRestApi;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.provider.SessionDataCollectorServiceProvider;
|
||||||
|
import eu.europa.eeas.erights.common.api.http.rest.transferobject.internal.MovementFileTransferObject;
|
||||||
|
import eu.europa.eeas.erights.common.security.MovementFileSecurityChecker;
|
||||||
|
import eu.europa.eeas.erights.common.service.data.provider.MovementFileJpaServiceProvider;
|
||||||
|
import eu.europa.eeas.erights.common.service.model.MovementFileModel;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
import static org.springframework.http.HttpStatus.OK;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/internal/api")
|
||||||
|
public class SessionRestController extends AbstractRestController implements SessionRestApi {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public SessionDataCollectorServiceProvider sessionDataCollectorServiceProvider;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public MovementFileJpaServiceProvider movementFileJpaServiceProvider;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public ResponseEntity<MovementFileTransferObject> saveMovementFileData(@Valid MovementFileTransferObject movementFileTransferObject) {
|
||||||
|
ResponseEntity<MovementFileTransferObject> result;
|
||||||
|
|
||||||
|
MovementFileModel movementFileModel = getBeanMapper().map(movementFileTransferObject, MovementFileModel.class);
|
||||||
|
MovementFileModel model = sessionDataCollectorServiceProvider.saveDataInSession(movementFileModel);
|
||||||
|
|
||||||
|
Long id = movementFileJpaServiceProvider.saveOrUpdate(model);
|
||||||
|
|
||||||
|
// Set id when creating, so the client receives it:
|
||||||
|
if (id != null && model.getId() == null) {
|
||||||
|
model.setId(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
sessionDataCollectorServiceProvider.clearDataFromSession();
|
||||||
|
result = ResponseEntity.ok(getBeanMapper().map(model, MovementFileTransferObject.class));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public ResponseEntity<MovementFileTransferObject> saveMovementFileDataInSession(@Valid MovementFileTransferObject movementFileTransferObject) {
|
||||||
|
ResponseEntity<MovementFileTransferObject> result;
|
||||||
|
|
||||||
|
MovementFileModel movementFileModel = getBeanMapper().map(movementFileTransferObject, MovementFileModel.class);
|
||||||
|
|
||||||
|
MovementFileModel model = sessionDataCollectorServiceProvider.saveDataInSession(movementFileModel);
|
||||||
|
result = ResponseEntity.ok(getBeanMapper().map(model, MovementFileTransferObject.class));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public ResponseEntity<Void> deleteMovementFileFromSession() {
|
||||||
|
sessionDataCollectorServiceProvider.clearDataFromSession();
|
||||||
|
return new ResponseEntity<>(OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@PreAuthorize(MovementFileSecurityChecker.CAN_ACCESS_BACK_OFFICE)
|
||||||
|
public ResponseEntity<MovementFileTransferObject> getMovementFileDataFromSession() {
|
||||||
|
ResponseEntity<MovementFileTransferObject> result;
|
||||||
|
MovementFileModel model = sessionDataCollectorServiceProvider.getMovementFileDataFromSession();
|
||||||
|
result = ResponseEntity.ok(getBeanMapper().map(model, MovementFileTransferObject.class));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.mapping.classmapbuilder;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.mapping.bean.AbstractTransferObjectToModelClassMapBuilder;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.transferobject.internal.AbacCommunicationTransferObject;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.model.BudgetLineInfoModel;
|
||||||
|
import eu.europa.eeas.erights.common.data.jpa.dto.AbacCommunicationDTO;
|
||||||
|
import ma.glasnost.orika.metadata.ClassMapBuilder;
|
||||||
|
import ma.glasnost.orika.metadata.Type;
|
||||||
|
import ma.glasnost.orika.metadata.TypeFactory;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple map builder for {@link BudgetLineInfoModel}
|
||||||
|
*
|
||||||
|
* @author idominju
|
||||||
|
*/
|
||||||
|
public class AbacCommunicationTransferObjectToModelClassMapBuilder extends AbstractTransferObjectToModelClassMapBuilder<AbacCommunicationTransferObject, AbacCommunicationDTO> {
|
||||||
|
|
||||||
|
private static final Type<AbacCommunicationTransferObject> A_TYPE = TypeFactory.valueOf(AbacCommunicationTransferObject.class);
|
||||||
|
|
||||||
|
private static final Type<AbacCommunicationDTO> B_TYPE = TypeFactory.valueOf(AbacCommunicationDTO.class);
|
||||||
|
|
||||||
|
public AbacCommunicationTransferObjectToModelClassMapBuilder(ApplicationContext applicationContext) {
|
||||||
|
super(applicationContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<AbacCommunicationTransferObject> getAType() {
|
||||||
|
return A_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<AbacCommunicationDTO> getBType() {
|
||||||
|
return B_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void buildMap(ClassMapBuilder<AbacCommunicationTransferObject, AbacCommunicationDTO> classMapBuilder) {
|
||||||
|
classMapBuilder.byDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.mapping.classmapbuilder;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.mapping.bean.AbstractTransferObjectToModelClassMapBuilder;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.transferobject.internal.AbacItemTransferObject;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.model.BudgetLineInfoModel;
|
||||||
|
import eu.europa.eeas.erights.common.service.model.AbacItemModel;
|
||||||
|
import ma.glasnost.orika.metadata.ClassMapBuilder;
|
||||||
|
import ma.glasnost.orika.metadata.Type;
|
||||||
|
import ma.glasnost.orika.metadata.TypeFactory;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple map builder for {@link BudgetLineInfoModel}
|
||||||
|
*
|
||||||
|
* @author idominju
|
||||||
|
*/
|
||||||
|
public class AbacItemTransferObjectToModelClassMapBuilder extends AbstractTransferObjectToModelClassMapBuilder<AbacItemTransferObject, AbacItemModel> {
|
||||||
|
|
||||||
|
private static final Type<AbacItemTransferObject> A_TYPE = TypeFactory.valueOf(AbacItemTransferObject.class);
|
||||||
|
|
||||||
|
private static final Type<AbacItemModel> B_TYPE = TypeFactory.valueOf(AbacItemModel.class);
|
||||||
|
|
||||||
|
public AbacItemTransferObjectToModelClassMapBuilder(ApplicationContext applicationContext) {
|
||||||
|
super(applicationContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<AbacItemTransferObject> getAType() {
|
||||||
|
return A_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<AbacItemModel> getBType() {
|
||||||
|
return B_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void buildMap(ClassMapBuilder<AbacItemTransferObject, AbacItemModel> classMapBuilder) {
|
||||||
|
classMapBuilder.byDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.mapping.classmapbuilder;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.mapping.bean.AbstractTransferObjectToModelClassMapBuilder;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.transferobject.internal.BudgetLineInfoTransferObject;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.model.BudgetLineInfoModel;
|
||||||
|
import ma.glasnost.orika.metadata.ClassMapBuilder;
|
||||||
|
import ma.glasnost.orika.metadata.Type;
|
||||||
|
import ma.glasnost.orika.metadata.TypeFactory;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple map builder for {@link BudgetLineInfoModel}
|
||||||
|
*
|
||||||
|
* @author idominju
|
||||||
|
*/
|
||||||
|
public class BudgetLineInfoTransferObjectToModelClassMapBuilder extends AbstractTransferObjectToModelClassMapBuilder<BudgetLineInfoTransferObject, BudgetLineInfoModel> {
|
||||||
|
|
||||||
|
private static final Type<BudgetLineInfoTransferObject> A_TYPE = TypeFactory.valueOf(BudgetLineInfoTransferObject.class);
|
||||||
|
|
||||||
|
private static final Type<BudgetLineInfoModel> B_TYPE = TypeFactory.valueOf(BudgetLineInfoModel.class);
|
||||||
|
|
||||||
|
public BudgetLineInfoTransferObjectToModelClassMapBuilder(ApplicationContext applicationContext) {
|
||||||
|
super(applicationContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<BudgetLineInfoTransferObject> getAType() {
|
||||||
|
return A_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<BudgetLineInfoModel> getBType() {
|
||||||
|
return B_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void buildMap(ClassMapBuilder<BudgetLineInfoTransferObject, BudgetLineInfoModel> classMapBuilder) {
|
||||||
|
classMapBuilder.byDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.mapping.classmapbuilder;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.mapping.bean.AbstractTransferObjectToModelClassMapBuilder;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.transferobject.internal.BudgetLineSubpostTransferObject;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.model.BudgetLineSubpostModel;
|
||||||
|
import ma.glasnost.orika.metadata.ClassMapBuilder;
|
||||||
|
import ma.glasnost.orika.metadata.Type;
|
||||||
|
import ma.glasnost.orika.metadata.TypeFactory;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple map builder for {@link BudgetLineSubpostModel}
|
||||||
|
*
|
||||||
|
* @author idominju
|
||||||
|
*/
|
||||||
|
public class BudgetLineSubpostTransferObjectToModelClassMapBuilder extends AbstractTransferObjectToModelClassMapBuilder<BudgetLineSubpostTransferObject, BudgetLineSubpostModel> {
|
||||||
|
|
||||||
|
private static final Type<BudgetLineSubpostTransferObject> A_TYPE = TypeFactory.valueOf(BudgetLineSubpostTransferObject.class);
|
||||||
|
|
||||||
|
private static final Type<BudgetLineSubpostModel> B_TYPE = TypeFactory.valueOf(BudgetLineSubpostModel.class);
|
||||||
|
|
||||||
|
public BudgetLineSubpostTransferObjectToModelClassMapBuilder(ApplicationContext applicationContext) {
|
||||||
|
super(applicationContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<BudgetLineSubpostTransferObject> getAType() {
|
||||||
|
return A_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<BudgetLineSubpostModel> getBType() {
|
||||||
|
return B_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void buildMap(ClassMapBuilder<BudgetLineSubpostTransferObject, BudgetLineSubpostModel> classMapBuilder) {
|
||||||
|
classMapBuilder.byDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,52 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.mapping.classmapbuilder;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.mapping.bean.AbstractTransferObjectToModelClassMapBuilder;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.model.p2phub.BusinessPartnerBankAccountModel;
|
||||||
|
import eu.europa.eeas.erights.web.p2phub.client.transferobject.BusinessPartnerBankAccountTransferObject;
|
||||||
|
import ma.glasnost.orika.metadata.ClassMapBuilder;
|
||||||
|
import ma.glasnost.orika.metadata.Type;
|
||||||
|
import ma.glasnost.orika.metadata.TypeFactory;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Map builder for {@link BusinessPartnerBankAccountModel}.
|
||||||
|
*/
|
||||||
|
public class BusinessPartnerBankAccountTransferObjectToModelClassMapBuilder
|
||||||
|
extends AbstractTransferObjectToModelClassMapBuilder<
|
||||||
|
BusinessPartnerBankAccountTransferObject,
|
||||||
|
BusinessPartnerBankAccountModel> {
|
||||||
|
|
||||||
|
private static final Type<BusinessPartnerBankAccountTransferObject> A_TYPE =
|
||||||
|
TypeFactory.valueOf(BusinessPartnerBankAccountTransferObject.class);
|
||||||
|
|
||||||
|
private static final Type<BusinessPartnerBankAccountModel> B_TYPE =
|
||||||
|
TypeFactory.valueOf(BusinessPartnerBankAccountModel.class);
|
||||||
|
|
||||||
|
public BusinessPartnerBankAccountTransferObjectToModelClassMapBuilder(ApplicationContext applicationContext) {
|
||||||
|
super(applicationContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<BusinessPartnerBankAccountTransferObject> getAType() {
|
||||||
|
return A_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<BusinessPartnerBankAccountModel> getBType() {
|
||||||
|
return B_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void buildMap(
|
||||||
|
ClassMapBuilder<BusinessPartnerBankAccountTransferObject, BusinessPartnerBankAccountModel> classMapBuilder) {
|
||||||
|
|
||||||
|
// If your Extended TO delegates with same accessor names, this will work.
|
||||||
|
// Otherwise, add explicit field mappings below.
|
||||||
|
classMapBuilder.byDefault();
|
||||||
|
|
||||||
|
// Examples if names differ:
|
||||||
|
// classMapBuilder.field("iban", "iban");
|
||||||
|
// classMapBuilder.field("bic", "bic");
|
||||||
|
// classMapBuilder.field("accountHolderName", "holderName");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,106 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.mapping.classmapbuilder;
|
||||||
|
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.mapping.bean.AbstractTransferObjectToModelClassMapBuilder;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.transferobject.BusinessPartnerInternalTransferObject;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.model.p2phub.BusinessPartnerBankAccountModel;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.model.p2phub.BusinessPartnerModel;
|
||||||
|
|
||||||
|
import ma.glasnost.orika.CustomMapper;
|
||||||
|
import ma.glasnost.orika.MappingContext;
|
||||||
|
import ma.glasnost.orika.metadata.ClassMapBuilder;
|
||||||
|
import ma.glasnost.orika.metadata.Type;
|
||||||
|
import ma.glasnost.orika.metadata.TypeFactory;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple map builder for {@link BusinessPartnerModel}
|
||||||
|
*
|
||||||
|
* @author tapiafo
|
||||||
|
*/
|
||||||
|
public class BusinessPartnerInternalTransferObjectToModelClassMapBuilder extends AbstractTransferObjectToModelClassMapBuilder<BusinessPartnerInternalTransferObject, BusinessPartnerModel> {
|
||||||
|
|
||||||
|
private static final Type<BusinessPartnerInternalTransferObject> A_TYPE = TypeFactory.valueOf(BusinessPartnerInternalTransferObject.class);
|
||||||
|
|
||||||
|
private static final Type<BusinessPartnerModel> B_TYPE = TypeFactory.valueOf(BusinessPartnerModel.class);
|
||||||
|
|
||||||
|
public BusinessPartnerInternalTransferObjectToModelClassMapBuilder(ApplicationContext applicationContext) {
|
||||||
|
super(applicationContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<BusinessPartnerInternalTransferObject> getAType() {
|
||||||
|
return A_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<BusinessPartnerModel> getBType() {
|
||||||
|
return B_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void buildMap(ClassMapBuilder<BusinessPartnerInternalTransferObject, BusinessPartnerModel> classMapBuilder) {
|
||||||
|
classMapBuilder
|
||||||
|
.byDefault()
|
||||||
|
.customize(new CustomMapper<BusinessPartnerInternalTransferObject, BusinessPartnerModel>() {
|
||||||
|
@Override
|
||||||
|
public void mapAtoB(BusinessPartnerInternalTransferObject src,
|
||||||
|
BusinessPartnerModel dst,
|
||||||
|
MappingContext context) {
|
||||||
|
// Default mapping first
|
||||||
|
super.mapAtoB(src, dst, context);
|
||||||
|
|
||||||
|
if (dst.getBankAccounts() == null || dst.getBankAccounts().isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// -------- perId from MappingContext (your existing logic) --------
|
||||||
|
Long perId = null;
|
||||||
|
if (context != null) {
|
||||||
|
Object perIdObj = context.getProperty("perId");
|
||||||
|
if (perIdObj instanceof Number) {
|
||||||
|
perId = ((Number) perIdObj).longValue();
|
||||||
|
} else if (perIdObj != null) {
|
||||||
|
try {
|
||||||
|
perId = Long.valueOf(perIdObj.toString());
|
||||||
|
} catch (NumberFormatException ignored) {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (perId != null) {
|
||||||
|
// optional top-level perId
|
||||||
|
try {
|
||||||
|
dst.setPerId(perId);
|
||||||
|
} catch (NoSuchMethodError | UnsupportedOperationException ignored) {
|
||||||
|
// ignore if top-level setter doesn't exist
|
||||||
|
}
|
||||||
|
// propagate to bank accounts
|
||||||
|
for (BusinessPartnerBankAccountModel m : dst.getBankAccounts()) {
|
||||||
|
if (m != null) {
|
||||||
|
m.setPerId(perId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// -------- businessPartnerIdByExtSystem → bankAccount.lef --------
|
||||||
|
// This value may be absent in the payload; handle null safely.
|
||||||
|
Object extIdObj = src.getBusinessPartnerIdByExtSystem(); // may be null
|
||||||
|
if (extIdObj != null) {
|
||||||
|
// Assuming bankAccount.lef is a String; if it's numeric, parse accordingly.
|
||||||
|
String extId = extIdObj.toString().trim();
|
||||||
|
if (!extId.isEmpty()) {
|
||||||
|
for (BusinessPartnerBankAccountModel m : dst.getBankAccounts()) {
|
||||||
|
if (m != null) {
|
||||||
|
m.setLef(extId);
|
||||||
|
// If lef is Long, use:
|
||||||
|
// try { m.setLef(Long.valueOf(extId)); } catch (NumberFormatException ignored) {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.mapping.classmapbuilder;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.mapping.bean.AbstractTransferObjectToModelClassMapBuilder;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.transferobject.internal.DelegationCodesTransferObject;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.model.DelegationCodesModel;
|
||||||
|
import ma.glasnost.orika.metadata.ClassMapBuilder;
|
||||||
|
import ma.glasnost.orika.metadata.Type;
|
||||||
|
import ma.glasnost.orika.metadata.TypeFactory;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple map builder for {@link DelegationCodesModel}
|
||||||
|
*
|
||||||
|
* @author idominju
|
||||||
|
*/
|
||||||
|
public class DelegationCodesTransferObjectToModelClassMapBuilder extends AbstractTransferObjectToModelClassMapBuilder<DelegationCodesTransferObject, DelegationCodesModel> {
|
||||||
|
|
||||||
|
private static final Type<DelegationCodesTransferObject> A_TYPE = TypeFactory.valueOf(DelegationCodesTransferObject.class);
|
||||||
|
|
||||||
|
private static final Type<DelegationCodesModel> B_TYPE = TypeFactory.valueOf(DelegationCodesModel.class);
|
||||||
|
|
||||||
|
public DelegationCodesTransferObjectToModelClassMapBuilder(ApplicationContext applicationContext) {
|
||||||
|
super(applicationContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<DelegationCodesTransferObject> getAType() {
|
||||||
|
return A_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<DelegationCodesModel> getBType() {
|
||||||
|
return B_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void buildMap(ClassMapBuilder<DelegationCodesTransferObject, DelegationCodesModel> classMapBuilder) {
|
||||||
|
classMapBuilder.byDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.mapping.classmapbuilder;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.mapping.bean.AbstractTransferObjectToModelClassMapBuilder;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.transferobject.internal.MovementFileDetailTransferObject;
|
||||||
|
import eu.europa.eeas.erights.common.service.model.MovementFileDetailModel;
|
||||||
|
import ma.glasnost.orika.metadata.ClassMapBuilder;
|
||||||
|
import ma.glasnost.orika.metadata.Type;
|
||||||
|
import ma.glasnost.orika.metadata.TypeFactory;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
|
||||||
|
public class MovementFileDetailTransferObjectToModelClassMapBuilder extends AbstractTransferObjectToModelClassMapBuilder<MovementFileDetailTransferObject, MovementFileDetailModel> {
|
||||||
|
|
||||||
|
private static final Type<MovementFileDetailTransferObject> A_TYPE = TypeFactory.valueOf(MovementFileDetailTransferObject.class);
|
||||||
|
|
||||||
|
private static final Type<MovementFileDetailModel> B_TYPE = TypeFactory.valueOf(MovementFileDetailModel.class);
|
||||||
|
|
||||||
|
public MovementFileDetailTransferObjectToModelClassMapBuilder(ApplicationContext applicationContext) {
|
||||||
|
super(applicationContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<MovementFileDetailTransferObject> getAType() {
|
||||||
|
return A_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<MovementFileDetailModel> getBType() {
|
||||||
|
return B_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void buildMap(ClassMapBuilder<MovementFileDetailTransferObject, MovementFileDetailModel> builder) {
|
||||||
|
builder.byDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.mapping.classmapbuilder;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.mapping.bean.AbstractTransferObjectToModelClassMapBuilder;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.transferobject.internal.PersonAbacInfoTransferObject;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.model.PersonAbacInfoModel;
|
||||||
|
import ma.glasnost.orika.metadata.ClassMapBuilder;
|
||||||
|
import ma.glasnost.orika.metadata.Type;
|
||||||
|
import ma.glasnost.orika.metadata.TypeFactory;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple map builder for {@link PersonAbacInfoModel}
|
||||||
|
*
|
||||||
|
* @author idominju
|
||||||
|
*/
|
||||||
|
public class PersonAbacInfoTransferObjectToModelClassMapBuilder extends AbstractTransferObjectToModelClassMapBuilder<PersonAbacInfoTransferObject, PersonAbacInfoModel> {
|
||||||
|
|
||||||
|
private static final Type<PersonAbacInfoTransferObject> A_TYPE = TypeFactory.valueOf(PersonAbacInfoTransferObject.class);
|
||||||
|
|
||||||
|
private static final Type<PersonAbacInfoModel> B_TYPE = TypeFactory.valueOf(PersonAbacInfoModel.class);
|
||||||
|
|
||||||
|
public PersonAbacInfoTransferObjectToModelClassMapBuilder(ApplicationContext applicationContext) {
|
||||||
|
super(applicationContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<PersonAbacInfoTransferObject> getAType() {
|
||||||
|
return A_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<PersonAbacInfoModel> getBType() {
|
||||||
|
return B_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void buildMap(ClassMapBuilder<PersonAbacInfoTransferObject, PersonAbacInfoModel> classMapBuilder) {
|
||||||
|
classMapBuilder.byDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.mapping.classmapbuilder;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.mapping.bean.AbstractTransferObjectToModelClassMapBuilder;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.transferobject.internal.PlaceOriginAirportTransferObject;
|
||||||
|
import eu.europa.eeas.erights.common.service.model.PlaceOriginAirportModel;
|
||||||
|
import ma.glasnost.orika.metadata.ClassMapBuilder;
|
||||||
|
import ma.glasnost.orika.metadata.Type;
|
||||||
|
import ma.glasnost.orika.metadata.TypeFactory;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
|
||||||
|
public class PlaceOriginAirportTransferObjectToModelClassMapBuilder extends AbstractTransferObjectToModelClassMapBuilder<PlaceOriginAirportTransferObject, PlaceOriginAirportModel> {
|
||||||
|
|
||||||
|
private static final Type<PlaceOriginAirportTransferObject> A_TYPE = TypeFactory.valueOf(PlaceOriginAirportTransferObject.class);
|
||||||
|
|
||||||
|
private static final Type<PlaceOriginAirportModel> B_TYPE = TypeFactory.valueOf(PlaceOriginAirportModel.class);
|
||||||
|
|
||||||
|
public PlaceOriginAirportTransferObjectToModelClassMapBuilder(ApplicationContext applicationContext) {
|
||||||
|
super(applicationContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<PlaceOriginAirportTransferObject> getAType() {
|
||||||
|
return A_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<PlaceOriginAirportModel> getBType() {
|
||||||
|
return B_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void buildMap(ClassMapBuilder<PlaceOriginAirportTransferObject, PlaceOriginAirportModel> builder) {
|
||||||
|
builder.byDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.mapping.classmapbuilder;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.mapping.bean.AbstractTransferObjectToModelClassMapBuilder;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.transferobject.internal.RequestPaymentAbacInfoTransferObject;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.model.RequestPaymentAbacInfoModel;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.model.RequestSubpostModel;
|
||||||
|
import ma.glasnost.orika.metadata.ClassMapBuilder;
|
||||||
|
import ma.glasnost.orika.metadata.Type;
|
||||||
|
import ma.glasnost.orika.metadata.TypeFactory;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple map builder for {@link RequestSubpostModel}
|
||||||
|
*
|
||||||
|
* @author idominju
|
||||||
|
*/
|
||||||
|
public class RequestPaymentAbacInfoTransferObjectToModelClassMapBuilder extends AbstractTransferObjectToModelClassMapBuilder<
|
||||||
|
RequestPaymentAbacInfoTransferObject, RequestPaymentAbacInfoModel> {
|
||||||
|
|
||||||
|
private static final Type<RequestPaymentAbacInfoTransferObject> A_TYPE = TypeFactory.valueOf(RequestPaymentAbacInfoTransferObject.class);
|
||||||
|
|
||||||
|
private static final Type<RequestPaymentAbacInfoModel> B_TYPE = TypeFactory.valueOf(RequestPaymentAbacInfoModel.class);
|
||||||
|
|
||||||
|
public RequestPaymentAbacInfoTransferObjectToModelClassMapBuilder(ApplicationContext applicationContext) {
|
||||||
|
super(applicationContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<RequestPaymentAbacInfoTransferObject> getAType() {
|
||||||
|
return A_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<RequestPaymentAbacInfoModel> getBType() {
|
||||||
|
return B_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void buildMap(ClassMapBuilder<RequestPaymentAbacInfoTransferObject, RequestPaymentAbacInfoModel> classMapBuilder) {
|
||||||
|
classMapBuilder.byDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.mapping.classmapbuilder;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.mapping.bean.AbstractTransferObjectToModelClassMapBuilder;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.transferobject.internal.RequestSubpostTransferObject;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.model.RequestSubpostModel;
|
||||||
|
import ma.glasnost.orika.metadata.ClassMapBuilder;
|
||||||
|
import ma.glasnost.orika.metadata.Type;
|
||||||
|
import ma.glasnost.orika.metadata.TypeFactory;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple map builder for {@link RequestSubpostModel}
|
||||||
|
*
|
||||||
|
* @author idominju
|
||||||
|
*/
|
||||||
|
public class RequestSubpostTransferObjectToModelClassMapBuilder extends AbstractTransferObjectToModelClassMapBuilder<RequestSubpostTransferObject, RequestSubpostModel> {
|
||||||
|
|
||||||
|
private static final Type<RequestSubpostTransferObject> A_TYPE = TypeFactory.valueOf(RequestSubpostTransferObject.class);
|
||||||
|
|
||||||
|
private static final Type<RequestSubpostModel> B_TYPE = TypeFactory.valueOf(RequestSubpostModel.class);
|
||||||
|
|
||||||
|
public RequestSubpostTransferObjectToModelClassMapBuilder(ApplicationContext applicationContext) {
|
||||||
|
super(applicationContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<RequestSubpostTransferObject> getAType() {
|
||||||
|
return A_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<RequestSubpostModel> getBType() {
|
||||||
|
return B_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void buildMap(ClassMapBuilder<RequestSubpostTransferObject, RequestSubpostModel> classMapBuilder) {
|
||||||
|
classMapBuilder.byDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.mapping.classmapbuilder;
|
||||||
|
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.mapping.bean.AbstractTransferObjectToModelClassMapBuilder;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.transferobject.internal.SummaFundSourceTransferObject;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.model.SummaFundSourceModel;
|
||||||
|
import ma.glasnost.orika.metadata.ClassMapBuilder;
|
||||||
|
import ma.glasnost.orika.metadata.Type;
|
||||||
|
import ma.glasnost.orika.metadata.TypeFactory;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple map builder for {@link SummaFundSourceModel}
|
||||||
|
*
|
||||||
|
* @author idominju
|
||||||
|
*/
|
||||||
|
public class SummaFundSourceTransferObjectToModelClassMapBuilder extends AbstractTransferObjectToModelClassMapBuilder<SummaFundSourceTransferObject, SummaFundSourceModel> {
|
||||||
|
|
||||||
|
private static final Type<SummaFundSourceTransferObject> A_TYPE = TypeFactory.valueOf(SummaFundSourceTransferObject.class);
|
||||||
|
|
||||||
|
private static final Type<SummaFundSourceModel> B_TYPE = TypeFactory.valueOf(SummaFundSourceModel.class);
|
||||||
|
|
||||||
|
public SummaFundSourceTransferObjectToModelClassMapBuilder(ApplicationContext applicationContext) {
|
||||||
|
super(applicationContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<SummaFundSourceTransferObject> getAType() {
|
||||||
|
return A_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<SummaFundSourceModel> getBType() {
|
||||||
|
return B_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void buildMap(ClassMapBuilder<SummaFundSourceTransferObject, SummaFundSourceModel> classMapBuilder) {
|
||||||
|
classMapBuilder.byDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.mapping.classmapbuilder.p2phub;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.mapping.bean.AbstractTransferObjectToModelClassMapBuilder;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.transferobject.AllowanceRequestInternalTransferObject;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.model.p2phub.AllowancePaymentModel;
|
||||||
|
import ma.glasnost.orika.metadata.ClassMapBuilder;
|
||||||
|
import ma.glasnost.orika.metadata.Type;
|
||||||
|
import ma.glasnost.orika.metadata.TypeFactory;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple map builder for {@link AllowancePaymentModel}
|
||||||
|
*/
|
||||||
|
public class AllowanceRequestInternalTransferObjectToModelClassMapBuilder
|
||||||
|
extends AbstractTransferObjectToModelClassMapBuilder<AllowanceRequestInternalTransferObject, AllowancePaymentModel> {
|
||||||
|
|
||||||
|
private static final Type<AllowanceRequestInternalTransferObject> A_TYPE =
|
||||||
|
TypeFactory.valueOf(AllowanceRequestInternalTransferObject.class);
|
||||||
|
|
||||||
|
private static final Type<AllowancePaymentModel> B_TYPE =
|
||||||
|
TypeFactory.valueOf(AllowancePaymentModel.class);
|
||||||
|
|
||||||
|
public AllowanceRequestInternalTransferObjectToModelClassMapBuilder(ApplicationContext applicationContext) {
|
||||||
|
super(applicationContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<AllowanceRequestInternalTransferObject> getAType() {
|
||||||
|
return A_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<AllowancePaymentModel> getBType() {
|
||||||
|
return B_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void buildMap(ClassMapBuilder<AllowanceRequestInternalTransferObject, AllowancePaymentModel> classMapBuilder) {
|
||||||
|
// If field names match (runId, batchId, hrRequestId, payMethodEnum, value), this is enough.
|
||||||
|
classMapBuilder.byDefault();
|
||||||
|
|
||||||
|
// If the enum or any field names differ, add explicit mappings here, e.g.:
|
||||||
|
// classMapBuilder.field("payMethod", "payMethodEnum");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.mapping.classmapbuilder.p2phub;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.mapping.bean.AbstractTransferObjectToModelClassMapBuilder;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.model.p2phub.BusinessPartnerIdentificationModel;
|
||||||
|
import eu.europa.eeas.erights.web.p2phub.client.transferobject.BusinessPartnerIdentificationTransferObject;
|
||||||
|
import ma.glasnost.orika.metadata.ClassMapBuilder;
|
||||||
|
import ma.glasnost.orika.metadata.Type;
|
||||||
|
import ma.glasnost.orika.metadata.TypeFactory;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple map builder for {@link BusinessPartnerIdentificationModel}
|
||||||
|
*/
|
||||||
|
public class BusinessPartnerIdentificationTransferObjectToModelClassMapBuilder
|
||||||
|
extends AbstractTransferObjectToModelClassMapBuilder<BusinessPartnerIdentificationTransferObject, BusinessPartnerIdentificationModel> {
|
||||||
|
|
||||||
|
private static final Type<BusinessPartnerIdentificationTransferObject> A_TYPE =
|
||||||
|
TypeFactory.valueOf(BusinessPartnerIdentificationTransferObject.class);
|
||||||
|
|
||||||
|
private static final Type<BusinessPartnerIdentificationModel> B_TYPE =
|
||||||
|
TypeFactory.valueOf(BusinessPartnerIdentificationModel.class);
|
||||||
|
|
||||||
|
public BusinessPartnerIdentificationTransferObjectToModelClassMapBuilder(ApplicationContext applicationContext) {
|
||||||
|
super(applicationContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<BusinessPartnerIdentificationTransferObject> getAType() {
|
||||||
|
return A_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<BusinessPartnerIdentificationModel> getBType() {
|
||||||
|
return B_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void buildMap(ClassMapBuilder<BusinessPartnerIdentificationTransferObject, BusinessPartnerIdentificationModel> classMapBuilder) {
|
||||||
|
// If field names match (runId, batchId, hrRequestId, payMethodEnum, value), this is enough.
|
||||||
|
classMapBuilder.byDefault();
|
||||||
|
|
||||||
|
// If the enum or any field names differ, add explicit mappings here, e.g.:
|
||||||
|
// classMapBuilder.field("payMethod", "payMethodEnum");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.mapping.classmapbuilder.p2phub;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.mapping.bean.AbstractTransferObjectToModelClassMapBuilder;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.model.p2phub.AllowanceDetailModel;
|
||||||
|
import eu.europa.eeas.erights.web.p2phub.client.transferobject.AllowanceDetailTransferObject;
|
||||||
|
import ma.glasnost.orika.metadata.ClassMapBuilder;
|
||||||
|
import ma.glasnost.orika.metadata.Type;
|
||||||
|
import ma.glasnost.orika.metadata.TypeFactory;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple map builder for {@link AllowanceDetailModel}
|
||||||
|
*/
|
||||||
|
public class DetailsAllowanceRequestTransferObjectToModelClassMapBuilder
|
||||||
|
extends AbstractTransferObjectToModelClassMapBuilder<AllowanceDetailTransferObject, AllowanceDetailModel> {
|
||||||
|
|
||||||
|
private static final Type<AllowanceDetailTransferObject> A_TYPE =
|
||||||
|
TypeFactory.valueOf(AllowanceDetailTransferObject.class);
|
||||||
|
|
||||||
|
private static final Type<AllowanceDetailModel> B_TYPE =
|
||||||
|
TypeFactory.valueOf(AllowanceDetailModel.class);
|
||||||
|
|
||||||
|
public DetailsAllowanceRequestTransferObjectToModelClassMapBuilder(ApplicationContext applicationContext) {
|
||||||
|
super(applicationContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<AllowanceDetailTransferObject> getAType() {
|
||||||
|
return A_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<AllowanceDetailModel> getBType() {
|
||||||
|
return B_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void buildMap(ClassMapBuilder<AllowanceDetailTransferObject, AllowanceDetailModel> classMapBuilder) {
|
||||||
|
// If field names match (runId, batchId, hrRequestId, payMethodEnum, value), this is enough.
|
||||||
|
classMapBuilder.byDefault();
|
||||||
|
|
||||||
|
// If the enum or any field names differ, add explicit mappings here, e.g.:
|
||||||
|
// classMapBuilder.field("payMethod", "payMethodEnum");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.mapping.classmapbuilder.p2phub;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.mapping.bean.AbstractTransferObjectToModelClassMapBuilder;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.model.p2phub.AllowanceHeaderModel;
|
||||||
|
import eu.europa.eeas.erights.web.p2phub.client.transferobject.AllowanceHeaderTransferObject;
|
||||||
|
import ma.glasnost.orika.metadata.ClassMapBuilder;
|
||||||
|
import ma.glasnost.orika.metadata.Type;
|
||||||
|
import ma.glasnost.orika.metadata.TypeFactory;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple map builder for {@link AllowanceHeaderModel}
|
||||||
|
*/
|
||||||
|
public class HeaderAllowanceRequestTransferObjectToModelClassMapBuilder
|
||||||
|
extends AbstractTransferObjectToModelClassMapBuilder<AllowanceHeaderTransferObject, AllowanceHeaderModel> {
|
||||||
|
|
||||||
|
private static final Type<AllowanceHeaderTransferObject> A_TYPE =
|
||||||
|
TypeFactory.valueOf(AllowanceHeaderTransferObject.class);
|
||||||
|
|
||||||
|
private static final Type<AllowanceHeaderModel> B_TYPE =
|
||||||
|
TypeFactory.valueOf(AllowanceHeaderModel.class);
|
||||||
|
|
||||||
|
public HeaderAllowanceRequestTransferObjectToModelClassMapBuilder(ApplicationContext applicationContext) {
|
||||||
|
super(applicationContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<AllowanceHeaderTransferObject> getAType() {
|
||||||
|
return A_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<AllowanceHeaderModel> getBType() {
|
||||||
|
return B_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void buildMap(ClassMapBuilder<AllowanceHeaderTransferObject, AllowanceHeaderModel> classMapBuilder) {
|
||||||
|
// If field names match (runId, batchId, hrRequestId, payMethodEnum, value), this is enough.
|
||||||
|
classMapBuilder.byDefault();
|
||||||
|
|
||||||
|
// If the enum or any field names differ, add explicit mappings here, e.g.:
|
||||||
|
// classMapBuilder.field("payMethod", "payMethodEnum");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.mapping.classmapbuilder.p2phub;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.mapping.bean.AbstractTransferObjectToModelClassMapBuilder;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.model.p2phub.OrderErrorResponseModel;
|
||||||
|
import eu.europa.eeas.erights.web.p2phub.client.transferobject.OrderErrorResponseTransferObject;
|
||||||
|
import ma.glasnost.orika.metadata.ClassMapBuilder;
|
||||||
|
import ma.glasnost.orika.metadata.Type;
|
||||||
|
import ma.glasnost.orika.metadata.TypeFactory;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple map builder for {@link OrderErrorResponseModel}
|
||||||
|
*/
|
||||||
|
public class OrderErrorResponseTransferObjectToModelClassMapBuilder
|
||||||
|
extends AbstractTransferObjectToModelClassMapBuilder<OrderErrorResponseTransferObject, OrderErrorResponseModel> {
|
||||||
|
|
||||||
|
private static final Type<OrderErrorResponseTransferObject> A_TYPE =
|
||||||
|
TypeFactory.valueOf(OrderErrorResponseTransferObject.class);
|
||||||
|
|
||||||
|
private static final Type<OrderErrorResponseModel> B_TYPE =
|
||||||
|
TypeFactory.valueOf(OrderErrorResponseModel.class);
|
||||||
|
|
||||||
|
public OrderErrorResponseTransferObjectToModelClassMapBuilder(ApplicationContext applicationContext) {
|
||||||
|
super(applicationContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<OrderErrorResponseTransferObject> getAType() {
|
||||||
|
return A_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<OrderErrorResponseModel> getBType() {
|
||||||
|
return B_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void buildMap(ClassMapBuilder<OrderErrorResponseTransferObject, OrderErrorResponseModel> classMapBuilder) {
|
||||||
|
// If field names match (runId, batchId, hrRequestId, payMethodEnum, value), this is enough.
|
||||||
|
classMapBuilder.byDefault();
|
||||||
|
|
||||||
|
// If the enum or any field names differ, add explicit mappings here, e.g.:
|
||||||
|
// classMapBuilder.field("payMethod", "payMethodEnum");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.mapping.classmapbuilder.p2phub;
|
||||||
|
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.mapping.bean.AbstractTransferObjectToModelClassMapBuilder;
|
||||||
|
|
||||||
|
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.transferobject.OrderResponseInternalTransferObject;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.model.p2phub.OrderResponseModel;
|
||||||
|
import ma.glasnost.orika.CustomMapper;
|
||||||
|
import ma.glasnost.orika.MappingContext;
|
||||||
|
import ma.glasnost.orika.metadata.ClassMapBuilder;
|
||||||
|
import ma.glasnost.orika.metadata.Type;
|
||||||
|
import ma.glasnost.orika.metadata.TypeFactory;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple map builder for {@link OrderResponseModel}
|
||||||
|
*
|
||||||
|
* @author tapiafo
|
||||||
|
*/
|
||||||
|
public class OrderResponseInternalTransferObjectToModelClassMapBuilder extends AbstractTransferObjectToModelClassMapBuilder<OrderResponseInternalTransferObject, OrderResponseModel> {
|
||||||
|
|
||||||
|
private static final Type<OrderResponseInternalTransferObject> A_TYPE = TypeFactory.valueOf(OrderResponseInternalTransferObject.class);
|
||||||
|
|
||||||
|
private static final Type<OrderResponseModel> B_TYPE = TypeFactory.valueOf(OrderResponseModel.class);
|
||||||
|
|
||||||
|
public OrderResponseInternalTransferObjectToModelClassMapBuilder(ApplicationContext applicationContext) {
|
||||||
|
super(applicationContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<OrderResponseInternalTransferObject> getAType() {
|
||||||
|
return A_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<OrderResponseModel> getBType() {
|
||||||
|
return B_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void buildMap(ClassMapBuilder<OrderResponseInternalTransferObject, OrderResponseModel> classMapBuilder) {
|
||||||
|
classMapBuilder
|
||||||
|
.byDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.mapping.classmapbuilder.p2phub;
|
||||||
|
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.mapping.bean.AbstractTransferObjectToModelClassMapBuilder;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.mapping.custommapper.OrderStatusResponseTransferObjectToModelCustomMapper;
|
||||||
|
import eu.europa.eeas.erights.web.p2phub.client.transferobject.OrderStatusResponseTransferObject;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.model.p2phub.OrderStatusResponseModel;
|
||||||
|
import ma.glasnost.orika.metadata.ClassMapBuilder;
|
||||||
|
import ma.glasnost.orika.metadata.Type;
|
||||||
|
import ma.glasnost.orika.metadata.TypeFactory;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple map builder for {@link OrderStatusResponseModel}
|
||||||
|
*
|
||||||
|
* @author tapiafo
|
||||||
|
*/
|
||||||
|
public class OrderStatusResponseTransferObjectToModelClassMapBuilder extends AbstractTransferObjectToModelClassMapBuilder<OrderStatusResponseTransferObject, OrderStatusResponseModel> {
|
||||||
|
|
||||||
|
private static final Type<OrderStatusResponseTransferObject> A_TYPE = TypeFactory.valueOf(OrderStatusResponseTransferObject.class);
|
||||||
|
|
||||||
|
private static final Type<OrderStatusResponseModel> B_TYPE = TypeFactory.valueOf(OrderStatusResponseModel.class);
|
||||||
|
|
||||||
|
public OrderStatusResponseTransferObjectToModelClassMapBuilder(ApplicationContext applicationContext) {
|
||||||
|
super(applicationContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<OrderStatusResponseTransferObject> getAType() {
|
||||||
|
return A_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<OrderStatusResponseModel> getBType() {
|
||||||
|
return B_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void buildMap(
|
||||||
|
ClassMapBuilder<OrderStatusResponseTransferObject, OrderStatusResponseModel> classMapBuilder) {
|
||||||
|
|
||||||
|
classMapBuilder
|
||||||
|
// Excluded field
|
||||||
|
.fieldMap("lastModificationDate", "lastModificationDate")
|
||||||
|
.exclude()
|
||||||
|
.add()
|
||||||
|
|
||||||
|
// Explicit mapping for different field names
|
||||||
|
.field("paymentReference", "paymentDirectiveReference")
|
||||||
|
|
||||||
|
// Custom mapper
|
||||||
|
.customize(new OrderStatusResponseTransferObjectToModelCustomMapper())
|
||||||
|
|
||||||
|
// Map remaining same-name fields automatically
|
||||||
|
.byDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.mapping.classmapbuilder.p2phub;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.mapping.bean.AbstractTransferObjectToModelClassMapBuilder;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.model.p2phub.SupplierModel;
|
||||||
|
import eu.europa.eeas.erights.web.p2phub.client.transferobject.SupplierTransferObject;
|
||||||
|
import ma.glasnost.orika.metadata.ClassMapBuilder;
|
||||||
|
import ma.glasnost.orika.metadata.Type;
|
||||||
|
import ma.glasnost.orika.metadata.TypeFactory;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple map builder for {@link SupplierModel}
|
||||||
|
*/
|
||||||
|
public class SupplierTransferObjectToModelClassMapBuilder
|
||||||
|
extends AbstractTransferObjectToModelClassMapBuilder<SupplierTransferObject, SupplierModel> {
|
||||||
|
|
||||||
|
private static final Type<SupplierTransferObject> A_TYPE =
|
||||||
|
TypeFactory.valueOf(SupplierTransferObject.class);
|
||||||
|
|
||||||
|
private static final Type<SupplierModel> B_TYPE =
|
||||||
|
TypeFactory.valueOf(SupplierModel.class);
|
||||||
|
|
||||||
|
public SupplierTransferObjectToModelClassMapBuilder(ApplicationContext applicationContext) {
|
||||||
|
super(applicationContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<SupplierTransferObject> getAType() {
|
||||||
|
return A_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<SupplierModel> getBType() {
|
||||||
|
return B_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void buildMap(ClassMapBuilder<SupplierTransferObject, SupplierModel> classMapBuilder) {
|
||||||
|
// If field names match (runId, batchId, hrRequestId, payMethodEnum, value), this is enough.
|
||||||
|
classMapBuilder.byDefault();
|
||||||
|
|
||||||
|
// If the enum or any field names differ, add explicit mappings here, e.g.:
|
||||||
|
// classMapBuilder.field("payMethod", "payMethodEnum");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
//package eu.europa.eeas.erights.backoffice.api.http.rest.mapping.custommapper;
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//import eu.europa.eeas.erights.common.service.model.declaration.PersonBankInfoModel;
|
||||||
|
//import eu.europa.eeas.erights.common.service.model.document.MovementDocModel;
|
||||||
|
//import eu.europa.eeas.erights.common.service.model.document.MovementDocSectionModel;
|
||||||
|
//import eu.europa.eeas.erights.web.p2phub.client.transferobject.BusinessPartnerResponseTransferObject;
|
||||||
|
//import ma.glasnost.orika.CustomMapper;
|
||||||
|
//import ma.glasnost.orika.MappingContext;
|
||||||
|
//import ma.glasnost.orika.metadata.ClassMapBuilder;
|
||||||
|
//import ma.glasnost.orika.metadata.Type;
|
||||||
|
//import ma.glasnost.orika.metadata.TypeFactory;
|
||||||
|
//import org.springframework.context.ApplicationContext;
|
||||||
|
//
|
||||||
|
//public class BusinessPartnerResponseTransferObjectToModelCustomMapper extends CustomMapper<BusinessPartnerResponseTransferObject, > {
|
||||||
|
//
|
||||||
|
//// @Override
|
||||||
|
//// public void mapAtoB(BusinessPartnerResponseTransferObject transferObject, MovementDocModel model, MappingContext context) {
|
||||||
|
//// MovementDocSectionModel movementDocSection = new MovementDocSectionModel();
|
||||||
|
//// movementDocSection.setId(transferObject.getMovementDocSectionId());
|
||||||
|
////
|
||||||
|
//// model.setMovementDocSection(movementDocSection);
|
||||||
|
//// }
|
||||||
|
////
|
||||||
|
//// @Override
|
||||||
|
//// public void mapBtoA(MovementDocModel model, BusinessPartnerResponseTransferObject transferObject, MappingContext context) {
|
||||||
|
//// transferObject.setMovementDocSectionId(model.getMovementDocSection().getId());
|
||||||
|
//// }
|
||||||
|
//}
|
||||||
|
|
@ -0,0 +1,54 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.mapping.custommapper;
|
||||||
|
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.api.provider.http.mapping.bean.AbstractTransferObjectToModelClassMapBuilder;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.model.p2phub.OrderStatusResponseModel;
|
||||||
|
import eu.europa.eeas.erights.web.p2phub.client.transferobject.OrderStatusResponseTransferObject;
|
||||||
|
import ma.glasnost.orika.CustomMapper;
|
||||||
|
import ma.glasnost.orika.MappingContext;
|
||||||
|
import ma.glasnost.orika.metadata.ClassMapBuilder;
|
||||||
|
import ma.glasnost.orika.metadata.Type;
|
||||||
|
import ma.glasnost.orika.metadata.TypeFactory;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple map builder for {@link OrderStatusResponseModel}
|
||||||
|
*
|
||||||
|
* @author tapiafo
|
||||||
|
*/
|
||||||
|
public class OrderStatusResponseTransferObjectToModelCustomMapper extends CustomMapper<OrderStatusResponseTransferObject, OrderStatusResponseModel> {
|
||||||
|
|
||||||
|
private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS");
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void mapAtoB(OrderStatusResponseTransferObject a,
|
||||||
|
OrderStatusResponseModel b,
|
||||||
|
MappingContext context) {
|
||||||
|
|
||||||
|
String dateStr = a.getLastModificationDate();
|
||||||
|
|
||||||
|
if (dateStr == null || dateStr.trim().isEmpty()) {
|
||||||
|
// default to sysdate
|
||||||
|
b.setLastModificationDate(LocalDateTime.now());
|
||||||
|
} else {
|
||||||
|
LocalDateTime ldt = LocalDateTime.parse(dateStr, FORMATTER);
|
||||||
|
b.setLastModificationDate(ldt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void mapBtoA(OrderStatusResponseModel b,
|
||||||
|
OrderStatusResponseTransferObject a,
|
||||||
|
MappingContext context) {
|
||||||
|
|
||||||
|
if (b.getLastModificationDate() != null) {
|
||||||
|
String formatted = b.getLastModificationDate().format(FORMATTER);
|
||||||
|
a.setLastModificationDate(formatted);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.transferobject;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import eu.europa.eeas.erights.web.p2phub.client.transferobject.AllowanceRequestTransferObject;
|
||||||
|
import eu.europa.eeas.erights.web.p2phub.client.transferobject.OrderResponseTransferObject;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
@Setter
|
||||||
|
@Getter
|
||||||
|
public class AllowanceRequestInternalTransferObject extends AllowanceRequestTransferObject {
|
||||||
|
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private Long requestId;
|
||||||
|
|
||||||
|
private Long perId;
|
||||||
|
|
||||||
|
@Valid
|
||||||
|
private OrderResponseTransferObject order;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.transferobject;
|
||||||
|
|
||||||
|
import eu.europa.eeas.erights.web.p2phub.client.transferobject.BusinessPartnerResponseTransferObject;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
|
||||||
|
@Setter
|
||||||
|
@Getter
|
||||||
|
public class BusinessPartnerInternalTransferObject extends BusinessPartnerResponseTransferObject {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private Long perId;
|
||||||
|
|
||||||
|
public BusinessPartnerInternalTransferObject(BusinessPartnerResponseTransferObject response) {
|
||||||
|
// Copy all fields from parent using BeanUtils
|
||||||
|
BeanUtils.copyProperties(response, this);
|
||||||
|
// id and perId remain null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.api.http.rest.transferobject;
|
||||||
|
|
||||||
|
|
||||||
|
import eu.europa.eeas.erights.web.p2phub.client.transferobject.OrderResponseTransferObject;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Setter
|
||||||
|
@Getter
|
||||||
|
public class OrderResponseInternalTransferObject extends OrderResponseTransferObject {
|
||||||
|
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private Long requestId;
|
||||||
|
|
||||||
|
private Long perId;
|
||||||
|
|
||||||
|
private String message;
|
||||||
|
|
||||||
|
private String errorCode;
|
||||||
|
|
||||||
|
private String errorText;
|
||||||
|
|
||||||
|
private LocalDateTime responseDateTime;
|
||||||
|
|
||||||
|
private String orderComment;
|
||||||
|
|
||||||
|
private String orderStatus;
|
||||||
|
|
||||||
|
private String paymentDirectiveReference;
|
||||||
|
|
||||||
|
private String jsonSent;
|
||||||
|
|
||||||
|
@Valid
|
||||||
|
private OrderResponseTransferObject order;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.boot;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.base.boot.AnankeStarter;
|
||||||
|
|
||||||
|
public class ERightsBackOffice extends AnankeStarter {
|
||||||
|
|
||||||
|
public static void main(String[] args) throws Exception {
|
||||||
|
start(new ERightsBackOffice(), args);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.boot.configuration;
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.cache.annotation.EnableCaching;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ienaccat
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
@EnableCaching
|
||||||
|
public class CacheConfiguration {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,53 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.boot.configuration;
|
||||||
|
|
||||||
|
public final class ERightsBackOfficeBeanNames {
|
||||||
|
/**
|
||||||
|
* PREFIX.
|
||||||
|
*/
|
||||||
|
private static final String PREFIX = "ERightsBackOffice";
|
||||||
|
|
||||||
|
public static final String EMAIL_NOTIFICATIONS_UPDATER_JOB = PREFIX + "EmailNotificationsUpdaterJob";
|
||||||
|
|
||||||
|
public static final String EMAIL_NOTIFICATIONS_UPDATER_TRIGGER = PREFIX + "EmailNotificationUpdaterTrigger";
|
||||||
|
|
||||||
|
public static final String NIGHTLY_UPDATER_JOB = PREFIX + "NightlyUpdaterJob";
|
||||||
|
|
||||||
|
public static final String NIGHTLY_UPDATER_TRIGGER = PREFIX + "NightlyUpdaterTrigger";
|
||||||
|
|
||||||
|
public static final String NIGHTLY_BANK_UPDATER_JOB = PREFIX + "NightlyBankUpdaterJob";
|
||||||
|
|
||||||
|
public static final String NIGHTLY_BANK_UPDATER_TRIGGER = PREFIX + "NightlyBankUpdaterTrigger";
|
||||||
|
|
||||||
|
public static final String CLEARING_EMAIL_NOTIFICATIONS_JOB = PREFIX + "ClearingRequestEmailNotificationJob";
|
||||||
|
|
||||||
|
public static final String CLEARING_EMAIL_NOTIFICATIONS_TRIGGER = PREFIX + "ClearingRequestEmailNotificationTrigger";
|
||||||
|
|
||||||
|
public static final String INSTALLATION_UPDATER_JOB = PREFIX + "InstallationUpdaterJob";
|
||||||
|
|
||||||
|
public static final String INSTALLATION_UPDATER_TRIGGER = PREFIX + "InstallationUpdaterTrigger";
|
||||||
|
|
||||||
|
public static final String P2P_ORDER_UPDATER_JOB = PREFIX + "P2POrderUpdaterJob";
|
||||||
|
public static final String P2P_ORDER_UPDATER_TRIGGER = PREFIX + "P2POrderUpdaterTrigger";
|
||||||
|
|
||||||
|
public static final String RATE_MISSING_UPDATER_JOB = PREFIX + "RateMissingUpdaterJob";
|
||||||
|
public static final String RATE_MISSING_UPDATER_TRIGGER = PREFIX + "RateMissingUpdaterTrigger";
|
||||||
|
|
||||||
|
public static final String TUD_FARE_UPDATER_JOB = PREFIX + "TudFareUpdaterJob";
|
||||||
|
public static final String TUD_FARE_UPDATER_TRIGGER = PREFIX + "TudFareUpdaterTrigger";
|
||||||
|
|
||||||
|
public static final String POSTING_TRAVEL_ALLOWANCE_TRINSITION_JOB = PREFIX + "PostingTravelAllowanceTransitionJob";
|
||||||
|
public static final String POSTING_TRAVEL_ALLOWANCE_TRINSITION_TRIGGER = PREFIX + "PostingTravelAllowanceTransitionTrigger";
|
||||||
|
|
||||||
|
public static final String TRAVEL_ALLOWANCE_CREATION_JOB = PREFIX + "TravelAllowanceCreationJob";
|
||||||
|
public static final String TRAVEL_ALLOWANCE_CREATION_TRIGGER = PREFIX + "TravelAllowanceCreationTrigger";
|
||||||
|
|
||||||
|
public static final String ACCOMMODATION_BANK_ACCOUNTS_SYNC_JOB = PREFIX + "AccommodationBankAccountsSyncJob";
|
||||||
|
public static final String ACCOMMODATION_BANK_ACCOUNTS_SYNC_TRIGGER = PREFIX + "AccommodationBankAccountsSyncTrigger";
|
||||||
|
|
||||||
|
public static final String ACCOMMODATION_CREATE_PAYMENT_JOB = PREFIX + "AccommodationCreatePaymentJob";
|
||||||
|
public static final String ACCOMMODATION_CREATE_PAYMENT_TRIGGER = PREFIX + "AccommodationCreatePaymentTrigger";
|
||||||
|
|
||||||
|
private ERightsBackOfficeBeanNames() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.boot.configuration;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.audit.provider.data.jpa.support.AnankeCoreAuditProviderDataJpaRepositoryFactoryBean;
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.AnankeCoreDataProviderJpaBeanNames;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.mvc.controller.MovementFileControllerBackOffice;
|
||||||
|
import eu.europa.eeas.erights.backoffice.api.http.rest.controller.internal.AuditMovementFilesRestController;
|
||||||
|
import eu.europa.eeas.erights.backoffice.boot.statemachine.configurations.AbacItemStateMachineConfiguration;
|
||||||
|
import eu.europa.eeas.erights.backoffice.boot.statemachine.configurations.AbacRequestMachineConfiguration;
|
||||||
|
import eu.europa.eeas.erights.backoffice.data.jpa.repository.VBudgetLineJpaRepository;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.data.provider.VReportMovementFileJpaServiceProvider;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.provider.MenuServiceProvider;
|
||||||
|
import eu.europa.eeas.erights.common.boot.configuration.ERightsBootAutoConfiguration;
|
||||||
|
import eu.europa.eeas.erights.common.boot.configuration.skyscanner.SkyscannerWSConfiguration;
|
||||||
|
import eu.europa.eeas.erights.common.service.data.provider.LocationJpaServiceProvider;
|
||||||
|
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
|
||||||
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@ImportAutoConfiguration({
|
||||||
|
AbacItemStateMachineConfiguration.class,
|
||||||
|
AbacRequestMachineConfiguration.class,
|
||||||
|
ERightsBootAutoConfiguration.class,
|
||||||
|
QuartzJobConfiguration.class,
|
||||||
|
SkyscannerWSConfiguration.class,
|
||||||
|
CacheConfiguration.class})
|
||||||
|
@EnableJpaRepositories(entityManagerFactoryRef = AnankeCoreDataProviderJpaBeanNames.ENTITY_MANAGER_FACTORY,
|
||||||
|
transactionManagerRef = AnankeCoreDataProviderJpaBeanNames.TRANSACTION_MANAGER,
|
||||||
|
repositoryFactoryBeanClass = AnankeCoreAuditProviderDataJpaRepositoryFactoryBean.class,
|
||||||
|
basePackageClasses = {
|
||||||
|
VBudgetLineJpaRepository.class
|
||||||
|
})
|
||||||
|
@ComponentScan(basePackageClasses = {
|
||||||
|
MovementFileControllerBackOffice.class,
|
||||||
|
AuditMovementFilesRestController.class,
|
||||||
|
MenuServiceProvider.class,
|
||||||
|
VReportMovementFileJpaServiceProvider.class,
|
||||||
|
LocationJpaServiceProvider.class
|
||||||
|
|
||||||
|
})
|
||||||
|
public class ERightsBackOfficeBootAutoConfiguration {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,332 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.boot.configuration;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.base.Profiles;
|
||||||
|
import eu.europa.eeas.ananke.core.base.context.AnankeContext;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.provider.allowances.AccommodationBankAccountsSyncService;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.provider.allowances.PostingAllowancesAppParamsServiceHelper;
|
||||||
|
import eu.europa.eeas.erights.backoffice.tools.scheduler.AccommodationBankAccountsSyncJob;
|
||||||
|
import eu.europa.eeas.erights.backoffice.tools.scheduler.AccommodationCreatePaymentJob;
|
||||||
|
import eu.europa.eeas.erights.backoffice.tools.scheduler.BankAccountUpdaterJob;
|
||||||
|
import eu.europa.eeas.erights.backoffice.tools.scheduler.ClearingRequestEmailNotificationJob;
|
||||||
|
import eu.europa.eeas.erights.backoffice.tools.scheduler.EmailNotificationsUpdaterJob;
|
||||||
|
import eu.europa.eeas.erights.backoffice.tools.scheduler.InstallationRequestUpdaterJob;
|
||||||
|
import eu.europa.eeas.erights.backoffice.tools.scheduler.NightlyUpdaterJob;
|
||||||
|
import eu.europa.eeas.erights.backoffice.tools.scheduler.PostingTravelAllowanceTransitionJob;
|
||||||
|
import eu.europa.eeas.erights.backoffice.tools.scheduler.RateMissingUpdaterJob;
|
||||||
|
import eu.europa.eeas.erights.backoffice.tools.scheduler.TravelAllowanceCreationJob;
|
||||||
|
import eu.europa.eeas.erights.backoffice.tools.scheduler.TudFareUpdaterJob;
|
||||||
|
import org.quartz.CronScheduleBuilder;
|
||||||
|
import org.quartz.JobBuilder;
|
||||||
|
import org.quartz.JobDetail;
|
||||||
|
import org.quartz.Trigger;
|
||||||
|
import org.quartz.TriggerBuilder;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
import eu.europa.eeas.erights.backoffice.tools.scheduler.P2pOrderUpdaterJob;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class QuartzJobConfiguration {
|
||||||
|
|
||||||
|
public static final String EVERY_DAY_3H_AM = "0 0 3 * * ? *";
|
||||||
|
|
||||||
|
public static final String EVERY_2DAYS_3H_30MIN_AM = "0 30 3 1/2 * ? *";
|
||||||
|
|
||||||
|
public static final String EVERY_DAY_4H_AM = "0 0 4 * * ? *";
|
||||||
|
|
||||||
|
public static final String EVERY_DAY_4H_30M_AM = "0 30 4 * * ?";
|
||||||
|
|
||||||
|
public static final String EVERY_DAY_5H_30M_AM = "0 30 5 * * ?";
|
||||||
|
|
||||||
|
public static final String EVERY_DAY_5H_AM = "0 0 5 * * ?";
|
||||||
|
|
||||||
|
public static final String EVERY_3_HOURS = "0 0 0/3 1/1 * ? *";
|
||||||
|
|
||||||
|
public static final String EVERY_1_HOURS = "0 0 0/1 1/1 * ? *";
|
||||||
|
|
||||||
|
public static final String EVERY_2_HOURS = "0 0 0/2 1/1 * ? *";
|
||||||
|
|
||||||
|
public static final String EVERY_5_HOURS = "0 0 0/5 1/1 * ? *";
|
||||||
|
|
||||||
|
public static final String EVERY_8_HOURS = "0 0 0/8 1/1 * ? *";
|
||||||
|
|
||||||
|
public static final String EVERY_4_HOURS = "0 0 0/4 1/1 * ? *";
|
||||||
|
|
||||||
|
//FOR TEST
|
||||||
|
public static final String EVERY_3_HOURS_10MIN = "0 10 0/3 1/1 * ? *";
|
||||||
|
|
||||||
|
public static final String EVERY_5_MIN = "0 0/5 * * * ?";
|
||||||
|
|
||||||
|
|
||||||
|
public static final String EVERY_20_MIN = "0 0/20 * * * ?";
|
||||||
|
|
||||||
|
public static final String EVERY_12_MIN = "0 0/12 * * * ?";
|
||||||
|
|
||||||
|
public static final String EVERY_10_MIN = "0 0/10 * * * ?";
|
||||||
|
|
||||||
|
public static final String EVERY_15_MIN = "0 0/15 * * * ?";
|
||||||
|
|
||||||
|
public static final String EVERY_1_MIN = "0 0/1 * * * ?";
|
||||||
|
|
||||||
|
public static final String EVERY_30_MIN = "0 0/30 * * * ?";
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AnankeContext anankeContext;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PostingAllowancesAppParamsServiceHelper postingAllowancesAppParamsServiceHelper;
|
||||||
|
|
||||||
|
@Bean(ERightsBackOfficeBeanNames.NIGHTLY_UPDATER_JOB)
|
||||||
|
public JobDetail nightlyJobDetails() {
|
||||||
|
return JobBuilder.newJob(NightlyUpdaterJob.class).withIdentity(ERightsBackOfficeBeanNames.NIGHTLY_UPDATER_JOB).storeDurably().build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean(ERightsBackOfficeBeanNames.NIGHTLY_UPDATER_TRIGGER)
|
||||||
|
public Trigger nightlyJobTrigger(@Qualifier(ERightsBackOfficeBeanNames.NIGHTLY_UPDATER_JOB) JobDetail nightlyJobDetails) {
|
||||||
|
String frequencyToRunJob = EVERY_DAY_4H_30M_AM;
|
||||||
|
if (!(anankeContext.getProfiles().contains(Profiles.PRODUCTION) || anankeContext.getProfiles().contains(Profiles.ACCEPTANCE))) { //EASREFN is refresh around 2 we should use EVERY_DAY_5H_AM in PRD , if not we will send
|
||||||
|
frequencyToRunJob = EVERY_2DAYS_3H_30MIN_AM;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TriggerBuilder.newTrigger().forJob(nightlyJobDetails)
|
||||||
|
.withIdentity(ERightsBackOfficeBeanNames.NIGHTLY_UPDATER_TRIGGER)
|
||||||
|
.withSchedule(CronScheduleBuilder.cronSchedule(frequencyToRunJob).withMisfireHandlingInstructionFireAndProceed())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean(ERightsBackOfficeBeanNames.EMAIL_NOTIFICATIONS_UPDATER_JOB)
|
||||||
|
public JobDetail emailNotificationsJobDetails() {
|
||||||
|
return JobBuilder.newJob(EmailNotificationsUpdaterJob.class).withIdentity(ERightsBackOfficeBeanNames.EMAIL_NOTIFICATIONS_UPDATER_JOB).storeDurably().build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean(ERightsBackOfficeBeanNames.EMAIL_NOTIFICATIONS_UPDATER_TRIGGER)
|
||||||
|
public Trigger emailNotificationJobTrigger(@Qualifier(ERightsBackOfficeBeanNames.EMAIL_NOTIFICATIONS_UPDATER_JOB) JobDetail emailNotificationsJobDetails) {
|
||||||
|
|
||||||
|
String frequencyToRunJob = EVERY_4_HOURS;
|
||||||
|
if (anankeContext.getProfiles().contains(Profiles.TEST)) {
|
||||||
|
frequencyToRunJob = EVERY_DAY_3H_AM;
|
||||||
|
} else if (anankeContext.getProfiles().contains(Profiles.STANDALONE) || anankeContext.getProfiles().contains(Profiles.DEVELOPMENT)) {
|
||||||
|
frequencyToRunJob = EVERY_DAY_3H_AM;
|
||||||
|
} else if (anankeContext.getProfiles().contains(Profiles.PRODUCTION) || anankeContext.getProfiles().contains(Profiles.ACCEPTANCE)) {
|
||||||
|
frequencyToRunJob = EVERY_4_HOURS;
|
||||||
|
}
|
||||||
|
return TriggerBuilder.newTrigger().forJob(emailNotificationsJobDetails)
|
||||||
|
.withIdentity(ERightsBackOfficeBeanNames.EMAIL_NOTIFICATIONS_UPDATER_TRIGGER)
|
||||||
|
.withSchedule(CronScheduleBuilder.cronSchedule(frequencyToRunJob).withMisfireHandlingInstructionFireAndProceed())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean(ERightsBackOfficeBeanNames.NIGHTLY_BANK_UPDATER_JOB)
|
||||||
|
public JobDetail nightlyBankAccountUpdaterJobDetails() {
|
||||||
|
return JobBuilder.newJob(BankAccountUpdaterJob.class).withIdentity(ERightsBackOfficeBeanNames.NIGHTLY_BANK_UPDATER_JOB).storeDurably().build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean(ERightsBackOfficeBeanNames.NIGHTLY_BANK_UPDATER_TRIGGER)
|
||||||
|
public Trigger nightlyBankAccountUpdaterJobTrigger(@Qualifier(ERightsBackOfficeBeanNames.NIGHTLY_BANK_UPDATER_JOB) JobDetail nightlyBankAccountUpdaterJobDetails) {
|
||||||
|
String frequencyToRunJob = EVERY_2DAYS_3H_30MIN_AM;
|
||||||
|
if (anankeContext.getProfiles().contains(Profiles.PRODUCTION) || anankeContext.getProfiles().contains(Profiles.ACCEPTANCE)) {
|
||||||
|
frequencyToRunJob = EVERY_2DAYS_3H_30MIN_AM ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return TriggerBuilder.newTrigger().forJob(nightlyBankAccountUpdaterJobDetails)
|
||||||
|
.withIdentity(ERightsBackOfficeBeanNames.NIGHTLY_BANK_UPDATER_TRIGGER)
|
||||||
|
.withSchedule(CronScheduleBuilder.cronSchedule(frequencyToRunJob).withMisfireHandlingInstructionFireAndProceed())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean(ERightsBackOfficeBeanNames.CLEARING_EMAIL_NOTIFICATIONS_JOB)
|
||||||
|
public JobDetail clearingEmailNotificationsJobDetails() {
|
||||||
|
return JobBuilder.newJob(ClearingRequestEmailNotificationJob.class).withIdentity(ERightsBackOfficeBeanNames.CLEARING_EMAIL_NOTIFICATIONS_JOB).storeDurably().build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean(ERightsBackOfficeBeanNames.CLEARING_EMAIL_NOTIFICATIONS_TRIGGER)
|
||||||
|
public Trigger clearingEmailNotificationsJobTrigger(@Qualifier(ERightsBackOfficeBeanNames.CLEARING_EMAIL_NOTIFICATIONS_JOB) JobDetail job) {
|
||||||
|
return TriggerBuilder.newTrigger().forJob(job)
|
||||||
|
.withIdentity(ERightsBackOfficeBeanNames.CLEARING_EMAIL_NOTIFICATIONS_TRIGGER)
|
||||||
|
.withSchedule(CronScheduleBuilder.cronSchedule(EVERY_DAY_3H_AM).withMisfireHandlingInstructionFireAndProceed())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean(ERightsBackOfficeBeanNames.INSTALLATION_UPDATER_JOB)
|
||||||
|
public JobDetail installationUpdaterJobDetails() {
|
||||||
|
return JobBuilder.newJob(InstallationRequestUpdaterJob.class).withIdentity(ERightsBackOfficeBeanNames.INSTALLATION_UPDATER_JOB).storeDurably().build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean(ERightsBackOfficeBeanNames.INSTALLATION_UPDATER_TRIGGER)
|
||||||
|
public Trigger installationUpdaterJobTrigger(@Qualifier(ERightsBackOfficeBeanNames.INSTALLATION_UPDATER_JOB) JobDetail job) {
|
||||||
|
//As comref is updating from sysper once a day we will run this once a day.If we change the frequency, we need to check the email notification.If we run this more than once a day, we will send several reminders
|
||||||
|
String frequencyToRunJob = EVERY_2DAYS_3H_30MIN_AM;
|
||||||
|
if (anankeContext.getProfiles().contains(Profiles.PRODUCTION) || anankeContext.getProfiles().contains(Profiles.ACCEPTANCE)) {
|
||||||
|
frequencyToRunJob = EVERY_DAY_5H_AM;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TriggerBuilder.newTrigger().forJob(job)
|
||||||
|
.withIdentity(ERightsBackOfficeBeanNames.INSTALLATION_UPDATER_TRIGGER)
|
||||||
|
.withSchedule(CronScheduleBuilder.cronSchedule(frequencyToRunJob).withMisfireHandlingInstructionFireAndProceed())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean(ERightsBackOfficeBeanNames.P2P_ORDER_UPDATER_JOB)
|
||||||
|
public JobDetail p2pOrderUpdaterJobDetails() {
|
||||||
|
return JobBuilder.newJob(P2pOrderUpdaterJob.class).withIdentity(ERightsBackOfficeBeanNames.P2P_ORDER_UPDATER_JOB).storeDurably().build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean(ERightsBackOfficeBeanNames.P2P_ORDER_UPDATER_TRIGGER)
|
||||||
|
public Trigger p2pOrderUpdaterJobTrigger(@Qualifier(ERightsBackOfficeBeanNames.P2P_ORDER_UPDATER_JOB) JobDetail job) {
|
||||||
|
String frequencyToRunJob = EVERY_5_MIN;
|
||||||
|
if (anankeContext.getProfiles().contains(Profiles.TEST)) {
|
||||||
|
frequencyToRunJob = EVERY_15_MIN;
|
||||||
|
} else if (anankeContext.getProfiles().contains(Profiles.STANDALONE) || anankeContext.getProfiles().contains(Profiles.DEVELOPMENT)) {
|
||||||
|
frequencyToRunJob = EVERY_2DAYS_3H_30MIN_AM;
|
||||||
|
} else if (anankeContext.getProfiles().contains(Profiles.PRODUCTION) || anankeContext.getProfiles().contains(Profiles.ACCEPTANCE)) {
|
||||||
|
frequencyToRunJob = EVERY_15_MIN;
|
||||||
|
}
|
||||||
|
return TriggerBuilder.newTrigger().forJob(job)
|
||||||
|
.withIdentity(ERightsBackOfficeBeanNames.P2P_ORDER_UPDATER_TRIGGER)
|
||||||
|
.withSchedule(CronScheduleBuilder.cronSchedule(frequencyToRunJob).withMisfireHandlingInstructionFireAndProceed())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Bean(ERightsBackOfficeBeanNames.RATE_MISSING_UPDATER_JOB)
|
||||||
|
public JobDetail rateMissingUpdaterJobDetails() {
|
||||||
|
return JobBuilder.newJob(RateMissingUpdaterJob.class).withIdentity(ERightsBackOfficeBeanNames.RATE_MISSING_UPDATER_JOB).storeDurably().build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean(ERightsBackOfficeBeanNames.RATE_MISSING_UPDATER_TRIGGER)
|
||||||
|
public Trigger rateMissingUpdaterJobTrigger(@Qualifier(ERightsBackOfficeBeanNames.RATE_MISSING_UPDATER_JOB) JobDetail job) {
|
||||||
|
String frequencyToRunJob = EVERY_12_MIN;
|
||||||
|
if (anankeContext.getProfiles().contains(Profiles.TEST)) {
|
||||||
|
frequencyToRunJob = EVERY_DAY_3H_AM;
|
||||||
|
} else if (anankeContext.getProfiles().contains(Profiles.STANDALONE) || anankeContext.getProfiles().contains(Profiles.DEVELOPMENT)) {
|
||||||
|
frequencyToRunJob = EVERY_DAY_3H_AM;
|
||||||
|
} else if (anankeContext.getProfiles().contains(Profiles.PRODUCTION) || anankeContext.getProfiles().contains(Profiles.ACCEPTANCE)) {
|
||||||
|
frequencyToRunJob = EVERY_3_HOURS;
|
||||||
|
}
|
||||||
|
return TriggerBuilder.newTrigger().forJob(job)
|
||||||
|
.withIdentity(ERightsBackOfficeBeanNames.RATE_MISSING_UPDATER_TRIGGER)
|
||||||
|
.withSchedule(CronScheduleBuilder.cronSchedule(frequencyToRunJob).withMisfireHandlingInstructionFireAndProceed())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Bean(ERightsBackOfficeBeanNames.TUD_FARE_UPDATER_JOB)
|
||||||
|
public JobDetail tudFareUpdaterJobDetails() {
|
||||||
|
return JobBuilder.newJob(TudFareUpdaterJob.class).withIdentity(ERightsBackOfficeBeanNames.TUD_FARE_UPDATER_JOB).storeDurably().build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean(ERightsBackOfficeBeanNames.TUD_FARE_UPDATER_TRIGGER)
|
||||||
|
public Trigger tudFareUpdaterJobTrigger(@Qualifier(ERightsBackOfficeBeanNames.TUD_FARE_UPDATER_JOB) JobDetail job) {
|
||||||
|
String frequencyToRunJob = EVERY_DAY_4H_30M_AM;
|
||||||
|
if (anankeContext.getProfiles().contains(Profiles.TEST)) {
|
||||||
|
frequencyToRunJob = EVERY_DAY_4H_30M_AM;
|
||||||
|
} else if (anankeContext.getProfiles().contains(Profiles.STANDALONE) || anankeContext.getProfiles().contains(Profiles.DEVELOPMENT)) {
|
||||||
|
frequencyToRunJob = EVERY_DAY_4H_30M_AM;
|
||||||
|
} else if (anankeContext.getProfiles().contains(Profiles.PRODUCTION) || anankeContext.getProfiles().contains(Profiles.ACCEPTANCE)) {
|
||||||
|
frequencyToRunJob = EVERY_10_MIN;
|
||||||
|
}
|
||||||
|
return TriggerBuilder.newTrigger().forJob(job)
|
||||||
|
.withIdentity(ERightsBackOfficeBeanNames.TUD_FARE_UPDATER_TRIGGER)
|
||||||
|
.withSchedule(CronScheduleBuilder.cronSchedule(frequencyToRunJob).withMisfireHandlingInstructionFireAndProceed())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Bean(ERightsBackOfficeBeanNames.POSTING_TRAVEL_ALLOWANCE_TRINSITION_JOB)
|
||||||
|
public JobDetail postingTravelAllowanceTransitionJobDetails() {
|
||||||
|
return JobBuilder.newJob(PostingTravelAllowanceTransitionJob.class).withIdentity(ERightsBackOfficeBeanNames.POSTING_TRAVEL_ALLOWANCE_TRINSITION_JOB).storeDurably().build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean(ERightsBackOfficeBeanNames.POSTING_TRAVEL_ALLOWANCE_TRINSITION_TRIGGER)
|
||||||
|
public Trigger postingTravelAllowanceTransitionJobTrigger(@Qualifier(ERightsBackOfficeBeanNames.POSTING_TRAVEL_ALLOWANCE_TRINSITION_JOB) JobDetail job) {
|
||||||
|
String frequencyToRunJob = EVERY_DAY_5H_30M_AM;
|
||||||
|
if (anankeContext.getProfiles().contains(Profiles.PRODUCTION) || anankeContext.getProfiles().contains(Profiles.ACCEPTANCE)) {
|
||||||
|
frequencyToRunJob = EVERY_1_HOURS;
|
||||||
|
}
|
||||||
|
return TriggerBuilder.newTrigger().forJob(job)
|
||||||
|
.withIdentity(ERightsBackOfficeBeanNames.POSTING_TRAVEL_ALLOWANCE_TRINSITION_TRIGGER)
|
||||||
|
.withSchedule(CronScheduleBuilder.cronSchedule(frequencyToRunJob).withMisfireHandlingInstructionFireAndProceed())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Bean(ERightsBackOfficeBeanNames.TRAVEL_ALLOWANCE_CREATION_JOB)
|
||||||
|
public JobDetail travelAllowanceCreationJobDetails() {
|
||||||
|
|
||||||
|
return JobBuilder.newJob(TravelAllowanceCreationJob.class)
|
||||||
|
.withIdentity(ERightsBackOfficeBeanNames.TRAVEL_ALLOWANCE_CREATION_JOB)
|
||||||
|
.storeDurably()
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Bean(ERightsBackOfficeBeanNames.TRAVEL_ALLOWANCE_CREATION_TRIGGER)
|
||||||
|
public Trigger travelAllowanceCreationJobTrigger(@Qualifier(ERightsBackOfficeBeanNames.TRAVEL_ALLOWANCE_CREATION_JOB) JobDetail job) {
|
||||||
|
|
||||||
|
return TriggerBuilder.newTrigger()
|
||||||
|
.forJob(job)
|
||||||
|
.withIdentity(ERightsBackOfficeBeanNames.TRAVEL_ALLOWANCE_CREATION_TRIGGER)
|
||||||
|
.withSchedule(CronScheduleBuilder.cronSchedule(EVERY_DAY_3H_AM)
|
||||||
|
.withMisfireHandlingInstructionFireAndProceed())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Bean(ERightsBackOfficeBeanNames.ACCOMMODATION_BANK_ACCOUNTS_SYNC_JOB)
|
||||||
|
public JobDetail accommodationBankAccountsSyncJobDetails() {
|
||||||
|
|
||||||
|
return JobBuilder.newJob(AccommodationBankAccountsSyncJob.class)
|
||||||
|
.withIdentity(ERightsBackOfficeBeanNames.ACCOMMODATION_BANK_ACCOUNTS_SYNC_JOB)
|
||||||
|
.storeDurably()
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Bean(ERightsBackOfficeBeanNames.ACCOMMODATION_BANK_ACCOUNTS_SYNC_TRIGGER)
|
||||||
|
public Trigger accommodationBankAccountsSyncJobTrigger(@Qualifier(ERightsBackOfficeBeanNames.ACCOMMODATION_BANK_ACCOUNTS_SYNC_JOB) JobDetail job) {
|
||||||
|
String cronExpression = EVERY_10_MIN;
|
||||||
|
int cronjobFrequencyMin =
|
||||||
|
postingAllowancesAppParamsServiceHelper.getAppParameterInteger(AccommodationBankAccountsSyncService.SYNC_DELAY);
|
||||||
|
if (20 == cronjobFrequencyMin) {
|
||||||
|
cronExpression = EVERY_20_MIN;
|
||||||
|
} else if (30 == cronjobFrequencyMin) {
|
||||||
|
cronExpression = EVERY_30_MIN;
|
||||||
|
} else if (60 == cronjobFrequencyMin) {
|
||||||
|
cronExpression = EVERY_1_HOURS;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TriggerBuilder.newTrigger()
|
||||||
|
.forJob(job)
|
||||||
|
.withIdentity(ERightsBackOfficeBeanNames.ACCOMMODATION_BANK_ACCOUNTS_SYNC_TRIGGER)
|
||||||
|
.withSchedule(CronScheduleBuilder.cronSchedule(cronExpression)
|
||||||
|
.withMisfireHandlingInstructionFireAndProceed())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean(ERightsBackOfficeBeanNames.ACCOMMODATION_CREATE_PAYMENT_JOB)
|
||||||
|
public JobDetail accommodationCreatePaymentJobDetails() {
|
||||||
|
|
||||||
|
return JobBuilder.newJob(AccommodationCreatePaymentJob.class)
|
||||||
|
.withIdentity(ERightsBackOfficeBeanNames.ACCOMMODATION_CREATE_PAYMENT_JOB)
|
||||||
|
.storeDurably()
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean(ERightsBackOfficeBeanNames.ACCOMMODATION_CREATE_PAYMENT_TRIGGER)
|
||||||
|
public Trigger accommodationCreatePaymentJobTrigger(@Qualifier(ERightsBackOfficeBeanNames.ACCOMMODATION_CREATE_PAYMENT_JOB) JobDetail job) {
|
||||||
|
|
||||||
|
|
||||||
|
return TriggerBuilder.newTrigger()
|
||||||
|
.forJob(job)
|
||||||
|
.withIdentity(ERightsBackOfficeBeanNames.ACCOMMODATION_CREATE_PAYMENT_TRIGGER)
|
||||||
|
.withSchedule(CronScheduleBuilder.cronSchedule(EVERY_DAY_4H_AM)
|
||||||
|
.withMisfireHandlingInstructionFireAndProceed())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.boot.configuration.p2phub;
|
||||||
|
|
||||||
|
import eu.europa.eeas.erights.backoffice.web.p2phub.auth.P2PHubSslFactory;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.core.io.ResourceLoader;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class P2PHubHttpConfig {
|
||||||
|
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public P2PHubSslFactory p2pHubSslFactory(
|
||||||
|
ResourceLoader resourceLoader,
|
||||||
|
P2pHubRestClientConfiguration props) {
|
||||||
|
return new P2PHubSslFactory(resourceLoader, props);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,77 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.boot.configuration.p2phub;
|
||||||
|
|
||||||
|
|
||||||
|
import eu.europa.eeas.erights.backoffice.boot.configuration.security.AuthorizationHeaderInterceptor;
|
||||||
|
import eu.europa.eeas.erights.web.p2phub.ApiClient;
|
||||||
|
import org.apache.http.conn.ssl.NoopHostnameVerifier;
|
||||||
|
import org.apache.http.impl.client.CloseableHttpClient;
|
||||||
|
import org.apache.http.impl.client.HttpClients;
|
||||||
|
import org.apache.http.ssl.SSLContexts;
|
||||||
|
import org.apache.http.ssl.TrustStrategy;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
|
||||||
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
|
import javax.net.ssl.SSLContext;
|
||||||
|
import java.security.KeyManagementException;
|
||||||
|
import java.security.KeyStoreException;
|
||||||
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
import java.security.cert.X509Certificate;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class P2pHubApiClientConfig {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Insecure HTTP client (trusts all) — only for DEV.
|
||||||
|
* Keep this in a dev-only profile if possible.
|
||||||
|
*/
|
||||||
|
private final P2pHubRestClientConfiguration p2pConfig;
|
||||||
|
private final AuthorizationHeaderInterceptor authInterceptor;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public P2pHubApiClientConfig(P2pHubRestClientConfiguration p2pConfig,
|
||||||
|
AuthorizationHeaderInterceptor authInterceptor) {
|
||||||
|
this.p2pConfig = p2pConfig;
|
||||||
|
this.authInterceptor = authInterceptor;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public ApiClient summaApiClient() {
|
||||||
|
if (p2pConfig.isSecureConnection()) {
|
||||||
|
return createSecureApiClient();
|
||||||
|
} else {
|
||||||
|
return createInsecureApiClient();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private ApiClient createSecureApiClient() {
|
||||||
|
RestTemplate restTemplate = new RestTemplate();
|
||||||
|
restTemplate.getInterceptors().add(authInterceptor);
|
||||||
|
return new ApiClient(restTemplate);
|
||||||
|
}
|
||||||
|
|
||||||
|
private ApiClient createInsecureApiClient() {
|
||||||
|
try {
|
||||||
|
TrustStrategy trustAll = (X509Certificate[] chain, String authType) -> true;
|
||||||
|
SSLContext sslContext = SSLContexts.custom()
|
||||||
|
.loadTrustMaterial(null, trustAll)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
CloseableHttpClient httpClient = HttpClients.custom()
|
||||||
|
.setSSLContext(sslContext)
|
||||||
|
.setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
RestTemplate insecureRestTemplate =
|
||||||
|
new RestTemplate(new HttpComponentsClientHttpRequestFactory(httpClient));
|
||||||
|
insecureRestTemplate.getInterceptors().add(authInterceptor);
|
||||||
|
|
||||||
|
return new ApiClient(insecureRestTemplate);
|
||||||
|
} catch (NoSuchAlgorithmException | KeyManagementException | KeyStoreException e) {
|
||||||
|
throw new IllegalStateException("Failed to create insecure ApiClient", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.boot.configuration.p2phub;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.starter.base.configuration.RootConfiguration;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
@EnableConfigurationProperties(P2pHubBusinessValuesConfiguration.class)
|
||||||
|
@ConfigurationProperties(P2pHubBusinessValuesConfiguration.PREFIX)
|
||||||
|
@Validated
|
||||||
|
@Configuration
|
||||||
|
/*
|
||||||
|
* Class that holds the static values that are pushed to ABAC HUB, subject to rare changes.
|
||||||
|
* */
|
||||||
|
public class P2pHubBusinessValuesConfiguration implements RootConfiguration {
|
||||||
|
|
||||||
|
public static final String PREFIX = "p2p-hub-business-values";
|
||||||
|
|
||||||
|
// @NotNull
|
||||||
|
// private String euloginOidcJwkKid;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,60 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.boot.configuration.p2phub;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.starter.base.configuration.RootConfiguration;
|
||||||
|
import eu.europa.eeas.ananke.core.starter.base.support.EncryptedConfigurationProperty;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Validated
|
||||||
|
@Component
|
||||||
|
@ConfigurationProperties(P2pHubRestClientConfiguration.PREFIX)
|
||||||
|
public class P2pHubRestClientConfiguration implements RootConfiguration {
|
||||||
|
|
||||||
|
public static final String PREFIX = "p2p-hub";
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private EncryptedConfigurationProperty euloginOidcJwkKid;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private EncryptedConfigurationProperty euloginOidcPrivateKey;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private EncryptedConfigurationProperty euloginOidcClientId;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private String euloginOidcTokenEndpoint;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private EncryptedConfigurationProperty restClientId;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private boolean secureConnection = true;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private boolean mtlsEnabled = false;
|
||||||
|
|
||||||
|
|
||||||
|
private String keyStore ;
|
||||||
|
|
||||||
|
|
||||||
|
private String keyStorePassword ;
|
||||||
|
|
||||||
|
|
||||||
|
private String keyStoreType ;
|
||||||
|
|
||||||
|
|
||||||
|
private String keyAlias ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.boot.configuration.security;
|
||||||
|
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.provider.p2p.AuthTokenProviderServiceProvider;
|
||||||
|
import org.springframework.http.HttpHeaders;
|
||||||
|
import org.springframework.http.HttpRequest;
|
||||||
|
import org.springframework.http.client.ClientHttpRequestExecution;
|
||||||
|
import org.springframework.http.client.ClientHttpRequestInterceptor;
|
||||||
|
import org.springframework.http.client.ClientHttpResponse;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds "Authorization: Bearer <token>" to every outgoing request.
|
||||||
|
* Token is fetched per request to avoid stale tokens.
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class AuthorizationHeaderInterceptor implements ClientHttpRequestInterceptor {
|
||||||
|
|
||||||
|
private final AuthTokenProviderServiceProvider authTokenProviderServiceProvider;
|
||||||
|
|
||||||
|
public AuthorizationHeaderInterceptor(AuthTokenProviderServiceProvider authTokenProviderServiceProvider) {
|
||||||
|
this.authTokenProviderServiceProvider = authTokenProviderServiceProvider;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ClientHttpResponse intercept(
|
||||||
|
HttpRequest request, byte[] body, ClientHttpRequestExecution execution
|
||||||
|
) throws IOException {
|
||||||
|
String token = authTokenProviderServiceProvider.getSystemPoPToken();
|
||||||
|
request.getHeaders().set(HttpHeaders.AUTHORIZATION, "Bearer " + token);
|
||||||
|
return execution.execute(request, body);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.boot.configuration.security;
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.servlet.*;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class CoopHeaderFilter implements Filter {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
|
||||||
|
throws IOException, ServletException {
|
||||||
|
HttpServletResponse response = (HttpServletResponse) res;
|
||||||
|
response.setHeader("Cross-Origin-Opener-Policy", "unsafe-none");
|
||||||
|
chain.doFilter(req, res);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.boot.statemachine.configurations;
|
||||||
|
|
||||||
|
import eu.europa.eeas.erights.common.tools.statemachine.AbacItemEvent;
|
||||||
|
import eu.europa.eeas.erights.common.tools.statemachine.AbacItemState;
|
||||||
|
import org.springframework.statemachine.config.EnableStateMachineFactory;
|
||||||
|
import org.springframework.statemachine.config.StateMachineConfigurerAdapter;
|
||||||
|
import org.springframework.statemachine.config.builders.StateMachineStateConfigurer;
|
||||||
|
import org.springframework.statemachine.config.builders.StateMachineTransitionConfigurer;
|
||||||
|
|
||||||
|
import java.util.EnumSet;
|
||||||
|
|
||||||
|
//@Configuration
|
||||||
|
@EnableStateMachineFactory(name = "abacOperationStateMachineFactory")
|
||||||
|
public class AbacItemStateMachineConfiguration extends StateMachineConfigurerAdapter<AbacItemState, AbacItemEvent> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void configure(StateMachineStateConfigurer<AbacItemState, AbacItemEvent> states) throws Exception {
|
||||||
|
states.withStates().initial(AbacItemState.REQUESTED)
|
||||||
|
.states(EnumSet.allOf(AbacItemState.class))
|
||||||
|
.end(AbacItemState.SUCCESS)
|
||||||
|
.end(AbacItemState.FAILED);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void configure(StateMachineTransitionConfigurer<AbacItemState, AbacItemEvent> transitions) throws Exception {
|
||||||
|
transitions.withExternal().source(AbacItemState.REQUESTED).target(AbacItemState.REQUESTED).event(AbacItemEvent.REQUEST)
|
||||||
|
.and()
|
||||||
|
.withExternal().source(AbacItemState.REQUESTED).target(AbacItemState.SUCCESS).event(AbacItemEvent.SUCCESS)
|
||||||
|
.and()
|
||||||
|
.withExternal().source(AbacItemState.REQUESTED).target(AbacItemState.FAILED).event(AbacItemEvent.FAIL);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.boot.statemachine.configurations;
|
||||||
|
|
||||||
|
import eu.europa.eeas.erights.common.tools.statemachine.AbacRequestEvent;
|
||||||
|
import eu.europa.eeas.erights.common.tools.statemachine.AbacRequestState;
|
||||||
|
import org.springframework.statemachine.config.EnableStateMachineFactory;
|
||||||
|
import org.springframework.statemachine.config.StateMachineConfigurerAdapter;
|
||||||
|
import org.springframework.statemachine.config.builders.StateMachineStateConfigurer;
|
||||||
|
import org.springframework.statemachine.config.builders.StateMachineTransitionConfigurer;
|
||||||
|
|
||||||
|
import java.util.EnumSet;
|
||||||
|
|
||||||
|
//@Configuration
|
||||||
|
@EnableStateMachineFactory(name = "abacRequestStateMachineFactory")
|
||||||
|
public class AbacRequestMachineConfiguration extends StateMachineConfigurerAdapter<AbacRequestState, AbacRequestEvent> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void configure(StateMachineStateConfigurer<AbacRequestState, AbacRequestEvent> states) throws Exception {
|
||||||
|
states.withStates().initial(AbacRequestState.INVOICE_REQUESTED)
|
||||||
|
.states(EnumSet.allOf(AbacRequestState.class))
|
||||||
|
.end(AbacRequestState.PAYMENT_ORDER_CREATED)
|
||||||
|
.end(AbacRequestState.MANUAL_PAYMENT)
|
||||||
|
.end(AbacRequestState.FAILED);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void configure(StateMachineTransitionConfigurer<AbacRequestState, AbacRequestEvent> transitions) throws Exception {
|
||||||
|
appendInvoiceTransitions(transitions);
|
||||||
|
appendInvoiceSecondVisaTransitions(transitions);
|
||||||
|
appendPaymentRequestTransitions(transitions);
|
||||||
|
appendPaymentOrderTransitions(transitions);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void appendInvoiceTransitions(StateMachineTransitionConfigurer<AbacRequestState, AbacRequestEvent> transitions) throws Exception {
|
||||||
|
transitions.withExternal().source(AbacRequestState.NEW).target(AbacRequestState.INVOICE_REQUESTED).event(AbacRequestEvent.REQUEST_INVOICE)
|
||||||
|
.and()
|
||||||
|
.withExternal().source(AbacRequestState.INVOICE_REQUESTED).target(AbacRequestState.INVOICE_CREATED).event(AbacRequestEvent.SUCCESS)
|
||||||
|
.and()
|
||||||
|
.withExternal().source(AbacRequestState.INVOICE_REQUESTED).target(AbacRequestState.FAILED).event(AbacRequestEvent.FAIL)
|
||||||
|
.and()
|
||||||
|
.withExternal().source(AbacRequestState.INVOICE_CREATED).target(AbacRequestState.INVOICE_SECOND_VISA_REQUESTED).event(AbacRequestEvent.REQUEST_SECOND_INVOICE_VISA);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void appendInvoiceSecondVisaTransitions(StateMachineTransitionConfigurer<AbacRequestState, AbacRequestEvent> transitions) throws Exception {
|
||||||
|
transitions.withExternal().source(AbacRequestState.INVOICE_SECOND_VISA_REQUESTED).target(AbacRequestState.INVOICE_SECOND_VISA_CREATED).event(AbacRequestEvent.SUCCESS)
|
||||||
|
.and()
|
||||||
|
.withExternal().source(AbacRequestState.INVOICE_SECOND_VISA_REQUESTED).target(AbacRequestState.FAILED).event(AbacRequestEvent.FAIL)
|
||||||
|
.and()
|
||||||
|
.withExternal().source(AbacRequestState.INVOICE_SECOND_VISA_CREATED).target(AbacRequestState.PAYMENT_REQUEST_REQUESTED).event(AbacRequestEvent.REQUEST_PAYMENT_REQUEST);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void appendPaymentRequestTransitions(StateMachineTransitionConfigurer<AbacRequestState, AbacRequestEvent> transitions) throws Exception {
|
||||||
|
transitions.withExternal().source(AbacRequestState.PAYMENT_REQUEST_REQUESTED).target(AbacRequestState.PAYMENT_REQUEST_CREATED).event(AbacRequestEvent.SUCCESS)
|
||||||
|
.and()
|
||||||
|
.withExternal().source(AbacRequestState.PAYMENT_REQUEST_REQUESTED).target(AbacRequestState.FAILED).event(AbacRequestEvent.FAIL)
|
||||||
|
.and()
|
||||||
|
.withExternal().source(AbacRequestState.PAYMENT_REQUEST_CREATED).target(AbacRequestState.PAYMENT_ORDER_REQUESTED).event(AbacRequestEvent.REQUEST_PAYMENT_ORDER);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void appendPaymentOrderTransitions(StateMachineTransitionConfigurer<AbacRequestState, AbacRequestEvent> transitions) throws Exception {
|
||||||
|
transitions.withExternal().source(AbacRequestState.PAYMENT_ORDER_REQUESTED).target(AbacRequestState.PAYMENT_ORDER_CREATED).event(AbacRequestEvent.SUCCESS)
|
||||||
|
.and()
|
||||||
|
.withExternal().source(AbacRequestState.PAYMENT_ORDER_REQUESTED).target(AbacRequestState.FAILED).event(AbacRequestEvent.FAIL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.data.jpa.entity;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Embeddable;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigInteger;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Complex ID because "ID" is not unique in table "MV_BUDGET_LINE_DATA"
|
||||||
|
*
|
||||||
|
* @author idominju
|
||||||
|
*/
|
||||||
|
@Embeddable
|
||||||
|
public class BudgetLineInfoId implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Column(name = "ID")
|
||||||
|
private BigInteger id;
|
||||||
|
|
||||||
|
@Column(name = "FUND_SOURCE")
|
||||||
|
private String fundSource;
|
||||||
|
|
||||||
|
public BigInteger getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(BigInteger id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFundSource() {
|
||||||
|
return fundSource;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFundSource(String fundSource) {
|
||||||
|
this.fundSource = fundSource;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(fundSource, id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
if (this == obj)
|
||||||
|
return true;
|
||||||
|
if (obj == null)
|
||||||
|
return false;
|
||||||
|
if (getClass() != obj.getClass())
|
||||||
|
return false;
|
||||||
|
BudgetLineInfoId other = (BudgetLineInfoId) obj;
|
||||||
|
return Objects.equals(fundSource, other.fundSource) && Objects.equals(id, other.id);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,230 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.data.jpa.entity;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.entity.AbstractJpaEntity;
|
||||||
|
import org.hibernate.annotations.Immutable;
|
||||||
|
import org.hibernate.annotations.Parameter;
|
||||||
|
import org.hibernate.annotations.Type;
|
||||||
|
import org.javamoney.moneta.Money;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author idominju
|
||||||
|
*/
|
||||||
|
@Entity
|
||||||
|
@Immutable
|
||||||
|
@Table(name = BudgetLineInfoJpaEntity.TABLE_NAME)
|
||||||
|
public class BudgetLineInfoJpaEntity extends AbstractJpaEntity<String> {
|
||||||
|
|
||||||
|
public static final String TABLE_NAME = "MV_BUDGET_LINE_DATA";
|
||||||
|
|
||||||
|
public static final String MONEY_AMOUNT = "org.jadira.usertype.moneyandcurrency.moneta.PersistentMoneyAmount";
|
||||||
|
|
||||||
|
public static final String MONETARY_UNIT = "EUR";
|
||||||
|
|
||||||
|
public static final String CURRENCY_CODE_PARAMETER = "currencyCode";
|
||||||
|
|
||||||
|
public static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@Column(name = "BUDGET_LINE_DATA_ID")
|
||||||
|
private String budgetLineInfoId;
|
||||||
|
|
||||||
|
@Column(name = "PARENT_LOCAL_KEY")
|
||||||
|
private String parentLocalKey;
|
||||||
|
|
||||||
|
@Column(name = "BUDGET_LINE")
|
||||||
|
private String budgetLine;
|
||||||
|
|
||||||
|
@Column(name = "MAIN_ACCOUNT")
|
||||||
|
private String mainAccount;
|
||||||
|
|
||||||
|
@Column(name = "BUDGET_POSITION")
|
||||||
|
private String budgetPosition;
|
||||||
|
|
||||||
|
@Column(name = "DELEGATION")
|
||||||
|
private String delegation;
|
||||||
|
|
||||||
|
@Column(name = "LVL_CODE")
|
||||||
|
private String lvlCode;
|
||||||
|
|
||||||
|
@Column(name = "LVL_NAME")
|
||||||
|
private String lvlName;
|
||||||
|
|
||||||
|
@Column(name = "COMMITMENT_ID")
|
||||||
|
private String commitmentId;
|
||||||
|
|
||||||
|
@Column(name = "COMMITMENT_HEADER_ID")
|
||||||
|
private String commitmentHeaderId;
|
||||||
|
|
||||||
|
@Column(name = "EXERCISE_ID")
|
||||||
|
private Integer exerciseId;
|
||||||
|
|
||||||
|
@Column(name = "FUND_SOURCE_GROUP")
|
||||||
|
private String fundSourceGroup;
|
||||||
|
|
||||||
|
@Column(name = "FUND_SOURCE")
|
||||||
|
private String fundSource;
|
||||||
|
|
||||||
|
@Column(name = "PAYMENT_CREDITS_AVAILABLE_EUR")
|
||||||
|
@Type(type = MONEY_AMOUNT, parameters = {@Parameter(name = CURRENCY_CODE_PARAMETER, value = MONETARY_UNIT)})
|
||||||
|
private Money paymentCreditsAvailableEur;
|
||||||
|
|
||||||
|
@Column(name = "RAL")
|
||||||
|
@Type(type = MONEY_AMOUNT, parameters = {@Parameter(name = CURRENCY_CODE_PARAMETER, value = MONETARY_UNIT)})
|
||||||
|
private Money ral;
|
||||||
|
|
||||||
|
@Column(name = "TOTAL_COMMITMENTS_EUR")
|
||||||
|
@Type(type = MONEY_AMOUNT, parameters = {@Parameter(name = CURRENCY_CODE_PARAMETER, value = MONETARY_UNIT)})
|
||||||
|
private Money totalCommitmentsEur;
|
||||||
|
|
||||||
|
@Column(name = "SYNC_COMMITMENTS_DATE")
|
||||||
|
private LocalDateTime syncCommitmentsDate;
|
||||||
|
/**
|
||||||
|
* Methods
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String getId() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBudgetLineInfoId() {
|
||||||
|
return budgetLineInfoId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBudgetLineInfoId(String budgetLineInfoId) {
|
||||||
|
this.budgetLineInfoId = budgetLineInfoId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getParentLocalKey() {
|
||||||
|
return parentLocalKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParentLocalKey(String parentLocalKey) {
|
||||||
|
this.parentLocalKey = parentLocalKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBudgetLine() {
|
||||||
|
return budgetLine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBudgetLine(String budgetLine) {
|
||||||
|
this.budgetLine = budgetLine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMainAccount() {
|
||||||
|
return mainAccount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMainAccount(String mainAccount) {
|
||||||
|
this.mainAccount = mainAccount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBudgetPosition() {
|
||||||
|
return budgetPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBudgetPosition(String budgetPosition) {
|
||||||
|
this.budgetPosition = budgetPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDelegation() {
|
||||||
|
return delegation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDelegation(String delegation) {
|
||||||
|
this.delegation = delegation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLvlCode() {
|
||||||
|
return lvlCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLvlCode(String lvlCode) {
|
||||||
|
this.lvlCode = lvlCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLvlName() {
|
||||||
|
return lvlName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLvlName(String lvlName) {
|
||||||
|
this.lvlName = lvlName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCommitmentId() {
|
||||||
|
return commitmentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCommitmentId(String commitmentId) {
|
||||||
|
this.commitmentId = commitmentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getExerciseId() {
|
||||||
|
return exerciseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExerciseId(Integer exerciseId) {
|
||||||
|
this.exerciseId = exerciseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFundSourceGroup() {
|
||||||
|
return fundSourceGroup;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFundSourceGroup(String fundSourceGroup) {
|
||||||
|
this.fundSourceGroup = fundSourceGroup;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Money getPaymentCreditsAvailableEur() {
|
||||||
|
return paymentCreditsAvailableEur;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPaymentCreditsAvailableEur(Money paymentCreditsAvailableEur) {
|
||||||
|
this.paymentCreditsAvailableEur = paymentCreditsAvailableEur;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Money getRal() {
|
||||||
|
return ral;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRal(Money ral) {
|
||||||
|
this.ral = ral;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Money getTotalCommitmentsEur() {
|
||||||
|
return totalCommitmentsEur;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalCommitmentsEur(Money totalCommitmentsEur) {
|
||||||
|
this.totalCommitmentsEur = totalCommitmentsEur;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFundSource() {
|
||||||
|
return fundSource;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFundSource(String fundSource) {
|
||||||
|
this.fundSource = fundSource;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCommitmentHeaderId() {
|
||||||
|
return commitmentHeaderId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCommitmentHeaderId(String commitmentHeaderId) {
|
||||||
|
this.commitmentHeaderId = commitmentHeaderId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDateTime getSyncCommitmentsDate() {
|
||||||
|
return syncCommitmentsDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSyncCommitmentsDate(LocalDateTime syncCommitmentsDate) {
|
||||||
|
this.syncCommitmentsDate = syncCommitmentsDate;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,93 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.data.jpa.entity;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.entity.AbstractJpaEntity;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import org.hibernate.annotations.Immutable;
|
||||||
|
import org.hibernate.annotations.Type;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author idominju
|
||||||
|
*/
|
||||||
|
@Entity
|
||||||
|
@Immutable
|
||||||
|
@Setter
|
||||||
|
@Getter
|
||||||
|
@Table(name = BudgetLineSubpostJpaEntity.TABLE_NAME)
|
||||||
|
public class BudgetLineSubpostJpaEntity extends AbstractJpaEntity<String> {
|
||||||
|
|
||||||
|
public static final String TABLE_NAME = "BUDGET_LINES_SUBPOSTS_MAPPING";
|
||||||
|
|
||||||
|
public static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@Column(name = "BUDGET_LINES_SUBPOSTS_MAPPING_ID")
|
||||||
|
private Long budgetLinesSubpostsMappingId;
|
||||||
|
|
||||||
|
@Column(name = "BUDGET_LINES")
|
||||||
|
private String budgetLines;
|
||||||
|
|
||||||
|
@Column(name = "BUDGET_POSITION_BUDGDEL")
|
||||||
|
private String budgetPositionBudgdel;
|
||||||
|
|
||||||
|
@Column(name = "BUDGET_POSITION_ERIGHTS")
|
||||||
|
private String budgetPositionErights;
|
||||||
|
|
||||||
|
@Column(name = "FUND_SOURCE")
|
||||||
|
private String fundSource;
|
||||||
|
|
||||||
|
@Column(name = "SUMMA_FUND_SOURCE_ID")
|
||||||
|
private Long summaFundSourceId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Column(name = "REQUEST_TYPE")
|
||||||
|
private String requestType;
|
||||||
|
|
||||||
|
@Column(name = "STATUTORY_LINK")
|
||||||
|
private String statutoryLink;
|
||||||
|
|
||||||
|
@Column(name = "SUBPOST_CODE")
|
||||||
|
private String subpostCode;
|
||||||
|
|
||||||
|
@Column(name = "SUBPOST_DESCRIPTION")
|
||||||
|
private String subpostDescription;
|
||||||
|
|
||||||
|
@Column(name = "PERSONNEL_TYPE_ID")
|
||||||
|
private Integer personnelTypeId;
|
||||||
|
|
||||||
|
@Column(name = "LST_CD")
|
||||||
|
private String lstCd;
|
||||||
|
|
||||||
|
@Column(name = "SUBPOST_TYPE")
|
||||||
|
private String subpostType;
|
||||||
|
|
||||||
|
@Column(name = "MOVEMENT_CONTEXT")
|
||||||
|
private String movementContext;
|
||||||
|
|
||||||
|
@Column(name = "COMMITMENT_LVL_4")
|
||||||
|
private String commitmentLvl4;
|
||||||
|
|
||||||
|
@Column(name = "BUDGET_PERIODS")
|
||||||
|
private String budgetPeriods;
|
||||||
|
|
||||||
|
@Column(name = "EARMARKED_FUND")
|
||||||
|
private String earmarkedFund;
|
||||||
|
|
||||||
|
@Type(type = "yes_no")
|
||||||
|
@Column(name = "DEFAULT_EARMARKED_FUND")
|
||||||
|
private Boolean defaultEarmarkedFund;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getId() {
|
||||||
|
return budgetLinesSubpostsMappingId != null
|
||||||
|
? String.valueOf(budgetLinesSubpostsMappingId)
|
||||||
|
: null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,84 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.data.jpa.entity;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.entity.AbstractJpaEntity;
|
||||||
|
import org.hibernate.annotations.Immutable;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author idominju
|
||||||
|
*/
|
||||||
|
@Entity
|
||||||
|
@Immutable
|
||||||
|
@Table(name = DelegationCodesJpaEntity.TABLE_NAME)
|
||||||
|
public class DelegationCodesJpaEntity extends AbstractJpaEntity<Long> {
|
||||||
|
|
||||||
|
public static final String TABLE_NAME = "V_DELEGATION_CODES";
|
||||||
|
|
||||||
|
public static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@Column(name = "ORG_ID")
|
||||||
|
private Long orgId;
|
||||||
|
|
||||||
|
@Column(name = "ORG_CODE")
|
||||||
|
private String orgCode;
|
||||||
|
|
||||||
|
@Column(name = "APPLICATION_VIEW")
|
||||||
|
private String applicationView;
|
||||||
|
|
||||||
|
@Column(name = "ORG_EXERCISE_ID")
|
||||||
|
private Integer orgExerciseId;
|
||||||
|
|
||||||
|
@Column(name = "NAME")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long getId() {
|
||||||
|
return getOrgId();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getOrgId() {
|
||||||
|
return orgId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrgId(Long orgId) {
|
||||||
|
this.orgId = orgId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOrgCode() {
|
||||||
|
return orgCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrgCode(String orgCode) {
|
||||||
|
this.orgCode = orgCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getApplicationView() {
|
||||||
|
return applicationView;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApplicationView(String applicationView) {
|
||||||
|
this.applicationView = applicationView;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getOrgExerciseId() {
|
||||||
|
return orgExerciseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrgExerciseId(Integer orgExerciseId) {
|
||||||
|
this.orgExerciseId = orgExerciseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.data.jpa.entity;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.entity.AbstractJpaEntity;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import org.hibernate.annotations.Immutable;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author idominju
|
||||||
|
* @author ienaccat
|
||||||
|
*/
|
||||||
|
@Entity
|
||||||
|
@Immutable
|
||||||
|
@Table(name = PersonAbacCriteriaInfoJpaEntity.TABLE_NAME)
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class PersonAbacCriteriaInfoJpaEntity extends AbstractJpaEntity<Long> {
|
||||||
|
|
||||||
|
public static final String TABLE_NAME = "MV_RGH_ANALYTICAL_POSTING_CRITERIA";
|
||||||
|
|
||||||
|
public static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@Column(name = "PER_ID")
|
||||||
|
private Long personId;
|
||||||
|
|
||||||
|
@Column(name = "CRITERIA_TYPE")
|
||||||
|
private String criteriaType;
|
||||||
|
|
||||||
|
@Column(name = "CRITERIA_CODE")
|
||||||
|
private String criteriaCode;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long getId() {
|
||||||
|
return getPersonId();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.data.jpa.entity;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.entity.AbstractJpaEntity;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import org.hibernate.annotations.Immutable;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ienaccat
|
||||||
|
*/
|
||||||
|
@Entity
|
||||||
|
@Immutable
|
||||||
|
@Table(name = PersonAbacNupInfoJpaEntity.TABLE_NAME)
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class PersonAbacNupInfoJpaEntity extends AbstractJpaEntity<Long> {
|
||||||
|
|
||||||
|
public static final String TABLE_NAME = "MV_NUP";
|
||||||
|
|
||||||
|
public static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@Column(name = "PER_ID")
|
||||||
|
private Long personId;
|
||||||
|
|
||||||
|
@Column(name = "NUP")
|
||||||
|
private String nup;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long getId() {
|
||||||
|
return getPersonId();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,313 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.data.jpa.entity;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.audit.provider.data.jpa.entity.AbstractAuditableJpaEntity;
|
||||||
|
import org.hibernate.annotations.Type;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.util.LinkedList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import static javax.persistence.GenerationType.SEQUENCE;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
|
||||||
|
@Table(name = RequestPaymentAbacInfoJpaEntity.TABLE_NAME)
|
||||||
|
public class RequestPaymentAbacInfoJpaEntity extends AbstractAuditableJpaEntity<Long> {
|
||||||
|
|
||||||
|
public static final String TABLE_NAME = "REQUEST_PAYMENT_ABAC_INFO";
|
||||||
|
|
||||||
|
public static final String SEQUENCE_NAME = "SEQ_" + TABLE_NAME;
|
||||||
|
|
||||||
|
public static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@Column(name = "REQUEST_PAYMENT_ABAC_INFO_ID")
|
||||||
|
@GeneratedValue(strategy = SEQUENCE, generator = "SEQ_GENERATOR")
|
||||||
|
@SequenceGenerator(name = "SEQ_GENERATOR", sequenceName = SEQUENCE_NAME, allocationSize = 1)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Column(name = "REQUEST_ID")
|
||||||
|
private Long requestId;
|
||||||
|
|
||||||
|
@Column(name = "ANALYTICAL_CODE")
|
||||||
|
private String analyticalCode;
|
||||||
|
|
||||||
|
@Column(name = "BUDGET_LINE")
|
||||||
|
private String budgetLine;
|
||||||
|
|
||||||
|
@Column(name = "BUDGET_POSITION")
|
||||||
|
private String budgetPosition;
|
||||||
|
|
||||||
|
@Column(name = "COMMITMENT_ID")
|
||||||
|
private String commitmentId;
|
||||||
|
|
||||||
|
@Column(name = "COMMITMENT_HEADER_ID")
|
||||||
|
private String commitmentHeaderId;
|
||||||
|
|
||||||
|
@Column(name = "EXERCISE_ID")
|
||||||
|
private String exerciseId;
|
||||||
|
|
||||||
|
@Column(name = "FUND_SOURCE_GROUP")
|
||||||
|
private String fundSourceGroup;
|
||||||
|
|
||||||
|
@Column(name = "FUND_SOURCE")
|
||||||
|
private String fundSource;
|
||||||
|
|
||||||
|
@Column(name = "DELEGATION")
|
||||||
|
private String delegation;
|
||||||
|
|
||||||
|
@Column(name = "LVL_CODE")
|
||||||
|
private String lvlCode;
|
||||||
|
|
||||||
|
@Column(name = "LVL_NAME")
|
||||||
|
private String lvlName;
|
||||||
|
|
||||||
|
@Column(name = "MAIN_ACCOUNT")
|
||||||
|
private String mainAccount;
|
||||||
|
|
||||||
|
@Column(name = "PARENT_LOCAL_KEY")
|
||||||
|
private String parentLocalKey;
|
||||||
|
|
||||||
|
@Column(name = "PAYMENT_CREDITS_AVAILABLE_EUR")
|
||||||
|
private Double paymentCreditsAvailableEur;
|
||||||
|
|
||||||
|
@Column(name = "RAL")
|
||||||
|
private Double ral;
|
||||||
|
|
||||||
|
@Column(name = "TOTAL_COMMITMENTS_EUR")
|
||||||
|
private Double totalCommitmentsEur;
|
||||||
|
|
||||||
|
@Column(name = "WORKFLOW")
|
||||||
|
private String workflow;
|
||||||
|
|
||||||
|
@Column(name = "LOCAL_DELEGATION_CODE")
|
||||||
|
private String localDelegationCode;
|
||||||
|
|
||||||
|
@OneToMany(mappedBy = "requestPaymentAbacInfo", cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true)
|
||||||
|
private List<RequestSubpostJpaEntity> requestSubpostList = new LinkedList<>();
|
||||||
|
|
||||||
|
@Type(type = "uuid-binary")
|
||||||
|
@Column(name = "ABAC_COMM_ID", length = 16, unique = true)
|
||||||
|
private UUID abacCommunicationId;
|
||||||
|
|
||||||
|
@Column(name = "AGENT_NAME")
|
||||||
|
private String agentName;
|
||||||
|
|
||||||
|
@Column(name = "RESPONSIBLE_ORGANIZATION")
|
||||||
|
private String responsibleOrganization;
|
||||||
|
|
||||||
|
@Column(name = "RESPONSIBLE_ORGANIZATION_TYPE")
|
||||||
|
private String responsibleOrganizationType;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getRequestId() {
|
||||||
|
return requestId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRequestId(Long requestId) {
|
||||||
|
this.requestId = requestId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAnalyticalCode() {
|
||||||
|
return analyticalCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAnalyticalCode(String analyticalCode) {
|
||||||
|
this.analyticalCode = analyticalCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBudgetLine() {
|
||||||
|
return budgetLine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBudgetLine(String budgetLine) {
|
||||||
|
this.budgetLine = budgetLine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBudgetPosition() {
|
||||||
|
return budgetPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBudgetPosition(String budgetPosition) {
|
||||||
|
this.budgetPosition = budgetPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCommitmentId() {
|
||||||
|
return commitmentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCommitmentId(String commitmentId) {
|
||||||
|
this.commitmentId = commitmentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExerciseId() {
|
||||||
|
return exerciseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExerciseId(String exerciseId) {
|
||||||
|
this.exerciseId = exerciseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFundSourceGroup() {
|
||||||
|
return fundSourceGroup;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFundSourceGroup(String fundSourceGroup) {
|
||||||
|
this.fundSourceGroup = fundSourceGroup;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFundSource() {
|
||||||
|
return fundSource;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFundSource(String fundSource) {
|
||||||
|
this.fundSource = fundSource;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDelegation() {
|
||||||
|
return delegation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDelegation(String delegation) {
|
||||||
|
this.delegation = delegation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLvlCode() {
|
||||||
|
return lvlCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLvlCode(String lvlCode) {
|
||||||
|
this.lvlCode = lvlCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLvlName() {
|
||||||
|
return lvlName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLvlName(String lvlName) {
|
||||||
|
this.lvlName = lvlName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMainAccount() {
|
||||||
|
return mainAccount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMainAccount(String mainAccount) {
|
||||||
|
this.mainAccount = mainAccount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getParentLocalKey() {
|
||||||
|
return parentLocalKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParentLocalKey(String parentLocalKey) {
|
||||||
|
this.parentLocalKey = parentLocalKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getPaymentCreditsAvailableEur() {
|
||||||
|
return paymentCreditsAvailableEur;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPaymentCreditsAvailableEur(Double paymentCreditsAvailableEur) {
|
||||||
|
this.paymentCreditsAvailableEur = paymentCreditsAvailableEur;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getRal() {
|
||||||
|
return ral;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRal(Double ral) {
|
||||||
|
this.ral = ral;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getTotalCommitmentsEur() {
|
||||||
|
return totalCommitmentsEur;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalCommitmentsEur(Double totalCommitmentsEur) {
|
||||||
|
this.totalCommitmentsEur = totalCommitmentsEur;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWorkflow() {
|
||||||
|
return workflow;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWorkflow(String workflow) {
|
||||||
|
this.workflow = workflow;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLocalDelegationCode() {
|
||||||
|
return localDelegationCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLocalDelegationCode(String localDelegationCode) {
|
||||||
|
this.localDelegationCode = localDelegationCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<RequestSubpostJpaEntity> getRequestSubpostList() {
|
||||||
|
return requestSubpostList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Please don't delete this and generate again is the mechanism to update the attachment with the latest ones
|
||||||
|
*
|
||||||
|
* @param requestSubpostList list of requestSubposts
|
||||||
|
*/
|
||||||
|
public void setRequestSubpostList(List<RequestSubpostJpaEntity> requestSubpostList) {
|
||||||
|
if (requestSubpostList != null) {
|
||||||
|
this.requestSubpostList.clear();
|
||||||
|
this.requestSubpostList.addAll(requestSubpostList);
|
||||||
|
for (RequestSubpostJpaEntity requestSubpost : this.requestSubpostList)
|
||||||
|
requestSubpost.setRequestPaymentAbacInfo(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public UUID getAbacCommunicationId() {
|
||||||
|
return abacCommunicationId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAbacCommunicationId(UUID abacCommunicationId) {
|
||||||
|
this.abacCommunicationId = abacCommunicationId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAgentName() {
|
||||||
|
return agentName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAgentName(String agentName) {
|
||||||
|
this.agentName = agentName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCommitmentHeaderId() {
|
||||||
|
return commitmentHeaderId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCommitmentHeaderId(String commitmentHeaderId) {
|
||||||
|
this.commitmentHeaderId = commitmentHeaderId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getResponsibleOrganization() {
|
||||||
|
return responsibleOrganization;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setResponsibleOrganization(String responsibleOrganization) {
|
||||||
|
this.responsibleOrganization = responsibleOrganization;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getResponsibleOrganizationType() {
|
||||||
|
return responsibleOrganizationType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setResponsibleOrganizationType(String responsibleOrganizationType) {
|
||||||
|
this.responsibleOrganizationType = responsibleOrganizationType;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,145 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.data.jpa.entity;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.TypeDefinition;
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.entity.AbstractJpaEntity;
|
||||||
|
import org.hibernate.annotations.Columns;
|
||||||
|
import org.hibernate.annotations.Type;
|
||||||
|
import org.javamoney.moneta.Money;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
|
||||||
|
import static javax.persistence.GenerationType.SEQUENCE;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
|
||||||
|
@Table(name = RequestSubpostJpaEntity.TABLE_NAME)
|
||||||
|
public class RequestSubpostJpaEntity extends AbstractJpaEntity<String> {
|
||||||
|
|
||||||
|
public static final String TABLE_NAME = "REQUEST_SUBPOSTS";
|
||||||
|
|
||||||
|
public static final String SEQUENCE_NAME = "SEQ_" + TABLE_NAME;
|
||||||
|
|
||||||
|
public static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@Column(name = "REQUEST_SUBPOSTS_ID")
|
||||||
|
@GeneratedValue(strategy = SEQUENCE, generator = "SEQ_GENERATOR")
|
||||||
|
@SequenceGenerator(name = "SEQ_GENERATOR", sequenceName = SEQUENCE_NAME, allocationSize = 1)
|
||||||
|
private Long requestSubpostsId;
|
||||||
|
|
||||||
|
@Column(name = "BUDGET_LINES_SUBPOSTS_MAPPING_ID")
|
||||||
|
private Long budgetLinesSubpostsMappingId;
|
||||||
|
|
||||||
|
@Column(name = "SUBPOST_CODE")
|
||||||
|
private String subpostCode;
|
||||||
|
|
||||||
|
@Column(name = "SUBPOST_TYPE")
|
||||||
|
private String subpostType;
|
||||||
|
|
||||||
|
@Column(name = "SUBPOST_DESCRIPTION")
|
||||||
|
private String subpostDescription;
|
||||||
|
|
||||||
|
@Columns(columns = {@Column(name = "AMOUNT_CURRENCY"),
|
||||||
|
@Column(name = "AMOUNT")
|
||||||
|
})
|
||||||
|
@Type(type = TypeDefinition.MONEY)
|
||||||
|
private Money amount;
|
||||||
|
|
||||||
|
@Column(name = "REQUEST_ID")
|
||||||
|
private Long requestId;
|
||||||
|
|
||||||
|
@JoinColumn(name = "REQUEST_PAYMENT_ABAC_INFO_ID", nullable = false)
|
||||||
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
|
private RequestPaymentAbacInfoJpaEntity requestPaymentAbacInfo;
|
||||||
|
|
||||||
|
@Column(name = "COMMITMENT_LVL_4")
|
||||||
|
private String commitmentLvl4;
|
||||||
|
|
||||||
|
@Column(name = "EARMARKED_FUND")
|
||||||
|
private String earmarkedFund;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getId() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getRequestSubpostsId() {
|
||||||
|
return requestSubpostsId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRequestSubpostsId(Long requestSubpostsId) {
|
||||||
|
this.requestSubpostsId = requestSubpostsId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getBudgetLinesSubpostsMappingId() {
|
||||||
|
return budgetLinesSubpostsMappingId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBudgetLinesSubpostsMappingId(Long budgetLinesSubpostsMappingId) {
|
||||||
|
this.budgetLinesSubpostsMappingId = budgetLinesSubpostsMappingId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSubpostCode() {
|
||||||
|
return subpostCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubpostCode(String subpostCode) {
|
||||||
|
this.subpostCode = subpostCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSubpostType() {
|
||||||
|
return subpostType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubpostType(String subpostType) {
|
||||||
|
this.subpostType = subpostType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSubpostDescription() {
|
||||||
|
return subpostDescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubpostDescription(String subpostDescription) {
|
||||||
|
this.subpostDescription = subpostDescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Money getAmount() {
|
||||||
|
return amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAmount(Money amount) {
|
||||||
|
this.amount = amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getRequestId() {
|
||||||
|
return requestId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRequestId(Long requestId) {
|
||||||
|
this.requestId = requestId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RequestPaymentAbacInfoJpaEntity getRequestPaymentAbacInfo() {
|
||||||
|
return requestPaymentAbacInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRequestPaymentAbacInfo(RequestPaymentAbacInfoJpaEntity requestPaymentAbacInfo) {
|
||||||
|
this.requestPaymentAbacInfo = requestPaymentAbacInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCommitmentLvl4() {
|
||||||
|
return commitmentLvl4;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCommitmentLvl4(String commitmentLvl4) {
|
||||||
|
this.commitmentLvl4 = commitmentLvl4;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEarmarkedFund() {
|
||||||
|
return earmarkedFund;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEarmarkedFund(String earmarkedFund) {
|
||||||
|
this.earmarkedFund = earmarkedFund;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,79 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.data.jpa.entity;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.entity.AbstractJpaEntity;
|
||||||
|
import eu.europa.eeas.erights.common.tools.statemachine.RequestEvent;
|
||||||
|
import eu.europa.eeas.erights.common.tools.statemachine.RequestState;
|
||||||
|
import org.hibernate.annotations.Type;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reimbursement Claim Entity.
|
||||||
|
*
|
||||||
|
* @author igianpan
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Entity
|
||||||
|
@Table(name = StateMachineCurrentStatesEntity.TABLE_NAME)
|
||||||
|
public class StateMachineCurrentStatesEntity extends AbstractJpaEntity<UUID> {
|
||||||
|
|
||||||
|
public static final String TABLE_NAME = "ANK_SM_CURRENT_STATES";
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@Column(name = "ID", length = 16)
|
||||||
|
@Type(type = "uuid-binary")
|
||||||
|
private UUID id;
|
||||||
|
|
||||||
|
@Column(name = "EVENT")
|
||||||
|
@Enumerated(EnumType.STRING)
|
||||||
|
private RequestEvent event;
|
||||||
|
|
||||||
|
@Column(name = "ARRIVAL_STATE")
|
||||||
|
@Enumerated(EnumType.STRING)
|
||||||
|
private RequestState arrivalState;
|
||||||
|
|
||||||
|
@Column(name = "SAVED_BY")
|
||||||
|
private Long savedByUserId;
|
||||||
|
|
||||||
|
@Column(name = "SAVED_AT")
|
||||||
|
private LocalDateTime savedAt;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UUID getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(UUID id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RequestEvent getEvent() {
|
||||||
|
return event;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEvent(
|
||||||
|
RequestEvent event) {
|
||||||
|
this.event = event;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getSavedByUserId() {
|
||||||
|
return savedByUserId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSavedByUserId(Long savedByUserId) {
|
||||||
|
this.savedByUserId = savedByUserId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDateTime getSavedAt() {
|
||||||
|
return savedAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSavedAt(LocalDateTime savedAt) {
|
||||||
|
this.savedAt = savedAt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,76 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.data.jpa.entity;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.entity.AbstractJpaEntity;
|
||||||
|
import eu.europa.eeas.erights.common.tools.statemachine.RequestEvent;
|
||||||
|
import org.hibernate.annotations.Type;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import static javax.persistence.GenerationType.SEQUENCE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reimbursement Claim Entity.
|
||||||
|
*
|
||||||
|
* @author itadephe
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Entity
|
||||||
|
@Table(name = StateMachinePreviousStatesEntity.TABLE_NAME)
|
||||||
|
public class StateMachinePreviousStatesEntity extends AbstractJpaEntity<Long> {
|
||||||
|
|
||||||
|
public static final String TABLE_NAME = "ANK_SM_PREVIOUS_STATES";
|
||||||
|
public static final String SEQUENCE_NAME = "SEQ_" + TABLE_NAME;
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@SequenceGenerator(name = "SEQ_GENERATOR", sequenceName = SEQUENCE_NAME, allocationSize = 1)
|
||||||
|
@GeneratedValue(strategy = SEQUENCE, generator = "SEQ_GENERATOR")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Column(name = "CURRENT_STATE_ID", length = 16)
|
||||||
|
@Type(type = "uuid-binary")
|
||||||
|
private UUID smId;
|
||||||
|
|
||||||
|
@Column(name = "EVENT")
|
||||||
|
@Enumerated(EnumType.STRING)
|
||||||
|
private RequestEvent event;
|
||||||
|
|
||||||
|
@Column(name = "SAVED_BY")
|
||||||
|
private Long savedByUserId;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UUID getSmId() {
|
||||||
|
return smId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSmId(UUID smId) {
|
||||||
|
this.smId = smId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RequestEvent getEvent() {
|
||||||
|
return event;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEvent(
|
||||||
|
RequestEvent event) {
|
||||||
|
this.event = event;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getSavedByUserId() {
|
||||||
|
return savedByUserId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSavedByUserId(Long savedByUserId) {
|
||||||
|
this.savedByUserId = savedByUserId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,52 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.data.jpa.entity;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.entity.AbstractJpaEntity;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = SummaFundSourceJpaEntity.TABLE_NAME)
|
||||||
|
public class SummaFundSourceJpaEntity extends AbstractJpaEntity<Long> {
|
||||||
|
public static final String TABLE_NAME = "SUMMA_FUND_SOURCE";
|
||||||
|
public static final String SEQUENCE_NAME = "SEQ_" + TABLE_NAME;
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_GENERATOR")
|
||||||
|
@SequenceGenerator(name = "SEQ_GENERATOR", sequenceName = SEQUENCE_NAME, allocationSize = 1)
|
||||||
|
@Column(name = "ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Column(name = "ABAC_CODE")
|
||||||
|
private String abacCode;
|
||||||
|
|
||||||
|
@Column(name = "SUMMA_CODE")
|
||||||
|
private String summaCode;
|
||||||
|
|
||||||
|
@Column(name = "DESCRIPTION")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@Column(name = "BUDGET_REGIME")
|
||||||
|
private String budgetRegime;
|
||||||
|
|
||||||
|
// Getters only (since @Immutable)
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAbacCode() {
|
||||||
|
return abacCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSummaCode() {
|
||||||
|
return summaCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBudgetRegime() {
|
||||||
|
return budgetRegime;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.data.jpa.entity;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.entity.AbstractJpaEntity;
|
||||||
|
import org.hibernate.annotations.Immutable;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Immutable
|
||||||
|
@Table(name = VBudgetLineJpaEntity.TABLE_NAME)
|
||||||
|
public class VBudgetLineJpaEntity extends AbstractJpaEntity<String> {
|
||||||
|
|
||||||
|
public static final String TABLE_NAME = "V_BUDGET_LINES";
|
||||||
|
|
||||||
|
public static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@Column(name = "BUDGET_LINE")
|
||||||
|
private String budgetLine;
|
||||||
|
|
||||||
|
//JOB_ID
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getId() {
|
||||||
|
return this.budgetLine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String budgetLine) {
|
||||||
|
this.budgetLine = budgetLine;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.data.jpa.entity.p2phub;
|
||||||
|
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.audit.provider.data.jpa.entity.AbstractAuditableJpaEntity;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import org.hibernate.envers.Audited;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
|
||||||
|
@Audited
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Entity
|
||||||
|
@Table(name = AllowanceDetailJpaEntity.TABLE_NAME)
|
||||||
|
public class AllowanceDetailJpaEntity extends AbstractAuditableJpaEntity<Long> {
|
||||||
|
|
||||||
|
public static final String TABLE_NAME = "DETAILS_ALLOWANCE_PAYMENT";
|
||||||
|
public static final String SEQUENCE_NAME = "SEQ_" + TABLE_NAME;
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_GENERATOR")
|
||||||
|
@SequenceGenerator(name = "SEQ_GENERATOR", sequenceName = SEQUENCE_NAME, allocationSize = 1)
|
||||||
|
@Column(name = "ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Column(name = "REQUEST_DET_ID")
|
||||||
|
private String requestDetId;
|
||||||
|
|
||||||
|
@Column(name = "BP_ID")
|
||||||
|
private String bpId;
|
||||||
|
|
||||||
|
@Column(name = "BANK_ACCOUNT")
|
||||||
|
private String bankAccount;
|
||||||
|
|
||||||
|
@Column(name = "REQUEST_HED_TITLE")
|
||||||
|
private String requestHedTitle;
|
||||||
|
|
||||||
|
@Column(name = "QUANTITY")
|
||||||
|
private String quantity;
|
||||||
|
|
||||||
|
@Column(name = "NET_AMOUNT_LCY")
|
||||||
|
private Float netAmountLcy;
|
||||||
|
|
||||||
|
@Column(name = "CURRENCY_CD_HED")
|
||||||
|
private String currencyCdHed;
|
||||||
|
|
||||||
|
@Column(name = "BUDGET_LINE_HED")
|
||||||
|
private String budgetLineHed;
|
||||||
|
|
||||||
|
@Column(name = "GL_ACCOUNT_HED")
|
||||||
|
private String glAccountHed;
|
||||||
|
|
||||||
|
@Column(name = "EMAIL_NOTIF")
|
||||||
|
private String emailNotif;
|
||||||
|
|
||||||
|
@ManyToOne(optional = false, fetch = FetchType.LAZY)
|
||||||
|
@JoinColumn(name = "ALLOWANCE_PAYMENT_ID", nullable = false,
|
||||||
|
foreignKey = @ForeignKey(name = "FK_DAP_AP"))
|
||||||
|
private AllowancePaymentJpaEntity allowancePayment;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,45 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.data.jpa.entity;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.audit.provider.data.jpa.entity.AbstractAuditableJpaEntity;
|
||||||
|
|
||||||
|
import eu.europa.eeas.erights.backoffice.tools.p2phub.PayMethodEnum;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import org.hibernate.envers.Audited;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
|
||||||
|
@Audited
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Entity
|
||||||
|
@Table(name = AllowanceHeaderJpaEntity.TABLE_NAME)
|
||||||
|
public class AllowanceHeaderJpaEntity extends AbstractAuditableJpaEntity<Long> {
|
||||||
|
|
||||||
|
public static final String TABLE_NAME = "HEADER_ALLOWANCE_PAYMENT";
|
||||||
|
public static final String SEQUENCE_NAME = "SEQ_" + TABLE_NAME;
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_GENERATOR")
|
||||||
|
@SequenceGenerator(name = "SEQ_GENERATOR", sequenceName = SEQUENCE_NAME, allocationSize = 1)
|
||||||
|
@Column(name = "ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Column(name = "RUN_ID")
|
||||||
|
private String runId;
|
||||||
|
|
||||||
|
@Column(name = "BATCH_ID")
|
||||||
|
private String batchId;
|
||||||
|
|
||||||
|
@Column(name = "HR_REQUEST_ID")
|
||||||
|
private String hrRequestId;
|
||||||
|
|
||||||
|
@Enumerated(EnumType.STRING)
|
||||||
|
@Column(name = "PAY_METHOD")
|
||||||
|
private PayMethodEnum payMethodEnum;
|
||||||
|
|
||||||
|
@Column(name = "VALUE")
|
||||||
|
private String value;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,69 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.data.jpa.entity.p2phub;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.audit.provider.data.jpa.entity.AbstractAuditableJpaEntity;
|
||||||
|
import eu.europa.eeas.erights.backoffice.data.jpa.entity.AllowanceHeaderJpaEntity;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import org.hibernate.envers.Audited;
|
||||||
|
import org.hibernate.envers.NotAudited;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Audited
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Entity
|
||||||
|
@Table(name = AllowancePaymentJpaEntity.TABLE_NAME)
|
||||||
|
public class AllowancePaymentJpaEntity extends AbstractAuditableJpaEntity<Long> {
|
||||||
|
|
||||||
|
public static final String TABLE_NAME = "ALLOWANCE_PAYMENT";
|
||||||
|
public static final String SEQUENCE_NAME = "SEQ_" + TABLE_NAME;
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_GENERATOR")
|
||||||
|
@SequenceGenerator(name = "SEQ_GENERATOR", sequenceName = SEQUENCE_NAME, allocationSize = 1)
|
||||||
|
@Column(name = "ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Column(name = "REQUEST_ID")
|
||||||
|
private Long requestId;
|
||||||
|
|
||||||
|
@Column(name = "PER_ID")
|
||||||
|
private Long perId;
|
||||||
|
|
||||||
|
@NotAudited
|
||||||
|
@OneToMany(mappedBy = "allowancePayment", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY)
|
||||||
|
private List<OrderResponseJpaEntity> orderResponses = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
|
@OneToOne(optional = false, fetch = FetchType.LAZY)
|
||||||
|
@JoinColumn(name = "HEADER_ID", nullable = false,
|
||||||
|
foreignKey = @ForeignKey(name = "FK_AP_HEADER"))
|
||||||
|
private AllowanceHeaderJpaEntity header;
|
||||||
|
|
||||||
|
@OneToMany(mappedBy = "allowancePayment", cascade = CascadeType.ALL, orphanRemoval = true)
|
||||||
|
private List<AllowanceDetailJpaEntity> details = new ArrayList<>();
|
||||||
|
|
||||||
|
// Helper methods
|
||||||
|
public void addDetail(AllowanceDetailJpaEntity detail) {
|
||||||
|
details.add(detail);
|
||||||
|
detail.setAllowancePayment(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeDetail(AllowanceDetailJpaEntity detail) {
|
||||||
|
details.remove(detail);
|
||||||
|
detail.setAllowancePayment(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addOrderResponse(OrderResponseJpaEntity orderResponse) {
|
||||||
|
orderResponses.add(orderResponse);
|
||||||
|
orderResponse.setAllowancePayment(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeOrderResponse(OrderResponseJpaEntity orderResponse) {
|
||||||
|
orderResponses.remove(orderResponse);
|
||||||
|
orderResponse.setAllowancePayment(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,52 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.data.jpa.entity.p2phub;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.audit.provider.data.jpa.entity.AbstractAuditableJpaEntity;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import org.hibernate.envers.Audited;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Entity
|
||||||
|
@Table(name = OrderErrorResponseJpaEntity.TABLE_NAME)
|
||||||
|
public class OrderErrorResponseJpaEntity extends AbstractAuditableJpaEntity<Long> {
|
||||||
|
|
||||||
|
|
||||||
|
public static final String TABLE_NAME = "ORDER_ERROR_RESPONSE";
|
||||||
|
public static final String SEQUENCE_NAME = "SEQ_" + TABLE_NAME;
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_GENERATOR")
|
||||||
|
@SequenceGenerator(name = "SEQ_GENERATOR", sequenceName = SEQUENCE_NAME, allocationSize = 1)
|
||||||
|
@Column(name = "ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Column(name = "ORDER_ID")
|
||||||
|
private Integer orderId;
|
||||||
|
|
||||||
|
@Column(name = "MESSAGE")
|
||||||
|
private String message;
|
||||||
|
|
||||||
|
@Column(name = "REQUEST_ID")
|
||||||
|
private Long requestId;
|
||||||
|
|
||||||
|
@Column(name = "PER_ID")
|
||||||
|
private Long perId;
|
||||||
|
|
||||||
|
@Column(name = "ERROR_CODE")
|
||||||
|
private String errorCode;
|
||||||
|
|
||||||
|
@Column(name = "ERROR_TEXT")
|
||||||
|
private String errorText;
|
||||||
|
|
||||||
|
@Column(name = "JSON_SENT")
|
||||||
|
private String jsonSent;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.data.jpa.entity.p2phub;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.audit.provider.data.jpa.entity.AbstractAuditableJpaEntity;
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.entity.AbstractJpaEntity;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import org.hibernate.envers.AuditOverride;
|
||||||
|
import org.hibernate.envers.Audited;
|
||||||
|
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Entity
|
||||||
|
@Table(name = OrderResponseJpaEntity.TABLE_NAME)
|
||||||
|
public class OrderResponseJpaEntity extends AbstractAuditableJpaEntity<Long> {
|
||||||
|
|
||||||
|
|
||||||
|
public static final String TABLE_NAME = "ORDER_RESPONSE";
|
||||||
|
public static final String SEQUENCE_NAME = "SEQ_" + TABLE_NAME;
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_GENERATOR")
|
||||||
|
@SequenceGenerator(name = "SEQ_GENERATOR", sequenceName = SEQUENCE_NAME, allocationSize = 1)
|
||||||
|
@Column(name = "ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Column(name = "ORDER_ID")
|
||||||
|
private Integer orderId;
|
||||||
|
|
||||||
|
@Column(name = "MESSAGE")
|
||||||
|
private String message;
|
||||||
|
|
||||||
|
@Column(name = "REQUEST_ID")
|
||||||
|
private Long requestId;
|
||||||
|
|
||||||
|
@Column(name = "PER_ID")
|
||||||
|
private Long perId;
|
||||||
|
|
||||||
|
@Column(name = "ORDER_STATUS")
|
||||||
|
private String orderStatus;
|
||||||
|
|
||||||
|
@Column(name = "ORDER_COMMENT")
|
||||||
|
private String orderComment;
|
||||||
|
|
||||||
|
@Column(name = "LAST_MODIFICATION_DATE") // DATE
|
||||||
|
private LocalDateTime lastModificationDate;
|
||||||
|
|
||||||
|
@Column(name = "PAYMENT_DIRECTIVE_REFERENCE")
|
||||||
|
private String paymentDirectiveReference;
|
||||||
|
|
||||||
|
@Column(name = "JSON_SENT")
|
||||||
|
private String jsonSent;
|
||||||
|
|
||||||
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
|
@JoinColumn(name = "ALLOWANCE_PAYMENT_ID", nullable = false,
|
||||||
|
foreignKey = @ForeignKey(name = "FK_ORDER_RESPONSE_ALLOWANCE_PAYMENT"))
|
||||||
|
private AllowancePaymentJpaEntity allowancePayment;
|
||||||
|
|
||||||
|
|
||||||
|
// One OrderResponse can have many statuses
|
||||||
|
@OneToMany(mappedBy = "orderResponse", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY)
|
||||||
|
private List<OrderStatusResponseJpaEntity> orderStatuses = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,50 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.data.jpa.entity.p2phub;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.entity.AbstractJpaEntity;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Entity
|
||||||
|
@Table(name = OrderStatusResponseJpaEntity.TABLE_NAME)
|
||||||
|
public class OrderStatusResponseJpaEntity extends AbstractJpaEntity<Long> {
|
||||||
|
|
||||||
|
public static final String TABLE_NAME = "ORDER_STATUS_RESPONSE";
|
||||||
|
public static final String SEQUENCE_NAME = "SEQ_" + TABLE_NAME;
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_GENERATOR")
|
||||||
|
@SequenceGenerator(name = "SEQ_GENERATOR", sequenceName = SEQUENCE_NAME, allocationSize = 1)
|
||||||
|
@Column(name = "ID", nullable = false)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Column(name = "ORDER_ID")
|
||||||
|
private Integer orderId;
|
||||||
|
|
||||||
|
@Column(name = "ORDER_STATUS")
|
||||||
|
private String orderStatus;
|
||||||
|
|
||||||
|
@Column(name = "LAST_MODIFICATION_DATE")
|
||||||
|
private LocalDateTime lastModificationDate;
|
||||||
|
|
||||||
|
@Column(name = "ORDER_COMMENT")
|
||||||
|
private String orderComment;
|
||||||
|
|
||||||
|
@Column(name = "PAYMENT_DIRECTIVE_REFERENCE")
|
||||||
|
private String paymentDirectiveReference;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Many statuses belong to one order response
|
||||||
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
|
@JoinColumn(name = "ORDER_RESPONSE_ID", referencedColumnName = "ID",
|
||||||
|
foreignKey = @ForeignKey(name = "FK_STATUS_ORDER_RESPONSE"))
|
||||||
|
private OrderResponseJpaEntity orderResponse;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.data.jpa.repository;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.repository.EntityReaderJpaRepository;
|
||||||
|
import eu.europa.eeas.erights.backoffice.data.jpa.entity.BudgetLineInfoJpaEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author idominju
|
||||||
|
*/
|
||||||
|
public interface BudgetLineInfoJpaRepository extends EntityReaderJpaRepository<BudgetLineInfoJpaEntity, String> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
default Class<BudgetLineInfoJpaEntity> getEntityType() {
|
||||||
|
return BudgetLineInfoJpaEntity.class;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.data.jpa.repository;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.repository.EntityReaderJpaRepository;
|
||||||
|
import eu.europa.eeas.erights.backoffice.data.jpa.entity.BudgetLineSubpostJpaEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author idominju
|
||||||
|
*/
|
||||||
|
public interface BudgetLineSubpostJpaRepository extends EntityReaderJpaRepository<BudgetLineSubpostJpaEntity, String> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
default Class<BudgetLineSubpostJpaEntity> getEntityType() {
|
||||||
|
return BudgetLineSubpostJpaEntity.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<BudgetLineSubpostJpaEntity> findAllByMovementContextContains(String content);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.data.jpa.repository;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.repository.EntityReaderJpaRepository;
|
||||||
|
import eu.europa.eeas.erights.backoffice.data.jpa.entity.DelegationCodesJpaEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author idominju
|
||||||
|
*/
|
||||||
|
public interface DelegationCodesJpaRepository extends EntityReaderJpaRepository<DelegationCodesJpaEntity, Long> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
default Class<DelegationCodesJpaEntity> getEntityType() {
|
||||||
|
return DelegationCodesJpaEntity.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<DelegationCodesJpaEntity> findByOrgExerciseIdOrderByOrgCodeAsc(Integer orgExerciseId);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.data.jpa.repository;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.repository.EntityReaderJpaRepository;
|
||||||
|
import eu.europa.eeas.erights.backoffice.data.jpa.entity.PersonAbacCriteriaInfoJpaEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author idominju
|
||||||
|
* @author ienaccat
|
||||||
|
*/
|
||||||
|
public interface PersonAbacCriteriaInfoJpaRepository extends EntityReaderJpaRepository<PersonAbacCriteriaInfoJpaEntity, Long> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
default Class<PersonAbacCriteriaInfoJpaEntity> getEntityType() {
|
||||||
|
return PersonAbacCriteriaInfoJpaEntity.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<PersonAbacCriteriaInfoJpaEntity> findByPersonIdAndCriteriaType(Long personId, String criteriaType);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.data.jpa.repository;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.repository.EntityReaderJpaRepository;
|
||||||
|
import eu.europa.eeas.erights.backoffice.data.jpa.entity.PersonAbacNupInfoJpaEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ienaccat
|
||||||
|
*/
|
||||||
|
public interface PersonAbacNupInfoJpaRepository extends EntityReaderJpaRepository<PersonAbacNupInfoJpaEntity, Long> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
default Class<PersonAbacNupInfoJpaEntity> getEntityType() {
|
||||||
|
return PersonAbacNupInfoJpaEntity.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
PersonAbacNupInfoJpaEntity findByPersonId(Long personId);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.data.jpa.repository;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.repository.EntityReaderJpaRepository;
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.repository.EntitySaverJpaRepository;
|
||||||
|
import eu.europa.eeas.erights.backoffice.data.jpa.entity.RequestPaymentAbacInfoJpaEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author idominju
|
||||||
|
*/
|
||||||
|
public interface RequestPaymentAbacInfoJpaRepository extends EntityReaderJpaRepository<RequestPaymentAbacInfoJpaEntity, Long>,
|
||||||
|
EntitySaverJpaRepository<RequestPaymentAbacInfoJpaEntity, Long> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
default Class<RequestPaymentAbacInfoJpaEntity> getEntityType() {
|
||||||
|
return RequestPaymentAbacInfoJpaEntity.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
RequestPaymentAbacInfoJpaEntity findByRequestId(Long requestId);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.data.jpa.repository;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.repository.EntityReaderJpaRepository;
|
||||||
|
import eu.europa.eeas.erights.backoffice.data.jpa.entity.RequestSubpostJpaEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author idominju
|
||||||
|
*/
|
||||||
|
public interface RequestSubpostJpaRepository extends EntityReaderJpaRepository<RequestSubpostJpaEntity, String> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
default Class<RequestSubpostJpaEntity> getEntityType() {
|
||||||
|
return RequestSubpostJpaEntity.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<RequestSubpostJpaEntity> findByRequestId(Long requestId);
|
||||||
|
|
||||||
|
List<RequestSubpostJpaEntity> findByRequestPaymentAbacInfo(Long requestPaymentAbacInfoId);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.data.jpa.repository;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.repository.EntityReaderJpaRepository;
|
||||||
|
import eu.europa.eeas.erights.backoffice.data.jpa.entity.StateMachineCurrentStatesEntity;
|
||||||
|
import eu.europa.eeas.erights.common.tools.statemachine.RequestEvent;
|
||||||
|
import eu.europa.eeas.erights.common.tools.statemachine.RequestState;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
public interface StateMachineCurrentStateJpaRepository extends EntityReaderJpaRepository<StateMachineCurrentStatesEntity, UUID> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public default Class<StateMachineCurrentStatesEntity> getEntityType() {
|
||||||
|
return StateMachineCurrentStatesEntity.class;
|
||||||
|
}
|
||||||
|
public StateMachineCurrentStatesEntity findFirstByIdAndEventOrderById(UUID id , RequestEvent event);
|
||||||
|
public StateMachineCurrentStatesEntity findFirstByIdAndArrivalStateOrderById(UUID id , RequestState state);
|
||||||
|
|
||||||
|
public List<StateMachineCurrentStatesEntity> findAll();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.data.jpa.repository;
|
||||||
|
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.repository.EntityReaderJpaRepository;
|
||||||
|
import eu.europa.eeas.erights.backoffice.data.jpa.entity.StateMachinePreviousStatesEntity;
|
||||||
|
import eu.europa.eeas.erights.common.tools.statemachine.RequestEvent;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
public interface StateMachinePreviousStateJpaRepository extends EntityReaderJpaRepository<StateMachinePreviousStatesEntity, Long> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public default Class<StateMachinePreviousStatesEntity> getEntityType() {
|
||||||
|
return StateMachinePreviousStatesEntity.class;
|
||||||
|
}
|
||||||
|
public StateMachinePreviousStatesEntity findFirstBySmIdAndEventOrderById(UUID smId , RequestEvent event);
|
||||||
|
|
||||||
|
public List<StateMachinePreviousStatesEntity> findAll();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.data.jpa.repository;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.repository.EntityReaderJpaRepository;
|
||||||
|
import eu.europa.eeas.erights.backoffice.data.jpa.entity.SummaFundSourceJpaEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Repository for SUMMA fund source reference data.
|
||||||
|
*/
|
||||||
|
public interface SummaFundSourceJpaRepository extends EntityReaderJpaRepository<SummaFundSourceJpaEntity, Long> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
default Class<SummaFundSourceJpaEntity> getEntityType() {
|
||||||
|
return SummaFundSourceJpaEntity.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
List<SummaFundSourceJpaEntity> findAll();
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.data.jpa.repository;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.repository.EntityReaderJpaRepository;
|
||||||
|
import eu.europa.eeas.erights.backoffice.data.jpa.entity.VBudgetLineJpaEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by ipatelav on 10/12/2019; e-rights.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* {@link VBudgetLineJpaRepository} jpa repository.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:Lavinia.PATE@ext.eeas.europa.eu">Lavinia Pate</a>.
|
||||||
|
* @see VBudgetLineJpaRepository
|
||||||
|
*/
|
||||||
|
public interface VBudgetLineJpaRepository extends EntityReaderJpaRepository<VBudgetLineJpaEntity, String> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
default Class<VBudgetLineJpaEntity> getEntityType() {
|
||||||
|
return VBudgetLineJpaEntity.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.data.jpa.repository.p2pbhub;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.repository.EntityDeleterJpaRepository;
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.repository.EntityReaderJpaRepository;
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.repository.EntitySaverJpaRepository;
|
||||||
|
import eu.europa.eeas.ananke.core.service.provider.data.entity.EntityCreator;
|
||||||
|
import eu.europa.eeas.erights.backoffice.data.jpa.entity.p2phub.AllowancePaymentJpaEntity;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.model.p2phub.AllowancePaymentModel;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface AllowancePaymentJpaRepository extends EntityReaderJpaRepository<AllowancePaymentJpaEntity, Long>,
|
||||||
|
EntitySaverJpaRepository<AllowancePaymentJpaEntity, Long>, EntityDeleterJpaRepository<AllowancePaymentJpaEntity, Long>{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
default Class<AllowancePaymentJpaEntity> getEntityType() {
|
||||||
|
return AllowancePaymentJpaEntity.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
List<AllowancePaymentJpaEntity> findAllByPerId(Long perId);
|
||||||
|
|
||||||
|
List<AllowancePaymentJpaEntity> findAllByRequestId(Long requestId);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.data.jpa.repository.p2pbhub;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.repository.EntityDeleterJpaRepository;
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.repository.EntityReaderJpaRepository;
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.repository.EntitySaverJpaRepository;
|
||||||
|
import eu.europa.eeas.erights.backoffice.data.jpa.entity.p2phub.OrderErrorResponseJpaEntity;
|
||||||
|
import eu.europa.eeas.erights.backoffice.data.jpa.entity.p2phub.OrderResponseJpaEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface OrderErrorResponseJpaRepository extends EntityReaderJpaRepository<OrderErrorResponseJpaEntity, Long>,
|
||||||
|
EntitySaverJpaRepository<OrderErrorResponseJpaEntity, Long>, EntityDeleterJpaRepository<OrderErrorResponseJpaEntity, Long>{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
default Class<OrderErrorResponseJpaEntity> getEntityType() {
|
||||||
|
return OrderErrorResponseJpaEntity.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<OrderErrorResponseJpaEntity> findAllByRequestId(Long requestId);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.data.jpa.repository.p2pbhub;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.repository.EntityDeleterJpaRepository;
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.repository.EntityReaderJpaRepository;
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.repository.EntitySaverJpaRepository;
|
||||||
|
import eu.europa.eeas.ananke.core.service.provider.data.entity.EntityCreator;
|
||||||
|
import eu.europa.eeas.erights.backoffice.data.jpa.entity.p2phub.OrderResponseJpaEntity;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.model.p2phub.OrderResponseModel;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface OrderResponseJpaRepository extends EntityReaderJpaRepository<OrderResponseJpaEntity, Long>,
|
||||||
|
EntitySaverJpaRepository<OrderResponseJpaEntity, Long>, EntityDeleterJpaRepository<OrderResponseJpaEntity, Long>{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
default Class<OrderResponseJpaEntity> getEntityType() {
|
||||||
|
return OrderResponseJpaEntity.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<OrderResponseJpaEntity> findAllByRequestId(Long requestId);
|
||||||
|
|
||||||
|
public OrderResponseJpaEntity findByOrderId(Integer orderId);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.data.jpa.repository.p2pbhub;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.repository.EntityDeleterJpaRepository;
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.repository.EntityReaderJpaRepository;
|
||||||
|
import eu.europa.eeas.ananke.core.data.provider.jpa.repository.EntitySaverJpaRepository;
|
||||||
|
import eu.europa.eeas.erights.backoffice.data.jpa.entity.p2phub.OrderStatusResponseJpaEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface OrderStatusResponseJpaRepository extends EntityReaderJpaRepository<OrderStatusResponseJpaEntity, Long>,
|
||||||
|
EntitySaverJpaRepository<OrderStatusResponseJpaEntity, Long>, EntityDeleterJpaRepository<OrderStatusResponseJpaEntity, Long>{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
default Class<OrderStatusResponseJpaEntity> getEntityType() {
|
||||||
|
return OrderStatusResponseJpaEntity.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<OrderStatusResponseJpaEntity> findAllByOrderId(Long orderId);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.exceptionhandling;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.base.exception.ExceptionCode;
|
||||||
|
|
||||||
|
public enum ERightsBackOfficeExceptionCode implements ExceptionCode {
|
||||||
|
|
||||||
|
ERBO001("Job not found"),
|
||||||
|
ERBO002("Error during sending reminder emails for movement files in PENDING state"),
|
||||||
|
ERBO003("Error during updating the movement files to ONGOING state"),
|
||||||
|
ERBO004("Error during updating the email notifications sent date and status"),
|
||||||
|
ERBO005("Error during updating the MF email notifications sent date and status"),
|
||||||
|
ERBO006("Error during updating the Request email notifications sent date and status"),
|
||||||
|
ERBO007("There is no expense amounting to more than 0 in the claim");
|
||||||
|
|
||||||
|
private final String description;
|
||||||
|
|
||||||
|
ERightsBackOfficeExceptionCode(String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getCode() {
|
||||||
|
return name();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDescription() {
|
||||||
|
return this.description;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.listeners.events;
|
||||||
|
|
||||||
|
import eu.europa.eeas.erights.common.tools.statemachine.AbacRequestEvent;
|
||||||
|
import org.springframework.context.ApplicationEvent;
|
||||||
|
|
||||||
|
public class AbacRequestApplicationEvent extends ApplicationEvent {
|
||||||
|
|
||||||
|
private final AbacRequestEvent abacRequestEvent;
|
||||||
|
|
||||||
|
private final Long requestId;
|
||||||
|
|
||||||
|
private final Long requestPaymentAbacInfoId;
|
||||||
|
|
||||||
|
private final String abacId;
|
||||||
|
|
||||||
|
public AbacRequestApplicationEvent(Object source, AbacRequestEvent abacRequestEvent, Long requestId, Long requestPaymentAbacInfoId, String abacId) {
|
||||||
|
super(source);
|
||||||
|
this.abacRequestEvent = abacRequestEvent;
|
||||||
|
this.requestId = requestId;
|
||||||
|
this.requestPaymentAbacInfoId = requestPaymentAbacInfoId;
|
||||||
|
this.abacId = abacId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AbacRequestEvent getAbacRequestEvent() {
|
||||||
|
return abacRequestEvent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getRequestId() {
|
||||||
|
return requestId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getRequestPaymentAbacInfoId() {
|
||||||
|
return requestPaymentAbacInfoId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAbacId() {
|
||||||
|
return abacId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.service.data.mapping.classmapbuilder;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.service.provider.data.mapping.AbstractModelToEntityClassMapBuilder;
|
||||||
|
import eu.europa.eeas.erights.backoffice.data.jpa.entity.p2phub.AllowanceDetailJpaEntity;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.model.p2phub.AllowanceDetailModel;
|
||||||
|
import ma.glasnost.orika.metadata.ClassMapBuilder;
|
||||||
|
import ma.glasnost.orika.metadata.Type;
|
||||||
|
import ma.glasnost.orika.metadata.TypeFactory;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
|
||||||
|
*
|
||||||
|
* @author tapiafo
|
||||||
|
*/
|
||||||
|
public class AllowanceDetailModelToJpaEntityClassMapBuilder extends AbstractModelToEntityClassMapBuilder<AllowanceDetailModel, AllowanceDetailJpaEntity> {
|
||||||
|
|
||||||
|
private static final Type<AllowanceDetailModel> MODEL_TYPE = TypeFactory.valueOf(AllowanceDetailModel.class);
|
||||||
|
|
||||||
|
private static final Type<AllowanceDetailJpaEntity> ENTITY_TYPE = TypeFactory.valueOf(AllowanceDetailJpaEntity.class);
|
||||||
|
|
||||||
|
public AllowanceDetailModelToJpaEntityClassMapBuilder(ApplicationContext applicationContext) {
|
||||||
|
super(applicationContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<AllowanceDetailModel> getAType() {
|
||||||
|
return MODEL_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<AllowanceDetailJpaEntity> getBType() {
|
||||||
|
return ENTITY_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void buildMap(ClassMapBuilder<AllowanceDetailModel, AllowanceDetailJpaEntity> classMapBuilder) {
|
||||||
|
classMapBuilder.byDefault();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.service.data.mapping.classmapbuilder;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.service.provider.data.mapping.AbstractModelToEntityClassMapBuilder;
|
||||||
|
import eu.europa.eeas.erights.backoffice.data.jpa.entity.AllowanceHeaderJpaEntity;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.model.p2phub.AllowanceHeaderModel;
|
||||||
|
import ma.glasnost.orika.metadata.ClassMapBuilder;
|
||||||
|
import ma.glasnost.orika.metadata.Type;
|
||||||
|
import ma.glasnost.orika.metadata.TypeFactory;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
|
||||||
|
*
|
||||||
|
* @author tapiafo
|
||||||
|
*/
|
||||||
|
public class AllowanceHeaderModelToJpaEntityClassMapBuilder extends AbstractModelToEntityClassMapBuilder<AllowanceHeaderModel, AllowanceHeaderJpaEntity> {
|
||||||
|
|
||||||
|
private static final Type<AllowanceHeaderModel> MODEL_TYPE = TypeFactory.valueOf(AllowanceHeaderModel.class);
|
||||||
|
|
||||||
|
private static final Type<AllowanceHeaderJpaEntity> ENTITY_TYPE = TypeFactory.valueOf(AllowanceHeaderJpaEntity.class);
|
||||||
|
|
||||||
|
public AllowanceHeaderModelToJpaEntityClassMapBuilder(ApplicationContext applicationContext) {
|
||||||
|
super(applicationContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<AllowanceHeaderModel> getAType() {
|
||||||
|
return MODEL_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<AllowanceHeaderJpaEntity> getBType() {
|
||||||
|
return ENTITY_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void buildMap(ClassMapBuilder<AllowanceHeaderModel, AllowanceHeaderJpaEntity> classMapBuilder) {
|
||||||
|
classMapBuilder.byDefault();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
package eu.europa.eeas.erights.backoffice.service.data.mapping.classmapbuilder;
|
||||||
|
|
||||||
|
import eu.europa.eeas.ananke.core.service.provider.data.mapping.AbstractModelToEntityClassMapBuilder;
|
||||||
|
import eu.europa.eeas.erights.backoffice.data.jpa.entity.p2phub.AllowancePaymentJpaEntity;
|
||||||
|
import eu.europa.eeas.erights.backoffice.service.model.p2phub.AllowancePaymentModel;
|
||||||
|
import ma.glasnost.orika.metadata.ClassMapBuilder;
|
||||||
|
import ma.glasnost.orika.metadata.Type;
|
||||||
|
import ma.glasnost.orika.metadata.TypeFactory;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
|
||||||
|
*
|
||||||
|
* @author tapiafo
|
||||||
|
*/
|
||||||
|
public class AllowancePaymentModelToJpaEntityClassMapBuilder extends AbstractModelToEntityClassMapBuilder<AllowancePaymentModel, AllowancePaymentJpaEntity> {
|
||||||
|
|
||||||
|
private static final Type<AllowancePaymentModel> MODEL_TYPE = TypeFactory.valueOf(AllowancePaymentModel.class);
|
||||||
|
|
||||||
|
private static final Type<AllowancePaymentJpaEntity> ENTITY_TYPE = TypeFactory.valueOf(AllowancePaymentJpaEntity.class);
|
||||||
|
|
||||||
|
public AllowancePaymentModelToJpaEntityClassMapBuilder(ApplicationContext applicationContext) {
|
||||||
|
super(applicationContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<AllowancePaymentModel> getAType() {
|
||||||
|
return MODEL_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Type<AllowancePaymentJpaEntity> getBType() {
|
||||||
|
return ENTITY_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void buildMap(ClassMapBuilder<AllowancePaymentModel, AllowancePaymentJpaEntity> classMapBuilder) {
|
||||||
|
classMapBuilder.byDefault();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue