rems icon indicating copy to clipboard operation
rems copied to clipboard

Indicate whether an attachment is active or has been removed

Open teemukataja opened this issue 9 months ago • 1 comments

Is your feature request related to a problem? Please describe. When reading applications from GET /api/applications/{id} all attachments added to the application can be seen in {"application/attachments": []}.

When an application is returned to the applicant, if the applicant removes an attachment and submits the application again, the attachment is removed from the form field, but it is still in the attachments list.

Describe the solution you'd like It would be useful if the attachment list would indicate whether an attachment is still active on the form or if it has been removed, so that it doesn't have to be parsed from the events or the form fields.

e.g.

  "application/attachments": [
    {
      "attachment/id": 1,
      "attachment/filename": "liite.txt",
      "attachment/type": "text/plain",
      "attachment/user": {
        "userid": "user",
        "name": "User Name",
        "email": null,
        "notification-email": "[email protected]"
      },
      "attachment/can-redact": false,
      "active": false # <-- new field
    },

Doesn't have to be exactly this, can be any way to tell if an attachment has been removed, e.g. active: false, removed: true.

Describe alternatives you've considered Current alternative for me is to take the attachment id and parse the form fields to see if the attachment id is found from an attachment field.

Additional context

teemukataja avatar Apr 09 '25 11:04 teemukataja

NB. REMS could annotate each attachment with what the function classify-attachments basically returns, i.e. if the attachment is from an event attachment or form field value, or previous value.

Macroz avatar Apr 14 '25 07:04 Macroz