adb-reports
AI-generated content
This document was generated by an AI assistant. Verify accuracy before relying on the details.
Role
PDF document generation service: signed contracts, termination letters, accounting reports, notifications. It combines FreeMarker (HTML templates stored in the database) with iTextPDF (HTML → PDF rendering).
It is the only direct consumer of adb-aggregates: it calls it to fetch consolidated models (contract + persons + parts) and feeds them into the templates.
Tech stack
| Item | Value |
|---|---|
| Spring Boot | 3.1.3 |
| Java | 18 |
| Port | 8090 |
| Database | MongoDB Atlas — database adb-reports |
| Auth | Keycloak (resource server) |
| Reactive stack | Spring WebFlux + Reactive MongoDB |
iTextPDF v4.0.2 (com.itextpdf:html2pdf) | |
| Templating | FreeMarker (spring-boot-starter-freemarker) |
| Storage | AWS S3 (BUCKET_TEMPLATES) |
| Tracing | Micrometer Tracing (Brave) |
| Version | 0.18.0-SNAPSHOT |
Depends on the module: adb-aggregates-model (consumed as a Maven dependency for aggregate DTOs).
Internal architecture
flowchart TB
Client[Client adb-ui<br/>or adb-web]
subgraph adb-reports
RC[ReportsController]
TC[TemplateController]
TMC[TemplateMetaDataController]
NGC[NotificationGeneratorController]
RS[ReportService]
TS[TemplateService]
FM[FreeMarker engine]
IT[iText html2pdf]
end
Mongo[(adb-reports<br/>templates,<br/>template_meta_data)]
S3[(S3 templates)]
Aggregates[adb-aggregates]
Contracts[adb-contracts]
Client -->|GET /reports/contracts/:id| RC
Client -->|GET /reports/templates| TC
RC --> RS
TC --> TS
TMC --> TS
RS -->|fetch enriched data| Aggregates
RS -->|fetch template values| Contracts
RS --> TS
TS --> Mongo
TS --> S3
RS --> FM
FM --> IT
IT -->|PDF bytes| Client
Endpoints
| Controller | Path | Role |
|---|---|---|
ReportsController | /reports | Report generation |
TemplateController | /reports/templates | Template management |
TemplateMetaDataController | /reports/metadata | Template metadata |
NotificationGeneratorController | /notifications | Notification generation |
Key endpoints
GET /reports/contracts/{contractId}→ contract PDF.GET /reports/contracts/{contractId}/resumptionOfLeasePDF→ termination PDF.GET /reports/info→ module info.
Data model
erDiagram
TemplateEntity ||--|| TemplateMetaDataEntity : "metadata"
TemplateEntity {
string _id
string name
string content "HTML + FreeMarker"
string version
}
TemplateMetaDataEntity {
string _id
string templateId
string description
array variables
}
Collections: templates, template_meta_data.
Events
None. adb-reports is purely synchronous (consumed on demand).
Inter-service dependencies
flowchart LR
reports[adb-reports]
aggregates[adb-aggregates]
contracts[adb-contracts]
reports -->|GET /aggregates/contracts/:id| aggregates
reports -->|GET /contracts/.../templateValues| contracts
ui[adb-ui] -->|GET /reports/...| reports
web[adb-web/bff] --> reports
Configuration / deployment
Environment variables
| Variable | Role |
|---|---|
MONGO_DB_URI | MongoDB connection string |
SECURITY_ISSUER_URI / SECURITY_TOKEN_URI | Keycloak |
CLIENT_ID / CLIENT_SECRET | OAuth2 |
AWS_REGION / AWS_ACCESS_KEY / AWS_SECRET_KEY | AWS |
BUCKET_TEMPLATES | S3 templates bucket |
Helm chart
adb-charts/charts/services/templates/adb-reports.yaml. Image: lifeconnect/adb-reports.
Links
- Code:
adb-reports/