feat: add organization exercise settings management

- Created a new SQL migration to define the organization_exercise_settings table with relevant fields and an index.
- Implemented handlers for loading and updating organization exercise settings in Rust, including default values and upsert functionality.
- Developed a React component for managing exercise feature settings, allowing toggling of features and saving updates to the backend.
This commit is contained in:
2026-04-13 16:55:09 -04:00
parent 7f3e1ce9b1
commit c750ad0423
17 changed files with 899 additions and 44 deletions
@@ -0,0 +1,15 @@
CREATE TABLE IF NOT EXISTS organization_exercise_settings (
organization_id UUID PRIMARY KEY REFERENCES organizations(id) ON DELETE CASCADE,
audio_response_enabled BOOLEAN NOT NULL DEFAULT TRUE,
hotspot_enabled BOOLEAN NOT NULL DEFAULT TRUE,
memory_match_enabled BOOLEAN NOT NULL DEFAULT TRUE,
peer_review_enabled BOOLEAN NOT NULL DEFAULT TRUE,
role_playing_enabled BOOLEAN NOT NULL DEFAULT TRUE,
mermaid_enabled BOOLEAN NOT NULL DEFAULT FALSE,
code_lab_enabled BOOLEAN NOT NULL DEFAULT TRUE,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
CREATE INDEX IF NOT EXISTS idx_org_exercise_settings_updated_at
ON organization_exercise_settings (updated_at DESC);