aboutsummaryrefslogtreecommitdiff
path: root/docs/PROTOCOL.md
diff options
context:
space:
mode:
authorAnders Betts <anders.betts@gmail.com>2026-09-18 22:16:32 +0200
committerAnders Betts <anders.betts@gmail.com>2026-09-18 22:16:32 +0200
commite9fc91dbc8314a25a0d71b7ee4344d3fc4ccfd5e (patch)
treed5c14087df9db17c63b5be5cada4f11592c493b3 /docs/PROTOCOL.md
parent251eb8c54c77029f0b43aa987ea50c44016147f3 (diff)
downloadbokf-0.1.29.tar.gz
bokf-0.1.29.zip
attachments: link/unlink from the TUI, multi-voucher linksv0.1.29
The voucher detail can attach a file to an existing voucher (^F) and the underlag picker (f) can remove a link (d, confirmed). The Underlag inbox links a highlighted item to a voucher picked from a list (k). attachment.link and attachment.unlink are new write commands (dry-run, audited); unlinked files return to the inbox. The same content may now link to several vouchers — only the same voucher/attachment pair is a CONFLICT, matching the table's primary key.
Diffstat (limited to 'docs/PROTOCOL.md')
-rw-r--r--docs/PROTOCOL.md8
1 files changed, 7 insertions, 1 deletions
diff --git a/docs/PROTOCOL.md b/docs/PROTOCOL.md
index e3e629b..75f384f 100644
--- a/docs/PROTOCOL.md
+++ b/docs/PROTOCOL.md
@@ -351,11 +351,17 @@ required.
|---|---|---|
| `attachment.put` | `filename`, `mime`, `content_base64`, `voucher_id?` | ≤ max_attachment_bytes |
| `attachment.get` | `id` | returns base64 + sha256 |
+| `attachment.link` | `id`, `voucher_id` | write; audited |
+| `attachment.unlink` | `id`, `voucher_id` | write; audited |
| `attachment.list` | `voucher_id?`, `unlinked?`, `limit`, `cursor` | inbox = `unlinked:true` |
Attachments are immutable and content-addressed by SHA-256. They are linked to
vouchers at posting time (`attachment_ids`) or afterwards via
-`attachment.put` with `voucher_id`; links are separate insert-only rows.
+`attachment.put` with `voucher_id` or `attachment.link`; links are audited
+rows, and `attachment.unlink` removes one (an unlinked attachment returns
+to the inbox). One attachment may be linked to several vouchers (the link
+key is the voucher/attachment pair); linking the same pair twice is a
+`CONFLICT`.
### 7.6 Reports