Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ [#1868] Implement Mijn vragen for companies #904

Merged
merged 7 commits into from
Dec 18, 2023

Conversation

stevenbal
Copy link
Contributor

@stevenbal stevenbal commented Dec 14, 2023

@stevenbal stevenbal marked this pull request as draft December 14, 2023 12:14
@codecov-commenter
Copy link

codecov-commenter commented Dec 14, 2023

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (72bd3a2) 92.91% compared to head (904b902) 92.92%.
Report is 10 commits behind head on develop.

Files Patch % Lines
src/open_inwoner/openklant/wrap.py 81.81% 8 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #904      +/-   ##
===========================================
+ Coverage    92.91%   92.92%   +0.01%     
===========================================
  Files          817      818       +1     
  Lines        28027    28212     +185     
===========================================
+ Hits         26041    26217     +176     
- Misses        1986     1995       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@stevenbal stevenbal force-pushed the feature/1868-mijn-vragen-for-companies branch 3 times, most recently from 459ca9b to 69d0276 Compare December 14, 2023 15:12
@stevenbal stevenbal marked this pull request as ready for review December 14, 2023 15:23
@stevenbal stevenbal force-pushed the feature/1868-mijn-vragen-for-companies branch from 69d0276 to 1d41a6e Compare December 14, 2023 15:37
@stevenbal
Copy link
Contributor Author

I moved the feature flag to toggle between RSIN/KvK to the OpenKlant config, so this PR is ready for review @alextreme @pi-sigma

Copy link
Member

@alextreme alextreme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, nice work. @pi-sigma after your review I'll do a final check

@alextreme alextreme requested review from alextreme and removed request for alextreme December 18, 2023 10:34
Copy link
Contributor

@pi-sigma pi-sigma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if some of the duplication in openklant.wrap could/should be removed, along the lines of the comment I left. Perhaps I've missed a reason for writing different functions that specifically work with bsn, kvk, and rsin. Otherwise looks good to me.

kcm = fetch_klantcontactmoment_for_kvk_or_rsin(
kwargs["kcm_uuid"], kvk_or_rsin
)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • We're performing the same check in the list and detail view.
  • The code for fetch_klantcontactmoment_for_bsn and fetch_clantcontactmoment_for_kvk_or_rsin in wrap.py is (almost?) identical, ditto for the list versions.

Perhaps we could make the function more generic, i.e. fetch_klantcontactmoment, which works with bsn, kvk, and rsin. We could perform this check and grab the relevant data in the KlantContactMomentBaseView and store it in the context as USER_IDENTIFIER, which could be bsn, kvk, or rsin. Then we could do kcm = fetch_klant_contactmoment(USER_IDENTIFIER).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're right, it was a bit too much copy pasting. I modified it 904b902, I chose not to add the fetch parameters to the context data, because this check is also performed in another view (+ we don't want to expose things in context that we're not gonna use in our templates).

@stevenbal stevenbal force-pushed the feature/1868-mijn-vragen-for-companies branch from 0ae99d0 to 1263111 Compare December 18, 2023 13:46
@stevenbal stevenbal force-pushed the feature/1868-mijn-vragen-for-companies branch from 1263111 to 904b902 Compare December 18, 2023 14:02
@alextreme alextreme merged commit c14479b into develop Dec 18, 2023
14 checks passed
@alextreme alextreme deleted the feature/1868-mijn-vragen-for-companies branch December 18, 2023 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants