Class: Report::MissedCalls::MissedCalls
- Inherits:
-
Object
- Object
- Report::MissedCalls::MissedCalls
- Defined in:
- app/services/report/missed_calls/missed_calls.rb
Defined Under Namespace
Classes: Result
Class Method Summary collapse
Class Method Details
.result_report(options = {}) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/services/report/missed_calls/missed_calls.rb', line 8 def self.result_report( = {}) start_time = [:period1_gteq].beginning_of_day end_time = [:period1_lteq].end_of_day employee_ids = [:employee_ids].map(&:presence).compact data_result = QueueCallLog.where(start_time: start_time..end_time) .where("outcome = 'missed' and enter_position is not null and ring_time > 1") if employee_ids.present? data_result = data_result.where("member_party_id in (#{employee_ids.map { |e| e.to_i }.join(',')})") end case [:result_type_filter] when 'completed' then data_result = data_result.where(result_type: 'completed') when 'not_completed' then data_result = data_result.where.not(result_type: 'completed') end Result.new(success: true, data: data_result) end |