1.9 KiB
1.9 KiB
Domain: Full Shipping Company
This document serves as the high-level domain breakdown for the "Golden Example" implementation of the Effect TDFDDD Template. We will use the TDFDDD agent suite to iteratively build out these workflows.
1. The Booking & Quoting Context (The "Order")
- Goal: A customer wants to ship a package from Origin A to Destination B.
- Key Workflows:
requestQuote: Takes dimensions, weight, origin, destination, and service level (e.g., Express vs. Ground) and calculates a price. This is a great example of a pure mathematical Policy combined with an Effect workflow.bookShipment: Validates the quote, charges the customer, and generates a shipping label/tracking number. This shows orchestrating multiple side-effects (payment + DB + third-party label generation).
2. The Logistics & Routing Context (The "Network")
- Goal: Figuring out how a package gets from Origin A to Destination B through our network of hubs.
- Key Workflows:
routePackage: When a package is dropped off, determine the sequence of hubs it must visit.loadTruck: The strict rules around weight, volume, and hazardous materials compatibility (e.g., "You can't load flammable liquids on the same truck as explosives"). This is perfect for complex Discriminated Union states and pure Policies.
3. The Tracking & Fulfillment Context (The "State")
- Goal: Tracking the physical location of the package and notifying the customer.
- Key Workflows:
scanPackage: A worker scans a package at a hub. This updates the package's state (Pending->InTransit->OutForDelivery->Delivered). This demonstrates strict state machine enforcement using TDFDDD.
Next Steps
When resuming work, pick one specific workflow (e.g., loadTruck or bookShipment) and invoke the Discovery Agent (Detective Mode) to begin uncovering edge cases and rules.