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>
208 lines
5.1 KiB
TypeScript
208 lines
5.1 KiB
TypeScript
export interface PipelineRecord {
|
|
Opportunity_ID: string;
|
|
Account_Name: string;
|
|
District_Name: string;
|
|
Stage: string;
|
|
Forecast_Category: string;
|
|
Amount_USD: number;
|
|
Closed_Amount_USD: number | null;
|
|
Probability_Pct: number;
|
|
Created_Date: string;
|
|
Expected_Close_Date: string;
|
|
Closed_Date: string | null;
|
|
Champion_Name: string | null;
|
|
Economic_Buyer: string | null;
|
|
Next_Step: string | null;
|
|
Next_Step_Date: string | null;
|
|
Primary_Objection: string | null;
|
|
Competitor: string | null;
|
|
Source_Play: string | null;
|
|
Product: string;
|
|
Deal_Type: string | null;
|
|
Status: string | null;
|
|
Stage_Entered_Date: string | null;
|
|
Tier: string | null;
|
|
MAP_In_Place_YN: string | null;
|
|
}
|
|
|
|
export interface AccountRecord {
|
|
Account_Name: string;
|
|
District_Name: string;
|
|
Tier: string;
|
|
Priority: string;
|
|
AgentMinder_Status: string;
|
|
Current_ARR_USD: number | null;
|
|
Touch_Count: number | null;
|
|
Date_First_Touched: string | null;
|
|
Date_Last_Touched: string | null;
|
|
MAP_In_Place_YN: 'Y' | 'N' | null;
|
|
Company_URL: string | null;
|
|
Area_Sales_Leader: string | null;
|
|
DM: string | null;
|
|
AD: string | null;
|
|
IMS_BA: string | null;
|
|
Logo_URL: string | null;
|
|
Next_Renewal_Date: string | null;
|
|
Next_Renewal_EAR: number | null;
|
|
Anchor_Contract_Date: string | null;
|
|
Anchor_Contract_EAR: number | null;
|
|
Google_Drive_URL: string | null;
|
|
Campaign_Artifacts_URL: string | null;
|
|
Competitors: string | null;
|
|
}
|
|
|
|
export interface ActivityRecord {
|
|
Activity_Date: string;
|
|
Activity_Type: string;
|
|
Account_Name: string;
|
|
District_Name: string;
|
|
Contact_Name: string | null;
|
|
Notes: string | null;
|
|
Play: string | null;
|
|
Channel: string | null;
|
|
Persona: string | null;
|
|
Outcome: string | null;
|
|
Logged_By: string | null;
|
|
}
|
|
|
|
export interface TargetRecord {
|
|
Account_Name: string;
|
|
Implementation_Stage: string;
|
|
Go_Live_Date: string | null;
|
|
Health_Status: string | null;
|
|
Notes: string | null;
|
|
}
|
|
|
|
export interface ImplementationRecord {
|
|
Implementation_ID: string;
|
|
Opportunity_ID: string | null;
|
|
Account_Name: string;
|
|
District_Name: string | null;
|
|
Tier: string | null;
|
|
Closed_Date: string | null;
|
|
Closed_Amount_USD: number | null;
|
|
Kickoff_Date: string | null;
|
|
Go_Live_Target: string | null;
|
|
Go_Live_Actual: string | null;
|
|
Deployment_Status: string;
|
|
Health_RYG: string | null;
|
|
Milestones_Complete: number;
|
|
Milestones_Total: number;
|
|
Onboarding_Owner: string | null;
|
|
Risk_Notes: string | null;
|
|
}
|
|
|
|
export interface MetricTarget {
|
|
Target_ID: string;
|
|
Period_Type: string;
|
|
Period_Label: string;
|
|
District_Name: string;
|
|
Metric: string;
|
|
Target_Value: number;
|
|
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[];
|
|
activities: ActivityRecord[];
|
|
targets: TargetRecord[];
|
|
implementations: ImplementationRecord[];
|
|
metricTargets: MetricTarget[];
|
|
lastRefreshed: string;
|
|
}
|
|
|
|
export interface DashboardConfig {
|
|
quotaTarget: number;
|
|
weeklyActivityTarget: number;
|
|
}
|
|
|
|
export type District = 'SE-SUNSHINE' | 'SE-PEACHTREE' | 'SE-MISS-VALLEY' | 'SE-MID-ATL';
|
|
|
|
export const DISTRICTS: District[] = ['SE-SUNSHINE', 'SE-PEACHTREE', 'SE-MISS-VALLEY', 'SE-MID-ATL'];
|
|
|
|
export const STAGES = [
|
|
'01-Qualified', '02-Discovery', '03-Evaluation', '04-Business Case',
|
|
'05-Negotiation', '06-Closed Won', '07-Closed Lost'
|
|
] as const;
|
|
|
|
export const FORECAST_CATEGORIES = ['Commit', 'Best Case', 'Pipeline', 'Closed', 'Omit'] as const;
|
|
|
|
export const IMPLEMENTATION_STAGES = ['Not Started', 'In Progress', 'Complete', 'Stalled'] as const;
|
|
|
|
export const ACTIVITY_TYPES = [
|
|
'Launch Briefing', 'Discovery', 'QBR Attach', 'Exec Meeting',
|
|
'Demo', 'Workshop', 'Email', 'Call'
|
|
] as const;
|