Observability: structured logs at domain state transitions #216
Copy link
Copy link
Closed
Labels
area:apiAPI/endpoint layerAPI/endpoint layerenhancementNew feature or requestNew feature or requestepic-1.1sliceThin vertical work itemThin vertical work item
Milestone
Description
Activity
- addedenhancementNew feature or requestNew feature or requestsliceThin vertical work itemThin vertical work itemarea:apiAPI/endpoint layerAPI/endpoint layer
on Jul 26, 2026 - added a commit that references this issue
on Aug 3, 2026
Metadata
Metadata
Assignees
Labels
area:apiAPI/endpoint layerAPI/endpoint layerenhancementNew feature or requestNew feature or requestepic-1.1sliceThin vertical work itemThin vertical work item
What to build
Application-layer handlers perform every business state transition (daily entry submit/lock/adjust, egg lot creation, FIFO allocation, sales order confirm/void, payments, inventory movements) with zero logging — a production incident currently leaves no narrative between "request arrived" and "exception stack trace or audit row".
Add structured logging to the money-path handlers:
Result(expected failure), including the failure reasonAccountId,FlockId,OrderId) so log queries work across featuresScope: daily entry lifecycle, FIFO allocation, sales order lifecycle, payments, egg/feed/water inventory movements. Purely additive — no behavior change, no new failure modes (logging must never throw into the handler path).
Acceptance criteria
Resultpaths in those handlers emit Warning with the failure reasonBlocked by
None - can start immediately (pairs well with the telemetry-pipeline slice, but is independent)