ADR-034 — All Configurable Values in Admin (No Hardcoding)
Status: Approved | Date: 2026-06-20 | Scope: All plugins
Context
Early plugin code hardcoded values like appointment duration (30 min), reminder lead time (24 h), SMS template text, maximum file size. Clinics have different workflows and these values need to be adjusted per company without a code deploy.
Decision
Every value a clinic administrator might want to change must be stored in
obelio_<plugin>_settings, not hardcoded in PHP.
Each plugin creates its settings table (see database conventions)
and an admin controller AdminObelio<Plugin>Settings that exposes these settings in the FS admin panel.
What is configurable
- Time durations (appointment length, reminder lead time, session timeouts)
- Message templates (WhatsApp, email subject/body)
- Numeric limits (max file size, max patients per slot, max retry attempts)
- Feature flags (enable/disable optional features per company)
- Default values shown in forms (default appointment type, default duration)
What is NOT configurable (exceptions)
| Exception | Reason |
|---|---|
Technical constants (STATUS_* enums) | Not a user concern |
Regulatory minimums (audit_retention_years = 10) | Legal requirement, cannot be lowered |
| Security parameters (password policy, session duration minimum) | Security baseline |
Implementation pattern
// Reading a setting with default fallback
$duration = $this->getSetting('default_appointment_minutes', 30);
// The getSetting helper reads obelio_scheduling_settings
// and falls back to the default if the row does not exist.
Consequences
- Clinic admins can customise behaviour without developer intervention
- No redeployment needed for operational parameter changes
- Default values (documented in audits) are loaded at plugin install time
- A missing setting never causes a runtime error — defaults are always defined in code