Class: OpportunityBriefing::UserContextBuilder
- Inherits:
-
Object
- Object
- OpportunityBriefing::UserContextBuilder
- Defined in:
- app/services/opportunity_briefing/user_context_builder.rb
Overview
Builds the serializable actor context used for the generated briefing turn.
The initial turn gets no database tools: all evidence is supplied by the
bounded ContextBuilder snapshot.
Class Method Summary collapse
Class Method Details
.call(party:, account:) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/services/opportunity_briefing/user_context_builder.rb', line 7 def self.call(party:, account:) { 'full_name' => party.full_name, 'party_id' => party.id, 'department' => party.try(:employee_record)&.department, 'job_title' => party.try(:job_title), 'is_admin' => account&.is_admin? || false, 'is_manager' => account&.is_manager? || false, 'account_id' => account&.id, 'inherited_role_names' => account&.inherited_role_names || [], 'analytics_domains' => account ? Assistant::DataDomainPolicy.domains_for(account: account) : [], 'permitted_services' => [], 'opportunity_briefing_generation' => true } end |