Multi-Module Maven Project
Shell
data-integration-service/ ← parent POM├── supplier/ ← domain module (jar)├── product/ ← domain module (jar)├── purchase/ ← domain module (jar)├── chemical/ ← domain module (jar)├── traceability/ ← domain module (jar)├── user/ ← domain module (jar)└── app/ ← runnable module (quarkus-app)
Domain modules are libraries — the app module provides the Quarkus runtime and wires them all together.
Layered Architecture
Shell
REST Resource (@Path)│Service (business logic, @ApplicationScoped)│Mapper (Entity ↔ DTO)│Entity (PanacheEntity, Hibernate ORM)│PostgreSQL
Request Authentication
All write endpoints require two headers:
| Header | Required on | Purpose |
|---|---|---|
X-API-Key | All requests | Service authentication |
X-User-Id | POST / PATCH | Audit logging (e.g. PurchaseStatusChangeLog) |
Entity Design
All entities extend PanacheEntity (Active Record pattern):
Java
@Entity@Table(name = "supplier")public class Supplier extends PanacheEntity {@NotBlank public String name;public String country;@PrePersist @PreUpdatevoid onPersist() {createdAt = LocalDateTime.now();}}
Testing
| Scope | Tool | Database |
|---|---|---|
| Integration test | @QuarkusTest | H2 in-memory |
| Transaction rollback | @TestTransaction | H2 |
| Dev mode | Quarkus Dev Services | PostgreSQL (Docker) |
| Production | — | PostgreSQL (validate only) |
Jandex Bean Indexing
Every domain module must include the Jandex Maven plugin to enable CDI scanning:
XML
<plugin><groupId>io.smallrye</groupId><artifactId>jandex-maven-plugin</artifactId><executions><execution><id>make-index</id><goals><goal>jandex</goal></goals></execution></executions></plugin>