feat(timeline): derive person life-events (Geburt/Tod/Heirat) — issue #776 #825
@@ -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())) {
|
||||
|
||||
Reference in New Issue
Block a user