Skip to main content
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_idfa_1099_forms(id)
  • created_byusers(id)
  • filed_byusers(id)
  • organization_idpf_organizations(id)
  • tax_year_idfa_tax_years(id)
  • updated_byusers(id)
Policies:
  • 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_idfa_accounts(id)
  • fund_idfa_funds(id)
  • organization_idpf_organizations(id)
  • period_idfa_fiscal_periods(id)
Policies:
  • 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_bypf_profiles(id)
  • fa_account_idfa_accounts(id)
  • fund_idfa_funds(id)
  • organization_idpf_organizations(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_bypf_profiles(id)
  • organization_idpf_organizations(id)
  • updated_byusers(id)
Policies:
  • 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_bypf_profiles(id)
  • default_fund_idfa_funds(id)
  • organization_idpf_organizations(id)
  • parent_account_idfa_accounts(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_byusers(id)
  • organization_idpf_organizations(id)
  • updated_byusers(id)
Policies:
  • 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_bypf_profiles(id)
  • organization_idpf_organizations(id)
  • pool_idfa_indirect_cost_pools(id)
Policies:
  • 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_idpf_profiles(id)
  • created_bypf_profiles(id)
  • organization_idpf_organizations(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_bypf_profiles(id)
  • invoice_idfa_invoices(id)
  • organization_idpf_organizations(id)
  • payment_idfa_customer_payments(id)
  • updated_byusers(id)
Policies:
  • 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_idfa_fixed_assets(id)
  • created_bypf_profiles(id)
  • fiscal_period_idfa_fiscal_periods(id)
  • journal_entry_idfa_journal_entries(id)
  • organization_idpf_organizations(id)
Policies:
  • 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_bypf_profiles(id)
  • asset_idfa_fixed_assets(id)
  • created_bypf_profiles(id)
  • fiscal_period_idfa_fiscal_periods(id)
  • journal_entry_idfa_journal_entries(id)
  • organization_idpf_organizations(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_idfa_fixed_assets(id)
  • created_bypf_profiles(id)
  • from_site_idpf_sites(id)
  • organization_idpf_organizations(id)
  • to_site_idpf_sites(id)
Policies:
  • 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_byusers(id)
  • journal_entry_idfa_journal_entries(id)
  • organization_idpf_organizations(id)
  • updated_byusers(id)
Policies:
  • 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_bypf_profiles(id)
  • fund_idfa_funds(id)
  • gl_account_idfa_accounts(id)
  • organization_idpf_organizations(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_idfa_bank_accounts(id)
  • completed_bypf_profiles(id)
  • created_bypf_profiles(id)
  • organization_idpf_organizations(id)
  • statement_idfa_bank_statements(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_idfa_accounts(id)
  • ai_suggested_debit_account_idfa_accounts(id)
  • auto_journal_entry_idfa_journal_entries(id)
  • organization_idpf_organizations(id)
  • rule_idfa_transaction_rules(id)
  • statement_idfa_bank_statements(id)
Policies:
  • 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_idfa_bank_accounts(id)
  • imported_bypf_profiles(id)
  • organization_idpf_organizations(id)
Policies:
  • 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_idfa_accounts(id)
  • acknowledged_bypf_profiles(id)
  • budget_idfa_budgets(id)
  • fund_idfa_funds(id)
  • notification_idpf_notifications(id)
  • organization_idpf_organizations(id)
  • period_idfa_fiscal_periods(id)
Policies:
  • 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_bypf_profiles(id)
  • budget_idfa_budgets(id)
  • organization_idpf_organizations(id)
Policies:
  • 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_idfa_accounts(id)
  • budget_idfa_budgets(id)
  • fund_idfa_funds(id)
  • organization_idpf_organizations(id)
  • program_idfa_programs(id)
  • site_idpf_sites(id)
Policies:
  • 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_idfa_budgets(id)
  • created_bypf_profiles(id)
  • organization_idpf_organizations(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_bypf_profiles(id)
  • organization_idpf_organizations(id)
  • shared_with_user_idpf_profiles(id)
  • template_idfa_budget_templates(id)
Policies:
  • 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_bypf_profiles(id)
  • last_used_bypf_profiles(id)
  • organization_idpf_organizations(id)
  • source_budget_idfa_budgets(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_bypf_profiles(id)
  • created_bypf_profiles(id)
  • fiscal_year_idfa_fiscal_years(id)
  • organization_idpf_organizations(id)
  • rejected_bypf_profiles(id)
  • submitted_bypf_profiles(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_byusers(id)
  • gl_account_idfa_accounts(id)
  • organization_idpf_organizations(id)
  • ramp_connection_idfa_ramp_connections(id)
  • updated_byusers(id)
  • vendor_idfa_vendors(id)
Policies:
  • 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_bypf_profiles(id)
  • organization_idpf_organizations(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_bypf_profiles(id)
  • organization_idpf_organizations(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_bypf_profiles(id)
  • credit_account_idfa_accounts(id)
  • debit_account_idfa_accounts(id)
  • fund_idfa_funds(id)
  • organization_idpf_organizations(id)
  • site_idpf_sites(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_idfa_close_periods(id)
  • completed_bypf_profiles(id)
  • created_bypf_profiles(id)
  • organization_idpf_organizations(id)
  • source_template_idfa_close_checklists(id)
  • started_bypf_profiles(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_idfa_close_periods(id)
  • created_bypf_profiles(id)
  • organization_idpf_organizations(id)
  • task_idfa_close_tasks(id)
  • updated_bypf_profiles(id)
  • uploaded_bypf_profiles(id)
Policies:
  • 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_bypf_profiles(id)
  • close_completed_bypf_profiles(id)
  • close_started_bypf_profiles(id)
  • created_bypf_profiles(id)
  • fiscal_period_idfa_fiscal_periods(id)
  • organization_idpf_organizations(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_topf_profiles(id)
  • checklist_idfa_close_checklists(id)
  • completed_bypf_profiles(id)
  • created_bypf_profiles(id)
  • depends_on_task_idfa_close_tasks(id)
  • organization_idpf_organizations(id)
  • started_bypf_profiles(id)
  • updated_bypf_profiles(id)
  • verified_bypf_profiles(id)
Policies:
  • 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_byusers(id)
  • organization_idpf_organizations(id)
  • updated_byusers(id)
Policies:
  • 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_bypf_profiles(id)
  • invoice_idfa_invoices(id)
  • organization_idpf_organizations(id)
  • performed_byusers(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_topf_profiles(id)
  • created_bypf_profiles(id)
  • invoice_idfa_invoices(id)
  • organization_idpf_organizations(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_byusers(id)
  • expense_account_idfa_accounts(id)
  • organization_idpf_organizations(id)
  • updated_byusers(id)
Policies:
  • 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_idfa_accounts(id)
  • organization_idpf_organizations(id)
Policies:
  • 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_bypf_profiles(id)
  • organization_idpf_organizations(id)
  • pool_idfa_indirect_cost_pools(id)
  • project_idfa_projects(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_bypf_profiles(id)
  • credit_memo_idfa_credit_memos(id)
  • invoice_idfa_invoices(id)
  • organization_idpf_organizations(id)
  • updated_byusers(id)
Policies:
  • 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_idfa_bank_accounts(id)
  • created_bypf_profiles(id)
  • interest_expense_account_idfa_accounts(id)
  • organization_idpf_organizations(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_idfa_accounts(id)
  • credit_memo_idfa_credit_memos(id)
  • fund_idfa_funds(id)
  • organization_idpf_organizations(id)
  • program_idfa_programs(id)
Policies:
  • 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_bypf_profiles(id)
  • customer_idfa_customers(id)
  • journal_entry_idfa_journal_entries(id)
  • organization_idpf_organizations(id)
  • original_invoice_idfa_invoices(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_bypf_profiles(id)
  • customer_idfa_customers(id)
  • journal_entry_idfa_journal_entries(id)
  • organization_idpf_organizations(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_bypf_profiles(id)
  • default_revenue_account_idfa_accounts(id)
  • organization_idpf_organizations(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_byusers(id)
  • organization_idpf_organizations(id)
  • updated_byusers(id)
Policies:
  • 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_byusers(id)
  • organization_idpf_organizations(id)
  • updated_byusers(id)
Policies:
  • 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_bypf_profiles(id)
  • invoice_idfa_invoices(id)
  • organization_idpf_organizations(id)
  • revenue_schedule_idfa_revenue_schedules(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_idpf_organizations(id)
Policies:
  • 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_idfa_entities(id)
  • organization_idpf_organizations(id)
  • parent_entity_idfa_entities(id)
Policies:
  • 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_idpf_profiles(id)
  • created_bypf_profiles(id)
  • delegated_topf_profiles(id)
  • expense_report_idfa_expense_reports(id)
  • organization_idpf_organizations(id)
  • threshold_idfa_approval_thresholds(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_bypf_profiles(id)
  • default_department_idpf_departments(id)
  • default_fund_idfa_funds(id)
  • gl_account_idfa_accounts(id)
  • organization_idpf_organizations(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_bypf_profiles(id)
  • department_idpf_departments(id)
  • expense_report_idfa_expense_reports(id)
  • fund_idfa_funds(id)
  • gl_account_idfa_accounts(id)
  • organization_idpf_organizations(id)
  • program_idfa_programs(id)
  • receipt_verified_bypf_profiles(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_bypf_profiles(id)
  • organization_idpf_organizations(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_bypf_profiles(id)
  • created_bypf_profiles(id)
  • default_gl_account_idfa_accounts(id)
  • department_idpf_departments(id)
  • employee_idhr_employees(id)
  • fund_idfa_funds(id)
  • journal_entry_idfa_journal_entries(id)
  • organization_idpf_organizations(id)
  • rejected_bypf_profiles(id)
  • site_idpf_sites(id)
  • submitted_bypf_profiles(id)
  • updated_bypf_profiles(id)
  • journal_entry_idfa_journal_entries(id)
Policies:
  • 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_bypf_profiles(id)
  • rule_idfa_expense_rules(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_bypf_profiles(id)
  • organization_idpf_organizations(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_bypf_profiles(id)
  • expense_line_idfa_expense_lines(id)
  • expense_report_idfa_expense_reports(id)
  • organization_idpf_organizations(id)
  • rule_idfa_expense_policies(id)
Policies:
  • 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_bypf_profiles(id)
  • fiscal_year_idfa_fiscal_years(id)
  • organization_idpf_organizations(id)
Policies:
  • 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_bypf_profiles(id)
  • organization_idpf_organizations(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_idfa_accounts(id)
  • asset_account_idfa_accounts(id)
  • created_bypf_profiles(id)
  • current_site_idpf_sites(id)
  • depreciation_expense_account_idfa_accounts(id)
  • gain_loss_account_idfa_accounts(id)
  • organization_idpf_organizations(id)
  • purchase_order_idfa_purchase_orders(id)
  • site_idpf_sites(id)
  • updated_bypf_profiles(id)
  • vendor_idfa_vendors(id)
Policies:
  • 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_idfa_accounts(id)
  • created_bypf_profiles(id)
  • department_idpf_departments(id)
  • forecast_idfa_rolling_forecasts(id)
  • fund_idfa_funds(id)
  • organization_idpf_organizations(id)
  • program_idfa_programs(id)
  • site_idpf_sites(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_bypf_profiles(id)
  • forecast_idfa_rolling_forecasts(id)
  • organization_idpf_organizations(id)
Policies:
  • 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_bypf_profiles(id)
  • organization_idpf_organizations(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_byusers(id)
  • gl_journal_entry_idfa_journal_entries(id)
  • organization_idpf_organizations(id)
  • updated_byusers(id)
Policies:
  • 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_bypf_profiles(id)
  • organization_idpf_organizations(id)
  • project_idfa_projects(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_bypf_profiles(id)
  • organization_idpf_organizations(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_bypf_profiles(id)
  • organization_idpf_organizations(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_bypf_profiles(id)
  • created_bypf_profiles(id)
  • organization_idpf_organizations(id)
  • pool_idfa_indirect_cost_pools(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_idfa_bank_accounts(id)
  • created_bypf_profiles(id)
  • interest_income_account_idfa_accounts(id)
  • investment_account_idfa_accounts(id)
  • organization_idpf_organizations(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_idfa_accounts(id)
  • fund_idfa_funds(id)
  • invoice_idfa_invoices(id)
  • organization_idpf_organizations(id)
  • program_idfa_programs(id)
Policies:
  • 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_bypf_profiles(id)
  • customer_idfa_customers(id)
  • journal_entry_idfa_journal_entries(id)
  • organization_idpf_organizations(id)
  • site_idpf_sites(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_bypf_profiles(id)
  • organization_idpf_organizations(id)
  • period_idfa_fiscal_periods(id)
  • posted_bypf_profiles(id)
  • reversal_of_entry_idfa_journal_entries(id)
  • reversed_by_entry_idfa_journal_entries(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_idfa_accounts(id)
  • fund_idfa_funds(id)
  • journal_entry_idfa_journal_entries(id)
  • organization_idpf_organizations(id)
  • program_idfa_programs(id)
  • related_entity_idfa_entities(id)
Policies:
  • 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_byusers(id)
  • organization_idpf_organizations(id)
  • updated_byusers(id)
Policies:
  • 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_byusers(id)
  • kpi_definition_idfa_kpi_definitions(id)
  • organization_idpf_organizations(id)
Policies:
  • 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_idfa_accounts(id)
  • compliance_default_expense_account_idfa_accounts(id)
  • created_bypf_profiles(id)
  • default_ar_account_idfa_accounts(id)
  • default_cash_account_idfa_accounts(id)
  • default_deferred_revenue_account_idfa_accounts(id)
  • default_revenue_account_idfa_accounts(id)
  • organization_idpf_organizations(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_idfa_vendor_bills(id)
  • bill_line_idfa_vendor_bill_lines(id)
  • payment_idfa_payments(id)
Policies:
  • 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_bypf_profiles(id)
  • journal_entry_idfa_journal_entries(id)
  • organization_idpf_organizations(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_bypf_profiles(id)
  • installment_idfa_payment_plan_installments(id)
  • organization_idpf_organizations(id)
  • plan_idfa_payment_plans(id)
Policies:
  • 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_bypf_profiles(id)
  • organization_idpf_organizations(id)
  • payment_idfa_customer_payments(id)
  • payment_plan_idfa_payment_plans(id)
  • skipped_bypf_profiles(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_bypf_profiles(id)
  • cancelled_bypf_profiles(id)
  • created_bypf_profiles(id)
  • customer_idfa_customers(id)
  • invoice_idfa_invoices(id)
  • organization_idpf_organizations(id)
  • rejected_bypf_profiles(id)
  • submitted_bypf_profiles(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_idfa_payment_batches(id)
  • created_bypf_profiles(id)
  • organization_idpf_organizations(id)
  • updated_bypf_profiles(id)
  • vendor_idfa_vendors(id)
Policies:
  • 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_idpf_organizations(id)
  • performed_bypf_profiles(id)
  • period_idfa_fiscal_periods(id)
Policies:
  • 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_idfa_bank_accounts(id)
  • organization_idpf_organizations(id)
  • triggered_byusers(id)
  • updated_byusers(id)
Policies:
  • 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_idpf_organizations(id)
  • user_idpf_profiles(id)
Policies:
  • 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_idfa_journal_entries(id)
  • organization_idpf_organizations(id)
Policies:
  • 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_bypf_profiles(id)
  • organization_idpf_organizations(id)
  • po_idfa_purchase_orders(id)
Policies:
  • 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_bypf_profiles(id)
  • organization_idpf_organizations(id)
  • po_line_idfa_purchase_order_lines(id)
  • receipt_idfa_po_receipts(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_bypf_profiles(id)
  • organization_idpf_organizations(id)
  • po_idfa_purchase_orders(id)
  • received_bypf_profiles(id)
  • updated_bypf_profiles(id)
  • voided_bypf_profiles(id)
Policies:
  • 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_bypf_profiles(id)
  • organization_idpf_organizations(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_idfa_accounts(id)
  • approved_bypf_profiles(id)
  • budget_idfa_budgets(id)
  • created_bypf_profiles(id)
  • fund_idfa_funds(id)
  • organization_idpf_organizations(id)
  • project_idfa_projects(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_idfa_accounts(id)
  • created_bypf_profiles(id)
  • organization_idpf_organizations(id)
  • project_idfa_projects(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_idfa_accounts(id)
  • created_bypf_profiles(id)
  • organization_idpf_organizations(id)
  • project_idfa_projects(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_bypf_profiles(id)
  • fund_idfa_funds(id)
  • organization_idpf_organizations(id)
  • program_director_idpf_profiles(id)
  • project_manager_idpf_profiles(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_idfa_accounts(id)
  • fund_idfa_funds(id)
  • organization_idpf_organizations(id)
  • po_idfa_purchase_orders(id)
  • program_idfa_programs(id)
Policies:
  • 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_bypf_profiles(id)
  • cancelled_bypf_profiles(id)
  • created_bypf_profiles(id)
  • organization_idpf_organizations(id)
  • ship_to_site_idpf_sites(id)
  • updated_bypf_profiles(id)
  • vendor_idfa_vendors(id)
Policies:
  • 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_idpf_credential_vault(id)
  • created_byusers(id)
  • organization_idpf_organizations(id)
  • refresh_token_vault_idpf_credential_vault(id)
  • updated_byusers(id)
Policies:
  • 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_bypf_profiles(id)
  • gl_account_idfa_accounts(id)
  • journal_entry_idfa_journal_entries(id)
  • reconciliation_idfa_bank_reconciliations(id)
Policies:
  • 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_idfa_bank_statement_lines(id)
  • gl_line_idfa_journal_entry_lines(id)
  • matched_bypf_profiles(id)
  • organization_idpf_organizations(id)
  • reconciliation_idfa_bank_reconciliations(id)
Policies:
  • 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_bypf_profiles(id)
  • organization_idpf_organizations(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_idfa_accounts(id)
  • created_bypf_profiles(id)
  • fund_idfa_funds(id)
  • organization_idpf_organizations(id)
  • recurring_invoice_idfa_recurring_invoices(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_bypf_profiles(id)
  • customer_idfa_customers(id)
  • organization_idpf_organizations(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_bypf_profiles(id)
  • organization_idpf_organizations(id)
  • site_idpf_sites(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_idfa_bank_accounts(id)
  • created_bypf_profiles(id)
  • employee_idhr_employees(id)
  • expense_report_idfa_expense_reports(id)
  • journal_entry_idfa_journal_entries(id)
  • organization_idpf_organizations(id)
  • reversal_payment_idfa_reimbursement_payments(id)
Policies:
  • 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_byusers(id)
  • organization_idpf_organizations(id)
  • report_run_idfa_report_runs(id)
  • updated_byusers(id)
Policies:
  • 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_bypf_profiles(id)
  • organization_idpf_organizations(id)
Policies:
  • 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_byusers(id)
  • organization_idpf_organizations(id)
  • user_idusers(id)
Policies:
  • 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_idfa_report_schedules(id)
Policies:
  • 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_idpf_organizations(id)
  • schedule_idfa_report_schedules(id)
  • triggered_bypf_profiles(id)
Policies:
  • 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_bypf_profiles(id)
  • organization_idpf_organizations(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_byusers(id)
  • organization_idpf_organizations(id)
  • updated_byusers(id)
Policies:
  • 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_bypf_profiles(id)
  • deferred_revenue_account_idfa_accounts(id)
  • organization_idpf_organizations(id)
  • project_idfa_projects(id)
  • revenue_account_idfa_accounts(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_bypf_profiles(id)
  • created_bypf_profiles(id)
  • organization_idpf_organizations(id)
  • recognition_idfa_revenue_recognitions(id)
  • revenue_schedule_idfa_revenue_schedules(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_bypf_profiles(id)
  • fiscal_period_idfa_fiscal_periods(id)
  • journal_entry_idfa_journal_entries(id)
  • journal_entry_line_idfa_journal_entry_lines(id)
  • organization_idpf_organizations(id)
  • revenue_schedule_idfa_revenue_schedules(id)
Policies:
  • 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_byusers(id)
  • organization_idpf_organizations(id)
  • recognition_idfa_revenue_recognitions(id)
  • revenue_schedule_idfa_revenue_schedules(id)
  • reversal_recognition_idfa_revenue_recognitions(id)
Policies:
  • 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_bypf_profiles(id)
  • fiscal_period_idfa_fiscal_periods(id)
  • organization_idpf_organizations(id)
  • revenue_schedule_idfa_revenue_schedules(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_bypf_profiles(id)
  • deferred_revenue_account_idfa_accounts(id)
  • invoice_idfa_invoices(id)
  • organization_idpf_organizations(id)
  • revenue_account_idfa_accounts(id)
  • revenue_contract_idfa_revenue_contracts(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_idpf_organizations(id)
  • revenue_schedule_idfa_revenue_schedules(id)
Policies:
  • 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_bypf_profiles(id)
  • organization_idpf_organizations(id)
  • source_budget_idfa_budgets(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_idfa_accounts(id)
  • created_bypf_profiles(id)
  • department_idpf_departments(id)
  • fund_idfa_funds(id)
  • organization_idpf_organizations(id)
  • program_idfa_programs(id)
  • scenario_idfa_budget_scenarios(id)
  • site_idpf_sites(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_byusers(id)
  • organization_idpf_organizations(id)
  • tax_year_idfa_tax_years(id)
  • updated_byusers(id)
Policies:
  • 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_byusers(id)
  • filed_byusers(id)
  • organization_idpf_organizations(id)
  • tax_year_idfa_tax_years(id)
  • updated_byusers(id)
Policies:
  • 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_byusers(id)
  • created_byusers(id)
  • organization_idpf_organizations(id)
  • updated_byusers(id)
Policies:
  • 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_byusers(id)
  • organization_idpf_organizations(id)
Policies:
  • 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_bypf_profiles(id)
  • credit_account_idfa_accounts(id)
  • debit_account_idfa_accounts(id)
  • fund_idfa_funds(id)
  • match_bank_account_idfa_bank_accounts(id)
  • organization_idpf_organizations(id)
  • updated_bypf_profiles(id)
Policies:
  • 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_idfa_accounts(id)
  • bill_idfa_vendor_bills(id)
  • fund_idfa_funds(id)
  • organization_idpf_organizations(id)
  • program_idfa_programs(id)
  • purchase_order_line_idfa_purchase_order_lines(id)
Policies:
  • 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_bypf_profiles(id)
  • attachment_document_idpf_documents(id)
  • created_bypf_profiles(id)
  • journal_entry_idfa_journal_entries(id)
  • organization_idpf_organizations(id)
  • updated_bypf_profiles(id)
  • vendor_idfa_vendors(id)
Policies:
  • 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_bypf_profiles(id)
  • default_account_idfa_accounts(id)
  • organization_idpf_organizations(id)
  • updated_bypf_profiles(id)
  • w9_document_idpf_documents(id)
Policies:
  • 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_idfa_w2_forms(id)
  • created_byusers(id)
  • filed_byusers(id)
  • organization_idpf_organizations(id)
  • tax_year_idfa_tax_years(id)
  • updated_byusers(id)
Policies:
  • fa_w2_forms_delete (DELETE)
  • fa_w2_forms_insert (INSERT)
  • fa_w2_forms_select (SELECT)
  • fa_w2_forms_update (UPDATE)