Class: SpreeCmCommissioner::Integrations::StadiumXV1

Inherits:
SpreeCmCommissioner::Integration show all
Defined in:
app/models/spree_cm_commissioner/integrations/stadium_x_v1.rb,
app/services/spree_cm_commissioner/integrations/stadium_x_v1/sync_manager.rb,
app/services/spree_cm_commissioner/integrations/stadium_x_v1/resources/base.rb,
app/services/spree_cm_commissioner/integrations/stadium_x_v1/resources/zone.rb,
app/services/spree_cm_commissioner/integrations/stadium_x_v1/resources/match.rb,
app/services/spree_cm_commissioner/integrations/stadium_x_v1/resources/league.rb,
app/services/spree_cm_commissioner/integrations/stadium_x_v1/resources/ticket.rb,
app/services/spree_cm_commissioner/integrations/stadium_x_v1/polling/sync_zones.rb,
app/services/spree_cm_commissioner/integrations/stadium_x_v1/polling/sync_matches.rb,
app/services/spree_cm_commissioner/integrations/stadium_x_v1/external_client/client.rb,
app/services/spree_cm_commissioner/integrations/stadium_x_v1/resources/ticket_image.rb,
app/services/spree_cm_commissioner/integrations/stadium_x_v1/inventory/unstock_inventory.rb,
app/services/spree_cm_commissioner/integrations/stadium_x_v1/sync_strategies/full_sync_strategy.rb,
app/services/spree_cm_commissioner/integrations/stadium_x_v1/sync_strategies/webhook_sync_strategy.rb,
app/services/spree_cm_commissioner/integrations/stadium_x_v1/sync_strategies/incremental_sync_strategy.rb

Defined Under Namespace

Modules: ExternalClient, Inventory, Polling, Resources, SyncStrategies Classes: SyncManager

Instance Method Summary collapse

Methods inherited from SpreeCmCommissioner::Integration

#external_inventory_item_status, #external_inventory_items, #hold_inventory!, #release_inventory!, #supports_auto_release_inventory?, #supports_external_inventory_holding?

Instance Method Details

#clientObject



28
29
30
# File 'app/models/spree_cm_commissioner/integrations/stadium_x_v1.rb', line 28

def client
  @client ||= SpreeCmCommissioner::Integrations::StadiumXV1::ExternalClient::Client.new(integration: self)
end

#restock_external_inventory!(_order, _line_items) ⇒ Object

override



22
23
24
# File 'app/models/spree_cm_commissioner/integrations/stadium_x_v1.rb', line 22

def restock_external_inventory!(_order, _line_items)
  raise SpreeCmCommissioner::Integrations::SyncError, 'Ticket cannot be cancelled'
end

#sync_item_availability!(_options = {}) ⇒ Object



26
# File 'app/models/spree_cm_commissioner/integrations/stadium_x_v1.rb', line 26

def sync_item_availability!(_options = {}); end

#sync_managerObject

override



7
8
9
# File 'app/models/spree_cm_commissioner/integrations/stadium_x_v1.rb', line 7

def sync_manager
  SpreeCmCommissioner::Integrations::StadiumXV1::SyncManager.new(integration: self)
end

#unstock_external_inventory!(order, line_items) ⇒ Object

override



12
13
14
15
16
17
18
19
# File 'app/models/spree_cm_commissioner/integrations/stadium_x_v1.rb', line 12

def unstock_external_inventory!(order, line_items)
  result = SpreeCmCommissioner::Integrations::StadiumXV1::Inventory::UnstockInventory.new.call(
    integration: self,
    order: order,
    line_items: line_items
  )
  raise SpreeCmCommissioner::Integrations::SyncError, result.error unless result.success?
end