cre-sync/types/dfy.ts
BusyBee3333 4e6467ffb0 Add CRESync CRM application with Setup page
- 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>
2026-01-14 17:30:55 -05:00

265 lines
6.1 KiB
TypeScript

/**
* Done For You (DFY) Service Types
* CRESyncFlow - Commercial Real Estate CRM
*
* Types for the DFY service offerings where users can pay
* for professional setup and configuration services
*/
// =============================================================================
// DFY Enums
// =============================================================================
export enum DFYServiceType {
SMS_SETUP = 'SMS_SETUP',
EMAIL_SETUP = 'EMAIL_SETUP',
CAMPAIGN_SETUP = 'CAMPAIGN_SETUP',
FULL_SETUP = 'FULL_SETUP',
PIPELINE_SETUP = 'PIPELINE_SETUP',
AUTOMATION_SETUP = 'AUTOMATION_SETUP',
CONTACT_IMPORT = 'CONTACT_IMPORT',
CUSTOM = 'CUSTOM'
}
export enum DFYStatus {
PENDING = 'PENDING',
PAID = 'PAID',
IN_PROGRESS = 'IN_PROGRESS',
REVIEW = 'REVIEW',
COMPLETED = 'COMPLETED',
CANCELLED = 'CANCELLED',
REFUNDED = 'REFUNDED'
}
export enum DFYPriority {
LOW = 'LOW',
NORMAL = 'NORMAL',
HIGH = 'HIGH',
URGENT = 'URGENT'
}
/**
* Legacy DFYType for backward compatibility
* @deprecated Use DFYServiceType instead
*/
export type DFYType = 'SMS' | 'EMAIL' | 'CAMPAIGN';
// =============================================================================
// DFY Request Types
// =============================================================================
export interface DFYRequest {
id: string;
userId: string;
serviceType: DFYServiceType;
status: DFYStatus;
priority: DFYPriority;
// Payment info
stripePaymentId?: string;
stripeInvoiceId?: string;
amountPaid?: number;
currency?: string;
// Task tracking
clickupTaskId?: string;
clickupTaskUrl?: string;
// Details
description?: string;
notes?: string;
adminNotes?: string;
requirements?: DFYRequirements;
// Assignment
assignedTo?: string;
assignedAt?: Date;
// Timestamps
createdAt: Date;
paidAt?: Date;
startedAt?: Date;
completedAt?: Date;
cancelledAt?: Date;
}
export interface DFYRequirements {
// SMS Setup
phoneNumber?: string;
twilioSid?: string;
smsTemplates?: string[];
// Email Setup
emailDomain?: string;
emailTemplates?: string[];
emailSignature?: string;
// Campaign Setup
campaignGoal?: string;
targetAudience?: string;
campaignDuration?: string;
campaignBudget?: number;
// General
additionalNotes?: string;
attachments?: string[];
deadline?: Date;
}
// =============================================================================
// DFY Service Definition Types
// =============================================================================
export interface DFYServiceDefinition {
type: DFYServiceType;
name: string;
description: string;
price: number; // In cents
estimatedDays: number;
features: string[];
requirements: string[];
isPopular?: boolean;
isAvailable: boolean;
}
export const DFY_SERVICES: DFYServiceDefinition[] = [
{
type: DFYServiceType.SMS_SETUP,
name: 'SMS Setup',
description: 'Complete two-way SMS configuration with templates',
price: 29900, // $299
estimatedDays: 3,
features: [
'Phone number setup',
'SMS template creation',
'Auto-reply configuration',
'Compliance setup'
],
requirements: [
'GHL location access',
'Business phone number'
],
isAvailable: true
},
{
type: DFYServiceType.EMAIL_SETUP,
name: 'Email Setup',
description: 'Professional email configuration and templates',
price: 29900, // $299
estimatedDays: 3,
features: [
'Domain verification',
'Email template design',
'Signature setup',
'Deliverability optimization'
],
requirements: [
'GHL location access',
'Domain access'
],
isAvailable: true
},
{
type: DFYServiceType.CAMPAIGN_SETUP,
name: 'Campaign Setup',
description: 'Custom follow-up campaign creation',
price: 49900, // $499
estimatedDays: 5,
features: [
'Campaign strategy',
'Multi-step sequences',
'A/B testing setup',
'Performance tracking'
],
requirements: [
'SMS or Email configured',
'Campaign goals defined'
],
isAvailable: true
},
{
type: DFYServiceType.FULL_SETUP,
name: 'Full Setup',
description: 'Complete CRESyncFlow configuration',
price: 99900, // $999
estimatedDays: 7,
features: [
'SMS setup',
'Email setup',
'Pipeline configuration',
'Campaign creation',
'Contact import',
'Training session'
],
requirements: [
'GHL location access',
'Domain access',
'Contact list'
],
isPopular: true,
isAvailable: true
}
];
// =============================================================================
// DFY Request Creation Types
// =============================================================================
export interface CreateDFYRequestDTO {
serviceType: DFYServiceType;
priority?: DFYPriority;
description?: string;
requirements?: Partial<DFYRequirements>;
}
export interface UpdateDFYRequestDTO {
status?: DFYStatus;
priority?: DFYPriority;
notes?: string;
adminNotes?: string;
assignedTo?: string;
requirements?: Partial<DFYRequirements>;
}
// =============================================================================
// DFY Dashboard Types
// =============================================================================
export interface DFYDashboardStats {
pendingRequests: number;
inProgressRequests: number;
completedThisMonth: number;
revenueThisMonth: number;
averageCompletionDays: number;
}
export interface DFYRequestSummary {
id: string;
userId: string;
userEmail: string;
userName: string;
serviceType: DFYServiceType;
status: DFYStatus;
priority: DFYPriority;
amountPaid?: number;
createdAt: Date;
daysInProgress?: number;
}
// =============================================================================
// DFY Checkout Types
// =============================================================================
export interface DFYCheckoutSession {
sessionId: string;
url: string;
expiresAt: Date;
}
export interface DFYPaymentIntent {
clientSecret: string;
paymentIntentId: string;
amount: number;
currency: string;
}