[ { "createCollection": "proposals", "validator": { "$jsonSchema": { "bsonType": "object", "required": [ "_id", "version", "created_at", "updated_at", "org_id", "workspace_id", "project_id", "status", "target_key", "change", "evidence", "model", "prompt_version", "created_by" ], "properties": { "_id": { "bsonType": "string", "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" }, "version": { "bsonType": "number" }, "created_at": { "bsonType": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$" }, "updated_at": { "bsonType": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$" }, "org_id": { "bsonType": "string", "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" }, "workspace_id": { "bsonType": "string", "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" }, "project_id": { "bsonType": "string", "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" }, "status": { "bsonType": "string", "enum": ["pending", "approved", "rejected"] }, "target_key": { "bsonType": "string" }, "target_record_id": { "bsonType": ["string", "null"] }, "written_record_id": { "bsonType": ["string", "null"] }, "change": { "bsonType": "object" }, "evidence": { "bsonType": "array", "items": { "bsonType": "object", "required": ["fileId"], "properties": { "fileId": { "bsonType": "string" }, "page": { "bsonType": "number" }, "blockId": { "bsonType": "string" }, "box": { "bsonType": "object", "required": ["x", "y", "width", "height"], "properties": { "x": { "bsonType": "number" }, "y": { "bsonType": "number" }, "width": { "bsonType": "number" }, "height": { "bsonType": "number" } }, "additionalProperties": false }, "quote": { "bsonType": "string" } }, "additionalProperties": false } }, "model": { "bsonType": "string" }, "prompt_version": { "bsonType": "string" }, "created_by": { "bsonType": "string" }, "edited_by": { "bsonType": ["string", "null"] }, "edited_at": { "bsonType": ["string", "null"] }, "decided_by": { "bsonType": ["string", "null"] }, "decided_at": { "bsonType": ["string", "null"] }, "reason": { "bsonType": ["string", "null"] } }, "additionalProperties": false } } }, { "createIndex": { "collection": "proposals", "keys": { "org_id": 1, "workspace_id": 1, "project_id": 1, "status": 1 }, "name": "proposals_org_id_workspace_id_project_id_status_idx", "unique": false } }, { "createIndex": { "collection": "proposals", "keys": { "org_id": 1, "workspace_id": 1, "project_id": 1, "target_key": 1, "target_record_id": 1 }, "name": "proposals_org_id_workspace_id_project_id_target_key_target_record_id_idx", "unique": false } } ]