brewlog/src/application/routes/api
Jon Seager 0030f87eed
refactor(timeline): extract event creation into service layer
Introduce application services that encapsulate entity creation +
timeline event recording. Route handlers call service.create() instead
of repo.insert() + inline timeline construction.

- Add define_simple_service! macro for roaster/cafe/gear services
- Add custom services for roasts, bags, brews, cups (need enrichment
  or cross-entity lookups)
- Add to_timeline_event() methods to all 7 domain entity types
- Remove timeline SQL from 4 repository insert() methods
- Delete brew_timeline_event() helper from brews route handler
- Update backup test to use services (timeline events created naturally)
- Document service layer pattern in CLAUDE.md
2026-02-06 10:42:52 +00:00
..
account.rs refactor(routes): split account, checkin, and webauthn into api/app 2026-02-05 19:04:52 +00:00
backup.rs refactor(routes): move API handlers to routes/api/ subdirectory 2026-02-05 19:04:21 +00:00
bags.rs refactor(timeline): extract event creation into service layer 2026-02-06 10:42:52 +00:00
brews.rs refactor(timeline): extract event creation into service layer 2026-02-06 10:42:52 +00:00
cafes.rs refactor(timeline): extract event creation into service layer 2026-02-06 10:42:52 +00:00
checkin.rs refactor(routes): split account, checkin, and webauthn into api/app 2026-02-05 19:04:52 +00:00
cups.rs refactor(timeline): extract event creation into service layer 2026-02-06 10:42:52 +00:00
gear.rs refactor(timeline): extract event creation into service layer 2026-02-06 10:42:52 +00:00
macros.rs refactor(routes): move API handlers to routes/api/ subdirectory 2026-02-05 19:04:21 +00:00
mod.rs refactor(routes): simplify visibility to pub(crate) 2026-02-05 19:08:44 +00:00
roasters.rs refactor(timeline): extract event creation into service layer 2026-02-06 10:42:52 +00:00
roasts.rs refactor(timeline): extract event creation into service layer 2026-02-06 10:42:52 +00:00
scan.rs refactor(timeline): extract event creation into service layer 2026-02-06 10:42:52 +00:00
tokens.rs refactor(account): convert token creation from imperative JS to Datastar 2026-02-05 21:58:57 +00:00
webauthn.rs fix: resolve clippy warnings for dead field and struct prefix 2026-02-05 20:49:17 +00:00