Skip to main content

Interface: IBookRepository

Defined in: Data/Repositories/IBookRepository.ts:11

Interface for Book repository Defines all operations for working with book module databases

Methods

createScriptureReference()

createScriptureReference(reference): ScriptureReference

Defined in: Data/Repositories/IBookRepository.ts:148

Create a scripture reference

Parameters

reference

ScriptureReference

Returns

ScriptureReference


createSection()

createSection(section): BookSection

Defined in: Data/Repositories/IBookRepository.ts:133

Create a new book section

Parameters

section

BookSection

Returns

BookSection


deleteScriptureReference()

deleteScriptureReference(referenceId): boolean

Defined in: Data/Repositories/IBookRepository.ts:153

Delete a scripture reference

Parameters

referenceId

number

Returns

boolean


deleteSection()

deleteSection(sectionId): boolean

Defined in: Data/Repositories/IBookRepository.ts:143

Delete a book section (and all its children)

Parameters

sectionId

number

Returns

boolean


getAllSections()

getAllSections(): BookSection[]

Defined in: Data/Repositories/IBookRepository.ts:48

Get all sections (for tree view or search)

Returns

BookSection[]


getAllSectionSummaries()

getAllSectionSummaries(): BookSectionSummary[]

Defined in: Data/Repositories/IBookRepository.ts:53

Get all section summaries (lighter weight for tree view)

Returns

BookSectionSummary[]


getModuleInfo()

getModuleInfo(): BookModuleInfo | undefined

Defined in: Data/Repositories/IBookRepository.ts:19

Get the module information for this book

Returns

BookModuleInfo | undefined


getNextSection()

getNextSection(currentSectionId): BookSection | undefined

Defined in: Data/Repositories/IBookRepository.ts:67

Get the next section in reading order (depth-first traversal)

Parameters

currentSectionId

number

Returns

BookSection | undefined


getParentSection()

getParentSection(currentSectionId): BookSection | undefined

Defined in: Data/Repositories/IBookRepository.ts:77

Get the parent section of the current section

Parameters

currentSectionId

number

Returns

BookSection | undefined


getPreviousSection()

getPreviousSection(currentSectionId): BookSection | undefined

Defined in: Data/Repositories/IBookRepository.ts:72

Get the previous section in reading order

Parameters

currentSectionId

number

Returns

BookSection | undefined


getScriptureReferences()

getScriptureReferences(sectionId): ScriptureReference[]

Defined in: Data/Repositories/IBookRepository.ts:90

Get all scripture references mentioned in a specific section.

Reads the unified verse_link table (source_type='book_section', WS-3) on a v2 module and the legacy scripture_reference table on a v1 module; the returned shape is the same either way.

Parameters

sectionId

number

Returns

ScriptureReference[]


getScriptureReferencesForRange()

getScriptureReferencesForRange(startVerseId, endVerseId): ScriptureReference[]

Defined in: Data/Repositories/IBookRepository.ts:124

Get all scripture references for a verse range

Parameters

startVerseId

number

endVerseId

number

Returns

ScriptureReference[]


getSection()

getSection(sectionId): BookSection | undefined

Defined in: Data/Repositories/IBookRepository.ts:33

Get a book section by ID

Parameters

sectionId

number

Returns

BookSection | undefined


getSectionsByParent()

getSectionsByParent(parentSectionId): BookSection[]

Defined in: Data/Repositories/IBookRepository.ts:43

Get all child sections of a parent section

Parameters

parentSectionId

number

Returns

BookSection[]


getSectionsReferencingVerse()

getSectionsReferencingVerse(verseId): BookSection[]

Defined in: Data/Repositories/IBookRepository.ts:103

Get all sections that reference a specific verse This is the inverse lookup - find all places in the book that mention this verse

Parameters

verseId

number

Returns

BookSection[]


getTopLevelSections()

getTopLevelSections(): BookSection[]

Defined in: Data/Repositories/IBookRepository.ts:38

Get all top-level sections (sections with no parent)

Returns

BookSection[]


getVerseLinksForSection()

getVerseLinksForSection(sectionId): VerseLinkRecord[]

Defined in: Data/Repositories/IBookRepository.ts:97

Get a section's verse links in the unified v2 shape. Empty on a v1 module — prefer getScriptureReferences for version-agnostic access.

Parameters

sectionId

number

Returns

VerseLinkRecord[]


getVerseReferencesWithSections()

getVerseReferencesWithSections(verseId): object[]

Defined in: Data/Repositories/IBookRepository.ts:109

Get scripture references for a verse with their section titles. Used by VerseLinksService to display book references without N+1 queries.

Parameters

verseId

number

Returns

object[]


getVerseReferencesWithSectionsForRange()

getVerseReferencesWithSectionsForRange(startVerseId, endVerseId): object[]

Defined in: Data/Repositories/IBookRepository.ts:116

Bulk variant of getVerseReferencesWithSections: every reference whose passage overlaps the inclusive range, each carrying its own passage bounds so the caller can attribute it to the individual verses it covers.

Parameters

startVerseId

number

endVerseId

number

Returns

object[]


searchSections()

searchSections(query, options?): BookSection[]

Defined in: Data/Repositories/IBookRepository.ts:58

Search book sections using full-text search

Parameters

query

string

options?
limit?

number

Returns

BookSection[]


updateModuleInfo()

updateModuleInfo(info): void

Defined in: Data/Repositories/IBookRepository.ts:24

Update the module information

Parameters

info

BookModuleInfo

Returns

void


updateSection()

updateSection(section): BookSection

Defined in: Data/Repositories/IBookRepository.ts:138

Update an existing book section

Parameters

section

BookSection

Returns

BookSection