// Integration types

export interface Integration {
  id: string;
  workspaceSlug: string;
  provider: string;
  name: string;
  config: string;
  status: string;
  lastSyncAt?: string;
  createdAt: string;
  updatedAt: string;
}

export interface Webhook {
  id: string;
  workspaceSlug: string;
  name: string;
  url: string;
  events: string[];
  active: boolean;
  lastTriggeredAt?: string;
  createdAt: string;
  updatedAt: string;
}

export interface Notification {
  id: string;
  workspaceSlug: string;
  userEmail: string;
  type: string;
  title: string;
  body: string;
  entityType?: string;
  entityId?: string;
  read: boolean;
  createdAt: string;
}

export interface Presence {
  id: string;
  workspaceSlug: string;
  userEmail: string;
  userName: string;
  entityType?: string;
  entityId?: string;
  lastSeenAt: string;
  createdAt: string;
}

export interface CreateIntegrationInput {
  workspaceSlug: string;
  provider: string;
  name: string;
  config?: string;
  credentials: string;
}

export interface CreateWebhookInput {
  workspaceSlug: string;
  name: string;
  url: string;
  events?: string[];
}

export interface UpdatePresenceInput {
  workspaceSlug: string;
  userEmail: string;
  userName: string;
  entityType?: string;
  entityId?: string;
}

export interface CreateNotificationInput {
  workspaceSlug: string;
  userEmail: string;
  type: NotificationType;
  title: string;
  body?: string;
  entityType?: string;
  entityId?: string;
}

export type NotificationType = 
  | "task_assigned"
  | "task_completed"
  | "mention"
  | "comment"
  | "invite_accepted"
  | "event_reminder";

export type IntegrationProvider = 
  | "google_calendar"
  | "slack"
  | "discord"
  | "webhook";
export interface OAuthConnectResponse {
  authUrl: string;
}

export interface OAuthCallbackResult {
  connected: string;
  integrationId?: string;
}