Loads a NoteTemplate by id from the DB by joining the template row with
its sections. Soft-deleted templates are treated as not found: note
generation must never produce new content from a deleted template
(DEV-2723). Throws DbNotFoundError (or any other repo error) so callers
can decide how to surface it (e.g. tRPC mutations map to NOT_FOUND, jobs
let it propagate to the queue retry handler).
Intentionally not exported from the note-generation barrel — this is an
internal cross-feature helper for @repo/services consumers (text-note
jobbable, processTextNote service).
Loads a
NoteTemplateby id from the DB by joining the template row with its sections. Soft-deleted templates are treated as not found: note generation must never produce new content from a deleted template (DEV-2723). ThrowsDbNotFoundError(or any other repo error) so callers can decide how to surface it (e.g. tRPC mutations map toNOT_FOUND, jobs let it propagate to the queue retry handler).Intentionally not exported from the
note-generationbarrel — this is an internal cross-feature helper for@repo/servicesconsumers (text-note jobbable, processTextNote service).