TB-09b — Supabase as Source of Truth (Status Fields First)

Summary

Make Supabase the primary write target for all status fields (cert, invoice, project status). Writes go to Supabase immediately with async SmartSuite mirror. Replaces the band-aid _sync_project_to_supabase() function with a proper supabase_write_service that patches raw_data JSONB and denormalized columns in one step.

What it produced

  • supabase-service — new supabase_write_service.py for Supabase-primary writes with async SmartSuite mirror
  • supabase-read-service — fixed double-encoded raw_data
  • Replaced 8 SmartSuite write call sites across cert, invoice, project, holding pool, cancel, and schedule routes

Connections

  • depends on: Supabase — now the primary write target
  • depends on: SmartSuite — relegated to async mirror (best-effort)
  • depends on: Redis — ARQ worker queues SmartSuite mirror tasks
  • produced: supabase-service (supabase_write_service.py)
  • feeds into: TB-10-smartsuite-cutover — foundation for eliminating SmartSuite entirely