Service Layer medium complexity backend
3
Dependencies
1
Dependents
5
Entities
0
Integrations

Description

Backend service that handles CRUD operations on the organization_settings table, enforcing role-based access (Org Admin and Global Admin only). Validates and persists all settings fields with versioned schema support for non-breaking additions. Emits audit_log entries for every mutating operation.

Feature: Organization Settings

organization-settings-service

Sources & reasoning

Encapsulates all server-side settings persistence and validation. The feature requires server-side enforcement of role gating and schema versioning (per implementation notes) rather than relying on UI-side checks. Audit emission on every write is a hard compliance requirement for the support-access grant mechanism.

No source references — this artifact was included based on reasoning alone (see above).

Responsibilities

  • Read and update organization settings for the current tenant
  • Validate settings payload against the versioned schema
  • Enforce Org Admin / Global Admin role gate before any mutation
  • Emit audit_log entry on every settings change
  • Support schema versioning to allow non-breaking field additions

Interfaces

getSettings(orgId: string): Promise<OrganizationSettings>
updateSettings(orgId: string, patch: Partial<OrganizationSettings>): Promise<OrganizationSettings>
getSettingsVersion(orgId: string): Promise<number>

Relationships

Dependencies (3)

Components this component depends on

Dependents (1)

Components that depend on this component