Architecture

Multi-module Maven architecture, layered design, and Quarkus conventions used in the Integration Service.

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:

HeaderRequired onPurpose
X-API-KeyAll requestsService authentication
X-User-IdPOST / PATCHAudit 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 @PreUpdate
void onPersist() {
createdAt = LocalDateTime.now();
}
}

Testing

ScopeToolDatabase
Integration test@QuarkusTestH2 in-memory
Transaction rollback@TestTransactionH2
Dev modeQuarkus Dev ServicesPostgreSQL (Docker)
ProductionPostgreSQL (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>