Skip to main content

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

TableSELECTINSERTUPDATEDELETEWITH CHECKStatus
pf_organizationsComplete
pf_profilesComplete
pf_sitesComplete
pf_user_rolesComplete
pf_notificationsComplete
pf_documentsComplete
pf_document_versions---Version table
pf_audit_logs---Audit table
pf_health_metricsComplete
pf_integration_credentialsDeny-all

Key Tables

pf_organizations

The root tenant entity. All business data is scoped to an organization.

pf_profiles

Extended user profiles linked to auth.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

FunctionPurpose
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
  • All modules depend on PF for organization context
  • HR references pf_profiles for employee user accounts
  • FW uses PF for workflow ownership and permissions
  • GR integrates with PF for policy document storage