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

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

Instance Method Summary collapse

Constructor Details

#initialize(integration:) ⇒ SyncManager

Returns a new instance of SyncManager.



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

def initialize(integration:)
  @integration = integration
  @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:



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

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



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

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



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

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