export interface Attachment {
  readonly id: string;
  readonly messageId: string;
  readonly deviceId: string;
  readonly externalId: string;
  readonly filename: string | null;
  readonly transferName: string | null;
  readonly mimeType: string | null;
  readonly size: number | null;
  readonly storageKind: 'inline_base64' | 'minio' | 'local' | 'missing';
  readonly data: Buffer | null;
  readonly storageBucket: string | null;
  readonly storageKey: string | null;
  readonly createdAt: string;
  readonly updatedAt: string;
}

export interface MissingAttachment {
  readonly id: string;
  readonly externalId: string;
  readonly filename: string | null;
  readonly transferName: string | null;
  readonly mimeType: string | null;
  readonly size: number | null;
}

export interface AttachmentDraft {
  readonly id: string;
  readonly messageId: string;
  readonly deviceId: string;
  readonly externalId: string;
  readonly filename?: string | null;
  readonly transferName?: string | null;
  readonly mimeType?: string | null;
  readonly size?: number | null;
  /** base64-encoded payload from Swift client. Stored inline as BYTEA if small. */
  readonly data?: string | null;
}
