docs(adr): ADR-036 — geschichte responses are views, never entities

Captures the read-model invariant that was only living in a code comment:
views are assembled in-transaction, entities never cross the controller
boundary in the geschichte domain. CLAUDE.md §DTOs now names the exception
so the convention text stops contradicting the code.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-06-10 07:29:21 +02:00
parent d34afb2298
commit d6ac88a211
3 changed files with 69 additions and 1 deletions

View File

@@ -148,6 +148,9 @@ public class GeschichteService {
g.setPublishedAt(LocalDateTime.now());
}
Geschichte saved = geschichteRepository.save(g);
// A freshly created Geschichte has no items by construction — items are only
// addable via the separate /items endpoints. Revisit if a create DTO ever
// accepts initial items.
return toView(saved, List.of());
}