{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/evalgate-com/json-schema/evalgate-com-post-api-audit-engagements-id-response200-application-json-schema.json",
  "title": "PostApiAuditEngagementsIdResponse200ApplicationJson",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/evalgate-com-audit-api-openapi.yml#/components/schemas/PostApiAuditEngagementsIdResponse200ApplicationJson",
  "type": "object",
  "properties": {
    "organizationId": {
      "$ref": "#/$defs/OrganizationId"
    },
    "exporterUserId": {
      "type": "string"
    },
    "schemaVersion": {
      "type": "number",
      "enum": [
        1
      ]
    },
    "exportedAt": {
      "type": "string"
    },
    "engagement": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number"
        },
        "organizationId": {
          "$ref": "#/$defs/OrganizationId"
        },
        "title": {
          "type": "string"
        },
        "controlObjective": {
          "type": "string"
        },
        "criteriaSource": {
          "type": "string"
        },
        "unitOfTesting": {
          "type": "string"
        },
        "periodStart": {
          "type": "string"
        },
        "periodEnd": {
          "type": "string"
        },
        "periodInclusivity": {
          "type": "string"
        },
        "timezone": {
          "type": "string"
        },
        "evidenceCutoff": {
          "type": "string"
        },
        "preparerUserId": {
          "type": "string"
        },
        "reviewerUserId": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "createdBy": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "string"
            }
          ]
        },
        "createdAt": {
          "type": "string"
        },
        "updatedAt": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "id",
        "organizationId",
        "title",
        "controlObjective",
        "criteriaSource",
        "unitOfTesting",
        "periodStart",
        "periodEnd",
        "periodInclusivity",
        "timezone",
        "evidenceCutoff",
        "preparerUserId",
        "reviewerUserId",
        "status",
        "createdBy",
        "createdAt",
        "updatedAt"
      ]
    },
    "populations": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "population": {
            "type": "object",
            "properties": {
              "id": {
                "type": "number"
              },
              "contentHash": {
                "type": "string"
              },
              "independentCount": {
                "type": "number"
              },
              "sourceKind": {
                "type": "string"
              }
            },
            "additionalProperties": false,
            "required": [
              "id",
              "contentHash",
              "independentCount",
              "sourceKind"
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "number"
                },
                "populationId": {
                  "type": "number"
                },
                "recordType": {
                  "type": "string"
                },
                "recordId": {
                  "type": "string"
                },
                "recordOccurredAt": {
                  "oneOf": [
                    {
                      "type": "null"
                    },
                    {
                      "type": "string"
                    }
                  ]
                },
                "reconciliationState": {
                  "oneOf": [
                    {
                      "type": "string",
                      "enum": [
                        "unresolved"
                      ]
                    },
                    {
                      "type": "string",
                      "enum": [
                        "matched"
                      ]
                    },
                    {
                      "type": "string",
                      "enum": [
                        "unmatched"
                      ]
                    },
                    {
                      "type": "string",
                      "enum": [
                        "duplicate"
                      ]
                    },
                    {
                      "type": "string",
                      "enum": [
                        "excluded"
                      ]
                    }
                  ]
                },
                "reconciliationReason": {
                  "oneOf": [
                    {
                      "type": "null"
                    },
                    {
                      "type": "string"
                    }
                  ]
                },
                "metadata": {
                  "type": "object",
                  "additionalProperties": {
                    "$ref": "#/$defs/JsonValue"
                  }
                },
                "hasApproval": {
                  "type": "boolean"
                },
                "approvalStatus": {
                  "oneOf": [
                    {
                      "type": "string",
                      "enum": [
                        "approved_at_occurrence"
                      ]
                    },
                    {
                      "type": "string",
                      "enum": [
                        "not_approved"
                      ]
                    },
                    {
                      "type": "string",
                      "enum": [
                        "unknown_insufficient_evidence"
                      ]
                    }
                  ]
                }
              },
              "additionalProperties": false,
              "required": [
                "id",
                "populationId",
                "recordType",
                "recordId",
                "recordOccurredAt",
                "reconciliationState",
                "reconciliationReason",
                "metadata",
                "hasApproval",
                "approvalStatus"
              ]
            }
          },
          "samples": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "sample": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "populationId": {
                      "type": "number"
                    },
                    "populationHash": {
                      "type": "string"
                    },
                    "method": {
                      "oneOf": [
                        {
                          "type": "string",
                          "enum": [
                            "statistical"
                          ]
                        },
                        {
                          "type": "string",
                          "enum": [
                            "judgmental"
                          ]
                        },
                        {
                          "type": "string",
                          "enum": [
                            "systematic"
                          ]
                        },
                        {
                          "type": "string",
                          "enum": [
                            "stratified"
                          ]
                        },
                        {
                          "type": "string",
                          "enum": [
                            "targeted"
                          ]
                        }
                      ]
                    },
                    "algorithm": {
                      "type": "string"
                    },
                    "algorithmVersion": {
                      "type": "string"
                    },
                    "seed": {
                      "type": "string"
                    },
                    "sampleSize": {
                      "type": "number"
                    },
                    "selectorUserId": {
                      "type": "string"
                    },
                    "selectedItemIds": {
                      "type": "array",
                      "items": {
                        "type": "number"
                      }
                    },
                    "revision": {
                      "type": "number"
                    },
                    "revisionReason": {
                      "oneOf": [
                        {
                          "type": "null"
                        },
                        {
                          "type": "string"
                        }
                      ]
                    },
                    "supersedesSampleId": {
                      "oneOf": [
                        {
                          "type": "null"
                        },
                        {
                          "type": "number"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "populationId",
                    "populationHash",
                    "method",
                    "algorithm",
                    "algorithmVersion",
                    "seed",
                    "sampleSize",
                    "selectorUserId",
                    "selectedItemIds",
                    "revision",
                    "revisionReason",
                    "supersedesSampleId",
                    "createdAt"
                  ]
                },
                "tests": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "number"
                      },
                      "sampleId": {
                        "type": "number"
                      },
                      "populationItemId": {
                        "type": "number"
                      },
                      "conclusion": {
                        "oneOf": [
                          {
                            "type": "string",
                            "enum": [
                              "control_design_assessment"
                            ]
                          },
                          {
                            "type": "string",
                            "enum": [
                              "operation_for_item"
                            ]
                          },
                          {
                            "type": "string",
                            "enum": [
                              "identified_deviation"
                            ]
                          },
                          {
                            "type": "string",
                            "enum": [
                              "evidence_insufficient"
                            ]
                          },
                          {
                            "type": "string",
                            "enum": [
                              "population_completeness_limitation"
                            ]
                          },
                          {
                            "type": "string",
                            "enum": [
                              "applicability_exclusion"
                            ]
                          },
                          {
                            "type": "string",
                            "enum": [
                              "remediation_and_retest"
                            ]
                          }
                        ]
                      },
                      "rationale": {
                        "oneOf": [
                          {
                            "type": "null"
                          },
                          {
                            "type": "string"
                          }
                        ]
                      },
                      "preparedBy": {
                        "type": "string"
                      },
                      "reviewedBy": {
                        "oneOf": [
                          {
                            "type": "null"
                          },
                          {
                            "type": "string"
                          }
                        ]
                      },
                      "reviewedAt": {
                        "oneOf": [
                          {
                            "type": "null"
                          },
                          {
                            "type": "string"
                          }
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false,
                    "required": [
                      "id",
                      "sampleId",
                      "populationItemId",
                      "conclusion",
                      "rationale",
                      "preparedBy",
                      "reviewedBy",
                      "reviewedAt",
                      "createdAt",
                      "updatedAt"
                    ]
                  }
                }
              },
              "additionalProperties": false,
              "required": [
                "sample",
                "tests"
              ]
            }
          }
        },
        "additionalProperties": false,
        "required": [
          "population",
          "items",
          "samples"
        ]
      }
    }
  },
  "additionalProperties": false,
  "required": [
    "organizationId",
    "exporterUserId",
    "schemaVersion",
    "exportedAt",
    "engagement",
    "populations"
  ],
  "$defs": {
    "JsonValue": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "type": "boolean"
        },
        {
          "type": "number"
        },
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        }
      ]
    },
    "OrganizationId": {
      "type": "string",
      "format": "uuid"
    }
  }
}