/**
 * Shared types for the live PubMed-backed Studies feature.
 *
 * A `Study` is a normalised subset of the NCBI efetch XML payload that the
 * /studies list and detail pages render. Everything here is plain data — no
 * React, no Next-specific imports — so it can be serialised through the
 * Next.js cache boundary without surprises.
 */

export type Study = {
  /** PubMed unique identifier — always a numeric string. */
  pmid: string;
  /** Full article title, with trailing punctuation stripped. */
  title: string;
  /** Ordered list of "LastName Initials" strings. */
  authors: string[];
  /** Journal name as PubMed returns it (ISO abbreviation). */
  journal: string;
  /** ISO-8601 publication date (YYYY-MM-DD). Approximate when month/day missing. */
  pubDate: string;
  /** Publication year as a plain number, duplicated from pubDate for filtering. */
  year: number;
  /** Plain-text abstract with paragraph breaks flattened to spaces. */
  abstract: string;
  /** DOI when PubMed provides one in ArticleIdList. */
  doi?: string;
  /** Direct link to the PubMed landing page. */
  pubmedUrl: string;
};
