Circle V2 API Docs
    Preparing search index...
    • NoteTemplate mirrors the DB row shape (Pick<TemplateRow, ...>):

      • nullable fields are T | null
      • bigint order is string | null (Kysely preserves bigint as string)

      LegacySelectedTemplate is what the session.selected_template jsonb column serializes to, defined by zLegacySelectedTemplate:

      • nullable fields are T | undefined (optional, not nullable)
      • order is z.number()

      These converters bridge the two without an as unknown as X cast at each call site. When the jsonb column is replaced with proper FK references (see the TODO in sessions.table.ts), both can be deleted.

      Parameters

      Returns {
          additional_ai_instructions?: string;
          check_cpt?: boolean;
          check_demo?: boolean;
          check_dsm_5?: boolean;
          check_icd_10?: boolean;
          created_by?: UserId | null;
          created_by_circle?: boolean;
          hidden_instructions?: string | null;
          id: TemplateId;
          is_allow_bullet_points?: boolean;
          is_unstructured_narrative?: boolean;
          last_updated?: string | null;
          last_used?: string | null;
          name?: string;
          original_template_id?: string;
          sections: {
              body: string;
              bullet_format?: boolean;
              id: SectionId;
              name: string;
              optional: boolean;
              order: number;
          }[];
          selected_audit_template_ids?: number[];
          shared_with_org_id?: string;
          title: string;
          [key: string]: unknown;
      }