{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://puranwater.com/schemas/postgres/legal/legal_fact.schema.json","title":"legal_fact","type":"object","properties":{"fact_id":{"type":"string","format":"uuid","x-pg-type":"uuid"},"project_ref":{"type":"string","x-pg-type":"text"},"contract_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"x-pg-type":"uuid"},"fact_type":{"type":"string","x-pg-type":"text"},"stable_key":{"type":"string","x-pg-type":"text"},"obligor":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"},"obligee":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"},"party_role":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"},"deadline_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"x-pg-type":"date"},"notice_window_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"x-pg-type":"int4"},"cap_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"x-pg-type":"numeric"},"cap_amount":{"anyOf":[{"type":"number"},{"type":"null"}],"x-pg-type":"numeric"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"},"ld_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"x-pg-type":"numeric"},"guarantee_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"x-pg-type":"uuid"},"requirement_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"x-pg-type":"uuid"},"fact_payload":{"x-pg-type":"jsonb"},"source_clause_id":{"type":"string","format":"uuid","x-pg-type":"uuid"},"source_clause_ref":{"type":"string","x-pg-type":"text"},"source_document_id":{"type":"string","format":"uuid","x-pg-type":"uuid"},"source_content_hash":{"type":"string","x-pg-type":"text"},"fact_fingerprint":{"type":"string","x-pg-type":"text"},"privilege_class":{"type":"string","x-pg-type":"text"},"superseded_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"x-pg-type":"uuid"},"inserted_at":{"type":"string","format":"date-time","x-pg-type":"timestamptz"},"inserted_by":{"type":"string","x-pg-type":"text"}},"x-table-schema":"public","required":["project_ref","fact_type","stable_key","source_clause_id","source_clause_ref","source_document_id","source_content_hash","fact_fingerprint"],"x-primary-key":["fact_id"],"x-foreign-keys":[{"column":"source_clause_id","references_table":"clause","references_column":"clause_id","constraint":"legal_fact_source_clause_id_fkey"},{"column":"source_document_id","references_table":"contract_document","references_column":"document_id","constraint":"legal_fact_source_document_id_fkey"},{"column":"superseded_by","references_table":"legal_fact","references_column":"fact_id","constraint":"legal_fact_superseded_by_fkey"}]}