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

Feature/239 add partij identificatoren on partij creation #321

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

danielmursa-dev
Copy link
Contributor

@danielmursa-dev danielmursa-dev commented Jan 22, 2025

Fixes #239

// POST /partijen allow to pass a list of partijIdentificatoren:

  • partij_identificator or UUID
// POST /partijen
{
    ...
    ...
    # list of partij identificatoren
    "partijIdentificatoren": [
        # create new partij_identificator and attach to partij
        {
            "anderePartijIdentificator": "string",
            "partijIdentificator": {
                "codeObjecttype": "niet_natuurlijk_persoon",
                "codeSoortObjectId": "rsin",
                "objectId": "296648875",
                "codeRegister": "hr",
            },
        },
        # attach existing partij_identificator with UUID to partij
        {
            "uuid": str(partij_identificator.uuid),
        },
    ],
    ...
    ...
}

// PUT /partijen allow to pass a list of partijIdentificatoren:

  • partij_identificator obj or UUID

// PUT /partijen
3 cases:

# 1 no action is performed
{
    ...
    ...
    # None or not specified key in PUT /partijen
    "partijIdentificatoren": None
    ...
    ...
}

# 2 delete all partijIdentificatoren, because specified a empty list
{
    ...
    ...
    # empty list in PUT /partijen
    "partijIdentificatoren": []
    ...
    ...
}

# 3 delete all partijIdentificatoren and attach new partij_identificator as in POST
{
    ...
    ...
    # list of partij identificatoren
    "partijIdentificatoren": [
        # create new partij_identificator and attach to partij
        {
            "anderePartijIdentificator": "string",
            "partijIdentificator": {
                "codeObjecttype": "niet_natuurlijk_persoon",
                "codeSoortObjectId": "rsin",
                "objectId": "296648875",
                "codeRegister": "hr",
            },
        },
        # attach existing partij_identificator with UUID to partij
        {
            "uuid": str(partij_identificator.uuid),
        },
    ],
    ...
    ...
}

**
For updating partij-identificatoren, this is not the right endpoint, because the edpoint /partij-identificatoren/ remains accessible for their operation.
**

Copy link
Contributor

@swrichards swrichards left a comment

Choose a reason for hiding this comment

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

One or two conceptual points to consider, see the comments.

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 99.22481% with 1 line in your changes missing coverage. Please review.

Project coverage is 97.21%. Comparing base (e6a3ea4) to head (8d4b20f).
Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
...nents/klantinteracties/api/serializers/partijen.py 97.14% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #321      +/-   ##
==========================================
+ Coverage   97.10%   97.21%   +0.11%     
==========================================
  Files         179      182       +3     
  Lines        8671     9061     +390     
==========================================
+ Hits         8420     8809     +389     
- Misses        251      252       +1     

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

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.

Accept Partij Identificatoren as part of Partij creation
4 participants