Skip to content

Commit

Permalink
Merge pull request #98 from xdev-software/develop
Browse files Browse the repository at this point in the history
v1.0.3
  • Loading branch information
JohannesRabauer authored Oct 25, 2024
2 parents d138508 + 6100b30 commit 36d23b4
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 62 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/broken-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@v1
uses: lycheeverse/lychee-action@v2

- name: Find already existing issue
id: find-issue
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
- '.idea/**'
- 'assets/**'
pull_request:
types: [opened, synchronize, reopened]
branches: [ develop ]
paths-ignore:
- '**.md'
- '.config/**'
Expand Down
2 changes: 1 addition & 1 deletion .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.8/apache-maven-3.9.8-bin.zip
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.0.3

* ReportableSellerCreator can now create "Rechtsträger" like a company.

# 1.0.2

* The alias for the private key in the keystore is now configurable (
Expand Down
50 changes: 14 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,24 @@

# bzst-dip-java-client

Client for using
the [Mass data transmission DIP (mass data
interface)](https://www.bzst.de/EN/Businesses/CESOP/electronic_data_transmission/electronic_data_transmission_node.html#js-toc-entry1).
Client for using the [Mass data transmission DIP (mass data interface)](https://www.bzst.de/EN/Businesses/CESOP/electronic_data_transmission/electronic_data_transmission_node.html#js-toc-entry1).

The BZSt (Bundeszentralamt für Steuern / Federal Central Tax Office) provides the Digital Inbox (DIP) as a service
for payment service providers to transmit financial data.
The BZSt (Bundeszentralamt für Steuern / Federal Central Tax Office) provides the Digital Inbox (DIP) as a service for payment service providers to transmit financial data.

Clients need to register / login
at [BZSt online.portal](https://www.bzst.de/DE/Service/Portalinformation/Massendaten/DIP/dip.html?nn=68828)
through [Elster](https://www.elster.de/elsterweb/start), [BundID](https://id.bund.de/de)
or [BZSt Online-Portal (BOP)](https://www.elster.de/bportal/start).
Clients need to register / login at [BZSt online.portal](https://www.bzst.de/DE/Service/Portalinformation/Massendaten/DIP/dip.html?nn=68828) through [Elster](https://www.elster.de/elsterweb/start), [BundID](https://id.bund.de/de) or [BZSt Online-Portal (BOP)](https://www.elster.de/bportal/start).

See
the [BZSt Information](https://www.bzst.de/EN/Service/Portalinformation/Login/login_node.html)
for more information.
See the [BZSt Information](https://www.bzst.de/EN/Service/Portalinformation/Login/login_node.html) for more information.

*Warning*: **BZSt Online-Portal** (deprecated) is different from **BZSt online.portal**.
> [!NOTE]
> **BZSt Online-Portal** (deprecated) is different from **BZSt online.portal**.
## Rationale

We created this client to make it as easy as possible for the developer to use the BZSt DIP.
Through usage of the builder pattern (see [Configuration](#configuration) below), DTOs
and a typesafe data model we ensure high usability and readability.
Through usage of the builder pattern (see [Configuration](#configuration) below), DTOs and a typesafe data model we ensure high usability and readability.

The BZSt
provides [XSD](https://www.bzst.de/SharedDocs/Downloads/DE/Digitale_Plattformbetreiber/amtlicher_datensatz_entwurf) that
define the expected XML structure and
make it possible to generate java
classes ([BZSt Docs](https://www.bzst.de/DE/Unternehmen/Intern_Informationsaustausch/DAC7/Handbuecher/handbuecher.html?nn=127558#js-toc-entry2)).
Our library validates each
request through these XSD find errors before they are sent to the DIP.
The BZSt provides [XSD](https://www.bzst.de/SharedDocs/Downloads/DE/Digitale_Plattformbetreiber/amtlicher_datensatz_entwurf) that define the expected XML structure and make it possible to generate java classes ([BZSt Docs](https://www.bzst.de/DE/Unternehmen/Intern_Informationsaustausch/DAC7/Handbuecher/handbuecher.html?nn=127558#js-toc-entry2)).<br/>
Our library validates each request through these XSD find errors before they are sent to the DIP.

## Installation
[Installation guide for the latest release](https://github.com/xdev-software/bzst-dip-java-client/releases/latest#Installation)
Expand All @@ -51,9 +38,7 @@ See the [examples in the demo package](./bzst-dip-java-client-demo/src/main/java

For authentification at the BZST you have to create a public- and private-key.

First you have to create a **PEM** file as described on
the [BZST Website](https://www.bzst.de/SharedDocs/Downloads/DE/EOP_BOP/khb_dip.pdf?__blob=publicationFile&v=9) (see
1.7).
First you have to create a **PEM** file as described on the [BZST Website](https://www.bzst.de/DE/Service/Portalinformation/Massendaten/DIP/dip_node.html) (see 1.7).

OpenSSL can be downloaded from their [website](https://www.openssl.org/).

Expand All @@ -67,15 +52,13 @@ Next you have to convert that file to a **PKCS12** file.
openssl pkcs12 -export -in cert.pem -inkey key.pem -out certificate.p12 -name "certificate"
```

The [keytool](https://docs.oracle.com/javase/8/docs/technotes/tools/unix/keytool.html) is contained in your JDK
installation.
The [keytool](https://docs.oracle.com/javase/8/docs/technotes/tools/unix/keytool.html) is contained in your JDK installation.

```
keytool -importkeystore -srckeystore certificate.p12 -srcstoretype pkcs12 -destkeystore cert.jks
```

The password you insert here, along with the file itself must be set in the client configuration. See example
at [app.properties](./bzst-dip-java-client-demo/src/main/resources/app.properties):
The password you insert here, along with the file itself must be set in the client configuration. See example at [app.properties](./bzst-dip-java-client-demo/src/main/resources/app.properties):

```
certificate.keystore.password=SECRET_PASSWORD
Expand All @@ -101,11 +84,7 @@ client.id=abcd1234-ab12-ab12-ab12-abcdef123456

### Configuration

The client can be configured through a properties file (
see [app.properties](./bzst-dip-java-client-demo/src/main/resources/app.properties)
and [ApplicationWithConfigurationFromProperties.java](./bzst-dip-java-client-demo/src/main/java/software/xdev/ApplicationWithConfigurationFromProperties.java))
or by creating a configuration object (
see [Application.java](./bzst-dip-java-client-demo/src/main/java/software/xdev/Application.java)).
The client can be configured through a properties file (see [app.properties](./bzst-dip-java-client-demo/src/main/resources/app.properties) and [ApplicationWithConfigurationFromProperties.java](./bzst-dip-java-client-demo/src/main/java/software/xdev/ApplicationWithConfigurationFromProperties.java)) or by creating a configuration object (see [Application.java](./bzst-dip-java-client-demo/src/main/java/software/xdev/Application.java)).

```java
public static BzstDipConfiguration createConfiguration()
Expand All @@ -130,8 +109,7 @@ public static BzstDipConfiguration createConfiguration()

## Support

If you need support as soon as possible, and you can't wait for any pull request, feel free to
use [our support](https://xdev.software/en/services/support).
If you need support as soon as possible, and you can't wait for any pull request, feel free to use [our support](https://xdev.software/en/services/support).

## Contributing
See the [contributing guide](./CONTRIBUTING.md) for detailed instructions on how to get started with our project.
Expand Down
4 changes: 2 additions & 2 deletions bzst-dip-java-client-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<mainClass>software.xdev.bzst.dip.client.Application</mainClass>
<mainClass>software.xdev.Application</mainClass>
</properties>

<dependencies>
Expand All @@ -38,7 +38,7 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j2-impl</artifactId>
<version>2.23.1</version>
<version>2.24.1</version>
</dependency>
</dependencies>

Expand Down
24 changes: 12 additions & 12 deletions bzst-dip-java-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.13</version>
<version>2.0.16</version>
</dependency>
<dependency>
<groupId>com.opencsv</groupId>
Expand All @@ -138,7 +138,7 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j2-impl</artifactId>
<version>2.23.1</version>
<version>2.24.1</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down Expand Up @@ -177,15 +177,15 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.6.2</version>
<version>3.8.0</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>4.5</version>
<version>4.6</version>
<configuration>
<properties>
<email>${project.organization.url}</email>
Expand Down Expand Up @@ -225,7 +225,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.8.0</version>
<version>3.10.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand Down Expand Up @@ -281,7 +281,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.4</version>
<version>3.2.7</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand Down Expand Up @@ -324,12 +324,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.4.0</version>
<version>3.5.0</version>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>10.17.0</version>
<version>10.18.2</version>
</dependency>
</dependencies>
<configuration>
Expand All @@ -355,7 +355,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.24.0</version>
<version>3.25.0</version>
<configuration>
<includeTests>true</includeTests>
<printFailingErrors>true</printFailingErrors>
Expand All @@ -367,12 +367,12 @@
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-core</artifactId>
<version>7.3.0</version>
<version>7.6.0</version>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-java</artifactId>
<version>7.3.0</version>
<version>7.6.0</version>
</dependency>
</dependencies>
</plugin>
Expand All @@ -384,7 +384,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>3.4.0</version>
<version>3.5.0</version>
</plugin>
</plugins>
</reporting>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@ public CorrectableReportableSellerType toXmlType(final BzstDipConfiguration conf
this.tin.toXmlType(),
this.handelsregisternummer,
this.vat,
this.firstName,
this.firstName == null ? ReportableSellerCreator.NULL_STRING : this.firstName,
this.lastName,
this.birthDate.format(DateTimeFormatter.ISO_LOCAL_DATE),
this.birthDate == null
? ReportableSellerCreator.NULL_STRING
: this.birthDate.format(DateTimeFormatter.ISO_LOCAL_DATE),
this.legalAddress.toXmlType(),
this.addressFix.toXmlType(),
this.numberOfActivities.toXmlType(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
public class ReportableSellerCreator
{
private static final Logger LOGGER = LoggerFactory.getLogger(ReportableSellerCreator.class);
public static final String NULL_STRING = "NULL";
private final BzstDipConfiguration configuration;

public ReportableSellerCreator(final BzstDipConfiguration configuration)
Expand Down Expand Up @@ -337,7 +338,7 @@ private static OrganisationPartyType createOrganisationPartyType(
*/
public static boolean isNULLAsString(final String checkNULLString)
{
return checkNULLString.equals("NULL");
return checkNULLString.equals(NULL_STRING);
}

private static OrganisationINType createIN(final String in)
Expand Down
12 changes: 6 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.4.0</version>
<version>3.5.0</version>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>10.17.0</version>
<version>10.18.2</version>
</dependency>
</dependencies>
<configuration>
Expand All @@ -70,7 +70,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.24.0</version>
<version>3.25.0</version>
<configuration>
<includeTests>true</includeTests>
<printFailingErrors>true</printFailingErrors>
Expand All @@ -82,12 +82,12 @@
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-core</artifactId>
<version>7.3.0</version>
<version>7.6.0</version>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-java</artifactId>
<version>7.3.0</version>
<version>7.6.0</version>
</dependency>
</dependencies>
</plugin>
Expand All @@ -99,7 +99,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>3.4.0</version>
<version>3.5.0</version>
</plugin>
</plugins>
</reporting>
Expand Down

0 comments on commit 36d23b4

Please sign in to comment.