add mileage support: files array, multiple odometer photos

This commit is contained in:
Connor Rhodes 2026-04-29 02:05:23 +00:00
parent 330dc09e85
commit bdb86c6c43

View file

@ -1,11 +1,11 @@
--- ---
name: log-work-expense name: log-work-expense
description: Log work expense receipts into MongoDB. Use when the user sends a receipt image (photo of a receipt) along with context about the expense, or says things like "log this expense", "record this receipt", "add this to my work expenses", "expense entry", or provides receipt details for work reimbursement tracking. description: Log work expense receipts and mileage into MongoDB. Use when the user sends receipt images or odometer photos along with context about the expense, or says things like "log this expense", "record this receipt", "add this to my work expenses", "expense entry", "mileage for XYZ", or provides receipt/mileage details for work reimbursement tracking.
--- ---
# Log Work Expense # Log Work Expense
Log receipt images and expense details into the `wip.work_expenses` collection in MongoDB. Log receipt images and mileage into the `wip.work_expenses` collection in MongoDB.
## Trigger Phrases ## Trigger Phrases
@ -13,28 +13,40 @@ Log receipt images and expense details into the `wip.work_expenses` collection i
- "record this receipt" - "record this receipt"
- "add this to my work expenses" - "add this to my work expenses"
- "expense entry" - "expense entry"
- "mileage for XYZ"
## Steps ## Steps
1. **Upload the receipt image to S2** — If the user provided an image, upload it to S2 and get the public URL. If they only provided a file or no image, skip this step. 1. **Upload images to S2** — Upload any images the user provided to S2 and collect the URLs.
2. **Insert into MongoDB** — Insert a document into `wip.work_expenses` with this structure: 2. **Insert into MongoDB** — Insert a document into `wip.work_expenses` with this structure:
**Single receipt:**
```json ```json
{ {
"file": "https://s2.connorrhodes.com/agent/{sha256}.{ext}", "files": ["https://s2.connorrhodes.com/agent/{sha256}.{ext}"],
"date": "YYYY-MM-DD", "date": "YYYY-MM-DD",
"note": "Context the user provided about the expense", "note": "Context the user provided",
"status": "todo" "status": "todo"
} }
``` ```
- **file**: The S2 URL of the uploaded receipt image. Omit if no image was provided. **Mileage (multiple odometer photos):**
```json
{
"files": ["https://s2.connorrhodes.com/agent/{sha2561}.jpg", "https://s2.connorrhodes.com/agent/{sha2562}.jpg"],
"date": "YYYY-MM-DD",
"note": "Context the user provided about the trip",
"status": "todo"
}
```
- **files**: Array of S2 URLs. One entry for receipts, two entries for mileage (start and end odometer).
- **date**: Always use today's date (the date you receive the message), formatted as YYYY-MM-DD. - **date**: Always use today's date (the date you receive the message), formatted as YYYY-MM-DD.
- **note**: What the user told you about the expense (e.g. "travel meal during LTISD onsite"). If they didn't provide context, ask. - **note**: What the user told you about the expense or trip. If they didn't provide context, ask.
- **status**: Always set to `"todo"` when inserting. - **status**: Always set to `"todo"` when inserting.
3. **Confirm** — Reply with a brief confirmation showing what was logged (date, note, and file link if applicable). 3. **Confirm** — Reply with a brief confirmation showing what was logged (date, note, and file links).
## Notes ## Notes