maykinmedia / open-klant

Registratiecomponent voor de opslag en ontsluiting van klantgegevens volgens de Klantinteracties API-specificatie.
Other
2 stars 3 forks source link

✨ [#246] Add is_standaard_adres for DigitaalAdres #269

Open stevenbal opened 1 month ago

stevenbal commented 1 month ago

Fixes #246

Changes

stevenbal commented 4 weeks 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?

joeribekker commented 3 weeks ago

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

stevenbal commented 3 weeks ago

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

stevenbal commented 1 week ago

@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