Create digital address for betrokkene in Customer Interactions API#6280
Conversation
… the existing address and doesn't set it as a default one
ef94940 to
74f89f8
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6280 +/- ##
==========================================
- Coverage 97.08% 97.07% -0.01%
==========================================
Files 872 866 -6
Lines 33122 32760 -362
Branches 2990 2982 -8
==========================================
- Hits 32155 31802 -353
+ Misses 652 646 -6
+ Partials 315 312 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
robinmolen
left a comment
There was a problem hiding this comment.
I have a few small suggestions, but otherwise this looks good!
|
|
||
| # flow 3. we create a new address and link it to betrokkene | ||
| elif ( | ||
| not is_address_new_preferred and address_value != prefill_preferred |
There was a problem hiding this comment.
I had some difficulty trying to understand this condition (mostly because i wasn't sure what prefill_preferred was, as i forgot what the property preferred on the CommunicationChannel represented).
Because we have the same check for flow 5, it might be nice to define a is_preferred variable.
So:
is_preferred_address: bool = bool(address_value == prefill_preferred)
...
# flow 3. we create a new address and link it to betrokkene
elif not is_address_new_preferred and not is_preferred_address:Bonus: in the type definition of CommunicationChannel it might be nice to add a comment what the property preferred contains. Something like:
class CommunicationChannel(TypedDict):
type: SupportedChannels
options: Sequence[str]
preferred: str | None # The preferred address in this channelThere was a problem hiding this comment.
Yes, I think with these changes the code is more readable. I also changed if statements, I couldn't get rid of nested "ifs", but I think now is clearer what happens in each flow
ad1c457 to
77bb2a7
Compare
| if prefill_communication_channel | ||
| else None | ||
| ) | ||
| is_preferred_address: bool = bool(address_value == prefill_preferred) |
There was a problem hiding this comment.
| is_preferred_address: bool = bool(address_value == prefill_preferred) | |
| is_preferred_address = address_value == prefill_preferred |
the cast to bool is not necesary for a simple equality test
77bb2a7 to
ae4d620
Compare
Closes #6082
Changes
voor de volgende keer.")
Checklist
Check off the items that are completed or not relevant.
Impact on features
Dockerfile/scripts
./binfolderCommit hygiene
Documentation