Class: Spree::Exchanges::Receive

Inherits:
Workflow
  • Object
show all
Includes:
PostSale::Receipt
Defined in:
app/workflows/spree/exchanges/receive.rb

Overview

Records what came back. Same partial-receipt shape as returns: the warehouse enters actual quantities and flags anything unsellable.

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 ServiceModule::Base

#call, prepended

Methods included from Workflow::ControlFlow

#failure

Instance Method Details

#perform(exchange:, items: nil, received_by: nil) ⇒ Object

Parameters:

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

    [{ exchange_line_item:, quantity:, resellable: }]

  • received_by (Object, nil) (defaults to: nil)


13
14
15
16
# File 'app/workflows/spree/exchanges/receive.rb', line 13

def perform(exchange:, items: nil, received_by: nil)
  super
  receive
end