|
1 | 1 | from django.conf import settings
|
| 2 | +from django.utils.translation import gettext_lazy as _ |
2 | 3 |
|
3 |
| -# TODO: write a propper description |
4 |
| -description = """ |
5 |
| -Description WIP. |
| 4 | +description = _( |
| 5 | + """ |
| 6 | +**Warning: Difference between `PUT` and `PATCH`** |
| 7 | +
|
| 8 | +Both `PUT` and `PATCH` methods are used to update the fields in a resource, |
| 9 | +but there is a key difference in how they handle required fields: |
| 10 | +
|
| 11 | +> The `PUT` method requires you to specify **all mandatory fields** when updating a resource. |
| 12 | +If any mandatory field is missing, the update will fail. |
| 13 | +
|
| 14 | +> The `PATCH` method, on the other hand, allows you to update only the fields you specify. |
| 15 | +Some mandatory fields can be left out, and the resource will only be updated with the provided data, |
| 16 | +leaving other fields unchanged. |
| 17 | +""" |
| 18 | +) |
| 19 | +partijen_description = _( |
| 20 | + """ |
| 21 | +**Atomicity in Partij and PartijIdentificator** |
| 22 | +
|
| 23 | +Starting from version **2.7.0**, the `Partij` endpoint has been modified to handle |
| 24 | +`PartijIdentificator` objects more effectively, |
| 25 | +allowing them to be processed within the same request. |
| 26 | +This ensures that both entities are handled atomically, preventing incomplete, |
| 27 | +and offering better control over the uniqueness of `PartijIdentificator` objects. |
| 28 | +
|
| 29 | +For `POST`, `PATCH`, and `PUT` requests for `Partij`, |
| 30 | +it is possible to send a list of `PartijIdentificator` objects. |
| 31 | +
|
| 32 | +**Warnings:** |
| 33 | +
|
| 34 | +- In all requests, `PartijIdentificator` objects should not contain the **UUID** |
| 35 | +of the parent `Partij`, because it is automatically assigned. |
| 36 | +- `POST` request: |
| 37 | + - If the **UUID** is provided in the `PartijIdentificator` object, |
| 38 | + the endpoint will treat it as an update operation for the existing `PartijIdentificator`, |
| 39 | + applying the provided data and linking the parent `Partij` to the new one created. |
| 40 | + - If the **UUID** is **not** specified, the system will create a new resource |
| 41 | + for the `PartijIdentificator` respecting all uniqueness constraints. |
| 42 | +- `PATCH` or `PUT` requests: |
| 43 | + - If the **UUID** is provided in the `PartijIdentificator` object, |
| 44 | + the system will update the specified resource with the new data. |
| 45 | + - If the **UUID** is **not** specified, the system will `DELETE` all `PartijIdentificator` |
| 46 | + objects related to the parent and `CREATE` new ones with the passed data. |
6 | 47 | """
|
| 48 | +) |
7 | 49 |
|
8 | 50 | custom_settings = {
|
9 | 51 | "TITLE": "klantinteracties",
|
|
22 | 64 | {"name": "klanten contacten"},
|
23 | 65 | {"name": "onderwerpobjecten"},
|
24 | 66 | {"name": "partij-identificatoren"},
|
25 |
| - {"name": "partijen"}, |
| 67 | + {"name": "partijen", "description": partijen_description}, |
26 | 68 | {"name": "rekeningnummers"},
|
27 | 69 | {"name": "vertegenwoordigingen"},
|
28 | 70 | ],
|
|
0 commit comments