# ▢️ Create Goal First use case. Application layer. It does not contain domain rules; it uses [[🎯 Goal]] invariants. Capture (hover β†’ `+ Add to Crafting Goals`) is one caller. The use case does not know about inventory screens. --- ## Input - `ItemId` (the item the player pointed at) ## Output - The plan’s goals - Refresh of missing materials (via [[πŸ“ˆ Progress Calculation]]) ## Quantity Always **1** on this path. New goal: quantity 1. Existing goal: quantity + 1. --- ## Flow ```text CreateGoal(item) ↓ Goal exists for this ItemId? yes β†’ quantity += 1 no β†’ add Goal(item, 1) ↓ RefreshProgress remaining per goal = qty βˆ’ available(item) resolve remaining through RecipeProvider aggregate missing = required βˆ’ available ``` Persistence: none in this slice. The list lives in memory. --- ## Sibling use cases (same slice) Needed so Screen 2’s `[+]`, `[-]`, and Clear are not invented in the UI. | Use case | Input | Result | |----------|-------|--------| | **Adjust Goal Quantity** | ItemId, delta +1 | Quantity + 1, then RefreshProgress | | **Remove Goal** | ItemId | Goal gone, then RefreshProgress | | **Clear Goals** | β€” | All goals gone, then RefreshProgress | | **Refresh Progress** | β€” | Recompute missing list from current goals + inventory | `[-]` on the overlay: if quantity > 1, Adjust βˆ’1; if quantity is 1, Remove Goal. The overlay does not keep a 0. No confirm on Clear. --- ## First wiring Capture: hover an item in inventory, the crafting bench craft pane, or the craft book, then `+ Add to Crafting Goals`. That calls this use case. `/satistaskory add` remains a debug caller. Overlay on the **right** of the play screen. Do not start EMI. Do not start a planner menu. --- ## Related Documents [[🎯 Goal]] [[πŸ“¦ Packages]] [[πŸ”Œ Recipe Provider]] [[πŸ“ˆ Progress Calculation]] [[πŸ–₯️ Experience]] [[πŸ–ΌοΈ Wireframes]] [[πŸ“ Decisions]] [[πŸ›οΈ Architecture]]