Class: Assistant::TechnicalSupport::CaseEventStream::EventBuilder

Inherits:
Object
  • Object
show all
Defined in:
app/services/assistant/technical_support/case_event_stream/event_builder.rb

Overview

Routes each evidence record to its source-specific serializer while sharing
one monotonically increasing sequence across the complete case chronology.

Defined Under Namespace

Classes: ActivitySerializer, Base, CallRecordSerializer, CommerceSerializer, CommunicationSerializer, RawEvent, RmaSerializer, RoomConfigurationSerializer, SupportCaseSerializer, UploadSerializer

Instance Method Summary collapse

Constructor Details

#initialize(graph:, redactor:, on_record:, on_unavailable:) ⇒ EventBuilder

Returns a new instance of EventBuilder.



26
27
28
29
30
31
32
33
34
35
# File 'app/services/assistant/technical_support/case_event_stream/event_builder.rb', line 26

def initialize(graph:, redactor:, on_record:, on_unavailable:)
  @serializer_attributes = {
    graph:,
    redactor:,
    on_record:,
    on_unavailable:,
    next_sequence: method(:next_sequence)
  }.freeze
  @sequence = 0
end

Instance Method Details

#activity_event(record) ⇒ Object



38
# File 'app/services/assistant/technical_support/case_event_stream/event_builder.rb', line 38

def activity_event(record) = serialize(ActivitySerializer, record)

#call_event(record) ⇒ Object



40
# File 'app/services/assistant/technical_support/case_event_stream/event_builder.rb', line 40

def call_event(record) = serialize(CallRecordSerializer, record)

#case_eventsObject



37
# File 'app/services/assistant/technical_support/case_event_stream/event_builder.rb', line 37

def case_events = serialize(SupportCaseSerializer, support_case)

#communication_event(record) ⇒ Object



39
# File 'app/services/assistant/technical_support/case_event_stream/event_builder.rb', line 39

def communication_event(record) = serialize(CommunicationSerializer, record)

#order_event(record) ⇒ Object



42
# File 'app/services/assistant/technical_support/case_event_stream/event_builder.rb', line 42

def order_event(record) = serialize(CommerceSerializer, record, source_type: 'Order')

#quote_event(record) ⇒ Object



43
# File 'app/services/assistant/technical_support/case_event_stream/event_builder.rb', line 43

def quote_event(record) = serialize(CommerceSerializer, record, source_type: 'Quote')

#rma_event(record) ⇒ Object



44
# File 'app/services/assistant/technical_support/case_event_stream/event_builder.rb', line 44

def rma_event(record) = serialize(RmaSerializer, record)

#room_event(record) ⇒ Object



45
# File 'app/services/assistant/technical_support/case_event_stream/event_builder.rb', line 45

def room_event(record) = serialize(RoomConfigurationSerializer, record)

#upload_event(record) ⇒ Object



41
# File 'app/services/assistant/technical_support/case_event_stream/event_builder.rb', line 41

def upload_event(record) = serialize(UploadSerializer, record)