Skip to content

Ledger

  • Route: src/routes/secure/ledger/+page.svelte
  • Feature: src/features/ledger/index.svelte (+ partials/, svc/)

Overview

The Ledger is a chronological record of past events — a case/audit ledger. Each event shows its files, logs, and chat from the call session. Files support sharing, favourites, renaming, descriptions, and deletion; secure-camera recordings can be renamed by their owner.

Core Features

  • Event list — past events, filterable by search (getLedgerEvents(search)).
  • Event viewer (partials/EventViewer.svelte) — event summary + the "Files & Logs" list mixing synthetic Chat / Logs entries with the actual shared files.
  • File viewer (partials/FileViewer.svelte) — file details via FileInfo: rename, alt-name, description, favourite, share/unshare, delete.
  • Log viewer (partials/LogViewer.svelte) — icon-coded timeline of session logs.
  • Chat viewer (partials/ChatViewer.svelte) — read-only event chat (MessageList).

Module Functions (svc/index.ts)

ts
export async function getLedgerEvents(search?: string): Promise<...>
export async function getALedger(eventId: number): Promise<...>
export async function getLedgerFile(sessionId: number, shareId: number): Promise<...>
export async function getLedgerFileWithChat(...): Promise<...>
export async function renameSecuredCameraEvent(command): Promise<...>
export async function deleteFile(fileId: number): Promise<...>
export async function renameFile(fileId: number, newName: string): Promise<...>
export async function renameFileShare(fileId: number, newName: string): Promise<...>
export async function setFileDescription(fileId, description): Promise<...>
export async function setFileAsFavourite(fileId, isFavourite): Promise<...>
export async function deleteFileShare(fileId): Promise<...>
export async function shareFile(fileId: number, contacts: number[]): Promise<...>

Permission model

  • Viewing the Ledger requires ViewLedger (nav entry).
  • Downloading/sharing files is gated by the CanDownloadFiles / CanShareFiles permissions.

Released under the MIT License.