{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://puranwater.com/schemas/postgres/procurement/purchase_order.schema.json","title":"purchase_order","type":"object","properties":{"po_id":{"type":"integer","x-pg-type":"int8"},"po_number":{"type":"string","x-pg-type":"text"},"project_ref":{"type":"string","x-pg-type":"text"},"vendor_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"x-pg-type":"int4"},"status":{"type":"string","x-pg-type":"text"},"total_value_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"x-pg-type":"float8"},"currency":{"type":"string","x-pg-type":"text"},"payment_terms":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"},"freight_terms":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"},"equipment_uids":{"anyOf":[{"type":"array","items":{"type":"string","format":"uuid"}},{"type":"null"}],"x-pg-type":"_uuid"},"vendor_quote_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"x-pg-type":"int4"},"cost_observation_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"x-pg-type":"int8"},"issued_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"x-pg-type":"date"},"expected_delivery":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"x-pg-type":"date"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"},"entered_by":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"},"created_at":{"type":"string","format":"date-time","x-pg-type":"timestamptz"},"updated_at":{"type":"string","format":"date-time","x-pg-type":"timestamptz"}},"x-table-schema":"public","required":["po_number","project_ref"],"x-primary-key":["po_id"],"x-foreign-keys":[{"column":"cost_observation_id","references_table":"cost_observation","references_column":"id","constraint":"purchase_order_cost_observation_id_fkey"},{"column":"project_ref","references_table":"project","references_column":"ref","constraint":"purchase_order_project_ref_fkey"},{"column":"vendor_id","references_table":"vendor","references_column":"id","constraint":"purchase_order_vendor_id_fkey"},{"column":"vendor_quote_id","references_table":"vendor_quote","references_column":"id","constraint":"purchase_order_vendor_quote_id_fkey"}]}