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

Als gebruiker wil ik gedurende de afhandeling van de zaak specifieke documentversies kunnen verwijderen #1767

Open
CMasselink opened this issue Feb 17, 2021 · 5 comments

Comments

@CMasselink
Copy link
Collaborator

Zodat alleen de versies bij de zaak bewaard blijven die daadwerkelijk bewaard moeten worden.
Deze functionaliteit is nodig om te voorkomen dat de DRC volloopt met documentversies die eigenlijk niet bewaard hoeven te blijven, en daarmee de inhoud van de DRC beheerbaar te houden. Op deze manier is, wanneer nodig, reconstructie achteraf veel beter mogelijk dan wanneer alle documentversies bewaard blijven.

Het gaat dus om het kunnen verwijderen van specifieke versies van documenten. Op dit moment is het alleen mogelijk om een een geheel informatieobject te verwijderen.
Verwijderen van versies kan gedurende de looptijd van de zaak plaatsvinden (bijvoorbeeld bij het bereiken van bepaalde mijlpalen/statussen).

@michielverhoef
Copy link
Collaborator

Dan moet eerst een eventuele relatie (objectinformatieobject) naar een specifieke versie van een document verwijderd worden. Zie ook #459.

Opnemen in beschrijving gedrag.

@sergei-maertens
Copy link
Collaborator

Dan moet eerst een eventuele relatie (objectinformatieobject) naar een specifieke versie van een document verwijderd worden. Zie ook #459.

dat hoort dus een validatiestap te zijn in de documenten API - dat alle relaties eerst verbroken worden. Ik laat een collega van mij aan een PR werken hiervoor op de referentie-implementatie.

@michielverhoef
Copy link
Collaborator

PR VNG-Realisatie/documenten-api#146 aangemaakt voor dit issue

@sergei-maertens
Copy link
Collaborator

The technical implementation is in VNG-Realisatie/documenten-api#145

There are a number of situations that can happen when using this, so below is a summary of all options handled.

  1. DELETE /api/v1/enkelvoudiginformatieobjecten/<uuid>

    • existing behaviour remains
    • validates that there are no more relations to other objects (zaken, besluiten)
    • delete cascades: gebruiksrechten & audittrails are deleted as well
  2. DELETE /api/v1/enkelvoudiginformatieobjecten/<uuid>?versie=<int>

    There are multiple paths here:

    1. This is one version of many

      • validate that there are no other objects related to this specific version (zaken, besluiten)
      • delete this particular version
      • gebruiksrechten & audittrails are not deleted
    2. This is the last remaining version of the document

      • validate that there are no other objects related to this specific version (zaken, besluiten)
      • validate that there are no other objects related to any version (zaken, besluiten) (implicit 'latest' version relation)
      • delete the document
      • delete cascades: gebruiksrechten & audittrails are deleted as well

This implies small changes to the writes as well:

  • When a document is related to another resource (zaak, besluit), it's possible to use the document URL including the ?versie querystring parameter. This version information is available in the OIO response body with the read-only informatieobject_versie attribute (so the clients don't have to parse that from the URL).
  • Relations can be made with explicit version or without. In the latter case, the relation points de-facto to the "latest version" of the document.
  • The relating to specific or implicit latest version is functionally unchanged from 1.0 - these changes make it more explicit and structured. The changes are required to be able to do proper/efficient unique-constraint validation.

@michielverhoef
Copy link
Collaborator

Thanks @sergei-maertens. I will this description in the "aanvullende specificaties"

@michielverhoef michielverhoef removed their assignment Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants