## Goal Add a hosted service that consumes engagement outbox events and maintains the `RecipeMetricsSnapshot` counters. ## Spec reference [`docs/specs/recipe-creation-target-architecture.md`](https://github.com/dgee2/Menu/blob/main/docs/specs/recipe-creation-target-architecture.md) — §"Related recipe usage capabilities – Metrics and engagement" ## Implementation notes - `RecipeMetricsConsumer : BackgroundService` polls outbox for unprocessed events: - `RecipeViewed` (isAuthenticated=true) → increment `AuthenticatedViewCount`, update `LastViewedAtUtc` - `RecipeViewed` (isAuthenticated=false) → increment `PublicViewCount`, update `LastViewedAtUtc` - `RecipeFavorited` → increment `FavoriteCount` - `RecipeUnfavorited` → decrement `FavoriteCount` (floor 0) - `RecipeDiaryEntryPlanned` → increment `PlannedCount` - `RecipeDiaryEntryCooked` → increment `CookedCount`, update `LastCookedAtUtc` - Upsert snapshot row (create if not exists) ## Acceptance criteria - [ ] Each event type increments the correct counter - [ ] `RecipeViewed` routes to correct counter via `isAuthenticated` flag ## Testing - Integration tests: emit each event type, run consumer polling cycle, assert correct snapshot field incremented ## Part of#1106
Activity