-
Notifications
You must be signed in to change notification settings - Fork 3
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
Accept Partij Identificatoren as part of Partij creation #239
Comments
I can take this ticket because it is related to this: #267. |
@Hugo-ter-Doest while implementing this, @danielmursa-dev hit upon a question we might want to consider from an architectural perspective. The This is I think problematic because
should function as a natural key and be unique. For example, a single
I would proposed the following changes:
This would, among other things, make this current feature more cogent, because creating a |
Refinement: There is some discussion about this. I see the |
@swrichards please reply (without bobby knowing) |
In my view this is a very significant downside, but that might be due to incorrect assumptions. Although this is more to do with #267, in my understanding the critical problem that we wish to solve is ambiguity around which Simply put, in my understanding the whole point of |
Refinement: We discussed this and #262 and find that the API becomes a little messy this way. If we follow these issues, the retrieval of Partij+PartijIdentificatoren (PI)is done via "expand" and the creation is done via a POST. We think this should be more the same, and thus make the retrieval of Partij+PI work with a GET-operation as well. While at it, we then also want to support PUT/PATCH for this nested resource. To that end, we also discussed how this behaviour should work, resulting in a very simple description (and also matches the current behaviour :)): PUT works like PATCH, with 1 difference. For PUT required fields are validated to be present in the request. For PATCH, this validation is not done. This allows us to update nested resources as you would update main resources. Behaviour of PUT and PATCH for nested resources: Current:
{
"foo": [
{
"id": 1,
"bar": "abc"
}
]
}
Scenario A
----------
PUT content:
{
"foo": []
}
Result:
{
"foo": []
}
Scenario B
----------
PUT
{
"foo": [
{
"id": 2
"bar": "klm"
}
]
}
Result:
Error: Because ID is generated and doesnt exist.
Scenario C
----------
PUT
{
"foo": [
{
"bar": "klm"
}
]
}
Result:
{
"foo": [
{
"id": 2,
"bar": "klm"
}
]
}
Scenario D
----------
PUT
{
}
Result:
{
"foo": [
{
"id": 1,
"bar": "abc"
}
]
}
Scenario E
----------
PUT
{
"foo": [
{
"id": 1,
"bar": "klm"
}
]
}
Result:
{
"foo": [
{
"id": 1,
"bar": "klm"
}
]
}
Scenario F
----------
PUT
{
"foo": [
{
"id": 1,
"bar": "klm"
},
{
"bar": "xyz"
}
]
}
Result:
{
"foo": [
{
"id": 1,
"bar": "klm"
},
{
"id": 2,
"bar": "xyz"
}
]
}
Scenario G
----------
Assume "bar" is optional. In this case PUT works as PATCH.
If "bar" is required, in the case of PUT it would throw a 400 error. In case of PATCH it would succeed.
PUT
{
"foo": [
{
"id": 1,
},
{
"bar": "xyz"
}
]
}
Result:
{
"foo": [
{
"id": 1,
"bar": "klm"
},
{
"id": 2,
"bar": "xyz"
}
]
} |
Thema / Theme
Klantinteracties API
Omschrijving / Description
Update the
partijenCreate
payload to accept one or more partij identificatoren, e.g.:Toegevoegde waarde / Added value
A common pattern emerging in Open Inwoner Platform is (1) creating a
Partij
and immediately subsequent to that (2) creating aPartijIdentificator
. We canonically identify parties in OK through the usual suspects from the basisregistraties:bsn
,kvk
, and so on.Although the bare
Partij
has thenummer
field, its intent is not very clear when it is client provided: OIP might choose to use thenummer
to build its own scheme (e.g. setting it to our internal user ID, or some pseudonymised version thereof), but this might not play well with other clients reading and writing from OK. We would in any case like to avoid having to maintain our internal mapping between aPartij.{uuid|nummer}
.TLDR: we would like to canonically identify a
Partij
through aPartij Identificator
, and this would be eased by being able to create thePartij
with itsIdentificator
atomically. The added value is thus it facilitates our use-case, in at least two ways:Partij
creation could succeed by the PartijIdentificator could fail. This forces clients to maintain a retry/compensating transaction queue, which is a nuisance. But also, it runs the risk of orphaned Partij objects lacking a clear identificator due to such a failed transaction.Our assumption is that this is probably a common use-case, but that is just a hunch.
Aanvullende opmerkingen / Additional context
No response
The text was updated successfully, but these errors were encountered: