Module: DailyFocus::SupportSections
- Defined in:
- app/services/daily_focus/support_sections.rb
Overview
Prompt body for the technical-support briefing (see DailyFocus.audience_for).
Four sections, signed off by the tech team on 2026-07-27: rolling queue
coverage, queue backlog, outreach windows, call statistics. Everything here
is prompt text plus the exact SQL Sunny should run — except the coverage
table (CoverageSection) and the statistics table (StatsSection), which we
compute ourselves and the model reproduces.
Every window is anchored on the briefing's date rather than the database's
CURRENT_DATE: a briefing can be regenerated for a past +daily_focus_date+
(see doc/operations/DAILY_FOCUS_RERUN_RUNBOOK.md), and a replay must not pair
a past coverage table with today's queue data.
Constant Summary collapse
- PRIORITY_RANK_SQL =
Orders High > Medium > Low; +priority+ is a varchar of those three values.
"CASE priority WHEN 'High' THEN 0 WHEN 'Medium' THEN 1 ELSE 2 END"- STALE_WAITING_STATES =
Mirrors SupportCase.waiting_cases, minus site_visit_scheduled /
pending_service_payment / waiting_on_accountant (those have their own
owners or scheduled dates — a stale-nudge is the wrong move for them). %w[ waiting_on_customer waiting_to_confirm_appointment waiting_on_equipment waiting_on_warmlyyours third_party_site_visit_scheduled ].freeze
- QUEUE_EXTENSIONS =
The support team's phone queues: 613 ("Tech 1") carries the daytime
volume, 600 ("Tech 24x7") the overflow. Report::TechCallsReport looks at
600 alone, which is why its totals read low — the briefing covers both. [600, 613].freeze
- QC_ROLES =
Stands in for a "does plan QC" flag the CRM does not have. Anatoliy owns
QC today; these are the roles his team actually carries. %w[engineering_rep engineering_manager].freeze
- BPO_EMPLOYEE_SQL =
Cases the outsourced call centre owns. Resolved by name in SQL so the
query is portable across dev/CI/production rather than pinning a prod id. "(SELECT id FROM parties WHERE type = 'Employee' AND full_name = 'BPO American' LIMIT 1)"
Class Method Summary collapse
Class Method Details
.body(primary_employee, covered, date = Date.current) ⇒ String
45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'app/services/daily_focus/support_sections.rb', line 45 def self.body(primary_employee, covered, date = Date.current) date = date.to_date [ briefing_intro(primary_employee, covered), Prompt.coaching_note_section(primary_employee), CoverageSection.prompt_section(date: date), extended_absences_sql(date), queue_backlog_sql(primary_employee, covered, date), pending_technical_article_reviews_sql(primary_employee, covered), case_lists_via_tools(primary_employee, covered, date), FollowUpSection.prompt_section(employees: [primary_employee, *covered], date: date), StatsSection.prompt_section(primary_employee: primary_employee, covered: covered, date: date) ].compact.join("\n") end |