Class: SpreeCmCommissioner::Integrations::Base::SyncManager

Inherits:
Object
  • Object
show all
Defined in:
app/services/spree_cm_commissioner/integrations/base/sync_manager.rb

Direct Known Subclasses

StadiumXV1::SyncManager

Instance Method Summary collapse

Constructor Details

#initialize(integration:, client:) ⇒ SyncManager

Returns a new instance of SyncManager.



3
4
5
6
7
# File 'app/services/spree_cm_commissioner/integrations/base/sync_manager.rb', line 3

def initialize(integration:, client:)
  @integration = integration
  @client = client
  @sync_session = nil
end

Instance Method Details

#sync_full!SpreeCmCommissioner::IntegrationSyncSession

Perform a full synchronization (initial setup or complete refresh) Override in subclass and use run_execution to wrap your sync logic

Returns:

Raises:



13
14
15
# File 'app/services/spree_cm_commissioner/integrations/base/sync_manager.rb', line 13

def sync_full!
  raise NotImplementedError, "#{self.class.name} must implement #sync_full!"
end

#sync_incremental!SpreeCmCommissioner::IntegrationSyncSession

Perform an incremental synchronization (delta updates) Override in subclass and use run_execution to wrap your sync logic

Returns:

Raises:

  • (SyncError)

    if sync fails or not supported



21
22
23
# File 'app/services/spree_cm_commissioner/integrations/base/sync_manager.rb', line 21

def sync_incremental!
  raise NotImplementedError, "#{self.class.name} must implement #sync_incremental!"
end

#sync_webhook!(event_type:, event_data:) ⇒ SpreeCmCommissioner::IntegrationSyncSession

Perform a webhook-triggered synchronization (real-time event) Override in subclass and use run_execution to wrap your sync logic

Parameters:

  • event_type (String)

    The type of event (e.g., ‘match.updated’, ‘ticket.created’)

  • event_data (Hash)

    The event payload

Returns:

Raises:

  • (SyncError)

    if sync fails or not supported



31
32
33
# File 'app/services/spree_cm_commissioner/integrations/base/sync_manager.rb', line 31

def sync_webhook!(event_type:, event_data:)
  raise NotImplementedError, "#{self.class.name} must implement #sync_webhook!"
end