- Build complete Next.js CRM for commercial real estate - Add authentication with JWT sessions and role-based access - Add GoHighLevel API integration for contacts, conversations, opportunities - Add AI-powered Control Center with tool calling - Add Setup page with onboarding checklist (/setup) - Add sidebar navigation with Setup menu item - Fix type errors in onboarding API, GHL services, and control center tools - Add Prisma schema with SQLite for local development - Add UI components with clay morphism design system Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
203 lines
4.6 KiB
TypeScript
203 lines
4.6 KiB
TypeScript
/**
|
|
* Onboarding Types
|
|
* CRESyncFlow - Commercial Real Estate CRM
|
|
*
|
|
* These types define the onboarding flow data collected from new users
|
|
*/
|
|
|
|
export enum ExperienceLevel {
|
|
UNDER_1_YEAR = 'Under 1 year',
|
|
ONE_TO_THREE_YEARS = '1-3 years',
|
|
THREE_PLUS_YEARS = '3+ years'
|
|
}
|
|
|
|
export enum GCIRange {
|
|
UNDER_50K = 'Under $50,000',
|
|
FIFTY_TO_100K = '$50,000 - $100,000',
|
|
OVER_100K = 'Over $100,000',
|
|
OVER_250K = 'Over $250,000'
|
|
}
|
|
|
|
export enum GoalPrimary {
|
|
NEW_SELLER_LEADS = 'Get new seller leads',
|
|
NEW_BUYER_LEADS = 'Get new buyer leads',
|
|
GET_ORGANIZED = 'Get more organized',
|
|
FOLLOW_UP_CAMPAIGNS = 'Set up follow-up campaigns',
|
|
TRACK_METRICS = 'Start tracking my metrics'
|
|
}
|
|
|
|
export enum LeadType {
|
|
INVESTOR = 'Investor',
|
|
BUYER = 'Buyer',
|
|
SELLER = 'Seller',
|
|
COMMERCIAL = 'Commercial'
|
|
}
|
|
|
|
export enum Channel {
|
|
SMS = 'SMS',
|
|
EMAIL = 'Email',
|
|
PHONE = 'Phone Call'
|
|
}
|
|
|
|
export enum CRMPainPoint {
|
|
TWO_WAY_TEXTING = 'Two-way texting',
|
|
BETTER_REPORTING = 'Better reporting',
|
|
BETTER_ORGANIZATION = 'Better organization',
|
|
FOLLOW_UP_CAMPAIGNS = 'Follow-up campaigns',
|
|
LEAD_GENERATION = 'Lead generation',
|
|
PIPELINE_MANAGEMENT = 'Pipeline management'
|
|
}
|
|
|
|
export enum ExternalSystem {
|
|
DIALER = 'Dialer',
|
|
TRANSACTION_MANAGEMENT = 'Transaction Management',
|
|
OTHER_CRM = 'Other CRM',
|
|
MARKETING_PLATFORM = 'Marketing Platform'
|
|
}
|
|
|
|
export enum ViewState {
|
|
ONBOARDING = 'ONBOARDING',
|
|
DASHBOARD = 'DASHBOARD',
|
|
CONVERSATIONS = 'CONVERSATIONS',
|
|
CONTACTS = 'CONTACTS',
|
|
OPPORTUNITIES = 'OPPORTUNITIES',
|
|
GET_LEADS = 'GET_LEADS',
|
|
AUTOMATIONS = 'AUTOMATIONS',
|
|
TODO_LIST = 'TODO_LIST',
|
|
REPORTING = 'REPORTING',
|
|
MARKETPLACE = 'MARKETPLACE',
|
|
EXTERNAL_TOOLS = 'EXTERNAL_TOOLS',
|
|
LEADERBOARD = 'LEADERBOARD',
|
|
QUIZ = 'QUIZ',
|
|
ADMIN = 'ADMIN',
|
|
TOUR_SIMULATION = 'TOUR_SIMULATION',
|
|
DFY_INTAKE = 'DFY_INTAKE',
|
|
CONTROL_CENTER = 'CONTROL_CENTER'
|
|
}
|
|
|
|
/**
|
|
* Main onboarding data interface with camelCase property names
|
|
*/
|
|
export interface OnboardingData {
|
|
// Experience questions
|
|
yearsInBusiness: ExperienceLevel | null;
|
|
gciLast12Months: GCIRange | null;
|
|
|
|
// CRM questions
|
|
usingOtherCrm: boolean | null;
|
|
currentCrmName: string;
|
|
crmPainPoints: CRMPainPoint[];
|
|
|
|
// Goals (multi-select)
|
|
goalsSelected: GoalPrimary[];
|
|
|
|
// Lead questions
|
|
hasLeadSource: boolean | null;
|
|
leadSourceName: string;
|
|
wantsMoreLeads: boolean | null;
|
|
leadTypeDesired: LeadType[];
|
|
leadsPerMonthTarget: string;
|
|
|
|
// Channels
|
|
channelsSelected: Channel[];
|
|
|
|
// Systems to connect
|
|
systemsToConnect: ExternalSystem[];
|
|
|
|
// Custom values for personalization
|
|
userFirstName: string;
|
|
userLastName: string;
|
|
userEmail: string;
|
|
brokerageName: string;
|
|
}
|
|
|
|
/**
|
|
* Legacy onboarding data interface with snake_case property names
|
|
* @deprecated Use OnboardingData instead
|
|
*/
|
|
export interface OnboardingDataLegacy {
|
|
years_in_business: ExperienceLevel | null;
|
|
gci_last_12_months: GCIRange | null;
|
|
using_other_crm: boolean | null;
|
|
current_crm_name: string;
|
|
crm_pain_points: CRMPainPoint[];
|
|
goals_selected: GoalPrimary[];
|
|
has_lead_source: boolean | null;
|
|
lead_source_name: string;
|
|
wants_more_leads: boolean | null;
|
|
lead_type_desired: LeadType[];
|
|
leads_per_month_target: number | string;
|
|
channels_selected: Channel[];
|
|
systems_to_connect: ExternalSystem[];
|
|
user_first_name: string;
|
|
user_last_name: string;
|
|
user_email: string;
|
|
brokerage_name: string;
|
|
}
|
|
|
|
/**
|
|
* Setup status tracking for new user configuration
|
|
*/
|
|
export interface SetupStatus {
|
|
smsConfigured: boolean;
|
|
emailConfigured: boolean;
|
|
contactsImported: boolean;
|
|
campaignsSetup: boolean;
|
|
}
|
|
|
|
/**
|
|
* Legacy system state interface
|
|
* @deprecated Use SetupStatus instead
|
|
*/
|
|
export interface SystemState {
|
|
sms_configured: boolean;
|
|
email_configured: boolean;
|
|
contacts_imported: boolean;
|
|
leads_acquired: boolean;
|
|
}
|
|
|
|
/**
|
|
* Onboarding step tracking
|
|
*/
|
|
export interface OnboardingStep {
|
|
id: string;
|
|
title: string;
|
|
description: string;
|
|
isComplete: boolean;
|
|
isCurrentStep: boolean;
|
|
}
|
|
|
|
/**
|
|
* Full onboarding state
|
|
*/
|
|
export interface OnboardingState {
|
|
currentStep: number;
|
|
totalSteps: number;
|
|
data: OnboardingData;
|
|
setupStatus: SetupStatus;
|
|
isComplete: boolean;
|
|
}
|
|
|
|
/**
|
|
* Helper type for creating initial onboarding data
|
|
*/
|
|
export const createInitialOnboardingData = (): OnboardingData => ({
|
|
yearsInBusiness: null,
|
|
gciLast12Months: null,
|
|
usingOtherCrm: null,
|
|
currentCrmName: '',
|
|
crmPainPoints: [],
|
|
goalsSelected: [],
|
|
hasLeadSource: null,
|
|
leadSourceName: '',
|
|
wantsMoreLeads: null,
|
|
leadTypeDesired: [],
|
|
leadsPerMonthTarget: '',
|
|
channelsSelected: [],
|
|
systemsToConnect: [],
|
|
userFirstName: '',
|
|
userLastName: '',
|
|
userEmail: '',
|
|
brokerageName: ''
|
|
});
|