Class: SpreeCmCommissioner::Integrations::BookMeBusV1::Inventory::ExternalInventoryItemStatus

Inherits:
Object
  • Object
show all
Includes:
Spree::ServiceModule::Base
Defined in:
app/services/spree_cm_commissioner/integrations/book_me_bus_v1/inventory/external_inventory_item_status.rb

Overview

Fetches detailed status for a specific inventory item (seat) from BookMeBus Uses the inventory_item_status! API (passenger_seat_infos endpoint)

Instance Method Summary collapse

Instance Method Details

#call(integration:, order:, options:) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/services/spree_cm_commissioner/integrations/book_me_bus_v1/inventory/external_inventory_item_status.rb', line 12

def call(integration:, order:, options:)
  @integration = integration
  @order = order
  @options = options

  validate_params!
  item_status = fetch_item_status

  success(item_status: item_status)
rescue SpreeCmCommissioner::Integrations::ExternalClientError => e
  failure(nil, e.message)
end