{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://puranwater.com/schemas/postgres/procurement/chemical_consumption_item.schema.json","title":"chemical_consumption_item","type":"object","properties":{"consumption_id":{"type":"string","format":"uuid","x-pg-type":"uuid"},"project_ref":{"type":"string","x-pg-type":"text"},"chemical_name":{"type":"string","x-pg-type":"text"},"chemical_cas":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"},"area_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"x-pg-type":"int4"},"purpose":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"},"dose_rate_value":{"anyOf":[{"type":"number"},{"type":"null"}],"x-pg-type":"numeric"},"dose_rate_unit":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"},"storage_capacity_value":{"anyOf":[{"type":"number"},{"type":"null"}],"x-pg-type":"numeric"},"storage_capacity_unit":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"},"safety_class":{"anyOf":[{"type":"string"},{"type":"null"}],"x-pg-type":"text"},"spec_jsonb":{"anyOf":[{},{"type":"null"}],"x-pg-type":"jsonb"},"lifecycle_stage":{"type":"string","x-pg-type":"text"},"review_state":{"type":"string","enum":["proposed"],"x-pg-type":"text"},"reviewed_by":{"anyOf":[{"type":"string","enum":["proposed"]},{"type":"null"}],"x-pg-type":"text"},"reviewed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"x-pg-type":"timestamptz"},"review_reason":{"anyOf":[{"type":"string","enum":["proposed"]},{"type":"null"}],"x-pg-type":"text"},"is_current":{"type":"boolean","x-pg-type":"bool"},"superseded_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"x-pg-type":"uuid"},"row_hash":{"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"},"provenance":{"type":"string","x-pg-type":"text"}},"x-table-schema":"public","required":["project_ref","chemical_name","provenance"],"x-primary-key":["consumption_id"],"x-foreign-keys":[{"column":"project_ref","references_table":"project","references_column":"ref","constraint":"chemical_consumption_item_project_ref_fkey"},{"column":"superseded_by","references_table":"chemical_consumption_item","references_column":"consumption_id","constraint":"chemical_consumption_item_superseded_by_fkey"}]}