Skip to content

Model reciprocal fulfillment and retirement lifecycles - #55

Merged
TheFellow merged 11 commits into
mainfrom
feat/stateful-cross-domain-lifecycles
Aug 6, 2026
Merged

Model reciprocal fulfillment and retirement lifecycles#55
TheFellow merged 11 commits into
mainfrom
feat/stateful-cross-domain-lifecycles

Conversation

@TheFellow

@TheFellow TheFellow commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • make Inventory own per-order reservations and expose on-hand, reserved, and available quantities
  • snapshot ingredient usage at order placement, block and unblock orders as reserved stock changes, and release or consume reservations through order lifecycle events
  • replace permissive blank drink lifecycle defaults with explicit legacy backfill and strict persisted-state validation
  • retire ingredients without deleting dependent drinks or menu curation; permit an explicit compatible permanent replacement and transactionally rewrite future recipes
  • distinguish permanent replacement, temporary substitution, review-required drinks, limited availability, and historical order snapshots
  • degrade already-published menus in place, while blocking draft publication when readiness has known blockers; low stock remains a warning
  • provide an authorized, queryable menu-readiness report and expose retirement/replacement/readiness consistently across CLI, TUI, and GUI
  • use dedicated retirement/readiness Cedar actions, complete audit entity touches, asynchronous stale-safe UI projections, dispatcher fan-out, and architecture documentation

Business behavior

  • retirement without replacement preserves recipes and marks required dependents for review
  • a compatible permanent replacement updates future canonical recipes using an explicit ratio
  • pending orders retain their historical snapshots and are not silently rewritten
  • published menus remain visible in a degraded state for operational honesty
  • publishing a draft menu with unavailable, retired, substituted, or review-required drinks is rejected with rich readiness details
  • readiness details are visible only to authorized manager/owner personas

Verification

  • gofmt
  • go generate ./... with a clean generated diff
  • go build ./...
  • go test ./... -count=1
  • go test -race -shuffle=on -count=1 -timeout=5m ./...
  • go tool arch-lint -config=.arch-lint.yaml
  • GOTOOLCHAIN=go1.26.5 go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.12.2 run
  • independent focused rerun: GOTOOLCHAIN=go1.26.5 go test ./app/domains/ingredients/... ./app/domains/drinks/... ./app/domains/menus/... ./app/domains/orders/... -count=1

@TheFellow
TheFellow merged commit 7b01054 into main Aug 6, 2026
3 checks passed
@TheFellow
TheFellow deleted the feat/stateful-cross-domain-lifecycles branch August 6, 2026 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant