/**
 * Automerge schema + doc ID helper for module-level comment pins.
 * One doc per space: "{space}:module-comments:pins"
 */

import type { DocSchema, DocumentId } from './local-first/document';
import type { ModuleCommentsDoc } from './module-comment-types';

export const moduleCommentsSchema: DocSchema<ModuleCommentsDoc> = {
  module: 'module-comments',
  collection: 'pins',
  version: 1,
  init: () => ({ pins: {} }),
};

export function moduleCommentsDocId(space: string): DocumentId {
  return `${space}:module-comments:pins` as DocumentId;
}
