Class: Spree::StockTransfers::Update

Inherits:
Workflow
  • Object
show all
Includes:
Receivables::DraftEditing
Defined in:
app/workflows/spree/stock_transfers/update.rb

Overview

Edits a draft transfer. Once the box is marked ready what is in it is a matter of record, so this refuses anything past draft rather than quietly rewriting a document the warehouse is already acting on.

Instance Method Summary collapse

Methods inherited from Workflow

#call, define_argument_readers, #errors, #halt!, hooks, inherited, model_name, #read_attribute_for_validation, #reject!, workflow_key

Methods included from Spree::ServiceModule::Base

#call, prepended

Methods included from Workflow::ControlFlow

#failure

Instance Method Details

#perform(stock_transfer:, attributes: {}, items: nil) ⇒ Object

Parameters:

  • stock_transfer (Spree::StockTransfer)
  • attributes (Hash) (defaults to: {}) —

    editable columns — reference, notes, the two locations, metadata

  • items (Array<Hash>, nil) (defaults to: nil) —

    [{ variant:, quantity_shipped: }] replacing the current lines; nil leaves them alone



16
17
18
19
# File 'app/workflows/spree/stock_transfers/update.rb', line 16

def perform(stock_transfer:, attributes: {}, items: nil)
  super
  edit
end