Class: Assistant::TechnicalSupport::CaseReplayEpisodeOutcomeValidator

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

Overview

Prevents administrative lifecycle and product-context events from being used
as the hidden verified Technical Support outcome.

Constant Summary collapse

VERIFIED_SOURCE_TYPES =
%w[Activity Communication CallRecord Upload].freeze
NON_DIAGNOSTIC_KINDS =
%w[
  administrative_activity administrative_communication
].freeze

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(episode:, events:) ⇒ CaseReplayEpisodeOutcomeValidator

Returns a new instance of CaseReplayEpisodeOutcomeValidator.



17
18
19
20
# File 'app/services/assistant/technical_support/case_replay_episode_outcome_validator.rb', line 17

def initialize(episode:, events:)
  @outcome_ids = episode.outcome_fragment_ids.to_set
  @events = Array(events)
end

Class Method Details

.call(episode:, events:) ⇒ Object



12
13
14
# File 'app/services/assistant/technical_support/case_replay_episode_outcome_validator.rb', line 12

def call(episode:, events:)
  new(episode:, events:).call
end

Instance Method Details

#callObject



22
23
24
25
26
# File 'app/services/assistant/technical_support/case_replay_episode_outcome_validator.rb', line 22

def call
  return if outcome_events.all? { |event| diagnostic?(event) }

  'The hidden outcome must come from explicit diagnostic evidence, not lifecycle or product context.'
end