63 lines
2.1 KiB
Markdown

# Settings Models
## Overview
The Settings module provides two singleton configuration models for global site settings and map-specific settings.
**Models (2):**
- SiteSettings — Org branding + theme + SMTP + feature toggles
- MapSettings — Map center/zoom + walk sheet config
**Key Features:**
- Singleton pattern (always ID "default")
- SMTP override hierarchy (SiteSettings → env vars)
- Feature flags (enableInfluence, enableMap, enableNewsletter, enableLandingPages)
- Theme color customization (admin + public)
- Walk sheet customization (title, subtitle, footer, QR codes)
See [Schema Reference](../schema.md#site-settings) for complete field listings.
---
## SiteSettings (Singleton)
**ID:** Always `"default"` (enforced by seed + UI)
**Sections:**
1. **Organization** — Name, logo, favicon
2. **Admin Theme** — Primary color, background color
3. **Public Theme** — Primary color, background color, container color, header gradient
4. **Email Branding** — From name, footer text, login subtitle
5. **SMTP Configuration** — Host, port, user, pass, from address, active provider, test mode
6. **Feature Toggles** — Enable/disable modules
**SMTP Hierarchy:**
- If SiteSettings.smtpHost is set → use SiteSettings SMTP
- Else → fallback to env vars (SMTP_HOST, SMTP_PORT, etc.)
---
## MapSettings (Singleton)
**ID:** Always `"default"` (enforced by seed + UI)
**Sections:**
1. **Map Center** — Latitude, longitude, zoom (default: Edmonton, AB)
2. **Walk Sheet** — Title, subtitle, footer text
3. **QR Codes** — 3 QR code slots (URL + label each)
**QR Code Usage:**
- Rendered on printable walk sheets
- Typically links to volunteer portal, shift signup, campaign page
- Generated via Mini QR service (GET /api/qr?url=...)
---
## Related Documentation
- [Schema Reference](../schema.md#site-settings) — Complete field listings
- [Seeding](../seeding.md) — Default settings
- [API Settings Routes](../../api/settings.md) — REST endpoints
- [Admin Settings Page](../../admin/settings.md) — Settings UI
- [Admin Map Settings Page](../../admin/map-settings.md) — Map settings UI