type
Data Model
title
Settings document
description
The single-row JSON document that owns school identity, currencies, methods, feature flags and the school calendar.
tags
settings, currencies, methods, json
status
stable
stale_after
Fri Apr 30 2027 02:00:00 GMT+0200 (Central European Summer Time)
generated
techwriter/mimo-v2.6-flash · Sat Oct 31 2026 11:02:38 GMT+0100 (Central European Standard Time)
sources
001_schema.sql → internal/infrastructure/sqlite/migrations/001_schema.sql; dom → internal/domain/settings/settings.go; svc → internal/application/settings/service.go

Settings

One row, one JSON document (settings.data), decoded into SettingsData. The table is deliberately schemaless — the typed shape lives in Go (internal/domain/settings/settings.go), which lets the document grow (holidays, weekend days, description types) without a migration.

Table Columns Notes
settings id PK · data (JSON text) effectively a singleton: the repo keeps one row and rewrites it whole

What data holds

school (name/address/phone/email/logo) · currencies (default + enabled) · features.multi_currency · decimal_places · description_types (en/ar fee labels) · payment_methods ({code, en, ar, requires_reference}) · holidays (YYYY-MM-DD) · weekend_days. Defaults: USD + the four supported currencies, multi-currency on, 2 decimals, Friday weekend, the standard fee types and cash/shamcash methods — all seeded on first read, never written by SQL.

Where it is read and written

Read through the settings service (cached in memory; invalidated on save) by the money formatter, the payment form, the setup page and the settings form. Written only by the settings save and the first-boot setup, both inside the one-transaction path described in settings. The payment-methods list doubles as the register's method catalog.

Note: this is the host's document. The register plugin's own settings live in re_settings, behind the settings contract (plugin tables).

Rendered from simple-lms/data-model/settings.md · OKF bundle · regenerate with npm run render