Skip to content

API - DRS Removal of Documents Files #24126

Closed

Description

@arlentees
  • Model change depending on policy decision of handling public files
  • Spec updates
  • Update unit tests

Possible actual deletions may be restricted by:

  • document class
  • staff account ID

For now update the DRS API to allow staff to:

  • Actually delete individual document files from document storage by documentServiceId (DELETE). Delete the file from cloud storage, remove the reference, and mark the record as deleted.
  • Mark an individual document record as deleted by documentServiceId (PATCH)
  • Mark all document records associated with a consumerDocumentId as deleted (PATCH)

Records marked as deleted are excluded from GET requests (searching).

Background:
Outstanding Question - Can we actually delete files? We will need to get explicit approval to destroy records
Can we flag a record so that it is no longer searchable?

  • could be done on the entire record (for example if it was done in error - this is a business question)
  • could be done on individual documents (for example being replaced or a corrupt)
    Justification for record deletion:
  • failing a virus scan should be a delete (automated or manual action - work to be done in another ticket)
  • staff uploaded the document in error.
  • file is not a pdf

Activity

  1. self-assigned this
    on Nov 26, 2024
  2. changed the title [-]API - DRS Removal and Edit of Documents Files[/-] [+]API - DRS Removal of Documents Files[/+] on Nov 26, 2024
  3. doug-lovett commented on Nov 27, 2024

    @doug-lovett
    Collaborator

    Example request to permanently delete an uploaded file by document service ID.
    DELETE https://bcregistry-dev.apigee.net/doc/api/v1/documents/DS0000100506

    Example request to mark a document record as deleted:
    PATCH https://bcregistry-dev.apigee.net/doc/api/v1/documents/DS0000100506
    {
    "removed": true
    }

  4. doug-lovett commented on Nov 28, 2024

    @doug-lovett
    Collaborator

    Latest postman collection with example requests - remove .txt.
    doc-api-unit.postman_collection.json.txt

  5. chdivyareddy commented on Dec 2, 2024

    @chdivyareddy
    Collaborator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions