Generated by npm run db:docs:generate — DO NOT EDIT BY HAND. Change the schema via a migration, then regenerate.
Core: fa_ · Tables: 129 · Source generated: 2026-06-10T02:55:32.169Z
Entity relationships
Tables
fa_1099_forms
FA-10: 1099 tax form records for vendor payments
RLS: ✅ enabled (3 policies)
Foreign keys:
corrects_form_id→fa_1099_forms(id)created_by→users(id)filed_by→users(id)organization_id→pf_organizations(id)tax_year_id→fa_tax_years(id)updated_by→users(id)
fa_1099_forms_insert(INSERT)fa_1099_forms_select(SELECT)fa_1099_forms_update(UPDATE)
fa_account_balances
RLS: ✅ enabled (4 policies)
Foreign keys:
account_id→fa_accounts(id)fund_id→fa_funds(id)organization_id→pf_organizations(id)period_id→fa_fiscal_periods(id)
fa_account_balances_delete(DELETE)fa_account_balances_insert(INSERT)fa_account_balances_select(SELECT)fa_account_balances_update(UPDATE)
fa_account_mappings
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)fa_account_id→fa_accounts(id)fund_id→fa_funds(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
fa_account_mappings_delete(DELETE)fa_account_mappings_insert(INSERT)fa_account_mappings_select(SELECT)fa_account_mappings_update(UPDATE)
fa_account_types
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→users(id)
fa_account_types_delete(DELETE)fa_account_types_insert(INSERT)fa_account_types_org_read(SELECT)fa_account_types_update(UPDATE)
fa_accounts
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)default_fund_id→fa_funds(id)organization_id→pf_organizations(id)parent_account_id→fa_accounts(id)updated_by→pf_profiles(id)
fa_accounts_delete(DELETE)fa_accounts_insert(INSERT)fa_accounts_org_read(SELECT)fa_accounts_update(UPDATE)
fa_alert_thresholds
FA-ENH: Configurable financial alert thresholds that trigger notifications when metrics cross boundaries
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)updated_by→users(id)
fa_alert_thresholds_delete(DELETE)fa_alert_thresholds_insert(INSERT)fa_alert_thresholds_select(SELECT)fa_alert_thresholds_update(UPDATE)
fa_allocation_bases
RLS: ✅ enabled (4 policies)
Foreign keys:
computed_by→pf_profiles(id)organization_id→pf_organizations(id)pool_id→fa_indirect_cost_pools(id)
fa_allocation_bases_delete(DELETE)fa_allocation_bases_insert(INSERT)fa_allocation_bases_select(SELECT)fa_allocation_bases_update(UPDATE)
fa_approval_thresholds
RLS: ✅ enabled (4 policies)
Foreign keys:
approver_user_id→pf_profiles(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
fa_approval_thresholds_finance_admin_delete(DELETE)fa_approval_thresholds_finance_admin_insert(INSERT)fa_approval_thresholds_finance_admin_update(UPDATE)fa_approval_thresholds_org_select(SELECT)
fa_ar_payment_applications
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)invoice_id→fa_invoices(id)organization_id→pf_organizations(id)payment_id→fa_customer_payments(id)updated_by→users(id)
fa_ar_payment_applications_finance_admin_delete(DELETE)fa_ar_payment_applications_finance_admin_insert(INSERT)fa_ar_payment_applications_org_select(SELECT)fa_ar_payment_applications_update(UPDATE)
fa_asset_depreciation
RLS: ✅ enabled (4 policies)
Foreign keys:
asset_id→fa_fixed_assets(id)created_by→pf_profiles(id)fiscal_period_id→fa_fiscal_periods(id)journal_entry_id→fa_journal_entries(id)organization_id→pf_organizations(id)
fa_asset_depreciation_delete(DELETE)fa_asset_depreciation_insert(INSERT)fa_asset_depreciation_select(SELECT)fa_asset_depreciation_update(UPDATE)
fa_asset_disposals
RLS: ✅ enabled (4 policies)
Foreign keys:
approved_by→pf_profiles(id)asset_id→fa_fixed_assets(id)created_by→pf_profiles(id)fiscal_period_id→fa_fiscal_periods(id)journal_entry_id→fa_journal_entries(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
fa_asset_disposals_delete(DELETE)fa_asset_disposals_insert(INSERT)fa_asset_disposals_select(SELECT)fa_asset_disposals_update(UPDATE)
fa_asset_transfers
RLS: ✅ enabled (2 policies)
Foreign keys:
asset_id→fa_fixed_assets(id)created_by→pf_profiles(id)from_site_id→pf_sites(id)organization_id→pf_organizations(id)to_site_id→pf_sites(id)
fa_asset_transfers_insert(INSERT)fa_asset_transfers_select(SELECT)
fa_bad_debt_reserves
Tracks bad debt reserve calculations and their GL journal entries
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)journal_entry_id→fa_journal_entries(id)organization_id→pf_organizations(id)updated_by→users(id)
fa_bad_debt_reserves_delete(DELETE)fa_bad_debt_reserves_insert(INSERT)fa_bad_debt_reserves_select(SELECT)fa_bad_debt_reserves_update(UPDATE)
fa_bank_accounts
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)fund_id→fa_funds(id)gl_account_id→fa_accounts(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
fa_bank_accounts_delete(DELETE)fa_bank_accounts_insert(INSERT)fa_bank_accounts_select(SELECT)fa_bank_accounts_update(UPDATE)
fa_bank_reconciliations
RLS: ✅ enabled (4 policies)
Foreign keys:
bank_account_id→fa_bank_accounts(id)completed_by→pf_profiles(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)statement_id→fa_bank_statements(id)updated_by→pf_profiles(id)
fa_bank_reconciliations_finance_admin_delete(DELETE)fa_bank_reconciliations_finance_admin_insert(INSERT)fa_bank_reconciliations_finance_admin_update(UPDATE)fa_bank_reconciliations_org_read(SELECT)
fa_bank_statement_lines
RLS: ✅ enabled (8 policies)
Foreign keys:
ai_suggested_credit_account_id→fa_accounts(id)ai_suggested_debit_account_id→fa_accounts(id)auto_journal_entry_id→fa_journal_entries(id)organization_id→pf_organizations(id)rule_id→fa_transaction_rules(id)statement_id→fa_bank_statements(id)
fa_bank_statement_lines_delete(DELETE)fa_bank_statement_lines_finance_admin_delete(DELETE)fa_bank_statement_lines_finance_admin_insert(INSERT)fa_bank_statement_lines_finance_admin_update(UPDATE)fa_bank_statement_lines_insert(INSERT)fa_bank_statement_lines_org_read(SELECT)fa_bank_statement_lines_select(SELECT)fa_bank_statement_lines_update(UPDATE)
fa_bank_statements
RLS: ✅ enabled (4 policies)
Foreign keys:
bank_account_id→fa_bank_accounts(id)imported_by→pf_profiles(id)organization_id→pf_organizations(id)
fa_bank_statements_finance_admin_delete(DELETE)fa_bank_statements_finance_admin_insert(INSERT)fa_bank_statements_finance_admin_update(UPDATE)fa_bank_statements_org_read(SELECT)
fa_budget_alerts
Budget variance alerts exceeding threshold
RLS: ✅ enabled (4 policies)
Foreign keys:
account_id→fa_accounts(id)acknowledged_by→pf_profiles(id)budget_id→fa_budgets(id)fund_id→fa_funds(id)notification_id→pf_notifications(id)organization_id→pf_organizations(id)period_id→fa_fiscal_periods(id)
fa_budget_alerts_delete(DELETE)fa_budget_alerts_insert(INSERT)fa_budget_alerts_select(SELECT)fa_budget_alerts_update(UPDATE)
fa_budget_approvals
Audit trail for budget approval workflow
RLS: ✅ enabled (4 policies)
Foreign keys:
action_by→pf_profiles(id)budget_id→fa_budgets(id)organization_id→pf_organizations(id)
fa_budget_approvals_delete(DELETE)fa_budget_approvals_insert(INSERT)fa_budget_approvals_select(SELECT)fa_budget_approvals_update(UPDATE)
fa_budget_lines
FA-08: Individual budget line items by account and period
RLS: ✅ enabled (4 policies)
Foreign keys:
account_id→fa_accounts(id)budget_id→fa_budgets(id)fund_id→fa_funds(id)organization_id→pf_organizations(id)program_id→fa_programs(id)site_id→pf_sites(id)
fa_budget_lines_delete(DELETE)fa_budget_lines_insert(INSERT)fa_budget_lines_select(SELECT)fa_budget_lines_update(UPDATE)
fa_budget_scenarios
Budget scenarios for what-if analysis (best/worst/base case)
RLS: ✅ enabled (4 policies)
Foreign keys:
base_budget_id→fa_budgets(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
fa_budget_scenarios_delete(DELETE)fa_budget_scenarios_insert(INSERT)fa_budget_scenarios_select(SELECT)fa_budget_scenarios_update(UPDATE)
fa_budget_template_shares
Explicit sharing grants for budget templates
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)shared_with_user_id→pf_profiles(id)template_id→fa_budget_templates(id)
fa_budget_template_shares_delete(DELETE)fa_budget_template_shares_insert(INSERT)fa_budget_template_shares_select(SELECT)fa_budget_template_shares_update(UPDATE)
fa_budget_templates
Reusable budget templates that can be shared and applied to create new budgets
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)last_used_by→pf_profiles(id)organization_id→pf_organizations(id)source_budget_id→fa_budgets(id)updated_by→pf_profiles(id)
fa_budget_templates_delete(DELETE)fa_budget_templates_insert(INSERT)fa_budget_templates_select(SELECT)fa_budget_templates_update(UPDATE)
fa_budgets
FA-08: Budget headers with version control and approval workflow
RLS: ✅ enabled (4 policies)
Foreign keys:
approved_by→pf_profiles(id)created_by→pf_profiles(id)fiscal_year_id→fa_fiscal_years(id)organization_id→pf_organizations(id)rejected_by→pf_profiles(id)submitted_by→pf_profiles(id)updated_by→pf_profiles(id)
fa_budgets_delete(DELETE)fa_budgets_insert(INSERT)fa_budgets_select(SELECT)fa_budgets_update(UPDATE)
fa_card_transactions
FA-30: Synced Ramp card transactions for GL coding and reconciliation.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)gl_account_id→fa_accounts(id)organization_id→pf_organizations(id)ramp_connection_id→fa_ramp_connections(id)updated_by→users(id)vendor_id→fa_vendors(id)
fa_card_transactions_delete(DELETE)fa_card_transactions_insert(INSERT)fa_card_transactions_select(SELECT)fa_card_transactions_update(UPDATE)
fa_cash_forecasts
Cash flow forecast data by period. Used for liquidity planning.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
fa_cash_forecasts_delete(DELETE)fa_cash_forecasts_insert(INSERT)fa_cash_forecasts_select(SELECT)fa_cash_forecasts_update(UPDATE)
fa_cash_positions
Aggregated cash positions by organization and date. Populated by fa_calculate_cash_position() function.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
fa_cash_positions_delete(DELETE)fa_cash_positions_insert(INSERT)fa_cash_positions_select(SELECT)fa_cash_positions_update(UPDATE)
fa_category_mappings
FA-21: Maps transaction categories between source systems and GL accounts for automated categorization
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)credit_account_id→fa_accounts(id)debit_account_id→fa_accounts(id)fund_id→fa_funds(id)organization_id→pf_organizations(id)site_id→pf_sites(id)updated_by→pf_profiles(id)
fa_category_mappings_delete(DELETE)fa_category_mappings_insert(INSERT)fa_category_mappings_select(SELECT)fa_category_mappings_update(UPDATE)
fa_close_checklists
Close checklists - can be templates or period-specific instances
RLS: ✅ enabled (4 policies)
Foreign keys:
close_period_id→fa_close_periods(id)completed_by→pf_profiles(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)source_template_id→fa_close_checklists(id)started_by→pf_profiles(id)updated_by→pf_profiles(id)
fa_close_checklists_delete(DELETE)fa_close_checklists_insert(INSERT)fa_close_checklists_select(SELECT)fa_close_checklists_update(UPDATE)
fa_close_documentation
Supporting documentation for close periods
RLS: ✅ enabled (4 policies)
Foreign keys:
close_period_id→fa_close_periods(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)task_id→fa_close_tasks(id)updated_by→pf_profiles(id)uploaded_by→pf_profiles(id)
fa_close_documentation_delete(DELETE)fa_close_documentation_insert(INSERT)fa_close_documentation_select(SELECT)fa_close_documentation_update(UPDATE)
fa_close_periods
Tracks financial close periods (monthly, quarterly, yearly)
RLS: ✅ enabled (4 policies)
Foreign keys:
close_approved_by→pf_profiles(id)close_completed_by→pf_profiles(id)close_started_by→pf_profiles(id)created_by→pf_profiles(id)fiscal_period_id→fa_fiscal_periods(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
fa_close_periods_delete(DELETE)fa_close_periods_insert(INSERT)fa_close_periods_select(SELECT)fa_close_periods_update(UPDATE)
fa_close_tasks
Individual tasks within close checklists
RLS: ✅ enabled (4 policies)
Foreign keys:
assigned_to→pf_profiles(id)checklist_id→fa_close_checklists(id)completed_by→pf_profiles(id)created_by→pf_profiles(id)depends_on_task_id→fa_close_tasks(id)organization_id→pf_organizations(id)started_by→pf_profiles(id)updated_by→pf_profiles(id)verified_by→pf_profiles(id)
fa_close_tasks_delete(DELETE)fa_close_tasks_insert(INSERT)fa_close_tasks_select(SELECT)fa_close_tasks_update(UPDATE)
fa_coa_templates
Org-specific custom CoA templates that finance admins save from their existing chart of accounts and apply later. Built-in industry templates remain code/seed-based in src/cores/fa/data/coaTemplates.ts. Plan: specs/fa/plans/FA-01-coa-templates-completion-PLAN.md (Phase 4).
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)updated_by→users(id)
fa_coa_templates_delete(DELETE)fa_coa_templates_insert(INSERT)fa_coa_templates_org_read(SELECT)fa_coa_templates_update(UPDATE)
fa_collection_activities
Tracks all collection actions taken on past-due invoices
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)invoice_id→fa_invoices(id)organization_id→pf_organizations(id)performed_by→users(id)updated_by→pf_profiles(id)
fa_collection_activities_delete(DELETE)fa_collection_activities_insert(INSERT)fa_collection_activities_select(SELECT)fa_collection_activities_update(UPDATE)
fa_collection_queue
FA-24: Tracks overdue invoices in the collection workflow with status, priority, and assignment
RLS: ✅ enabled (4 policies)
Foreign keys:
assigned_to→pf_profiles(id)created_by→pf_profiles(id)invoice_id→fa_invoices(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
fa_collection_queue_delete(DELETE)fa_collection_queue_insert(INSERT)fa_collection_queue_select(SELECT)fa_collection_queue_update(UPDATE)
fa_compliance_account_mapping
FA-34: Per-organization mapping from GR compliance event categories to FA expense accounts. Used by fa-gr-compliance-cost-consumer when posting GL entries.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)expense_account_id→fa_accounts(id)organization_id→pf_organizations(id)updated_by→users(id)
fa_compliance_mapping_delete(DELETE)fa_compliance_mapping_insert(INSERT)fa_compliance_mapping_select(SELECT)fa_compliance_mapping_update(UPDATE)
fa_consolidation_adjustments
FA-09: Manual consolidation-only adjustments (US-08, Slice 3 UI). consolidation_run_id FK added with fa_consolidation_runs in Slice 2.
RLS: ✅ enabled (3 policies)
Foreign keys:
account_id→fa_accounts(id)organization_id→pf_organizations(id)
fa_cons_adj_insert(INSERT)fa_cons_adj_select(SELECT)fa_cons_adj_update(UPDATE)
fa_cost_allocations
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)pool_id→fa_indirect_cost_pools(id)project_id→fa_projects(id)updated_by→pf_profiles(id)
fa_cost_allocations_delete(DELETE)fa_cost_allocations_insert(INSERT)fa_cost_allocations_select(SELECT)fa_cost_allocations_update(UPDATE)
fa_credit_applications
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)credit_memo_id→fa_credit_memos(id)invoice_id→fa_invoices(id)organization_id→pf_organizations(id)updated_by→users(id)
credit_applications_finance_delete(DELETE)credit_applications_finance_insert(INSERT)credit_applications_org_access(SELECT)fa_credit_applications_update(UPDATE)
fa_credit_lines
Line of credit management for treasury operations.
RLS: ✅ enabled (4 policies)
Foreign keys:
bank_account_id→fa_bank_accounts(id)created_by→pf_profiles(id)interest_expense_account_id→fa_accounts(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
fa_credit_lines_delete(DELETE)fa_credit_lines_insert(INSERT)fa_credit_lines_select(SELECT)fa_credit_lines_update(UPDATE)
fa_credit_memo_lines
RLS: ✅ enabled (8 policies)
Foreign keys:
account_id→fa_accounts(id)credit_memo_id→fa_credit_memos(id)fund_id→fa_funds(id)organization_id→pf_organizations(id)program_id→fa_programs(id)
credit_memo_lines_delete(DELETE)credit_memo_lines_insert(INSERT)credit_memo_lines_select(SELECT)credit_memo_lines_update(UPDATE)fa_credit_memo_lines_delete(DELETE)fa_credit_memo_lines_insert(INSERT)fa_credit_memo_lines_select(SELECT)fa_credit_memo_lines_update(UPDATE)
fa_credit_memos
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)customer_id→fa_customers(id)journal_entry_id→fa_journal_entries(id)organization_id→pf_organizations(id)original_invoice_id→fa_invoices(id)updated_by→pf_profiles(id)
credit_memos_finance_delete(DELETE)credit_memos_finance_insert(INSERT)credit_memos_finance_update(UPDATE)credit_memos_org_access(SELECT)
fa_customer_payments
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)customer_id→fa_customers(id)journal_entry_id→fa_journal_entries(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
fa_customer_payments_finance_admin_delete(DELETE)fa_customer_payments_finance_admin_insert(INSERT)fa_customer_payments_finance_admin_update(UPDATE)fa_customer_payments_org_select(SELECT)
fa_customers
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)default_revenue_account_id→fa_accounts(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
fa_customers_finance_admin_delete(DELETE)fa_customers_finance_admin_insert(INSERT)fa_customers_finance_admin_update(UPDATE)fa_customers_org_select(SELECT)
fa_dashboard_definitions
FA-07 Phase 2: Per-organization financial dashboard layout definitions
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)updated_by→users(id)
fa_dashboard_definitions_delete(DELETE)fa_dashboard_definitions_insert(INSERT)fa_dashboard_definitions_select(SELECT)fa_dashboard_definitions_update(UPDATE)
fa_dashboard_widgets
FA-16: User-configurable dashboard widget layout and preferences
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)updated_by→users(id)
fa_dashboard_widgets_delete(DELETE)fa_dashboard_widgets_insert(INSERT)fa_dashboard_widgets_select(SELECT)fa_dashboard_widgets_update(UPDATE)
fa_deferred_revenue
FA-18: Deferred revenue (liability). Optionally linked to a recognition schedule.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)invoice_id→fa_invoices(id)organization_id→pf_organizations(id)revenue_schedule_id→fa_revenue_schedules(id)updated_by→pf_profiles(id)
fa_deferred_revenue_delete(DELETE)fa_deferred_revenue_insert(INSERT)fa_deferred_revenue_select(SELECT)fa_deferred_revenue_update(UPDATE)
fa_entities
FA-09: Legal entity master for multi-entity consolidation.
RLS: ✅ enabled (3 policies)
Foreign keys:
organization_id→pf_organizations(id)
fa_entities_insert(INSERT)fa_entities_select(SELECT)fa_entities_update(UPDATE)
fa_entity_relationships
FA-09: Parent/child entity relationships with ownership tracking.
RLS: ✅ enabled (4 policies)
Foreign keys:
child_entity_id→fa_entities(id)organization_id→pf_organizations(id)parent_entity_id→fa_entities(id)
fa_entity_rel_delete(DELETE)fa_entity_rel_insert(INSERT)fa_entity_rel_select(SELECT)fa_entity_rel_update(UPDATE)
fa_expense_approvals
RLS: ✅ enabled (3 policies)
Foreign keys:
approver_id→pf_profiles(id)created_by→pf_profiles(id)delegated_to→pf_profiles(id)expense_report_id→fa_expense_reports(id)organization_id→pf_organizations(id)threshold_id→fa_approval_thresholds(id)updated_by→pf_profiles(id)
fa_expense_approvals_insert(INSERT)fa_expense_approvals_select(SELECT)fa_expense_approvals_update(UPDATE)
fa_expense_category_mappings
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)default_department_id→pf_departments(id)default_fund_id→fa_funds(id)gl_account_id→fa_accounts(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
fa_expense_category_mappings_delete(DELETE)fa_expense_category_mappings_insert(INSERT)fa_expense_category_mappings_select(SELECT)fa_expense_category_mappings_update(UPDATE)
fa_expense_lines
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)department_id→pf_departments(id)expense_report_id→fa_expense_reports(id)fund_id→fa_funds(id)gl_account_id→fa_accounts(id)organization_id→pf_organizations(id)program_id→fa_programs(id)receipt_verified_by→pf_profiles(id)updated_by→pf_profiles(id)
fa_expense_lines_delete(DELETE)fa_expense_lines_insert(INSERT)fa_expense_lines_select(SELECT)fa_expense_lines_update(UPDATE)
fa_expense_policies
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
fa_expense_policies_delete(DELETE)fa_expense_policies_insert(INSERT)fa_expense_policies_select(SELECT)fa_expense_policies_update(UPDATE)
fa_expense_reports
RLS: ✅ enabled (4 policies)
Foreign keys:
approved_by→pf_profiles(id)created_by→pf_profiles(id)default_gl_account_id→fa_accounts(id)department_id→pf_departments(id)employee_id→hr_employees(id)fund_id→fa_funds(id)journal_entry_id→fa_journal_entries(id)organization_id→pf_organizations(id)rejected_by→pf_profiles(id)site_id→pf_sites(id)submitted_by→pf_profiles(id)updated_by→pf_profiles(id)journal_entry_id→fa_journal_entries(id)
fa_expense_reports_delete(DELETE)fa_expense_reports_insert(INSERT)fa_expense_reports_select(SELECT)fa_expense_reports_update(UPDATE)
fa_expense_rule_conditions
FA-27: optional scope for a rule (single condition row in Phase 1; OR semantics when multiple rows exist in future).
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)rule_id→fa_expense_rules(id)updated_by→pf_profiles(id)
fa_expense_rule_conditions_delete(DELETE)fa_expense_rule_conditions_insert(INSERT)fa_expense_rule_conditions_select(SELECT)fa_expense_rule_conditions_update(UPDATE)
fa_expense_rules
FA-27: declarative expense policy rules (limits, receipt thresholds, per-diem/mileage hooks).
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
fa_expense_rules_delete(DELETE)fa_expense_rules_insert(INSERT)fa_expense_rules_select(SELECT)fa_expense_rules_update(UPDATE)
fa_expense_violations
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)expense_line_id→fa_expense_lines(id)expense_report_id→fa_expense_reports(id)organization_id→pf_organizations(id)rule_id→fa_expense_policies(id)
fa_expense_violations_delete(DELETE)fa_expense_violations_insert(INSERT)fa_expense_violations_select(SELECT)fa_expense_violations_update(UPDATE)
fa_fiscal_periods
RLS: ✅ enabled (4 policies)
Foreign keys:
closed_by→pf_profiles(id)fiscal_year_id→fa_fiscal_years(id)organization_id→pf_organizations(id)
fa_fiscal_periods_delete(DELETE)fa_fiscal_periods_insert(INSERT)fa_fiscal_periods_org_read(SELECT)fa_fiscal_periods_update(UPDATE)
fa_fiscal_years
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
fa_fiscal_years_delete(DELETE)fa_fiscal_years_insert(INSERT)fa_fiscal_years_org_read(SELECT)fa_fiscal_years_update(UPDATE)
fa_fixed_assets
RLS: ✅ enabled (3 policies)
Foreign keys:
accumulated_depreciation_account_id→fa_accounts(id)asset_account_id→fa_accounts(id)created_by→pf_profiles(id)current_site_id→pf_sites(id)depreciation_expense_account_id→fa_accounts(id)gain_loss_account_id→fa_accounts(id)organization_id→pf_organizations(id)purchase_order_id→fa_purchase_orders(id)site_id→pf_sites(id)updated_by→pf_profiles(id)vendor_id→fa_vendors(id)
fa_fixed_assets_insert(INSERT)fa_fixed_assets_select(SELECT)fa_fixed_assets_update(UPDATE)
fa_forecast_lines
Individual line items for rolling forecasts by account and period
RLS: ✅ enabled (4 policies)
Foreign keys:
account_id→fa_accounts(id)created_by→pf_profiles(id)department_id→pf_departments(id)forecast_id→fa_rolling_forecasts(id)fund_id→fa_funds(id)organization_id→pf_organizations(id)program_id→fa_programs(id)site_id→pf_sites(id)updated_by→pf_profiles(id)
fa_forecast_lines_delete(DELETE)fa_forecast_lines_insert(INSERT)fa_forecast_lines_select(SELECT)fa_forecast_lines_update(UPDATE)
fa_forecast_versions
Version history for rolling forecasts with complete line snapshots
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)forecast_id→fa_rolling_forecasts(id)organization_id→pf_organizations(id)
fa_forecast_versions_delete(DELETE)fa_forecast_versions_insert(INSERT)fa_forecast_versions_select(SELECT)fa_forecast_versions_update(UPDATE)
fa_funds
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
fa_funds_delete(DELETE)fa_funds_insert(INSERT)fa_funds_org_read(SELECT)fa_funds_update(UPDATE)
fa_gr_event_log
FA-34: Idempotent inbox + audit log of GR compliance cost events processed by fa-gr-compliance-cost-consumer Edge Function. Append-only (no DELETE policy).
RLS: ✅ enabled (3 policies)
Foreign keys:
created_by→users(id)gl_journal_entry_id→fa_journal_entries(id)organization_id→pf_organizations(id)updated_by→users(id)
fa_gr_event_log_insert(INSERT)fa_gr_event_log_select(SELECT)fa_gr_event_log_update(UPDATE)
fa_grant_drawdowns
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)project_id→fa_projects(id)updated_by→pf_profiles(id)
fa_grant_drawdowns_delete(DELETE)fa_grant_drawdowns_insert(INSERT)fa_grant_drawdowns_select(SELECT)fa_grant_drawdowns_update(UPDATE)
fa_import_jobs
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
fa_import_jobs_delete(DELETE)fa_import_jobs_insert(INSERT)fa_import_jobs_select(SELECT)fa_import_jobs_update(UPDATE)
fa_indirect_cost_pools
Indirect cost pool definitions for IDC rate calculation (FA-15). Referenced by FA-13 for project cost allocation.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
fa_indirect_cost_pools_delete(DELETE)fa_indirect_cost_pools_insert(INSERT)fa_indirect_cost_pools_select(SELECT)fa_indirect_cost_pools_update(UPDATE)
fa_indirect_cost_rates
RLS: ✅ enabled (4 policies)
Foreign keys:
approved_by→pf_profiles(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)pool_id→fa_indirect_cost_pools(id)updated_by→pf_profiles(id)
fa_indirect_cost_rates_delete(DELETE)fa_indirect_cost_rates_insert(INSERT)fa_indirect_cost_rates_select(SELECT)fa_indirect_cost_rates_update(UPDATE)
fa_investments
Short-term investment tracking for treasury management.
RLS: ✅ enabled (4 policies)
Foreign keys:
bank_account_id→fa_bank_accounts(id)created_by→pf_profiles(id)interest_income_account_id→fa_accounts(id)investment_account_id→fa_accounts(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
fa_investments_delete(DELETE)fa_investments_insert(INSERT)fa_investments_select(SELECT)fa_investments_update(UPDATE)
fa_invoice_lines
RLS: ✅ enabled (8 policies)
Foreign keys:
account_id→fa_accounts(id)fund_id→fa_funds(id)invoice_id→fa_invoices(id)organization_id→pf_organizations(id)program_id→fa_programs(id)
fa_invoice_lines_delete(DELETE)fa_invoice_lines_finance_admin_delete(DELETE)fa_invoice_lines_finance_admin_insert(INSERT)fa_invoice_lines_finance_admin_update(UPDATE)fa_invoice_lines_insert(INSERT)fa_invoice_lines_org_select(SELECT)fa_invoice_lines_select(SELECT)fa_invoice_lines_update(UPDATE)
fa_invoices
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)customer_id→fa_customers(id)journal_entry_id→fa_journal_entries(id)organization_id→pf_organizations(id)site_id→pf_sites(id)updated_by→pf_profiles(id)
fa_invoices_finance_admin_delete(DELETE)fa_invoices_finance_admin_insert(INSERT)fa_invoices_finance_admin_update(UPDATE)fa_invoices_org_select(SELECT)
fa_journal_entries
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)period_id→fa_fiscal_periods(id)posted_by→pf_profiles(id)reversal_of_entry_id→fa_journal_entries(id)reversed_by_entry_id→fa_journal_entries(id)updated_by→pf_profiles(id)
fa_journal_entries_delete(DELETE)fa_journal_entries_insert(INSERT)fa_journal_entries_select(SELECT)fa_journal_entries_update(UPDATE)
fa_journal_entry_lines
RLS: ✅ enabled (4 policies)
Foreign keys:
account_id→fa_accounts(id)fund_id→fa_funds(id)journal_entry_id→fa_journal_entries(id)organization_id→pf_organizations(id)program_id→fa_programs(id)related_entity_id→fa_entities(id)
fa_journal_entry_lines_delete(DELETE)fa_journal_entry_lines_insert(INSERT)fa_journal_entry_lines_select(SELECT)fa_journal_entry_lines_update(UPDATE)
fa_kpi_definitions
FA-16: KPI definitions with thresholds and formulas
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)updated_by→users(id)
fa_kpi_definitions_delete(DELETE)fa_kpi_definitions_insert(INSERT)fa_kpi_definitions_select(SELECT)fa_kpi_definitions_update(UPDATE)
fa_kpi_history
FA-16: Append-only KPI calculation history for trend analysis
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)kpi_definition_id→fa_kpi_definitions(id)organization_id→pf_organizations(id)
fa_kpi_history_insert(INSERT)fa_kpi_history_no_delete(DELETE)fa_kpi_history_no_update(UPDATE)fa_kpi_history_select(SELECT)
fa_module_settings
RLS: ✅ enabled (4 policies)
Foreign keys:
compliance_default_ap_account_id→fa_accounts(id)compliance_default_expense_account_id→fa_accounts(id)created_by→pf_profiles(id)default_ar_account_id→fa_accounts(id)default_cash_account_id→fa_accounts(id)default_deferred_revenue_account_id→fa_accounts(id)default_revenue_account_id→fa_accounts(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
fa_module_settings_delete(DELETE)fa_module_settings_insert(INSERT)fa_module_settings_select(SELECT)fa_module_settings_update(UPDATE)
fa_payment_applications
RLS: ✅ enabled (4 policies)
Foreign keys:
bill_id→fa_vendor_bills(id)bill_line_id→fa_vendor_bill_lines(id)payment_id→fa_payments(id)
fa_payment_applications_finance_admin_delete(DELETE)fa_payment_applications_finance_admin_insert(INSERT)fa_payment_applications_org_select(SELECT)fa_payment_applications_update(UPDATE)
fa_payment_batches
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)journal_entry_id→fa_journal_entries(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
fa_payment_batches_finance_admin_delete(DELETE)fa_payment_batches_finance_admin_insert(INSERT)fa_payment_batches_finance_admin_update(UPDATE)fa_payment_batches_org_select(SELECT)
fa_payment_plan_audit_log
Immutable audit log for payment plan changes
RLS: ✅ enabled (2 policies)
Foreign keys:
changed_by→pf_profiles(id)installment_id→fa_payment_plan_installments(id)organization_id→pf_organizations(id)plan_id→fa_payment_plans(id)
fa_payment_plan_audit_log_insert(INSERT)fa_payment_plan_audit_log_select(SELECT)
fa_payment_plan_installments
Individual installments within a payment plan
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)payment_id→fa_customer_payments(id)payment_plan_id→fa_payment_plans(id)skipped_by→pf_profiles(id)updated_by→pf_profiles(id)
fa_payment_plan_installments_delete(DELETE)fa_payment_plan_installments_insert(INSERT)fa_payment_plan_installments_select(SELECT)fa_payment_plan_installments_update(UPDATE)
fa_payment_plans
Payment plans for customers with approval workflow and audit trail
RLS: ✅ enabled (4 policies)
Foreign keys:
approved_by→pf_profiles(id)cancelled_by→pf_profiles(id)created_by→pf_profiles(id)customer_id→fa_customers(id)invoice_id→fa_invoices(id)organization_id→pf_organizations(id)rejected_by→pf_profiles(id)submitted_by→pf_profiles(id)updated_by→pf_profiles(id)
fa_payment_plans_delete(DELETE)fa_payment_plans_insert(INSERT)fa_payment_plans_select(SELECT)fa_payment_plans_update(UPDATE)
fa_payments
RLS: ✅ enabled (4 policies)
Foreign keys:
batch_id→fa_payment_batches(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)vendor_id→fa_vendors(id)
fa_payments_finance_admin_delete(DELETE)fa_payments_finance_admin_insert(INSERT)fa_payments_finance_admin_update(UPDATE)fa_payments_org_select(SELECT)
fa_period_close_audit
FA-02: Immutable audit log for period close/reopen events. Append-only via SECURITY DEFINER function.
RLS: ✅ enabled (1 policies)
Foreign keys:
organization_id→pf_organizations(id)performed_by→pf_profiles(id)period_id→fa_fiscal_periods(id)
fa_period_close_audit_select(SELECT)
fa_plaid_sync_log
FA-20: Plaid sync history with error tracking and retry queue for recovery
RLS: ✅ enabled (3 policies)
Foreign keys:
bank_account_id→fa_bank_accounts(id)organization_id→pf_organizations(id)triggered_by→users(id)updated_by→users(id)
fa_plaid_sync_log_insert(INSERT)fa_plaid_sync_log_select(SELECT)fa_plaid_sync_log_update(UPDATE)
fa_plaid_transfer_intents
FA-20: Maps Plaid transfer_intent_id to organization for ownership validation
RLS: ✅ enabled (2 policies)
Foreign keys:
organization_id→pf_organizations(id)user_id→pf_profiles(id)
fa_plaid_transfer_intents_insert(INSERT)fa_plaid_transfer_intents_select(SELECT)
fa_pm_event_log
EN-01: Idempotency log for PM payment_posted and write_off_approved events consumed by FA for GL posting
RLS: ✅ enabled (3 policies)
Foreign keys:
journal_entry_id→fa_journal_entries(id)organization_id→pf_organizations(id)
fa_pm_event_log_insert(INSERT)fa_pm_event_log_select(SELECT)fa_pm_event_log_update(UPDATE)
fa_po_amendments
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)po_id→fa_purchase_orders(id)
fa_po_amendments_delete(DELETE)fa_po_amendments_insert(INSERT)fa_po_amendments_select(SELECT)fa_po_amendments_update(UPDATE)
fa_po_receipt_lines
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)po_line_id→fa_purchase_order_lines(id)receipt_id→fa_po_receipts(id)updated_by→pf_profiles(id)
fa_po_receipt_lines_finance_admin_delete(DELETE)fa_po_receipt_lines_finance_admin_insert(INSERT)fa_po_receipt_lines_finance_admin_update(UPDATE)fa_po_receipt_lines_org_select(SELECT)
fa_po_receipts
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)po_id→fa_purchase_orders(id)received_by→pf_profiles(id)updated_by→pf_profiles(id)voided_by→pf_profiles(id)
fa_po_receipts_finance_admin_delete(DELETE)fa_po_receipts_finance_admin_insert(INSERT)fa_po_receipts_finance_admin_update(UPDATE)fa_po_receipts_org_select(SELECT)
fa_programs
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
fa_programs_delete(DELETE)fa_programs_insert(INSERT)fa_programs_org_read(SELECT)fa_programs_update(UPDATE)
fa_project_budgets
RLS: ✅ enabled (4 policies)
Foreign keys:
account_id→fa_accounts(id)approved_by→pf_profiles(id)budget_id→fa_budgets(id)created_by→pf_profiles(id)fund_id→fa_funds(id)organization_id→pf_organizations(id)project_id→fa_projects(id)updated_by→pf_profiles(id)
fa_project_budgets_delete(DELETE)fa_project_budgets_insert(INSERT)fa_project_budgets_select(SELECT)fa_project_budgets_update(UPDATE)
fa_project_expenses
RLS: ✅ enabled (4 policies)
Foreign keys:
account_id→fa_accounts(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)project_id→fa_projects(id)updated_by→pf_profiles(id)
fa_project_expenses_delete(DELETE)fa_project_expenses_insert(INSERT)fa_project_expenses_select(SELECT)fa_project_expenses_update(UPDATE)
fa_project_revenue
RLS: ✅ enabled (4 policies)
Foreign keys:
account_id→fa_accounts(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)project_id→fa_projects(id)updated_by→pf_profiles(id)
fa_project_revenue_delete(DELETE)fa_project_revenue_insert(INSERT)fa_project_revenue_select(SELECT)fa_project_revenue_update(UPDATE)
fa_projects
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)fund_id→fa_funds(id)organization_id→pf_organizations(id)program_director_id→pf_profiles(id)project_manager_id→pf_profiles(id)updated_by→pf_profiles(id)
fa_projects_delete(DELETE)fa_projects_insert(INSERT)fa_projects_select(SELECT)fa_projects_update(UPDATE)
fa_purchase_order_lines
FA-04: Line items for purchase orders with GL distribution
RLS: ✅ enabled (8 policies)
Foreign keys:
account_id→fa_accounts(id)fund_id→fa_funds(id)organization_id→pf_organizations(id)po_id→fa_purchase_orders(id)program_id→fa_programs(id)
fa_po_lines_finance_admin_delete(DELETE)fa_po_lines_finance_admin_insert(INSERT)fa_po_lines_finance_admin_update(UPDATE)fa_po_lines_org_select(SELECT)fa_purchase_order_lines_delete(DELETE)fa_purchase_order_lines_insert(INSERT)fa_purchase_order_lines_select(SELECT)fa_purchase_order_lines_update(UPDATE)
fa_purchase_orders
FA-04: Purchase orders for procurement management
RLS: ✅ enabled (4 policies)
Foreign keys:
approved_by→pf_profiles(id)cancelled_by→pf_profiles(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)ship_to_site_id→pf_sites(id)updated_by→pf_profiles(id)vendor_id→fa_vendors(id)
fa_pos_finance_admin_delete(DELETE)fa_pos_finance_admin_insert(INSERT)fa_pos_finance_admin_update(UPDATE)fa_pos_org_select(SELECT)
fa_ramp_connections
FA-30: Ramp OAuth connection per organization. One row per org.
RLS: ✅ enabled (4 policies)
Foreign keys:
access_token_vault_id→pf_credential_vault(id)created_by→users(id)organization_id→pf_organizations(id)refresh_token_vault_id→pf_credential_vault(id)updated_by→users(id)
fa_ramp_connections_delete(DELETE)fa_ramp_connections_insert(INSERT)fa_ramp_connections_select(SELECT)fa_ramp_connections_update(UPDATE)
fa_reconciliation_adjustments
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)gl_account_id→fa_accounts(id)journal_entry_id→fa_journal_entries(id)reconciliation_id→fa_bank_reconciliations(id)
adjustments_finance_admin_delete(DELETE)adjustments_finance_admin_insert(INSERT)adjustments_org_read(SELECT)fa_reconciliation_adjustments_update(UPDATE)
fa_reconciliation_matches
RLS: ✅ enabled (6 policies)
Foreign keys:
bank_line_id→fa_bank_statement_lines(id)gl_line_id→fa_journal_entry_lines(id)matched_by→pf_profiles(id)organization_id→pf_organizations(id)reconciliation_id→fa_bank_reconciliations(id)
fa_reconciliation_matches_delete(DELETE)fa_reconciliation_matches_finance_admin_delete(DELETE)fa_reconciliation_matches_finance_admin_insert(INSERT)fa_reconciliation_matches_insert(INSERT)fa_reconciliation_matches_select(SELECT)fa_reconciliation_matches_update(UPDATE)
fa_recurring_entries
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
fa_recurring_entries_delete(DELETE)fa_recurring_entries_insert(INSERT)fa_recurring_entries_select(SELECT)fa_recurring_entries_update(UPDATE)
fa_recurring_invoice_lines
RLS: ✅ enabled (4 policies)
Foreign keys:
account_id→fa_accounts(id)created_by→pf_profiles(id)fund_id→fa_funds(id)organization_id→pf_organizations(id)recurring_invoice_id→fa_recurring_invoices(id)updated_by→pf_profiles(id)
fa_recurring_invoice_lines_delete(DELETE)fa_recurring_invoice_lines_insert(INSERT)fa_recurring_invoice_lines_select(SELECT)fa_recurring_invoice_lines_update(UPDATE)
fa_recurring_invoices
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)customer_id→fa_customers(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
fa_recurring_invoices_delete(DELETE)fa_recurring_invoices_insert(INSERT)fa_recurring_invoices_select(SELECT)fa_recurring_invoices_update(UPDATE)
fa_recurring_transaction_templates
FA-21: Templates for recurring journal entries, adjustments, and other automated transactions
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)site_id→pf_sites(id)updated_by→pf_profiles(id)
fa_recurring_transaction_templates_delete(DELETE)fa_recurring_transaction_templates_insert(INSERT)fa_recurring_transaction_templates_select(SELECT)fa_recurring_transaction_templates_update(UPDATE)
fa_reimbursement_payments
RLS: ✅ enabled (2 policies)
Foreign keys:
bank_account_id→fa_bank_accounts(id)created_by→pf_profiles(id)employee_id→hr_employees(id)expense_report_id→fa_expense_reports(id)journal_entry_id→fa_journal_entries(id)organization_id→pf_organizations(id)reversal_payment_id→fa_reimbursement_payments(id)
fa_reimbursement_payments_insert(INSERT)fa_reimbursement_payments_select(SELECT)
fa_report_annotations
FA-07: Inline annotations on financial report lines with PHI awareness
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)report_run_id→fa_report_runs(id)updated_by→users(id)
fa_report_annotations_delete(DELETE)fa_report_annotations_insert(INSERT)fa_report_annotations_select(SELECT)fa_report_annotations_update(UPDATE)
fa_report_definitions
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)
fa_report_definitions_delete(DELETE)fa_report_definitions_insert(INSERT)fa_report_definitions_org_read(SELECT)fa_report_definitions_update(UPDATE)
fa_report_favorites
User report favorites. Insert/delete only; audit tracks creation only (created_by).
RLS: ✅ enabled (3 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)user_id→users(id)
fa_report_favorites_delete(DELETE)fa_report_favorites_insert(INSERT)fa_report_favorites_select(SELECT)
fa_report_recipients
RLS: ✅ enabled (4 policies)
Foreign keys:
schedule_id→fa_report_schedules(id)
fa_report_recipients_delete(DELETE)fa_report_recipients_insert(INSERT)fa_report_recipients_select(SELECT)fa_report_recipients_update(UPDATE)
fa_report_runs
RLS: ✅ enabled (4 policies)
Foreign keys:
organization_id→pf_organizations(id)schedule_id→fa_report_schedules(id)triggered_by→pf_profiles(id)
fa_report_runs_delete(DELETE)fa_report_runs_org_insert(INSERT)fa_report_runs_org_read(SELECT)fa_report_runs_org_update(UPDATE)
fa_report_schedules
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
fa_report_schedules_finance_admin_delete(DELETE)fa_report_schedules_finance_admin_insert(INSERT)fa_report_schedules_finance_admin_update(UPDATE)fa_report_schedules_org_read(SELECT)
fa_report_versions
FA-07 Phase 2: Stores versioned snapshots of report configurations for the custom report builder
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)updated_by→users(id)
fa_report_versions_delete(DELETE)fa_report_versions_insert(INSERT)fa_report_versions_select(SELECT)fa_report_versions_update(UPDATE)
fa_revenue_contracts
FA-18: Master revenue contracts. Source of recognition schedules for multi-period revenue.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)deferred_revenue_account_id→fa_accounts(id)organization_id→pf_organizations(id)project_id→fa_projects(id)revenue_account_id→fa_accounts(id)updated_by→pf_profiles(id)
fa_revenue_contracts_delete(DELETE)fa_revenue_contracts_insert(INSERT)fa_revenue_contracts_select(SELECT)fa_revenue_contracts_update(UPDATE)
fa_revenue_milestones
FA-18 WS-D: Performance-based revenue recognition milestones. Each achievement creates a recognition entry.
RLS: ✅ enabled (4 policies)
Foreign keys:
achieved_by→pf_profiles(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)recognition_id→fa_revenue_recognitions(id)revenue_schedule_id→fa_revenue_schedules(id)updated_by→pf_profiles(id)
fa_revenue_milestones_delete(DELETE)fa_revenue_milestones_insert(INSERT)fa_revenue_milestones_select(SELECT)fa_revenue_milestones_update(UPDATE)
fa_revenue_recognitions
FA-18: Append-only recognition entries. UNIQUE(schedule, period) prevents duplicates.
RLS: ✅ enabled (2 policies)
Foreign keys:
created_by→pf_profiles(id)fiscal_period_id→fa_fiscal_periods(id)journal_entry_id→fa_journal_entries(id)journal_entry_line_id→fa_journal_entry_lines(id)organization_id→pf_organizations(id)revenue_schedule_id→fa_revenue_schedules(id)
fa_revenue_recognitions_insert(INSERT)fa_revenue_recognitions_select(SELECT)
fa_revenue_schedule_modifications
FA-18 WS-A: Append-only ledger of revenue schedule modifications and recognition reversals. Never updated or deleted.
RLS: ✅ enabled (2 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)recognition_id→fa_revenue_recognitions(id)revenue_schedule_id→fa_revenue_schedules(id)reversal_recognition_id→fa_revenue_recognitions(id)
fa_rev_sched_mods_insert(INSERT)fa_rev_sched_mods_select(SELECT)
fa_revenue_schedule_periods
FA-18 / FA-UX-15: Per-fiscal-period allocations for a revenue schedule. Persisted atomically by fa_create_revenue_schedule().
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)fiscal_period_id→fa_fiscal_periods(id)organization_id→pf_organizations(id)revenue_schedule_id→fa_revenue_schedules(id)updated_by→pf_profiles(id)
fa_revenue_schedule_periods_delete(DELETE)fa_revenue_schedule_periods_insert(INSERT)fa_revenue_schedule_periods_select(SELECT)fa_revenue_schedule_periods_update(UPDATE)
fa_revenue_schedules
FA-18: Revenue recognition schedule. Sourced from EITHER a contract OR an invoice.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)deferred_revenue_account_id→fa_accounts(id)invoice_id→fa_invoices(id)organization_id→pf_organizations(id)revenue_account_id→fa_accounts(id)revenue_contract_id→fa_revenue_contracts(id)updated_by→pf_profiles(id)
fa_revenue_schedules_delete(DELETE)fa_revenue_schedules_insert(INSERT)fa_revenue_schedules_select(SELECT)fa_revenue_schedules_update(UPDATE)
fa_revenue_source_event_log
WS-B: Append-only idempotency log for fa-consume-revenue-source-events. One row per (event_id, event_name).
RLS: ✅ enabled (1 policies)
Foreign keys:
organization_id→pf_organizations(id)revenue_schedule_id→fa_revenue_schedules(id)
fa_revenue_source_event_log_select(SELECT)
fa_rolling_forecasts
Rolling forecasts for financial planning with configurable horizons
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)source_budget_id→fa_budgets(id)updated_by→pf_profiles(id)
fa_rolling_forecasts_delete(DELETE)fa_rolling_forecasts_insert(INSERT)fa_rolling_forecasts_select(SELECT)fa_rolling_forecasts_update(UPDATE)
fa_scenario_budget_lines
Line items for budget scenarios with account/fund/department allocations
RLS: ✅ enabled (4 policies)
Foreign keys:
account_id→fa_accounts(id)created_by→pf_profiles(id)department_id→pf_departments(id)fund_id→fa_funds(id)organization_id→pf_organizations(id)program_id→fa_programs(id)scenario_id→fa_budget_scenarios(id)site_id→pf_sites(id)updated_by→pf_profiles(id)
fa_scenario_budget_lines_delete(DELETE)fa_scenario_budget_lines_insert(INSERT)fa_scenario_budget_lines_select(SELECT)fa_scenario_budget_lines_update(UPDATE)
fa_tax_distributions
FA-10: Tax document distribution tracking
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)tax_year_id→fa_tax_years(id)updated_by→users(id)
fa_tax_distributions_delete(DELETE)fa_tax_distributions_insert(INSERT)fa_tax_distributions_select(SELECT)fa_tax_distributions_update(UPDATE)
fa_tax_reports
FA-10: Quarterly/annual tax reports (Form 941, 940, state reports)
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)filed_by→users(id)organization_id→pf_organizations(id)tax_year_id→fa_tax_years(id)updated_by→users(id)
fa_tax_reports_delete(DELETE)fa_tax_reports_insert(INSERT)fa_tax_reports_select(SELECT)fa_tax_reports_update(UPDATE)
fa_tax_years
FA-10: Tax year configuration and lifecycle tracking
RLS: ✅ enabled (4 policies)
Foreign keys:
closed_by→users(id)created_by→users(id)organization_id→pf_organizations(id)updated_by→users(id)
fa_tax_years_delete(DELETE)fa_tax_years_insert(INSERT)fa_tax_years_select(SELECT)fa_tax_years_update(UPDATE)
fa_template_applications
Append-only audit of CoA template applies. One row per Apply Template event. Implements FA-01 Phase 3 US-3.1 acceptance criterion “Template metadata stored (e.g., template_id, applied_at) for audit”.
RLS: ✅ enabled (2 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)
fa_template_applications_insert(INSERT)fa_template_applications_org_read(SELECT)
fa_transaction_rules
FA-21: User-defined rules to auto-create GL journal entries from bank transactions.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)credit_account_id→fa_accounts(id)debit_account_id→fa_accounts(id)fund_id→fa_funds(id)match_bank_account_id→fa_bank_accounts(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
fa_transaction_rules_delete(DELETE)fa_transaction_rules_insert(INSERT)fa_transaction_rules_select(SELECT)fa_transaction_rules_update(UPDATE)
fa_vendor_bill_lines
Line-item distribution of vendor bills to GL accounts
RLS: ✅ enabled (8 policies)
Foreign keys:
account_id→fa_accounts(id)bill_id→fa_vendor_bills(id)fund_id→fa_funds(id)organization_id→pf_organizations(id)program_id→fa_programs(id)purchase_order_line_id→fa_purchase_order_lines(id)
fa_vendor_bill_lines_delete(DELETE)fa_vendor_bill_lines_finance_admin_delete(DELETE)fa_vendor_bill_lines_finance_admin_insert(INSERT)fa_vendor_bill_lines_finance_admin_update(UPDATE)fa_vendor_bill_lines_insert(INSERT)fa_vendor_bill_lines_org_select(SELECT)fa_vendor_bill_lines_select(SELECT)fa_vendor_bill_lines_update(UPDATE)
fa_vendor_bills
Vendor bills/invoices awaiting approval and payment
RLS: ✅ enabled (4 policies)
Foreign keys:
approved_by→pf_profiles(id)attachment_document_id→pf_documents(id)created_by→pf_profiles(id)journal_entry_id→fa_journal_entries(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)vendor_id→fa_vendors(id)
fa_vendor_bills_finance_admin_delete(DELETE)fa_vendor_bills_finance_admin_insert(INSERT)fa_vendor_bills_finance_admin_update(UPDATE)fa_vendor_bills_org_select(SELECT)
fa_vendors
Vendor master data with tax and banking information
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)default_account_id→fa_accounts(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)w9_document_id→pf_documents(id)
fa_vendors_finance_admin_delete(DELETE)fa_vendors_finance_admin_insert(INSERT)fa_vendors_finance_admin_update(UPDATE)fa_vendors_finance_select(SELECT)
fa_w2_forms
FA-10: W-2 tax form records for employee wages. employee_id references hr_employees conceptually (no FK to maintain core boundary)
RLS: ✅ enabled (4 policies)
Foreign keys:
corrects_form_id→fa_w2_forms(id)created_by→users(id)filed_by→users(id)organization_id→pf_organizations(id)tax_year_id→fa_tax_years(id)updated_by→users(id)
fa_w2_forms_delete(DELETE)fa_w2_forms_insert(INSERT)fa_w2_forms_select(SELECT)fa_w2_forms_update(UPDATE)