feat: add feed given event handling

- Add FEED_GIVEN to FeedInventoryProjection with apply/revert
- Add give_feed method to FeedService
- Block feed given if no purchase exists <= ts_utc
- Validate feed type and location existence
- 13 new tests for give_feed functionality

🤖 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-29 08:10:37 +00:00
parent ff8f3bb3f5
commit fa3c99b755
4 changed files with 349 additions and 13 deletions

12
PLAN.md
View File

@@ -153,12 +153,12 @@ Check off items as completed. Each phase builds on the previous.
- [x] **Commit checkpoint** (5c10a75)
### Step 4.2: Feed Given Event
- [ ] Implement apply_feed_given (increment given_kg, decrement balance)
- [ ] Implement revert_feed_given
- [ ] Add give_feed to services/feed.py
- [ ] Block if no purchase <= ts_utc
- [ ] Write tests: give updates inventory, blocked without purchase, revert
- [ ] **Commit checkpoint**
- [x] Implement apply_feed_given (increment given_kg, decrement balance)
- [x] Implement revert_feed_given
- [x] Add give_feed to services/feed.py
- [x] Block if no purchase <= ts_utc
- [x] Write tests: give updates inventory, blocked without purchase, revert
- [x] **Commit checkpoint** (2eb0ca7)
### Step 4.3: Product Collection Event
- [ ] Create `projections/products.py` for ProductCollected