// Domain types for the inbox surface (work items + mail). Zero transport imports.

export type InboxState = 'OPEN' | 'SNOOZED' | 'DONE' | 'ARCHIVED' | 'CANCELLED' | 'STALE';

/** A unified inbox row — a work item (mention/needs-reply/alert) OR a mail thread. */
export interface InboxItem {
  id: string;
  kind: string; // MAIL | MENTION | NEEDS_REPLY | SYSTEM_ALERT | …
  state: InboxState;
  title: string;
  summary?: string;
  priority: string;
  /** Present when the row opens a conversation/mail thread. */
  threadId?: string;
  createdAt: string;
}

/** A mail attachment reference (bytes live in storage; the reader resolves a display URL). */
export interface MailAttachment {
  contentRef: string;
  mimeType: string;
  sizeBytes: number;
  filename: string | null;
}

/** One message in a mail thread — HTML and/or plain text, optionally an attachment. */
export interface MailMessage {
  id: string;
  actorId: string | null;
  kind: string;
  at: string;
  html: string | null;
  text: string | null;
  attachment: MailAttachment | null;
}

/** A person you can compose an in-app message to. */
export interface MailPerson {
  id: string;
  name: string;
  kind: 'staff' | 'customer';
}
