-
Notifications
You must be signed in to change notification settings - Fork 6
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
✨ [#2179] Display list of Qmatic appointments in profiel #1099
Conversation
344d0c6
to
c0b909e
Compare
c0b909e
to
e83be31
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1099 +/- ##
===========================================
- Coverage 95.02% 94.92% -0.10%
===========================================
Files 911 919 +8
Lines 31991 32169 +178
===========================================
+ Hits 30399 30537 +138
- Misses 1592 1632 +40 ☔ View full report in Codecov by Sentry. |
e83be31
to
41f85fc
Compare
41f85fc
to
6dd5f69
Compare
6dd5f69
to
a1866a6
Compare
a1866a6
to
a4e7f8c
Compare
{% list_item text=appointment.branch.name caption=_("Locatie") compact=True strong=False %} | ||
{% list_item text=appointment.branch.addressCity compact=True strong=False %} | ||
{% list_item text=appointment.branch.addressLine2 compact=True strong=False %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if these are the right fields to display, because the documentation isn't too clear about what is stored in these fields
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feels like a testing and acceptance problem 😉
context["appointments"] = [] | ||
else: | ||
context["appointments"] = client.list_appointments_for_customer( | ||
quote(self.request.user.email) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assumes that the municipality uses a citizen's email as external_id
in Qmatic (still awaiting confirmation from Hoorn if this is correct). If we want to support bsn
or something else, we'll probably have to add a feature flag or choicefield on the config to enable that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This quote()
doesn't belong here but should be in the client method. It is not the responsibility of the using code to encode the values (as conceptually it doesn't even know how the client works internally).
This relates to my earlier comment I put in the client.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty clean, with some subtle feedback.
{% list_item text=appointment.branch.name caption=_("Locatie") compact=True strong=False %} | ||
{% list_item text=appointment.branch.addressCity compact=True strong=False %} | ||
{% list_item text=appointment.branch.addressLine2 compact=True strong=False %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feels like a testing and acceptance problem 😉
context["appointments"] = [] | ||
else: | ||
context["appointments"] = client.list_appointments_for_customer( | ||
quote(self.request.user.email) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This quote()
doesn't belong here but should be in the client method. It is not the responsibility of the using code to encode the values (as conceptually it doesn't even know how the client works internally).
This relates to my earlier comment I put in the client.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple minor questions + suggestions
|
||
self.assertEqual(len(cards), 2) | ||
|
||
passport_appointment = PQ(cards[0]).find("ul").children() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to use PyQuery directly, since you're already using response.pyquery
, or just more convenient?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It actually is necessary, it's a bit weird but for some reason I can't use .find
and other methods on the element that I get from cards[0]
directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks familiar: iirc pyquery doesn't wrap recursively like some other api's do.
5efd9a9
to
6d1313e
Compare
@Bartvaderkin can you re-review this? :) |
task: https://taiga.maykinmedia.nl/project/open-inwoner/task/2179
Can be tested by logging in with an account with email
[email protected]
and navigating to Mijn profielI adapted the client code from Open Forms and replaced
TypedDict
with pydantic'sBaseModel
to deserialize the data. Although we don't actually use the same client methods as OF (because OF implements creating appointments and we just need to implement the list of appointments + modify/cancel), this should probably be merged into a library at some point?