Add receipt/attachment support to journal entries #11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Users need to attach receipt photos or documents to their expense (and income) submissions. The frontend already has image upload infrastructure via pict-rs (
img.<domain>), but castle has no way to store attachment URLs on journal entries.Proposed Changes
1. Add
attachmentsfield to expense submission2. Store as Beancount metadata
Attachments can be stored as metadata on the journal entry:
3. Return attachments in API responses
When querying entries via
/entries/useror/entries/pending, include attachment URLs in the response so the frontend can display receipt thumbnails.Context
The Castle standalone app implements an "expense drafts" feature where users can:
Without this backend support, receipt URLs can only live in the draft (localStorage) and are lost when the expense is submitted.
Image Infrastructure
Images are hosted on pict-rs at
VITE_PICTRS_BASE_URL(e.g.,https://img.example.com). The frontend'sImageUploadServicehandles uploads and returns URLs. Castle just needs to store and return these URLs — no image processing needed on the backend.Splitting the "drafts" workflow this issue's Context section motivates out into its own dedicated issue: #21 — Add server-persisted entry drafts (snap-and-finish-later workflow).
The two features compose but ship independently:
attachmentsfield on entries, Beancount metadata storage, and surfacing URLs in API responses.This issue's Context section ("expense drafts feature") can be read as motivation rather than scope — the actual draft implementation lives in #21.