hsa-app/internal/web/templates/upload.html
Jean-Michel Tremblay 8b7252dad4 Initial commit: HSA receipt tracker
Go app for capturing and archiving HSA-eligible receipts: OIDC/PKCE auth
against Authelia, SQLite storage with dual-write (filesystem + DB blob),
mobile-first upload, and DB export.

Adds AI receipt classification: a config.json catalog of people and
categories (seeded into the DB on startup), a prompt builder that derives
name-order/initial variants from the data (with same-surname ambiguity
handling), and an Anthropic tool-use client behind POST /classify. Tests
run against a mock endpoint; a live integration test is env-gated to the
cheapest model.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 21:40:12 -04:00

29 lines
1.4 KiB
HTML

{{define "title"}}Add receipt{{end}}
{{define "content"}}
<header>
<span>{{.Subject}}</span>
<span><a href="/manage">Manage</a> · <a href="/export">Export</a> · <a href="/logout">Log out</a></span>
</header>
<h1>Add receipt</h1>
{{range .Errors}}<div class="err">{{.}}</div>{{end}}
<form method="post" action="/upload" enctype="multipart/form-data">
<label for="receipt">Receipt photo or PDF</label>
<input id="receipt" type="file" name="receipt" accept="image/*,application/pdf" capture="environment" required>
<label for="amount">Amount ($)</label>
<input id="amount" type="number" name="amount" step="0.01" min="0.01" inputmode="decimal" value="{{.Amount}}" required>
<label for="receipt_date">Date on receipt</label>
<input id="receipt_date" type="date" name="receipt_date" value="{{.Date}}" required>
<label for="category_id">Category</label>
<select id="category_id" name="category_id">
{{$sc := .CategoryID}}
{{range .Categories}}<option value="{{.ID}}" {{if eq (printf "%d" .ID) $sc}}selected{{end}}>{{.Label}}</option>{{end}}
</select>
<label for="person_id">Who</label>
<select id="person_id" name="person_id">
{{$sp := .PersonID}}
<option value=""></option>
{{range .People}}<option value="{{.ID}}" {{if eq (printf "%d" .ID) $sp}}selected{{end}}>{{.Label}}</option>{{end}}
</select>
<button type="submit" class="primary">Submit</button>
</form>
{{end}}