feat(timeline): derive person life-events (Geburt/Tod/Heirat) — issue #776 #825

Merged
marcel merged 6 commits from worktree-feat-issue-776-derived-person-life-events into main 2026-06-13 15:13:29 +02:00
Showing only changes of commit 7810ca7dd7 - Show all commits

View File

@@ -86,6 +86,15 @@ public class RelationshipService {
return new NetworkDTO(nodes, edges);
}
/**
* Returns all {@code SPOUSE_OF} edges with both person sides JOIN FETCHed.
* Used by {@code TimelineService.assembleDerivedEvents()} to build Heirat events
* without per-edge N+1 queries.
*/
public List<PersonRelationship> findAllSpouseEdges() {
return relationshipRepository.findAllByRelationTypeIn(List.of(RelationType.SPOUSE_OF));
}
@Transactional
public RelationshipDTO addRelationship(UUID personId, CreateRelationshipRequest dto) {
if (personId.equals(dto.relatedPersonId())) {