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) ──▶ ElasticsearchRequest lifecycle
Section titled “Request lifecycle”- The SPA calls a
*Resourcecontroller with a DTO and a JWT. - The controller delegates to a
*Service; the service enforces the status transition rules (state machine). - The mapper converts the DTO to an entity; the repository persists it.
AbstractAuditingEntitystampscreatedBy / createdDateautomatically. - Every status transition appends a row to the append-only event log
(
EvenimentInterdictie) — UPDATE/DELETE are forbidden at the repository level. - Indexed entities are mirrored to Elasticsearch for search.