I have a project in which I have a 1->N relationship: a person needs to have at least a pet. Because of this rule, we can't have a person without any pets.
There are a PetRepository and a PersonRepository with a delete function.
When deleting a pet, which would be the recommended approach in clean architecture?
1. Check in the domain whether that was the only pet of the person: if true, delete person, if not delete pet
2. Implement the PetRepository delete method in such a way that it enforces data integrity in the DB, for instance by deleting the pet.