Use cases, ports and adapters as a class diagram, with the arrows pointing the right way.
What is on this board
Parts
- OrderController Class
- PlaceOrder Class
- Order Class
- OrderItem Class
- Money Class
- OrderStatus Enum
- OrderRepository Interface
- PaymentGateway Interface
- PgOrderRepository Class
- StripeGateway Class
- orders DB table
How they connect
- OrderController → PlaceOrder: calls
- PlaceOrder → OrderRepository: uses
- PlaceOrder → PaymentGateway: uses
- PlaceOrder → Order: creates
- Order → OrderItem: has
- PgOrderRepository → orders: writes
Notes and decisions
- Everything points inward: the domain knows nothing about Postgres or Stripe.