Class: Spree::DeliveryRateProvider::Estimate

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Attributes, ActiveModel::Model
Defined in:
app/models/spree/delivery_rate_provider/estimate.rb

Overview

A single quote returned by a delivery rate provider.

cost is the quoted price: the Estimator adds markup and resolves the tax rate afterwards, exactly as it does for calculator output, and the market decides whether that tax is inside the cost or added on top. Everything else is carrier metadata that flows onto the persisted DeliveryRate.

Instance Method Summary collapse

Instance Method Details

#service_key ⇒ String?

Stable identity of the carrier service within a method — what DeliveryMethodService rows match against for selection filtering and label/markup overrides.

Returns:

  • (String, nil)


38
39
40
41
42
# File 'app/models/spree/delivery_rate_provider/estimate.rb', line 38

def service_key
  return if carrier.blank? && service_level.blank?

  [carrier, service_level].compact.join('/')
end