Class: Assistant::TechnicalSupport::CaseReplaySourceValidator
- Inherits:
-
Object
- Object
- Assistant::TechnicalSupport::CaseReplaySourceValidator
- Defined in:
- app/services/assistant/technical_support/case_replay_source_validator.rb
Overview
Confirms the replay source and Sunny account are eligible for an internal
Technical Support evaluation.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(support_case:, account:) ⇒ CaseReplaySourceValidator
constructor
A new instance of CaseReplaySourceValidator.
Constructor Details
#initialize(support_case:, account:) ⇒ CaseReplaySourceValidator
Returns a new instance of CaseReplaySourceValidator.
12 13 14 15 |
# File 'app/services/assistant/technical_support/case_replay_source_validator.rb', line 12 def initialize(support_case:, account:) @support_case = support_case @account = account end |
Class Method Details
.call(support_case:, account:) ⇒ Object
7 8 9 |
# File 'app/services/assistant/technical_support/case_replay_source_validator.rb', line 7 def call(support_case:, account:) new(support_case:, account:).call end |
Instance Method Details
#call ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'app/services/assistant/technical_support/case_replay_source_validator.rb', line 17 def call return 'A source support case is required.' unless support_case return 'Only Technical Support cases can be replayed.' unless support_case.case_type == TechnicalSupportReplayCriteria::CASE_TYPE return 'Only closed cases can be replayed.' unless support_case.state == TechnicalSupportReplayCriteria::CLOSED_STATE return unless 'An active employee with Technical Article read access is required to run Sunny.' end |