The egg sale form had two issues:
- Duplicate POST /actions/product-sold route in products.py was
overwriting the eggs.py handler, causing incomplete page responses
(no tabs, no recent sales list)
- Price input used cents while feed purchase uses euros, inconsistent UX
Changes:
- Remove duplicate handler from products.py (keep only redirect)
- Change sell form price input from cents to euros (consistent with feed)
- Parse euros in handler, convert to cents for storage
- Add TestEggSale class with 4 tests for the fixed behavior
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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>