app/support/orders/item_adder.rb
# timed services default to 1 minute (arbitrary)
timed services default to 1 minute (arbitrary)
timed services default to 1 minute ( arbitrary )
def add(product, quantity = 1, attributes = {})
    check_for_mixed_facility! product
    quantity = quantity.to_i
    duration = attributes.delete(:duration)
    return [] if quantity <= 0
    ods = case product
          when Bundle
            add_bundles(product, quantity, attributes)
          when Service
            add_services(product, quantity, attributes)
          when TimedService
            add_timed_services(product, quantity, duration, attributes)
          when Instrument
            add_instruments(product, quantity, attributes)
          else
            [create_order_detail({ product: product, quantity: quantity }.merge(attributes))]
          end
    ods || []
  end
def add ( product , quantity = 1 , attributes = { } ) check_for_mixed_facility! product quantity = quantity . to_i duration = attributes . delete ( :duration ) return [ ] if quantity <= 0 ods = case product when Bundle add_bundles ( product , quantity , attributes ) when Service add_services ( product , quantity , attributes ) when TimedService add_timed_services ( product , quantity , duration , attributes ) when Instrument add_instruments ( product , quantity , attributes ) else [ create_order_detail ( { product : product , quantity : quantity } . merge ( attributes ) ) ] end ods || [ ] end
timed services default to 1 minute (arbitrary)
timed services default to 1 minute ( arbitrary )
# Only TimedServices care about duration
product
<not_specific>
quantity
<not_specific>
attributes
<not_specific>