Skip to content

Component layering

Services follow a standard layering. Each request flows top-to-bottom; entities never leave the service layer — controllers exchange DTOs.

Angular SPA ──HTTPS + JWT──▶ web.rest.*Resource (controllers, DTOs only)
└▶ service.*Service (+ impl)
└▶ service.*QueryService (JPA Criteria filtering)
└▶ service.mapper (MapStruct, entity ⇄ DTO)
└▶ repository.*Repository (Spring Data JPA) ──▶ PostgreSQL
└▶ repository.search.* (Spring Data ES) ──▶ Elasticsearch
  1. The SPA calls a *Resource controller with a DTO and a JWT.
  2. The controller delegates to a *Service; the service enforces the status transition rules (state machine).
  3. The mapper converts the DTO to an entity; the repository persists it. AbstractAuditingEntity stamps createdBy / createdDate automatically.
  4. Every status transition appends a row to the append-only event log (EvenimentInterdictie) — UPDATE/DELETE are forbidden at the repository level.
  5. Indexed entities are mirrored to Elasticsearch for search.