feat: implement product-sold route (Step 9.2)

Add POST /actions/product-sold route for recording product sales.

Changes:
- Create web/templates/products.py with product_sold_form
- Create web/routes/products.py with GET /sell and POST /actions/product-sold
- Wire up routes in __init__.py and app.py
- Add "Record Sale" link to Egg Quick Capture page
- Add comprehensive tests for form rendering and sale recording

The form allows selling any sellable product with quantity and price,
and calculates unit_price_cents using floor division. Defaults to
egg.duck product as per spec.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-31 14:16:12 +00:00
parent 943383a620
commit 0eef3ed7cb
7 changed files with 603 additions and 12 deletions

10
PLAN.md
View File

@@ -353,11 +353,11 @@ Check off items as completed. Each phase builds on the previous.
- [x] Write tests for each action
- [x] **Commit checkpoint**: 29ea3e2
### Step 9.2: Product Sold Route
- [ ] POST /actions/product-sold
- [ ] Create form template
- [ ] Write tests: sale creates event, unit price calculated
- [ ] **Commit checkpoint**
### Step 9.2: Product Sold Route
- [x] POST /actions/product-sold
- [x] Create form template
- [x] Write tests: sale creates event, unit price calculated
- [x] **Commit checkpoint**
### Step 9.3: User Defaults
- [ ] Create migration for user_defaults table