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

Instance Method Details

#clientObject



30
31
32
33
34
35
36
# File 'app/models/spree_cm_commissioner/integrations/stadium_x_v1.rb', line 30

def client
  SpreeCmCommissioner::Integrations::StadiumXV1::ExternalClient::Client.new(
    public_key: public_key,
    private_key: private_key,
    base_url: base_url
  )
end

#restock_external_inventory!(_order, _line_items) ⇒ Object

override



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

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

#sync_managerObject

override



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

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

#unstock_external_inventory!(order, line_items) ⇒ Object

override



15
16
17
18
19
20
21
22
23
# File 'app/models/spree_cm_commissioner/integrations/stadium_x_v1.rb', line 15

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