maykinmedia / open-klant

Registratiecomponent voor de opslag en ontsluiting van klantgegevens volgens de Klantinteracties API-specificatie.
Other
2 stars 3 forks source link

Klantcontact.onderwerpobjecten inline does not show related onderwerpobjecten #261

Closed stevenbal closed 1 week ago

stevenbal commented 1 month ago

Product versie / Product version

latest

Omschrijf het probleem / Describe the bug

Onderwerpobjecten do not show up in the inline of the Klantcontact admin, despite existing in the API

image

GET http://localhost:8000/klantinteracties/api/v1/onderwerpobjecten

{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "uuid": "27b2bd53-4416-4e22-93bb-98bf650dbe06",
      "url": "http://localhost:8000/klantinteracties/api/v1/onderwerpobjecten/27b2bd53-4416-4e22-93bb-98bf650dbe06",
      "klantcontact": {
        "uuid": "68c1fd86-a772-4aeb-bccd-a6143b552ada",
        "url": "http://localhost:8000/klantinteracties/api/v1/klantcontacten/68c1fd86-a772-4aeb-bccd-a6143b552ada"
      },
      "wasKlantcontact": null,
      "onderwerpobjectidentificator": {
        "objectId": "objectId",
        "codeObjecttype": "codeObjecttype",
        "codeRegister": "codeRegister",
        "codeSoortObjectId": "codeSoortObjectId"
      }
    }
  ]
}

Stappen om te reproduceren / Steps to reproduce

  1. Create a Klantcontact via the API
  2. Create a related Onderwerpobject via the API
  3. Navigate to /admin/klantinteracties/klantcontact and click on the newly created Klantcontact
  4. Scroll down to the Onderwerpobjecten inline and observe that it is empty

Verwacht gedrag / Expected behavior

The admin should show the related onderwerpobjecten

stevenbal commented 1 month ago

Might be because the Onderwerpobject resource has both klantcontact and was_klantcontact fields. I'm not sure what the difference between them is @bart-maykin do you know more about this?

joeribekker commented 1 month ago

if you look at the model (https://vng-realisatie.github.io/klantinteracties/informatiemodel/semantisch_model) it shows 2 relations:

wasKlantcontact: OnderwerpObject-was->Klantcontact klantcontact: Klantcontact-(gingover->OnderwerpObject

So, we need to make sure the admin shows the proper one (or the API?)

Coperh commented 2 weeks ago

The current behaviour in the admin:

The above API example is shows that wasKlantcontact is None and thus is not related to any admin klantcontact.