-
Notifications
You must be signed in to change notification settings - Fork 26
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
Add Product to the ZGW API registration #4803
base: master
Are you sure you want to change the base?
Conversation
9e24349
to
135ff90
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4803 +/- ##
==========================================
- Coverage 96.55% 96.55% -0.01%
==========================================
Files 748 748
Lines 25423 25474 +51
Branches 3362 3370 +8
==========================================
+ Hits 24548 24597 +49
Misses 610 610
- Partials 265 267 +2 ☔ View full report in Codecov by Sentry. |
63d8e50
to
f3c7954
Compare
src/openforms/js/components/admin/form_design/registrations/zgw/ZGWOptionsFormFields.stories.js
Show resolved
Hide resolved
1b0eee6
to
3574ee1
Compare
3574ee1
to
03d0f12
Compare
03d0f12
to
4e229c2
Compare
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'd suggest renaming product
-> product_url
everywhere so that it's clear we're dealing with a URL. Especially because we're moving literal URL-configuration options to their semantic 'description' and resolve URLs dynamically, I suspect we will go through this at some point too (where maybe a product slug/description will be stored instead of the exact URL).
flask_app: | ||
build: ./open-zaak | ||
ports: | ||
- "80:80" | ||
volumes: | ||
- ./open-zaak/:/app/ |
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.
Let's put this in it's own docker-compose and directory and not lump it in with open-zaak
. The products/services API specification doesn't exist yet so it definitely can't be part of Open Zaak.
A folder named rx_mission
is okay - that makes it clear which service/API we're supporting with this. Instructions for tests will then require you to bring up both open zaak and rx_mission docker compose
|
||
data = { | ||
"url": request.base_url, | ||
"id": "XXXXXXXX", |
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.
Maybe you can take the JSON file that was given to us, obfuscate that a little bit, but ultimately use that as a "database"? We then at least have some representative, different test data rather than every product (with different URLs) showing the same description.
# Log the request body | ||
app.logger.info("Request body: %s", request.data.decode("utf-8")) |
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.
Not needed, they're simple GET calls without body
@@ -48,9 +49,15 @@ class CaseType(TypedDict): | |||
beginGeldigheid: str # ISO 8601 date string | |||
eindeGeldigheid: NotRequired[str | None] # ISO 8601 date string or empty | |||
concept: NotRequired[bool] | |||
productenOfDiensten: NotRequired[list[str]] # URL pointers to products |
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.
class Product(TypedDict): | ||
uri: str | ||
description: NotRequired[str] |
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.
Would be good to add a comment that this is non-standard and not backed by any API specification yet
|
||
const ProductSelect = ({catalogueUrl = ''}) => { | ||
const { | ||
values: {zgwApiGroup = null, caseTypeIdentification = null}, |
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.
values: {zgwApiGroup = null, caseTypeIdentification = null}, | |
values: {zgwApiGroup = null, caseTypeIdentification = ''}, |
we're not using typescript yet, but still it's good practice to think about the data types :) this field is not nullable, ever.
ProductSelect.propTypes = { | ||
caseTypeIdentification: PropTypes.string, | ||
}; |
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.
proptypes don't match the actual props
case_type_identification = filter_serializer.validated_data[ | ||
"case_type_identification" | ||
] | ||
version_valid_on = datetime_in_amsterdam(timezone.now()).date() |
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.
version_valid_on = datetime_in_amsterdam(timezone.now()).date() | |
today = datetime_in_amsterdam(timezone.now()).date() |
@@ -72,6 +72,14 @@ class ZaakOptionsSerializer(JsonSchemaSerializerMixin, serializers.Serializer): | |||
), | |||
default="", | |||
) | |||
product = serializers.CharField( |
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.
Should be URLField, no?
product = serializers.CharField( | |
product = serializers.URLField( |
@@ -32,6 +32,7 @@ class RegistrationOptions(TypedDict): | |||
zgw_api_group: ZGWApiGroupConfig | |||
catalogue: NotRequired[CatalogueOption] | |||
case_type_identification: str | |||
product: NotRequired[str] |
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.
if you do default=""
on the serializer, you can drop the NotRequired
and that makes code less verbose
product: NotRequired[str] | |
product: str # URL reference to a product in the case type |
Closes #4796
Changes
Added product as a configuration option to the ZGW API registration. The product select gets populated from the selected case type. If there are multiple versions of the case type, then the case type version that is active at the moment of configuring is chosen.
Checklist
Check off the items that are completed or not relevant.
Impact on features
Release management
I have updated the translations assets (you do NOT need to provide translations)
./bin/makemessages_js.sh
./bin/compilemessages_js.sh
Commit hygiene