Open stevenbal opened 1 month ago
@bart-maykin @joeribekker hmm you're right, though upon looking at this again, I don't know if what I implemented here makes sense to begin with actually, because with the current logic there can only be three default addresses in total (one for each type). Should I add the betrokkene
and partij
to the condition in the unique constraint as well?
refinement: So, Partij should be included in the unique check.
We should allow something like this, where preference is not necessarily a default option (this should be enforced by the client app if needed).
default = per type, per party preference = overall preferred option, for a party
a. email: john@gmail.com (default, preference) b. email: john@maykin.com c. phone: 01234567890 (default) d. phone: 09876544321
You should also change the validation for the voorkeur digitaal adress to only allow these default addresses. Because I don't see a scenario where this would be wanted behavior.
this was discussed on monday and as Joeri mentioned, we will not enforce this but leave it to client applications to enforce this if needed
@annashamray this PR is ready for review.
I was working on splitting DigitaalAdres (https://github.com/maykinmedia/open-klant/pull/277) into two separate resources (one linked to Partij and one to Betrokkene), but as we talked about on slack we should probably discuss this next week, since it would be a breaking change
Fixes #246
Changes