// CRM Types

export interface Contact {
  id: string;
  workspaceSlug: string;
  firstName: string;
  lastName: string;
  email: string;
  phone: string;
  companyId?: string;
  companyName?: string;
  title: string;
  notes: string;
  avatarUrl: string;
  createdAt: string;
  updatedAt: string;
}

export interface Company {
  id: string;
  workspaceSlug: string;
  name: string;
  domain: string;
  website: string;
  industry: string;
  size: string;
  notes: string;
  logoUrl: string;
  createdAt: string;
  updatedAt: string;
}

export interface InboxItem {
  id: string;
  workspaceSlug: string;
  content: string;
  source: string;
  processed: boolean;
  processedAt?: string;
  processedEntityType?: string;
  processedEntityId?: string;
  createdAt: string;
}

export interface TimeEntry {
  id: string;
  workspaceSlug: string;
  taskId?: string;
  description: string;
  startedAt: string;
  endedAt?: string;
  durationSeconds: number;
  createdAt: string;
  updatedAt: string;
}

export interface SavedView {
  id: string;
  workspaceSlug: string;
  name: string;
  entityType: string;
  filterJson: string;
  sortJson: string;
  isDefault: boolean;
  createdAt: string;
  updatedAt: string;
}

export interface CreateContactInput {
  workspaceSlug: string;
  firstName?: string;
  lastName?: string;
  email?: string;
  phone?: string;
  companyId?: string;
  title?: string;
  notes?: string;
}

export interface UpdateContactInput {
  firstName?: string;
  lastName?: string;
  email?: string;
  phone?: string;
  companyId?: string;
  title?: string;
  notes?: string;
}

export interface CreateCompanyInput {
  workspaceSlug: string;
  name: string;
  domain?: string;
  website?: string;
  industry?: string;
  size?: string;
  notes?: string;
}

export interface UpdateCompanyInput {
  name?: string;
  domain?: string;
  website?: string;
  industry?: string;
  size?: string;
  notes?: string;
}

export interface CreateInboxItemInput {
  workspaceSlug: string;
  content: string;
  source?: string;
}

export interface CreateTimeEntryInput {
  workspaceSlug: string;
  taskId?: string;
  description?: string;
  startedAt: string;
  endedAt?: string;
}

export interface UpdateTimeEntryInput {
  description?: string;
  endedAt?: string;
}

export interface CreateSavedViewInput {
  workspaceSlug: string;
  name: string;
  entityType: string;
  filterJson?: string;
  sortJson?: string;
  isDefault?: boolean;
}