/**
 * Review persistence/semantics boundary.
 *
 * Local review keeps Learnitive's projection-based Track Changes and IndexedDB
 * persistence. Collaborative review keeps Y.Text canonical and stores shared
 * review metadata in the active project Y.Doc. ProjectReviewService owns the
 * UI/domain API while these adapters make the backend contract explicit.
 */
export type ProjectReviewBackendKind = 'local' | 'collaboration';

export type ProjectReviewBackendAdapter = Readonly<{
  kind: ProjectReviewBackendKind;
  shared: boolean;
  persistsLocalThreads: boolean;
  canonicalContainsPendingChanges: boolean;
}>;

export const LOCAL_REVIEW_BACKEND: ProjectReviewBackendAdapter = Object.freeze({
  kind: 'local',
  shared: false,
  persistsLocalThreads: true,
  canonicalContainsPendingChanges: false,
});

export const COLLABORATIVE_REVIEW_BACKEND: ProjectReviewBackendAdapter = Object.freeze({
  kind: 'collaboration',
  shared: true,
  persistsLocalThreads: false,
  canonicalContainsPendingChanges: true,
});
