DOC: SCH-001
PHASE: 1 (SCHEMA DEFINITION)
ENGINE: MULTI-MODEL

1. PostgreSQL (Core Relational Truth)

users Master Auth & Identity
ColumnTypeNotes
iduuidPrimary Key
company_iduuidFK -> companies.id
roleenum'GC', 'SUB', 'SUPPLIER'
first_namevarchar(50)
last_namevarchar(50)
phonevarchar(20)Used for SMS cascade
ecosystem_scorenumeric(3,1)Aggregate Trust Commons score
tier_statusinteger1, 2, or 3
companies Business Entities
ColumnTypeNotes
iduuidPrimary Key
namevarchar(100)DBA Name
trade_categoryvarchar(50)From Estimator matrix
tax_einvarchar(20)Encrypted
insurance_coi_urltextS3 Bucket Link
insurance_exp_datedateTriggers COI renewal alert
bonding_capacitynumericFor Subs/GCs
projects Project Containers
ColumnTypeNotes
iduuidPrimary Key
gc_company_iduuidFK -> companies.id
namevarchar(100)e.g., 'Oak Flow Subdivision'
addresstext
latitudenumeric(10,8)Crucial for hyper-local weather
longitudenumeric(11,8)Crucial for hyper-local weather
statusenumPRE_CON, ACTIVE, CLOSED
total_budgetnumeric
trust_ratings Double-Blind Engine
ColumnTypeNotes
iduuidPrimary Key
project_iduuidFK -> projects.id
rater_company_iduuidWho is rating
target_company_iduuidWho is being rated
statusenumPENDING, LOCKED, REVEALED
dimensionsjsonbe.g., {"quality": 9, "pay": 10}
overall_scorenumeric(3,1)Calculated average
disputed_flagbooleanTriggers dispute resolution
financial_draws A/R & Payments
ColumnTypeNotes
iduuidPrimary Key
project_iduuidFK -> projects.id
payee_company_iduuidSub or Supplier
amountnumeric
statusenumSUBMITTED, APPROVED, PAID, LATE
lien_waiver_statusenumREQUIRED, SIGNED, EXEMPT
quickbooks_sync_idvarcharExternal ERP mapping

2. Neo4j (Graph - Schedule DAG)

(Activity) Node
Properties:
id: uuid (Maps to Postgres)
project_id: uuid
name: string (e.g., 'Slab Pour')
duration_hours: int
float_days: int (Calculated)
is_critical_path: boolean
weather_sensitivity: string ('CRITICAL', 'SENSITIVE', 'INDEPENDENT')
state: string ('SCHEDULED', 'WEATHER_HOLD', 'CONFIRMED')
-[DEPENDS_ON]-> Edge
Properties:
type: string ('FS' Finish-to-Start, 'SS' Start-to-Start)
lag_hours: int (e.g., 48 hours for concrete curing before framing)

Graph Traversal Value: Instantly calculates cascading delays. When Node A is pushed 24H, Cypher query traverses all -[DEPENDS_ON]-> edges to update successors and identify float availability.
-[ASSIGNED_TO]-> Edge
Properties:
company_id: uuid (Subcontractor mapping)
confirmation_status: string ('PENDING', 'ACKNOWLEDGED')

Graph Traversal Value: Allows the cascade engine to instantly find all Subcontractors affected by a node shift, triggering the Twilio SMS routing.

3. TimescaleDB (Weather Telemetry)

weather_forecast_hyperlocal Time-Series
ColumnTypeNotes
timetimestamptzHyper-table partition key
project_iduuidIndexed
temp_fnumeric(4,1)
wind_speed_mphnumeric(4,1)
precip_probabilityinteger0-100
disruption_magnitudenumeric(3,1)Calculated (0.0 - 10.0)
forecast_confidenceintegerDecays over future horizons