Receipts¶
Receipts attach to five kinds of records:
- payment — a brother's dues payment
- deduction — a brother's out-of-pocket spending
- donation — incoming donation
- transaction — a Slash card swipe
- expense — a recurring bill / nationals payment
All five flow through the same upload pipeline. Files are saved on the bot server under receipts/<year>/<kind>/<record_id>.<ext> — local-first, the bot is the source of truth.
/attach_receipt¶
Upload a receipt and link it to a record.
Usage: /attach_receipt <kind> <record_id> <file>
| Argument | Required | Description |
|---|---|---|
kind |
yes | Payment / Deduction / Donation / Transaction / Expense |
record_id |
yes | The record's ID (visible in the record's confirmation embed) |
file |
yes | Image (PNG/JPEG/WebP/GIF/HEIC) or PDF, max 25 MB |
Example:
Limits:
- 25 MB file size cap
- Allowed types: PNG, JPG/JPEG, WebP, GIF, HEIC, PDF
- Other types rejected with a clear error
How to find a record ID¶
| Kind | Where the ID shows |
|---|---|
| Payment | In the /log_payment confirmation footer, or /my_history, or /show_payment |
| Deduction | /deduct_dues confirmation, or /show_deduction |
| Donation | /log_donation confirmation, or /donations list |
| Transaction | /charges row (printed under each row in a code block), or /txn footer |
| Expense | /list_expenses row, or /show_expense footer |
For mobile copy-paste, /charges and the dropdown drill-downs include a plain-text follow-up message with just the ID — long-press → Select All → Copy.
What happens when you attach¶
- Bot downloads the file from Discord (Discord CDN URLs expire, so we save immediately to disk)
- Saves under
receipts/<year>/<kind>/<id>.<ext>on the bot server - Updates the record's
receipt_pathfield in Mongo - (Transactions only) Pushes "📎 Receipt attached" memo to Slash via
PATCH /transaction/{id}/noteif a memo was set
After upload, the record's display will show "Receipt: 📎 attached". /charges rows show a 📎 indicator. Drill-down views show the receipt image inline.
Permanence¶
Receipts persist on the server forever — they don't get cleaned up automatically. If you back up the bot, include the receipts/ directory.
The Slash dashboard does not show our receipts (their API doesn't have a transaction-attachment endpoint — only expense reports do, and we don't use those). The bot is the canonical receipt store.