For RS-2265, a ReturnAuth should allow selection of a warehouse, defaulting to SF
My intended workflow would have been something like this:
- add a warehouse_id column to ReturnAuthorizations
- include spec for validations that a ReturnAuth marked as "accepted" has to have a warehouse_id present
- ReturnAuthorization#process_return calls ReturnAuthorization#return_inventory_units
- ReturnAuthorization#return_inventory_units calls InventoryUnit#return! on each of the ReturnAuth's inventory_units
- InventoryUnit#return! is a state transition that has a callback function, InventoryUnit#restock_variants
- InventoryUnit#restock_variants increments the variant count to restock that item
- This should also be where the warehouse is set for that variant, but you need to be able to pass in the warehouse object to the #return! method used for the state transition. This can be done with a block, but requries reimplementing the state machine found in Spree::InventoryUnit in the spree/trr-deploy branch.