Skip to content

Settings API ​

Implementation: front/src/services/api/settingsService.ts. The form model is AppSettings in that file. JSON requests use the common Axios headers.

GET /settings ​

  • Called from: Settings page, Dashboard, Analytics, Reports, Create Lease wizard.
  • When: Page initialization or before dependent default-currency/discount settings are used.
  • Response expected: ApiResponse<AppSettings>; consumers use defaultCurrency, defaultDiscountRate, and settings fields.
  • Failure: service logs and throws; consumers handle according to page-specific states.
  • Example: GET {VITE_API_BASE_URL}/settings

PUT /settings ​

  • Called from: Settings form submission.
  • Body type: Partial<AppSettings>.
  • Response expected: ApiResponse<AppSettings>.
  • Failure: logs and throws; page shows error.
  • Example: PUT {VITE_API_BASE_URL}/settings with changed settings fields only.

POST /settings/reset ​

  • Called from: Settings reset action after confirmation.
  • Body: none supplied.
  • Response expected: ApiResponse<AppSettings>.
  • Failure: logs and throws; page shows error.
  • Example: POST {VITE_API_BASE_URL}/settings/reset

GET /settings/export ​

  • Called from: settingsService.exportUserSettings; page call site not confirmed.
  • Response type: ApiResponse<AppSettings>.
  • Failure: logs and throws.
  • Example: GET {VITE_API_BASE_URL}/settings/export

POST /settings/import ​

  • Called from: settingsService.importUserSettings; page call site not confirmed.
  • Body type: AppSettings.
  • Response type: ApiResponse<AppSettings>.
  • Failure: logs and throws.
  • Example: POST {VITE_API_BASE_URL}/settings/import with an AppSettings JSON object.

GET /settings/system ​

  • Called from: settingsService.getSystemSettings; page call site not confirmed.
  • Response type: ApiResponse<SystemSettings>; declared arrays include currencies, timezones, date formats, languages, fiscal year starts, and backup frequencies.
  • Failure: logs and throws.
  • Example: GET {VITE_API_BASE_URL}/settings/system

Exact backend field requirements and validation are not available from the frontend source code. Backend/API contract verification required.