Documentation Index
Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
Use this file to discover all available pages before exploring further.
Module: Platform Foundation
Prefix:pf_
Tables: 73
Last Updated: 2026-01-11
Overview
Platform Foundation provides the core infrastructure for multi-tenancy, authentication, user management, and cross-module services. All other modules depend on PF for organization context and user identity.Core Entities ERD
Authentication & Security ERD
Notifications & Communications ERD
Documents & Storage ERD
Platform Services ERD
RLS Policy Coverage
| Table | SELECT | INSERT | UPDATE | DELETE | WITH CHECK | Status |
|---|---|---|---|---|---|---|
| pf_organizations | ✅ | ✅ | ✅ | ✅ | ✅ | Complete |
| pf_profiles | ✅ | ✅ | ✅ | ✅ | ✅ | Complete |
| pf_sites | ✅ | ✅ | ✅ | ✅ | ✅ | Complete |
| pf_user_roles | ✅ | ✅ | ✅ | ✅ | ✅ | Complete |
| pf_notifications | ✅ | ✅ | ✅ | ✅ | ✅ | Complete |
| pf_documents | ✅ | ✅ | ✅ | ✅ | ✅ | Complete |
| pf_document_versions | ✅ | ✅ | - | - | - | Version table |
| pf_audit_logs | ✅ | ✅ | - | - | - | Audit table |
| pf_health_metrics | ✅ | ✅ | ✅ | ✅ | ✅ | Complete |
| pf_integration_credentials | ❌ | ❌ | ❌ | ❌ | ❌ | Deny-all |
Key Tables
pf_organizations
The root tenant entity. All business data is scoped to an organization.pf_profiles
Extended user profiles linked toauth.users. Contains display name, avatar, preferences.
pf_user_roles
Maps users to roles within organizations. Used by RLS helper functions.pf_sites
Physical locations within an organization. Used for multi-site deployments.pf_audit_logs
Immutable audit trail of all significant actions. Append-only.Helper Functions
| Function | Purpose |
|---|---|
pf_has_org_access(org_id, user_id) | Check if user belongs to organization |
pf_is_platform_admin(user_id) | Check if user is platform admin |
pf_get_user_organizations(user_id) | Get all organizations for user |
pf_get_user_role(org_id, user_id) | Get user’s role in organization |
Related Modules
- All modules depend on PF for organization context
- HR references
pf_profilesfor employee user accounts - FW uses PF for workflow ownership and permissions
- GR integrates with PF for policy document storage