{"id":16416130,"url":"https://github.com/phax/peppol-reporting","last_synced_at":"2026-03-07T17:16:09.696Z","repository":{"id":142747842,"uuid":"567272318","full_name":"phax/peppol-reporting","owner":"phax","description":"Peppol Reporting support library","archived":false,"fork":false,"pushed_at":"2026-02-26T19:27:29.000Z","size":1403,"stargazers_count":22,"open_issues_count":0,"forks_count":2,"subscribers_count":7,"default_branch":"main","last_synced_at":"2026-02-27T01:28:38.776Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-11-17T12:50:48.000Z","updated_at":"2026-02-26T19:27:33.000Z","dependencies_parsed_at":"2025-12-29T19:04:23.345Z","dependency_job_id":null,"html_url":"https://github.com/phax/peppol-reporting","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/phax/peppol-reporting","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phax%2Fpeppol-reporting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phax%2Fpeppol-reporting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phax%2Fpeppol-reporting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phax%2Fpeppol-reporting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phax","download_url":"https://codeload.github.com/phax/peppol-reporting/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phax%2Fpeppol-reporting/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30222787,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T17:00:40.062Z","status":"ssl_error","status_checked_at":"2026-03-07T17:00:39.026Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T07:08:30.111Z","updated_at":"2026-03-07T17:16:09.690Z","avatar_url":"https://github.com/phax.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# peppol-reporting\n\n[![javadoc](https://javadoc.io/badge2/com.helger.peppol/peppol-reporting-api/javadoc.svg)](https://javadoc.io/doc/com.helger.peppol/peppol-reporting-api)\n[![Maven Central](https://img.shields.io/maven-central/v/com.helger.peppol/peppol-reporting.svg)](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.helger.peppol%22%20AND%20a%3A%22peppol-reporting%22)\n\nPeppol Reporting support library.\nPeppol Reporting is the process of collecting, aggregating and transmitting Peppol Reports to OpenPeppol. \n\npeppol-reporting is part of my Peppol solution stack. See https://github.com/phax/peppol for other components and libraries in that area.\n\nThis library supports the following reports:\n* Peppol Transaction Statistics Report 1.0.1 (March 2023)\n    * Specification link: https://docs.peppol.eu/edelivery/specs/reporting/tsr/\n* Peppol End User Statistics Report 1.1.0 (June 2023)\n    * Specification link: https://docs.peppol.eu/edelivery/specs/reporting/eusr/\n* OpenPeppol Operational Guideline for Reporting implementation: https://docs.peppol.eu/edelivery/ \n\nThis library does not deal with the transmission of Reports.\nThat needs to be done with [phase4](https://github.com/phax/phase4) or another AS4 solution.\nSee the [phase4 Wiki](https://github.com/phax/phase4/wiki/Profile-Peppol#special-handling-for-peppol-reporting) for detailed guidance on integration with this project. \n\nThis library requires Java 17 and Maven to build.\n\n# How to use it\n\nThis library offers a Java domain model for EUSR and TSR reports.\n\n*Note*: phase4 v2.2.2 and onwards has direct support for this project.\n\n## Overview images\n\n![Data collection on sending](https://github.com/phax/peppol-reporting/blob/main/docs/collection-sending.png)\n\n![Data collection on receiving](https://github.com/phax/peppol-reporting/blob/main/docs/collection-receiving.png)\n\n![Report creation and transmission](https://github.com/phax/peppol-reporting/blob/main/docs/creation-and-transmission.png)\n\n## Data collection\n\nData collection needs to happen inside your Access Point instances.\n\nThe data for reporting needs to be collected in instances of class `PeppolReportingItem`.\nFor each sent or received Peppol transmission, such a `PeppolReportingItem` needs to be collected, and persisted.\n\nEach `PeppolReportingItem` consists of the following elements:\n* `OffsetDateTime m_aExchangeDTUTC` - timing of the exchange in UTC; for TSR and EUSR\n* `EReportingDirection m_eDirection` - direction of the exchange; for TSR and EUSR\n* `String m_sC2ID` - Peppol Seat ID of C2; for TSR only\n* `String m_sC3ID` - Peppol Seat ID of C3; for TSR only\n* `String m_sDocTypeIDScheme` and `String m_sDocTypeIDValue` - Document Type ID of the exchange; for TSR and EUSR \n* `String m_sProcessIDScheme` and `String m_sProcessIDValue` - Process ID of the exchange; for TSR and EUSR\n* `String m_sTransportProtocol` - the transport protocol used; for TSR only\n* `String m_sC1CountryCode` - the country code of C1; for TSR and EUSR\n* `String m_sC4CountryCode` - the country code of C4 - only required for received messages; for TSR and EUSR\n* `String m_sEndUserID` - the end user ID to aggregate on - this ID is **not** part of any report; for EUSR only\n\nTo facilitate this collection, the submodule `peppol-reporting-api` exists.\n\n## Data storage\n\nThe created reporting item must be stored somewhere, to be able to retrieve them later.\n\nThis project comes with different backends for storing `PeppolReportingItem` objects, each in a separate submodule.\nEach submodule is described below.\n\nTo choose a submodule, it needs to be added as a Maven dependency. The main logic is loaded via SPI.\nPlease make sure to only use **one** submodule at a time - storing to multiple backends is currently not supported out of the box.\n\nAlternatively you can implement your own Reporting backend implementation, by implementing the  SPI interface\n`com.helper.peppol.reporting.api.backend.IPeppolReportingBackendSPI` defined in the `peppol-reporting-api` submodule. \n\n### Storage in MongoDB\n\nSubmodule `peppol-reporting-backend-mongodb` stores data in a MongoDB.\nThis submodule was introduced in version 2.1.0.\n\nIt creates one collection called: `reporting-items`\n\nIt supports the following configuration properties:\n* **`peppol.reporting.mongodb.connectionstring`**: the connection string to use to connect to MongoDB  \n* **`peppol.reporting.mongodb.dbname`**: the MongoDB database name to use  \n* **`peppol.reporting.mongodb.collection`** (since v2.2.1): the MongoDB collection name to use. Defaults to `reporting-items`.\n\n### Storage in Redis\n\nSubmodule `peppol-reporting-backend-redis` stores data in Redis. Make sure you use persistent storage for this one.\nThis submodule was introduced in version 2.1.0.\n\nThe used Redis keys are:\n* `peppol:reporting:itemidx` - counter for unique IDs\n* `peppol:reporting:item:*` - represents a single reporting item hash map\n* `peppol:reporting:*` - contains a list of reporting item keys of a single day\n\nIt supports the following configuration properties:\n* **`peppol.reporting.redis.host`**: the Redis host to connect to\n* **`peppol.reporting.redis.port`**: the Redis port to connect to\n* **`peppol.reporting.redis.user`** (since v2.2.3; optional): the username used to connect to the Redis server\n* **`peppol.reporting.redis.password`** (since v2.2.3; optional): the password used to connect to the Redis server\n\n### Storage in CSV file\n\nSubmodule `peppol-reporting-backend-csv` stores data in a CSV file.\nThis submodule was introduced in version 2.2.4.\n\nIt supports the following configuration properties:\n* **`peppol.reporting.csv.filename`**: the CSV filename to store the entries in\n* **`peppol.reporting.csv.separator-char`** (optional): the CSV cell separator character to use. The default is `,`\n* **`peppol.reporting.csv.quote-char`** (optional): the CSV quote character to use. The default is `\"`\n* **`peppol.reporting.csv.escape-char`** (optional): the CSV escape character to use. The default is `\\`\n\n### Storage in SQL databases\n\nSubmodule `peppol-reporting-backend-sql` stores data in relational databases.\nThis submodule was introduced in version 3.0.1.\n\nIt supports the following configuration properties:\n* **`peppol.reporting.jdbc.database-type`**: the SQL database type to operate on. Currently supported are `postgresql`, `mysql` and `sqlserver`. The value is case-insensitive.\n* **`peppol.reporting.jdbc.driver`**: contains the fully qualified class name of the JDBC driver to be used. E.g. `org.postgresql.Driver` for PostgreSQL, `com.mysql.cj.jdbc.Driver` for MySQL or `com.microsoft.sqlserver.jdbc.SQLServerDriver` for SQL Server\n* **`peppol.reporting.jdbc.url`**: contains the full JDBC connection URL to connect to the database\n* **`peppol.reporting.jdbc.user`** (optional): the database username to use\n* **`peppol.reporting.jdbc.password`** (optional): the database password to use\n* **`peppol.reporting.jdbc.schema`** (optional): the database schema to use\n* **`peppol.reporting.jdbc.execution-time-warning.enabled`** (optional):  if `true` enables warning logging if an SQL command takes too long to execute. Defaults to `true`.\n* **`peppol.reporting.jdbc.execution-time-warning.ms`** (optional): the number of milliseconds after the which an SQL execution will trigger an execution time warning. Defaults to `1000` which is one second.\n* **`peppol.reporting.jdbc.debug.connections`** (optional):  if `true` enables logging of SQL connection handling. Defaults to `false`.\n* **`peppol.reporting.jdbc.debug.transactions`** (optional): if `true` enables logging of SQL transactions. Defaults to `false`. \n* **`peppol.reporting.jdbc.debug.sql`** (optional): if `true` enables logging of SQL statements. Defaults to `false`.\n\nDatabase change management is done with the Open Source version of Flyway.\nAll the Flyway DDL scripts are available in the folder https://github.com/phax/peppol-reporting/tree/main/peppol-reporting-backend-sql/src/main/resources/db\n\nIt can be configured as followed:\n* **`peppol.reporting.flyway.enabled`**: `true` if Flyway should be enabled, `false` if not. Defaults to `true`.\n* **`peppol.reporting.flyway.jdbc.url`** (optional): allows a specific JDBC URL for usage with Flyway. If none is provided, the value of `peppol.reporting.jdbc.url` is used instead.\n* **`peppol.reporting.flyway.jdbc.user`** (optional): allows a specific JDBC username for usage with Flyway. If none is provided, the value of `peppol.reporting.jdbc.user` is used instead.\n* **`peppol.reporting.flyway.jdbc.password`** (optional): allows a specific JDBC password for usage with Flyway. If none is provided, the value of `peppol.reporting.jdbc.password` is used instead.\n* **`peppol.reporting.flyway.jdbc.schema-create`** (optional): `true` if the DB schema as defined in `peppol.reporting.jdbc.schema` should be automatically created by Flyway. Defaults to `false`.\n* **`peppol.reporting.flyway.baseline.version`** (optional): the Flyway baseline version to use. Defaults to `0`.\n\nBy default it is not bound to any specific DB engine, so you need to provide the necessary driver dependency manually.\nPostgreSQL:\n```xml\n    \u003cdependency\u003e\n      \u003cgroupId\u003eorg.postgresql\u003c/groupId\u003e\n      \u003cartifactId\u003epostgresql\u003c/artifactId\u003e\n      \u003cversion\u003ex.y.z\u003c/version\u003e\n    \u003c/dependency\u003e\n```\n\nMySQL:\n```xml\n    \u003cdependency\u003e\n      \u003cgroupId\u003ecom.mysql\u003c/groupId\u003e\n      \u003cartifactId\u003emysql-connector-j\u003c/artifactId\u003e\n      \u003cversion\u003ex.y.z\u003c/version\u003e\n    \u003c/dependency\u003e\n```\n\nSQL Server:\n```xml\n    \u003cdependency\u003e\n      \u003cgroupId\u003ecom.microsoft.sqlserver\u003c/groupId\u003e\n      \u003cartifactId\u003emssql-jdbc\u003c/artifactId\u003e\n      \u003cversion\u003ex.y.z\u003c/version\u003e\n    \u003c/dependency\u003e\n```\n\n### Storage in memory\n\nSubmodule `peppol-reporting-backend-inmemory` stores data in memory only and is **not persistent**.\nThis submodule was introduced in version 2.1.1.\n\nThis module is mainly meant for testing purposes.\n\n## Data aggregation\n\nTo aggregate data for a single Reporting Period, all the matching `PeppolReportingItem` objects need to be collected first.\nAll the matching items need to be fed into the respective report builder.\n\nVia the builder `EndUserStatisticsReport.builder ()`, the report of type `EndUserStatisticsReportType` (EUSR) can be created.\n\nVia the builder `TransactionStatisticsReport.builder ()`, the report of type `TransactionStatisticsReportType` (TSR) can be created.\n\n## Report XML Serialization\n\nThe JAXB generated domain model classes reside in the packages `com.helger.peppol.reporting.jaxb.eusr.v110` and `com.helger.peppol.reporting.jaxb.tsr.v101`.\nThis domain model can be read from and written to XML documents via the marshaller classes `EndUserStatisticsReport110Marshaller` and `TransactionStatisticsReport101Marshaller`.\n\n## Report Validation\n\nAdditionally, the Schematron compatibility can be verified using the classes `EndUserStatisticsReportValidator` and `TransactionStatisticsReportValidator`.\nAll checks are performed against the default Schematrons provided by OpenPeppol.\n\n# Glossary\n\n* EUSR - End User Statistics Report\n* TSR - Transaction Statistics Report\n* Report - Document containing OpenPeppol reporting information\n* Reporting - The process of transmitting a **Report** to OpenPeppol\n* Reporting Period - The period for which reporting data is to be collected and transmitted to OpenPeppol \n\n# Maven usage\n\nAdd the following to your pom.xml to use this artifact, replacing `x.y.z` with the real version:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.helger.peppol\u003c/groupId\u003e\n  \u003cartifactId\u003epeppol-reporting\u003c/artifactId\u003e\n  \u003cversion\u003ex.y.z\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nUsage as Maven BOM:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.helger.peppol\u003c/groupId\u003e\n  \u003cartifactId\u003epeppol-reporting-parent-pom\u003c/artifactId\u003e\n  \u003cversion\u003ex.y.z\u003c/version\u003e\n  \u003ctype\u003epom\u003c/type\u003e\n  \u003cscope\u003eimport\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\nNote: all v1.x releases used the group ID `com.helger` only.\n\n# News and Noteworthy\n\nv4.1.1 - 2026-03-07\n* (Redis) Updated to Jedis 7.2.0 and using `RedisClient` instead of `Jedis` and `JedisPool`\n* (SQL) Added support for SQL Server as a database backend\n\nv4.1.0 - 2025-11-16\n* Updated to ph-commons 12.1.0\n* Using JSpecify annotations\n\nv4.0.1 - 2025-09-19\n* (SQL) Updated to ph-db 8.0.1 to fix an error with schema name masking for MySQL\n* (SQL) Removed `PeppolReportingBackendSqlSPI.getTableNamePrefix` in favour of `DBSystemHelper.getTableNamePrefix` (incompatible change)\n\nv4.0.0 - 2025-08-27\n* Requires Java 17 as the minimum version\n* Updated to ph-commons 12.0.0\n* Removed all code marked as deprecated for removal\n* (SQL) Updated to Flyway 11.x\n\nv3.1.0 - 2025-04-11\n* (SQL) Requires ph-db 7.1.0\n* [MongoDB] Extended `PeppolReportingBackendMongoDBSPI` API\n* (SQL) Renamed class `EDatabaseType` to `EReportingDatabaseType` (internal backwards incompatible change)\n* (SQL) Renamed class `FlywayMigrator` to `ReportingFlywayMigrator` (internal backwards incompatible change)\n* (SQL) Removed class `ReportingFlywayConfiguration` in favour of `ReportingFlywayConfigurationBuilder`\n* (SQL) Replaced class `EReportingDatabaseType` with `EDatabaseSystemType` from ph-db\n* (SQL) Reworked class `ReportingJdbcConfiguration` to be based on a new shared class from ph-db\n\nv3.0.3 - 2024-11-27\n* Calling the `PeppolReportingHelper.isDocumentTypeEligableForReporting` method in all backends to avoid the need for outside filtering\n\nv3.0.2 - 2024-10-31\n* Added new method `PeppolReportingBackend.setBackendService(IPeppolReportingBackendSPI)` to explicitly set the backend\n* (CSV) Added missing write locking in CSV backend\n\nv3.0.1 - 2024-08-12\n* Added new submodule `peppol-reporting-backend-sql` to support PostgreSQL and MySQL\n\nv3.0.0 - 2024-06-28\n* Extracted `peppol-reporting-datatypes` submodule\n* Extracted `peppol-reporting-testfiles` submodule\n* Changed the Java package names from `com.helper.*` to `com.helger.*` - LOL\n\nv2.2.5 - 2024-03-29\n* Updated to ph-commons 11.1.5\n* Ensured Java 21 compatibility\n\nv2.2.4 - 2024-03-21\n* Added new submodule `peppol-reporting-backend-csv` that uses a CSV file as the backend to store reporting items\n\nv2.2.3 - 2024-03-05\n* Added the possibility to provide username and password via configuration for the Redis backend. See [PR #13](https://github.com/phax/peppol-reporting/pull/13) - thx @TaKO8Ki\n\nv2.2.2 - 2024-01-29\n* Moved the method `PeppolReportingItem.isValidCountryCode(String)` to class `PeppolReportingHelper`\n* Added a constant `CPeppolReporting.REPLACEMENT_COUNTRY_CODE` for the `ZZ` code for invalid incoming country codes\n* Added a constant `CPeppolReporting.OPENPEPPOL_PARTICIPANT_ID` for the default receiver PID\n\nv2.2.1 - 2023-12-31\n* Made the collection name customizable in the MongoDB backend\n* Fixed an error in iterating in the \"in-memory\" backend when only entries from the last day of the period are present\n\nv2.2.0 - 2023-12-07\n* Modified classes `EUSRReportingItemList` and `TSRReportingItemList` so that the list is only iterated once and is based on `Iterable`. Backwards incompatible change.\n* Extended class `IPeppolReportingBackendSPI` with method `iterateReportingItems` to be able to lazily iterate over a data source. See [#2](https://github.com/phax/peppol-reporting/issues/2) - thx @iansmirlis\n\nv2.1.6 - 2023-11-10\n* Updated EUSR Schematron to v1.1.4\n\nv2.1.5 - 2023-11-02\n* Updated EUSR Schematron to v1.1.3 and TSR Schematron to v1.0.4\n\nv2.1.4 - 2023-10-12\n* Updated EUSR Schematron to v1.1.2 and TSR Schematron to v1.0.3\n\nv2.1.3 - 2023-09-21\n* Updated EUSR Schematron to v1.1.1 and TSR Schematron to v1.0.2\n\nv2.1.2 - 2023-09-12\n* Added class `PeppolReportingHelper` with some generic helper methods\n\nv2.1.1 - 2023-09-10\n* Added new submodule `peppol-reporting-backend-inmemory` that uses memory persistence as the backend to store reporting items\n* Added third party module descriptors\n* Fixed the date time offset when storing to MongoDB\n\nv2.1.0 - 2023-09-10\n* Added new API package `com.helper.peppol.reporting.api.backend` to define a generic backend API\n* Added new submodule `peppol-reporting-backend-mongodb` that uses MongoDB as the backend to store reporting items\n* Added new submodule `peppol-reporting-backend-redis` that uses Redis as the backend to store reporting items\n\nv2.0.0 - 2023-07-21\n* Changed the Maven Group ID to be `com.helger.peppol` instead of `com.helger`\n* Introduced the new submodule `peppol-reporting-api`\n* Changed some of the package names introduced in v1.2.0 to reflect the submodule name\n* Using Maven Bundle plugin to create OSGI bundles\n\nv1.2.0 - 2023-07-20\n* Added data models to easily build End User Statistics Reports v1.1.0 in code\n* Added data models to easily build Transaction Statistics Reports v1.0.1 in code\n\nv1.1.0 - 2023-07-02\n* Updated to support EUSR 1.1.0\n\nv1.0.0 - 2023-04-26\n* Initial Version\n* Supports EUSR 1.0.0 and TSR 1.0.1 \n\n---\n\nMy personal [Coding Styleguide](https://github.com/phax/meta/blob/master/CodingStyleguide.md) |\nIt is appreciated if you star the GitHub project if you like it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphax%2Fpeppol-reporting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphax%2Fpeppol-reporting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphax%2Fpeppol-reporting/lists"}