/**
 * UI-facing shapes returned by the JSON API (camelCase, read state merged in).
 * These intentionally mirror server/src/services/items.js, not the DB rows.
 */

export interface User {
  id: number;
  email: string;
}

export interface Feed {
  id: number;
  url: string;
  title: string | null;
}

export interface Subscription {
  id: number;
  url: string;
  title: string | null;
}

export interface Item {
  id: number;
  feedId: number;
  feedTitle: string | null;
  title: string;
  url: string;
  author: string | null;
  publishedAt: string;
  contentHtml: string | null;
  contentText: string | null;
  read: boolean;
}

/** Read state as exposed to the UI; absence of a subscription item means unread. */
export interface ReadState {
  itemId: number;
  read: boolean;
}

export interface ItemsPage {
  items: Item[];
  nextCursor: string | null;
}

export interface UnreadCount {
  count: number;
}
