{
  "openapi": "3.1.0",
  "info": {
    "title": "Records API",
    "summary": "Service to Store and retrieve records",
    "version": "0.1.0"
  },
  "paths": {
    "/records/": {
      "post": {
        "tags": [
          "records"
        ],
        "summary": "Create New Record",
        "operationId": "create_new_record_records__post",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Record"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-public": true
      },
      "get": {
        "tags": [
          "records"
        ],
        "summary": "List Records",
        "description": "Get all Records of a tennant matching the specified filters",
        "operationId": "list_records_records__get",
        "parameters": [
          {
            "name": "products",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                {
                  "type": "null"
                }
              ],
              "title": "Products"
            }
          },
          {
            "name": "templates",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                {
                  "type": "null"
                }
              ],
              "title": "Templates"
            }
          },
          {
            "name": "id__in",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Id  In"
            }
          },
          {
            "name": "context__linked_product",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Context  Linked Product"
            }
          },
          {
            "name": "context__form_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Context  Form Id"
            }
          },
          {
            "name": "context__knowledge_unit_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Context  Knowledge Unit Id"
            }
          },
          {
            "name": "context__knowledge_unit_topic_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Context  Knowledge Unit Topic Id"
            }
          },
          {
            "name": "context__knowledge_unit_topic_id__in",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Context  Knowledge Unit Topic Id  In"
            }
          },
          {
            "name": "context__global_element_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Context  Global Element Id"
            }
          },
          {
            "name": "context__linked_document__document_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Context  Linked Document  Document Id"
            }
          },
          {
            "name": "context__linked_document__document_version",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Context  Linked Document  Document Version"
            }
          },
          {
            "name": "context__linked_document__template_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Context  Linked Document  Template Id"
            }
          },
          {
            "name": "context__linked_sop",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Context  Linked Sop"
            }
          },
          {
            "name": "context__filter_tag",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Context  Filter Tag"
            }
          },
          {
            "name": "audit_info__user_id_created",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Audit Info  User Id Created"
            }
          },
          {
            "name": "audit_info__start_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Audit Info  Start Date"
            }
          },
          {
            "name": "audit_info__end_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Audit Info  End Date"
            }
          },
          {
            "name": "audit_info__include_updated",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "default": false,
              "title": "Audit Info  Include Updated"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Record"
                  },
                  "title": "Response List Records Records  Get"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-public": true
      }
    },
    "/records/{id}": {
      "get": {
        "tags": [
          "records"
        ],
        "summary": "Read Record",
        "operationId": "read_record_records__id__get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/PydanticObjectId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Record"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-public": true
      }
    },
    "/records/bulk-update": {
      "patch": {
        "tags": [
          "records"
        ],
        "summary": "Update Bulk Of Records Endpoint",
        "operationId": "update_bulk_of_records_endpoint_records_bulk_update_patch",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordBulkUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-public": true
      }
    },
    "/global-elements/": {
      "get": {
        "tags": [
          "global-elements"
        ],
        "summary": "List Global Elements",
        "description": "Get all Global Elements of a tennant matching the specified filters",
        "operationId": "list_global_elements_global_elements__get",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/GlobalElementType",
              "description": "Type of global element to filter by",
              "default": "system_context_collection"
            },
            "description": "Type of global element to filter by"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GlobalElement"
                  },
                  "title": "Response List Global Elements Global Elements  Get"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-public": true
      }
    },
    "/global-elements/{id}": {
      "get": {
        "tags": [
          "global-elements"
        ],
        "summary": "Get Single Global Element",
        "description": "Get a single Global Element by ID",
        "operationId": "get_single_global_element_global_elements__id__get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/PydanticObjectId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GlobalElement"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-public": true
      }
    },
    "/qmList/": {
      "get": {
        "tags": [
          "qmList"
        ],
        "summary": "List Qm Lists",
        "description": "Get all QM Lists of a tennant matching the specified filters",
        "operationId": "list_qm_lists_qmList__get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/QmList"
                  },
                  "type": "array",
                  "title": "Response List Qm Lists Qmlist  Get"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        },
        "x-public": true
      }
    },
    "/qmList/{id}": {
      "get": {
        "tags": [
          "qmList"
        ],
        "summary": "Get Single Qm List",
        "description": "Get a single QM List by ID",
        "operationId": "get_single_qm_list_qmList__id__get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/PydanticObjectId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QmList"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-public": true
      }
    }
  },
  "components": {
    "schemas": {
      "AuditInfo": {
        "properties": {
          "user_id_created": {
            "type": "string",
            "title": "User Id Created"
          },
          "timestamp_created": {
            "type": "string",
            "format": "date-time",
            "title": "Timestamp Created"
          },
          "user_id_last_updated": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Id Last Updated"
          },
          "timestamp_last_updated": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timestamp Last Updated"
          },
          "last_action": {
            "$ref": "#/components/schemas/LastActionType"
          }
        },
        "type": "object",
        "required": [
          "user_id_created",
          "timestamp_created",
          "last_action"
        ],
        "title": "AuditInfo"
      },
      "ExportGlobalElementsRequest": {
        "properties": {
          "element_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Element Ids",
            "description": "List of global element IDs to export"
          }
        },
        "type": "object",
        "required": [
          "element_ids"
        ],
        "title": "ExportGlobalElementsRequest",
        "description": "Request model for exporting global elements"
      },
      "GlobalElement": {
        "properties": {
          "_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PydanticObjectId"
              },
              {
                "type": "null"
              }
            ],
            "description": "MongoDB document ObjectID"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "schema": {
            "type": "object",
            "title": "Schema"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "metadata": {
            "$ref": "#/components/schemas/TenantMetadata"
          },
          "audit_info": {
            "$ref": "#/components/schemas/AuditInfo"
          },
          "type": {
            "$ref": "#/components/schemas/GlobalElementType"
          }
        },
        "type": "object",
        "required": [
          "name",
          "metadata",
          "audit_info",
          "type"
        ],
        "title": "GlobalElement"
      },
      "GlobalElementBulkRequest": {
        "properties": {
          "ids": {
            "items": {
              "$ref": "#/components/schemas/PydanticObjectId"
            },
            "type": "array",
            "title": "Ids"
          },
          "include_schema": {
            "type": "boolean",
            "title": "Include Schema",
            "default": true
          }
        },
        "type": "object",
        "required": [
          "ids"
        ],
        "title": "GlobalElementBulkRequest"
      },
      "GlobalElementBulkResponse": {
        "properties": {
          "_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PydanticObjectId"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "schema": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Schema"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "metadata": {
            "$ref": "#/components/schemas/TenantMetadata"
          },
          "audit_info": {
            "$ref": "#/components/schemas/AuditInfo"
          },
          "type": {
            "$ref": "#/components/schemas/GlobalElementType"
          }
        },
        "type": "object",
        "required": [
          "name",
          "metadata",
          "audit_info",
          "type"
        ],
        "title": "GlobalElementBulkResponse",
        "description": "Response model for bulk fetch; schema is optional depending on include_schema."
      },
      "GlobalElementCreate": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "schema": {
            "type": "object",
            "title": "Schema"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "type": {
            "$ref": "#/components/schemas/GlobalElementType"
          }
        },
        "type": "object",
        "required": [
          "name",
          "type"
        ],
        "title": "GlobalElementCreate"
      },
      "GlobalElementType": {
        "type": "string",
        "enum": [
          "product_data_collection",
          "system_context_collection"
        ],
        "title": "GlobalElementType"
      },
      "GlobalElementUpdate": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "schema": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Schema"
          },
          "type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/GlobalElementType"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "title": "GlobalElementUpdate"
      },
      "GridColumnVisibility": {
        "properties": {
          "field_id": {
            "type": "string",
            "title": "Field Id"
          },
          "visible": {
            "type": "boolean",
            "title": "Visible"
          }
        },
        "type": "object",
        "required": [
          "field_id",
          "visible"
        ],
        "title": "GridColumnVisibility"
      },
      "GridDensity": {
        "type": "string",
        "enum": [
          "compact",
          "standard",
          "comfortable"
        ],
        "title": "GridDensity"
      },
      "GridFilterItem": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "field": {
            "type": "string",
            "title": "Field"
          },
          "operator": {
            "type": "string",
            "title": "Operator"
          },
          "value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Value"
          }
        },
        "type": "object",
        "required": [
          "id",
          "field",
          "operator"
        ],
        "title": "GridFilterItem"
      },
      "GridFilterModel": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/GridFilterItem"
            },
            "type": "array",
            "title": "Items"
          },
          "logicOperator": {
            "$ref": "#/components/schemas/GridLogicOperator"
          }
        },
        "type": "object",
        "required": [
          "items",
          "logicOperator"
        ],
        "title": "GridFilterModel"
      },
      "GridLogicOperator": {
        "type": "string",
        "enum": [
          "AND",
          "OR"
        ],
        "title": "GridLogicOperator"
      },
      "GridSettings": {
        "properties": {
          "gridFilterModel": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/GridFilterModel"
              },
              {
                "type": "null"
              }
            ]
          },
          "columnVisibility": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/GridColumnVisibility"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Columnvisibility"
          },
          "gridDensity": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/GridDensity"
              },
              {
                "type": "null"
              }
            ]
          },
          "sorting": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/GridSorting"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sorting"
          }
        },
        "type": "object",
        "title": "GridSettings"
      },
      "GridSortDirection": {
        "type": "string",
        "enum": [
          "asc",
          "desc"
        ],
        "title": "GridSortDirection"
      },
      "GridSorting": {
        "properties": {
          "field": {
            "type": "string",
            "title": "Field"
          },
          "sort": {
            "$ref": "#/components/schemas/GridSortDirection"
          }
        },
        "type": "object",
        "required": [
          "field",
          "sort"
        ],
        "title": "GridSorting"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "ImportGlobalElementsRequest": {
        "properties": {
          "files": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Files",
            "description": "JSON files in string format to import"
          },
          "type": {
            "$ref": "#/components/schemas/GlobalElementType",
            "description": "Type of global element to import"
          }
        },
        "type": "object",
        "required": [
          "files",
          "type"
        ],
        "title": "ImportGlobalElementsRequest",
        "description": "Request model for importing global elements"
      },
      "ImportGlobalElementsResponse": {
        "properties": {
          "successful_imports": {
            "type": "integer",
            "title": "Successful Imports",
            "description": "Number of successfully imported global elements",
            "default": 0
          },
          "failed_imports": {
            "type": "integer",
            "title": "Failed Imports",
            "description": "Number of failed imports",
            "default": 0
          },
          "error_details": {
            "items": {
              "type": "object"
            },
            "type": "array",
            "title": "Error Details",
            "description": "Details of any failed imports"
          }
        },
        "type": "object",
        "title": "ImportGlobalElementsResponse",
        "description": "Response model for import operations"
      },
      "LastActionType": {
        "type": "string",
        "enum": [
          "created",
          "updated"
        ],
        "title": "LastActionType"
      },
      "LinkedDocument": {
        "properties": {
          "document_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Document Id"
          },
          "document_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Document Version"
          },
          "template_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Template Id"
          },
          "template_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Template Version"
          }
        },
        "type": "object",
        "title": "LinkedDocument"
      },
      "PydanticObjectId": {
        "type": "string",
        "maxLength": 24,
        "minLength": 24,
        "pattern": "^[0-9a-f]{24}$",
        "example": "5eb7cf5a86d9755df3a6c593"
      },
      "QmList": {
        "properties": {
          "_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PydanticObjectId"
              },
              {
                "type": "null"
              }
            ],
            "description": "MongoDB document ObjectID"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description",
            "default": ""
          },
          "metadata": {
            "$ref": "#/components/schemas/TenantMetadata"
          },
          "settings": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/GridSettings"
              },
              {
                "type": "null"
              }
            ]
          },
          "audit_info": {
            "$ref": "#/components/schemas/AuditInfo"
          },
          "category": {
            "anyOf": [
              {
                "properties": {
                  "id": {
                    "type": "string",
                    "title": "Id"
                  },
                  "collection": {
                    "type": "string",
                    "title": "Collection"
                  }
                },
                "type": "object",
                "required": [
                  "id",
                  "collection"
                ]
              },
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Category"
          },
          "filter_tag": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Filter Tag"
          },
          "template_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Template Ids"
          }
        },
        "type": "object",
        "required": [
          "name",
          "metadata",
          "audit_info",
          "template_ids"
        ],
        "title": "QmList"
      },
      "QmListCategory": {
        "properties": {
          "_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PydanticObjectId"
              },
              {
                "type": "null"
              }
            ],
            "description": "MongoDB document ObjectID"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "metadata": {
            "$ref": "#/components/schemas/TenantMetadata"
          },
          "audit_info": {
            "$ref": "#/components/schemas/AuditInfo"
          }
        },
        "type": "object",
        "required": [
          "name",
          "metadata",
          "audit_info"
        ],
        "title": "QmListCategory"
      },
      "QmListCategoryCreate": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          }
        },
        "type": "object",
        "required": [
          "name"
        ],
        "title": "QmListCategoryCreate"
      },
      "QmListCategoryUpdate": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          }
        },
        "type": "object",
        "required": [
          "name"
        ],
        "title": "QmListCategoryUpdate"
      },
      "QmListCreate": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description",
            "default": ""
          },
          "filter_tag": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Filter Tag"
          },
          "template_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Template Ids"
          }
        },
        "type": "object",
        "required": [
          "name",
          "template_ids"
        ],
        "title": "QmListCreate"
      },
      "QmListUpdate": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "settings": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/GridSettings"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "title": "QmListUpdate"
      },
      "Record": {
        "properties": {
          "_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PydanticObjectId"
              },
              {
                "type": "null"
              }
            ],
            "description": "MongoDB document ObjectID"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "form": {
            "type": "object",
            "title": "Form"
          },
          "version": {
            "type": "string",
            "title": "Version"
          },
          "data": {
            "type": "object",
            "title": "Data"
          },
          "read_only": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Read Only",
            "default": false
          },
          "metadata": {
            "$ref": "#/components/schemas/TenantMetadata"
          },
          "context": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RecordContext"
              },
              {
                "type": "null"
              }
            ]
          },
          "audit_info": {
            "$ref": "#/components/schemas/AuditInfo"
          }
        },
        "type": "object",
        "required": [
          "name",
          "form",
          "version",
          "data",
          "metadata",
          "context",
          "audit_info"
        ],
        "title": "Record"
      },
      "RecordBulkFetchByContextsResponse": {
        "additionalProperties": {
          "items": {
            "$ref": "#/components/schemas/Record"
          },
          "type": "array"
        },
        "type": "object",
        "title": "RecordBulkFetchByContextsResponse",
        "description": "Map of context keys to the records matched for each context."
      },
      "RecordBulkUpdate": {
        "properties": {
          "ids": {
            "items": {
              "$ref": "#/components/schemas/PydanticObjectId"
            },
            "type": "array",
            "title": "Ids"
          },
          "form": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Form"
          }
        },
        "type": "object",
        "required": [
          "ids"
        ],
        "title": "RecordBulkUpdate",
        "description": "Bulk update payload for updating a bulk of records by ids.\nCurrently only `form` can be updated."
      },
      "RecordContext": {
        "properties": {
          "linked_product": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Linked Product"
          },
          "linked_sop": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Linked Sop"
          },
          "form_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Form Id"
          },
          "global_element_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Global Element Id"
          },
          "knowledge_unit_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Knowledge Unit Id"
          },
          "knowledge_unit_topic_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Knowledge Unit Topic Id"
          },
          "linked_document": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LinkedDocument"
              },
              {
                "type": "null"
              }
            ]
          },
          "group_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Group Id"
          }
        },
        "type": "object",
        "title": "RecordContext"
      },
      "RecordContextFilter": {
        "properties": {
          "id__in": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/PydanticObjectId"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id  In"
          },
          "context__linked_product": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context  Linked Product"
          },
          "context__form_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context  Form Id"
          },
          "context__knowledge_unit_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context  Knowledge Unit Id"
          },
          "context__knowledge_unit_topic_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context  Knowledge Unit Topic Id"
          },
          "context__knowledge_unit_topic_id__in": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context  Knowledge Unit Topic Id  In"
          },
          "context__global_element_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context  Global Element Id"
          },
          "context__linked_document__document_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context  Linked Document  Document Id"
          },
          "context__linked_document__document_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context  Linked Document  Document Version"
          },
          "context__linked_document__template_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context  Linked Document  Template Id"
          },
          "context__linked_sop": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context  Linked Sop"
          },
          "context__filter_tag": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context  Filter Tag"
          },
          "audit_info__user_id_created": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Audit Info  User Id Created"
          },
          "audit_info__start_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Audit Info  Start Date"
          },
          "audit_info__end_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Audit Info  End Date"
          },
          "audit_info__include_updated": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Audit Info  Include Updated",
            "default": false
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "RecordContextFilter"
      },
      "RecordCreate": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "form": {
            "type": "object",
            "title": "Form"
          },
          "data": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Data"
          },
          "context": {
            "$ref": "#/components/schemas/RecordContext"
          },
          "auto_number": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Auto Number",
            "default": false
          },
          "read_only": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Read Only"
          }
        },
        "type": "object",
        "required": [
          "name",
          "form",
          "context"
        ],
        "title": "RecordCreate"
      },
      "RecordDuplicateBatch": {
        "properties": {
          "source_ku_id": {
            "type": "string",
            "title": "Source Ku Id"
          },
          "source_kt_id": {
            "type": "string",
            "title": "Source Kt Id"
          },
          "source_product_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Product Id"
          },
          "target_ku_id": {
            "type": "string",
            "title": "Target Ku Id"
          },
          "target_kt_id": {
            "type": "string",
            "title": "Target Kt Id"
          },
          "target_product_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Target Product Id"
          }
        },
        "type": "object",
        "required": [
          "source_ku_id",
          "source_kt_id",
          "source_product_id",
          "target_ku_id",
          "target_kt_id",
          "target_product_id"
        ],
        "title": "RecordDuplicateBatch"
      },
      "RecordDuplicateBatchResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success"
          },
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "success",
          "message"
        ],
        "title": "RecordDuplicateBatchResponse"
      },
      "RecordUpdate": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "form": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Form"
          },
          "data": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Data"
          },
          "context": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/UpdateRecordContext"
              },
              {
                "type": "null"
              }
            ]
          },
          "read_only": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Read Only"
          }
        },
        "type": "object",
        "title": "RecordUpdate"
      },
      "TenantMetadata": {
        "properties": {
          "tenant_id": {
            "type": "string",
            "title": "Tenant Id"
          }
        },
        "type": "object",
        "required": [
          "tenant_id"
        ],
        "title": "TenantMetadata"
      },
      "UpdateRecordContext": {
        "properties": {
          "linked_product": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Linked Product"
          },
          "linked_sop": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Linked Sop"
          },
          "linked_document": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LinkedDocument"
              },
              {
                "type": "null"
              }
            ]
          },
          "group_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Group Id"
          }
        },
        "type": "object",
        "title": "UpdateRecordContext"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      }
    },
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    }
  },
  "security": [
    {
      "ApiKeyAuth": []
    }
  ]
}
