/**
 * DI token + contract for the session-guidelines PDF generator, kept in a browser-free file so
 * consumers (e.g. CommunicationMergeDataService) can depend on it via `import type` + @Inject
 * without pulling the puppeteer/chromium browser manager into their module-load (and test) graph.
 */
export const SESSION_GUIDELINES_PDF_SERVICE = 'SESSION_GUIDELINES_PDF_SERVICE';

/** Session-specific merge values for the Invite guidelines PDF (computed by the caller). */
export interface SessionGuidelinesMergeData {
  preSessionLoginTime: string | number;
  sessionLoginTime: string;
}

export interface SessionGuidelinesPdfContract {
  /**
   * Program-level (Welcome) guidelines PDF URL — the bare S3 URL is cached on
   * program.guidelines_pdf_url, but a freshly-signed (7-day) URL is returned on every call since
   * the bucket is private and external fetchers (e.g. WATI/Meta) can't reach the bare URL.
   */
  resolveProgramPdfUrl(programId: number): Promise<string>;
  /**
   * Session-level (Invite) guidelines PDF URL — the bare S3 URL is cached on
   * program_session.guidelines_pdf_url, but a freshly-signed (7-day) URL is returned on every
   * call for the same reason. `computeMergeData` runs only on a cache miss.
   */
  resolveSessionPdfUrl(
    sessionId: number,
    computeMergeData: () => Promise<SessionGuidelinesMergeData>,
  ): Promise<string>;
}
