Class: Spree::PickupPointProvider::Base

Inherits:
Object
  • Object
show all
Extended by:
ApiTyped
Defined in:
app/models/spree/pickup_point_provider/base.rb

Overview

Contract for third-party pickup point networks (InPost lockers, DHL ServicePoints, ...). Points are ephemeral value objects — never persisted; the selected point is validated via find_by_external_id and frozen into fulfillment.pickup_point_data.

Not yet a stable extension point: in 6.1 the constructor becomes new(delivery_method) (credential access via the method's store integrations) and find_nearby gains +zipcode:+/+query:+ params. Build third-party providers against 6.1, not this shape.

Instance Method Summary collapse

Methods included from ApiTyped

api_type, api_type_for, api_typed_family, class_name_for, find, registered_class

Instance Method Details

#find_by_external_id(external_id) ⇒ Spree::PickupPointOption?

Returns:

Raises:

  • (NotImplementedError)


21
22
23
# File 'app/models/spree/pickup_point_provider/base.rb', line 21

def find_by_external_id(external_id)
  raise NotImplementedError, "Please implement 'find_by_external_id' in your pickup point provider: #{self.class.name}"
end

#find_nearby(latitude:, longitude:, limit: 20) ⇒ Array<Spree::PickupPointOption>

Returns:

Raises:

  • (NotImplementedError)


16
17
18
# File 'app/models/spree/pickup_point_provider/base.rb', line 16

def find_nearby(latitude:, longitude:, limit: 20)
  raise NotImplementedError, "Please implement 'find_nearby' in your pickup point provider: #{self.class.name}"
end