Implement Phase 2 features for Campaign Command Center

Adds 14 new features across the dashboard:
- Deal Risk Scoring (0-100) with risk factors on pipeline deals
- Account Health Score with multi-factor analysis on account cards
- Next Best Action Engine on Executive Overview
- Account Notes with pin/edit/delete in activity overlay and account detail
- Stakeholder Contact Map with role, sentiment, email, LinkedIn
- Competitive Intelligence Tracker with multi-select competitors and filtering
- CSV/Excel Export on accounts, activities, and pipeline pages
- Data Quality Dashboard in admin with completeness scoring
- Campaign Playbook Templates with 5 default plays and account progress tracking
- Goals & District Targets with quarterly tracking and progress bars
- Weekly Status Report (printable) and Executive Summary (printable)
- Activity Effectiveness Scoring showing pipeline conversion by activity type
- Mobile Activity FAB for quick activity logging on mobile
- Multi-User Auth (NextAuth + Google OAuth, @broadcom.com domain, role-based)

Also adds Phase 2 API route, scoring utilities, sidebar navigation updates,
and database schema extensions for notes, contacts, snapshots, playbooks,
and district targets.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-08-31 18:07:46 -04:00
parent 3c8c8ee594
commit d2d5632086
28 changed files with 3541 additions and 25 deletions

View File

@@ -48,6 +48,7 @@ export interface AccountRecord {
Anchor_Contract_EAR: number | null;
Google_Drive_URL: string | null;
Campaign_Artifacts_URL: string | null;
Competitors: string | null;
}
export interface ActivityRecord {
@@ -101,6 +102,77 @@ export interface MetricTarget {
Notes: string | null;
}
export interface AccountNote {
id: number;
Account_Name: string;
note_text: string;
next_action: string | null;
is_pinned: number;
created_at: string;
created_by: string | null;
}
export interface Contact {
id: number;
Account_Name: string;
Contact_Name: string;
Role: string | null;
Sentiment: string | null;
Email: string | null;
LinkedIn_URL: string | null;
}
export interface Snapshot {
id: number;
snapshot_date: string;
period_type: 'weekly' | 'monthly' | 'quarterly';
total_accounts: number;
accounts_touched: number;
total_pipeline: number;
open_opps: number;
closed_won_amount: number;
total_activities: number;
accounts_by_priority_json: string;
pipeline_by_stage_json: string;
district_data_json: string;
}
export interface PipelineSnapshot {
id: number;
snapshot_date: string;
Opportunity_ID: string;
Account_Name: string;
Stage: string;
Amount_USD: number;
Forecast_Category: string;
}
export interface Playbook {
id: number;
play_name: string;
description: string | null;
steps_json: string;
}
export interface PlaybookProgress {
id: number;
Account_Name: string;
playbook_id: number;
current_step: number;
status: string;
started_at: string;
updated_at: string;
}
export interface DistrictTarget {
id: number;
District_Name: string;
quarter: string;
activities_per_week: number;
accounts_touched: number;
pipeline_generated: number;
}
export interface DashboardData {
pipeline: PipelineRecord[];
accounts: AccountRecord[];