Version: 1.0.0Documentation Index
Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
Use this file to discover all available pages before exploring further.
Status: š Planned
Related Specs: FA-01, FA-02, FA-04, FA-08
Constitution Reference: Section 3.1 (Module Settings Pattern)
1. Overview
Every domain core should have a{core}_module_settings table and admin page for organization-level configuration. This document specifies the FA (Finance & Accounting) module settings implementation.
2. Database Schema
Table: fa_module_settings
3. Frontend Implementation
3.1 Admin Page
Location:src/cores/fa/pages/FASettings.tsxRoute:
/fa/settingsAccess: org_admin only Layout:
3.2 Settings Form Component
Location:src/cores/fa/components/FASettingsForm.tsx
Tabs Structure:
- General Ledger - Default accounts, fiscal year settings
- Accounts Payable - Payment terms, approval thresholds, PO requirements
- Accounts Receivable - Invoice terms, late fees, payment application
- Bank Reconciliation - Approval requirements, variance thresholds
- Budgeting - Approval workflow, alert thresholds, over-budget controls
- Reporting - Default formats, consolidation, fund accounting
- Compliance - Dual approval, period restrictions, audit controls
- Notifications - Alert preferences for period close, budgets, large transactions
3.3 Hook
Location:src/cores/fa/hooks/useFAModuleSettings.ts
4. Navigation Integration
Add to FA Module Registry
File:src/platform/navigation/module-registry.ts
Add Route
File:src/App.tsx
5. Usage in Other FA Modules
Example: FA-02 (General Ledger)
Example: FA-04 (Accounts Payable)
Example: FA-08 (Budgeting)
6. Implementation Checklist
- Create
fa_module_settingstable with RLS policies - Add
set_updated_attrigger - Create
seed_fa_module_settings()function - Create hook:
useFAModuleSettings.ts - Create form:
FASettingsForm.tsxwith 8 tabs - Create page:
FASettings.tsx - Add route to
App.tsx - Add navigation item (org_admin only)
- Document in
IMPLEMENTATION_LOG.md - Update FA-01, FA-02, FA-04, FA-08 specs to reference module settings
7. Testing Requirements
Unit Tests
- Settings hook fetches and updates correctly
- Default values applied when creating new settings
- Form validation for numeric thresholds
Integration Tests
- Only org_admin can access settings page
- Settings auto-created on first access
- Settings apply correctly across FA modules (GL, AP, AR, Budget)
RLS Tests
- Users in org can view settings
- Only org_admin can update settings
- Users outside org cannot view/modify settings
8. Documentation
UpdateIMPLEMENTATION_LOG.md: