import { Contact } from '../../entities/crm/contact'; import { Company } from '../../entities/crm/company'; import { Lead } from '../../entities/crm/lead'; import { Deal } from '../../entities/crm/deal'; import { BaseEntity } from '../../entities/types'; import { IRepository } from './repository'; export interface Activity extends BaseEntity { targetEntityType: 'contact' | 'company' | 'deal' | 'lead'; targetEntityId: string; type: 'call' | 'meeting' | 'task' | 'email' | 'message'; title: string; description?: string; dueDate?: string; completed: boolean; assignedTo?: string; } export interface Note extends BaseEntity { targetEntityType: 'contact' | 'company' | 'deal' | 'lead'; targetEntityId: string; content: string; authorName: string; pinned?: boolean; } export interface TimelineItem { id: string; timestamp: string; type: 'activity' | 'note' | 'status_change' | 'deal_created' | 'order_created'; title: string; description?: string; actor: string; } export interface ICrmService { contacts: IRepository; companies: IRepository; leads: IRepository; deals: IRepository; activities: IRepository; notes: IRepository; getTimeline(entityType: string, entityId: string): Promise; convertLeadToDeal(leadId: string, dealTitle: string): Promise<{ deal: Deal; contact?: Contact }>; }