Class: Assistant::TechnicalSupport::CaseEventStream::EvidenceGraph
- Inherits:
-
Object
- Object
- Assistant::TechnicalSupport::CaseEventStream::EvidenceGraph
- Defined in:
- app/services/assistant/technical_support/case_event_stream/evidence_graph.rb
Overview
Resolves the records that make up one Support Case's evidence graph. Only
explicit database relationships are followed; temporal or participant-based
guesses must never attach an unrelated call or document to a replay.
Defined Under Namespace
Classes: RecordReader
Instance Attribute Summary collapse
-
#support_case ⇒ Object
readonly
Returns the value of attribute support_case.
Delegated Instance Attributes collapse
-
#array_for ⇒ Object
Alias for Record_reader#array_for.
-
#first_present ⇒ Object
Alias for Record_reader#first_present.
-
#raw_attribute ⇒ Object
Alias for Record_reader#raw_attribute.
-
#unique_records ⇒ Object
Alias for Record_reader#unique_records.
-
#value_for ⇒ Object
Alias for Record_reader#value_for.
Instance Method Summary collapse
- #activities ⇒ Object
- #calls ⇒ Object
- #communications ⇒ Object
-
#initialize(support_case, record_reader: RecordReader.new) ⇒ EvidenceGraph
constructor
A new instance of EvidenceGraph.
- #orders ⇒ Object
- #quotes ⇒ Object
- #rmas ⇒ Object
- #room_configurations ⇒ Object
- #uploads ⇒ Object
Constructor Details
#initialize(support_case, record_reader: RecordReader.new) ⇒ EvidenceGraph
Returns a new instance of EvidenceGraph.
9 10 11 12 |
# File 'app/services/assistant/technical_support/case_event_stream/evidence_graph.rb', line 9 def initialize(support_case, record_reader: RecordReader.new) @support_case = support_case @record_reader = record_reader end |
Instance Attribute Details
#support_case ⇒ Object (readonly)
Returns the value of attribute support_case.
7 8 9 |
# File 'app/services/assistant/technical_support/case_event_stream/evidence_graph.rb', line 7 def support_case @support_case end |
Instance Method Details
#activities ⇒ Object
20 21 22 23 24 25 |
# File 'app/services/assistant/technical_support/case_event_stream/evidence_graph.rb', line 20 def activities @activities ||= unique_records( array_for(support_case, :activities) + rmas.flat_map { |rma| array_for(rma, :activities) } ) end |
#array_for ⇒ Object
Alias for Record_reader#array_for
14 |
# File 'app/services/assistant/technical_support/case_event_stream/evidence_graph.rb', line 14 delegate :array_for, :first_present, :raw_attribute, :unique_records, :value_for, to: :record_reader |
#calls ⇒ Object
31 32 33 34 35 |
# File 'app/services/assistant/technical_support/case_event_stream/evidence_graph.rb', line 31 def calls @calls ||= unique_records( activities.filter_map { |activity| value_for(activity, :call_record) } ) end |
#communications ⇒ Object
27 28 29 |
# File 'app/services/assistant/technical_support/case_event_stream/evidence_graph.rb', line 27 def communications @communications ||= unique_records(communication_records) end |
#first_present ⇒ Object
Alias for Record_reader#first_present
14 |
# File 'app/services/assistant/technical_support/case_event_stream/evidence_graph.rb', line 14 delegate :array_for, :first_present, :raw_attribute, :unique_records, :value_for, to: :record_reader |
#orders ⇒ Object
41 |
# File 'app/services/assistant/technical_support/case_event_stream/evidence_graph.rb', line 41 def orders = array_for(support_case, :orders) |
#quotes ⇒ Object
42 |
# File 'app/services/assistant/technical_support/case_event_stream/evidence_graph.rb', line 42 def quotes = array_for(support_case, :quotes) |
#raw_attribute ⇒ Object
Alias for Record_reader#raw_attribute
14 |
# File 'app/services/assistant/technical_support/case_event_stream/evidence_graph.rb', line 14 delegate :array_for, :first_present, :raw_attribute, :unique_records, :value_for, to: :record_reader |
#rmas ⇒ Object
16 17 18 |
# File 'app/services/assistant/technical_support/case_event_stream/evidence_graph.rb', line 16 def rmas @rmas ||= unique_records(array_for(support_case, :rmas) + array_for(support_case, :order_rmas)) end |
#room_configurations ⇒ Object
43 |
# File 'app/services/assistant/technical_support/case_event_stream/evidence_graph.rb', line 43 def room_configurations = array_for(support_case, :room_configurations) |
#unique_records ⇒ Object
Alias for Record_reader#unique_records
14 |
# File 'app/services/assistant/technical_support/case_event_stream/evidence_graph.rb', line 14 delegate :array_for, :first_present, :raw_attribute, :unique_records, :value_for, to: :record_reader |
#uploads ⇒ Object
37 38 39 |
# File 'app/services/assistant/technical_support/case_event_stream/evidence_graph.rb', line 37 def uploads @uploads ||= unique_records(upload_records) end |
#value_for ⇒ Object
Alias for Record_reader#value_for
14 |
# File 'app/services/assistant/technical_support/case_event_stream/evidence_graph.rb', line 14 delegate :array_for, :first_present, :raw_attribute, :unique_records, :value_for, to: :record_reader |