MGTEKENINGENSETmichaelgoldman.dev

BLAD 03Projecten

ENNLCV
BLADEN
ENNLCV
BLAD 03 · TEKENINGENREGISTER

DETAILBLAD 03.2 — P-02

Subscription Tracker

Track recurring subscriptions and see your monthly total. Part 1 of the series: a classic layered backend with hand-written SQL.

REPOSITORY OP GITHUB

JUN 2026 · DEEL 1 VAN DE SERIE

FIG. 1 — LAYERS
ControllerREST · validation
DTOs
Servicetransactions · mapping
entity
DAO · JdbcTemplatehand-written SQL
SQL
PostgreSQL 16Flyway migrations

SPECIFICATIE

LAYERS
Controller → service → DAO, each talking only to the one beneath. DTOs at the edge; the entity never leaves the service.
DATA ACCESS
Spring JDBC: JdbcTemplate with hand-written, parameterized SQL and RowMappers — no JPA, no Spring Data.
MIGRATIONS
Flyway on PostgreSQL 16. V2 replaces a plain unique constraint with a case-insensitive unique index on LOWER(name).
API
Code-first OpenAPI with springdoc and Swagger UI; versioned under /api/v1, Bean Validation at the edge.
ERRORS
RFC 9457 problem details (400, 404, 409) from one exception handler; unexpected errors get a generic message, never the exception text.
TESTING
63 tests, written test-first: unit, web slice, DAO integration and end-to-end against a real PostgreSQL on Testcontainers; JaCoCo coverage.
FIG. 2 — TEST PYRAMID — 63 TESTS
  1. 2end-to-end on Testcontainers
  2. 22DAO integration
  3. 25web slice
  4. 14unit

REV. NOTE Names are unique regardless of case — enforced by a case-insensitive unique index, not just in code.