{
  "openapi": "3.0.4",
  "info": {
    "title": "Atlas API",
    "version": "v1"
  },
  "paths": {
    "/api/v1/area/{id}": {
      "get": {
        "tags": [
          "Area"
        ],
        "summary": "Get all the Areas based on  LocationType",
        "description": "Fetches Areas based on LocationType all the Areas",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully fetched all Areas based on LocationType",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AreaModel"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/": {
      "get": {
        "tags": [
          "Atlas.Api"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/audit/lookups": {
      "get": {
        "tags": [
          "Audit"
        ],
        "summary": "Get audit lookups",
        "description": "Fetches all the audit lookups",
        "responses": {
          "200": {
            "description": "Successfully fetched all audit lookups",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditLookupResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/audit/firm/{auditFirmId}/location/{isExternalLocation}": {
      "get": {
        "tags": [
          "Audit"
        ],
        "summary": "Get audit types",
        "description": "Fetches all the audit type for the given audit firm and location",
        "parameters": [
          {
            "name": "auditFirmId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "isExternalLocation",
            "in": "path",
            "required": true,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully fetched audit types",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditTypeDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/audit": {
      "put": {
        "tags": [
          "Audit"
        ],
        "summary": "Save audit details",
        "description": "Create/Update audit details, based on auditId, if found it updates else it create a new one.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveAuditRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveAuditRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SaveAuditRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Audit created/updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SaveAuditResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/audit/{auditId}": {
      "get": {
        "tags": [
          "Audit"
        ],
        "summary": "Get audit detail",
        "description": "Fetches the audit detail",
        "parameters": [
          {
            "name": "auditId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully fetched audit detail",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AuditDetailResponse"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Audit doesn't exist"
          }
        }
      }
    },
    "/api/v1/audit/ciaAuditsAndFindings/{employeeEmail}": {
      "get": {
        "tags": [
          "Audit"
        ],
        "summary": "Get CIA audits and associated findings for an employee",
        "description": "Fetches a list of CIA audits and findings for the given employeeEmail",
        "parameters": [
          {
            "name": "employeeEmail",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully fetched CIA audits and findings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CIADashboardDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/audit/GeneratePdf": {
      "post": {
        "tags": [
          "Audit"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAuditReportPdfDTO"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAuditReportPdfDTO"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAuditReportPdfDTO"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/auditFindings/lookups": {
      "get": {
        "tags": [
          "AuditFindings"
        ],
        "summary": "Get audit findings lookups.",
        "description": "Provides audit findings lookups.",
        "responses": {
          "200": {
            "description": "Successfully obtained audit findings lookups.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditFindingsLookup"
                }
              }
            }
          },
          "204": {
            "description": "Audit findings lookups doesn't exist."
          }
        }
      }
    },
    "/api/v1/auditFindings/{auditId}/finding/{type}/corrective": {
      "get": {
        "tags": [
          "AuditFindings"
        ],
        "summary": "Get audit correction findings.",
        "description": "Provides audit correction(Non-Conformance and Correction) findings.",
        "parameters": [
          {
            "name": "auditId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "type",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully obtained audit correction findings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SaveAuditFindingsRequest"
                }
              }
            }
          },
          "204": {
            "description": "Audit correction findings doesn't exist."
          }
        }
      }
    },
    "/api/v1/auditFindings/{auditId}/finding/{type}/positive": {
      "get": {
        "tags": [
          "AuditFindings"
        ],
        "summary": "Get audit positive findings.",
        "description": "Provides audit positive(Improvement and Commendation) findings.",
        "parameters": [
          {
            "name": "auditId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "type",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully obtained audit positive findings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PositiveFindings"
                }
              }
            }
          },
          "204": {
            "description": "Audit positive findings doesn't exist."
          }
        }
      }
    },
    "/api/v1/auditFindings/findings/corrective": {
      "put": {
        "tags": [
          "AuditFindings"
        ],
        "summary": "Save audit corrective findings.",
        "description": "Save audit corrective(Non-Conformance and Correction) findings.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveAuditFindingsRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveAuditFindingsRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SaveAuditFindingsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Audit corrective findings created/updated."
          }
        }
      }
    },
    "/api/v1/auditFindings/findings/positive": {
      "put": {
        "tags": [
          "AuditFindings"
        ],
        "summary": "Save audit positive findings.",
        "description": "Save audit positive(Improvement and Commendation) findings.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SavePositiveFindings"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SavePositiveFindings"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SavePositiveFindings"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Audit positive findings created/updated."
          }
        }
      }
    },
    "/api/v1/auditReport/{auditId}/employee": {
      "get": {
        "tags": [
          "AuditReport"
        ],
        "summary": "Get audit employee count.",
        "description": "Provides the employee count at the time of audit  (Temporary and Permanent employee, Updating permanent employee will also update location employee.)",
        "parameters": [
          {
            "name": "auditId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully obtained employee count.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditEmployeeCount"
                }
              }
            }
          },
          "204": {
            "description": "Audit employee doesn't exist."
          }
        }
      }
    },
    "/api/v1/auditReport/{auditId}/status": {
      "get": {
        "tags": [
          "AuditReport"
        ],
        "summary": "Get audit report status.",
        "description": "Provides audit report status.",
        "parameters": [
          {
            "name": "auditId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully obtained audit report status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditReportStatus"
                }
              }
            }
          },
          "204": {
            "description": "Audit employee count doesn't exist."
          }
        }
      }
    },
    "/api/v1/auditReport/{auditId}/crops": {
      "get": {
        "tags": [
          "AuditReport"
        ],
        "summary": "Get audit crops.",
        "description": "Provides audit crops.",
        "parameters": [
          {
            "name": "auditId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully obtained audit crops.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditCrops"
                }
              }
            }
          },
          "204": {
            "description": "Audit crops doesn't exist."
          }
        }
      }
    },
    "/api/v1/auditReport/{auditId}/criteria": {
      "get": {
        "tags": [
          "AuditReport"
        ],
        "summary": "Get audit report criteria.",
        "description": "Provides audit report criteria.",
        "parameters": [
          {
            "name": "auditId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully obtained audit report criteria.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportCriteria"
                }
              }
            }
          },
          "204": {
            "description": "Audit criteria doesn't exist."
          }
        }
      }
    },
    "/api/v1/auditReport/lookups": {
      "get": {
        "tags": [
          "AuditReport"
        ],
        "summary": "Get audit report lookups",
        "description": "Fetches all the audit report lookups",
        "responses": {
          "200": {
            "description": "Successfully fetched all audit report lookups",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditReportLookupResponse"
                }
              }
            }
          },
          "204": {
            "description": "Audit report lookups doesn't exist."
          }
        }
      }
    },
    "/api/v1/auditReport/{auditId}/summary": {
      "get": {
        "tags": [
          "AuditReport"
        ],
        "summary": "Get audit report summary.",
        "description": "Provides audit report summary.",
        "parameters": [
          {
            "name": "auditId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully obtained audit report summary.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditReportSummary"
                }
              }
            }
          },
          "204": {
            "description": "Audit summary doesn't exist."
          }
        }
      }
    },
    "/api/v1/auditReport/{auditId}/personnel": {
      "get": {
        "tags": [
          "AuditReport"
        ],
        "summary": "Get audit personnel.",
        "description": "Provides audit personnel, which includes secondary auditor and meeting attendees.",
        "parameters": [
          {
            "name": "auditId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully obtained audit personnel.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditPersonnel"
                }
              }
            }
          },
          "204": {
            "description": "Audit personnel doesn't exist."
          }
        }
      }
    },
    "/api/v1/auditReport/crops": {
      "put": {
        "tags": [
          "AuditReport"
        ],
        "summary": "Save audit crops.",
        "description": "Save audit crops, based on auditId, if found it updates else it create a new one.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuditCrops"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AuditCrops"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AuditCrops"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Audit crops created/updated."
          },
          "400": {
            "description": "Unable to save crops for the audit."
          }
        }
      }
    },
    "/api/v1/auditReport/employees": {
      "put": {
        "tags": [
          "AuditReport"
        ],
        "summary": "Save audit employees.",
        "description": "Save audit employees, based on auditId, if found it updates else it create a new one.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuditEmployeeModel"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AuditEmployeeModel"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AuditEmployeeModel"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Audit employees created/updated."
          }
        }
      }
    },
    "/api/v1/auditReport/criteria": {
      "put": {
        "tags": [
          "AuditReport"
        ],
        "summary": "Save audit criteria.",
        "description": "Save audit criteria, based on auditId, if found it updates else it create a new one.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportCriteria"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportCriteria"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ReportCriteria"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Audit criteria created/updated."
          }
        }
      }
    },
    "/api/v1/auditReport/status": {
      "put": {
        "tags": [
          "AuditReport"
        ],
        "summary": "Save audit status.",
        "description": "Save audit status, based on auditId, if found it updates else it create a new one.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuditReportStatus"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AuditReportStatus"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AuditReportStatus"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Audit status created/updated."
          }
        }
      }
    },
    "/api/v1/auditReport/summary": {
      "put": {
        "tags": [
          "AuditReport"
        ],
        "summary": "Save audit summary.",
        "description": "Save audit summary, based on auditId, if found it updates else it create a new one.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuditReportSummary"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AuditReportSummary"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AuditReportSummary"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Audit summary created/updated."
          }
        }
      }
    },
    "/api/v1/auditReport/personnel": {
      "put": {
        "tags": [
          "AuditReport"
        ],
        "summary": "Save audit personnel, which includes secondary auditor and meeting attendees.",
        "description": "Save audit personnel, based on auditId, if found it updates else it create a new one.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuditPersonnel"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AuditPersonnel"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AuditPersonnel"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Audit personnel created/updated."
          }
        }
      }
    },
    "/api/v1/cia/{findingId}": {
      "get": {
        "tags": [
          "CIA"
        ],
        "summary": "Get CIA by Finding ID",
        "description": "Retrieves CIA data including action plans and root cause files for a specific finding.",
        "parameters": [
          {
            "name": "findingId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved CIA data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CIAResponse"
                }
              }
            }
          },
          "204": {
            "description": "No CIA data found for this finding"
          },
          "404": {
            "description": "Finding not found"
          }
        }
      }
    },
    "/api/v1/cia": {
      "put": {
        "tags": [
          "CIA"
        ],
        "summary": "Save or Submit CIA",
        "description": "Saves or submits a CIA form with action plans.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveCIARequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveCIARequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SaveCIARequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "CIA saved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SaveCIAResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request data"
          }
        }
      }
    },
    "/api/v1/contacts": {
      "get": {
        "tags": [
          "Contacts"
        ],
        "summary": "Get all the Contacts.",
        "description": "Fetches the Contacts.",
        "responses": {
          "200": {
            "description": "Successfully fetched all Contacts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ContactModel"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/crops/allCrops": {
      "get": {
        "tags": [
          "Crops"
        ],
        "summary": "Get all the Crops",
        "description": "Fetches all the Crops",
        "responses": {
          "200": {
            "description": "Successfully fetched all Crops",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CropsModel"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/file/lookups": {
      "get": {
        "tags": [
          "File"
        ],
        "summary": "Get file lookups",
        "description": "Fetches all the file lookups",
        "responses": {
          "200": {
            "description": "Successfully fetched all file lookups",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/FileLookupResponse"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/file": {
      "put": {
        "tags": [
          "File"
        ],
        "summary": "Upload File",
        "description": "Upload file to Azure Blob Storage in folder structure: ATLAS_{FileReferenceType}/{RecordTypeName}/{GUID}.ext. Only .pdf, .doc, and .docx files are allowed.",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "required": [
                  "File",
                  "FileReferenceId",
                  "FileReferenceTable",
                  "FileReferenceType"
                ],
                "type": "object",
                "properties": {
                  "FileReferenceId": {
                    "type": "integer",
                    "format": "int32"
                  },
                  "FileId": {
                    "type": "integer",
                    "format": "int32"
                  },
                  "FileReferenceType": {
                    "type": "integer",
                    "format": "int32"
                  },
                  "FileReferenceTable": {
                    "$ref": "#/components/schemas/FileReferenceType"
                  },
                  "File": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              },
              "encoding": {
                "FileReferenceId": {
                  "style": "form"
                },
                "FileId": {
                  "style": "form"
                },
                "FileReferenceType": {
                  "style": "form"
                },
                "FileReferenceTable": {
                  "style": "form"
                },
                "File": {
                  "style": "form"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "File uploaded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadedFileResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Invalid file type or validation error"
          },
          "403": {
            "description": "Forbidden"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/v1/file/{fileId}/{crossRefTable}": {
      "get": {
        "tags": [
          "File"
        ],
        "summary": "Download file",
        "description": "Downloads file from Azure Blob Storage or database fallback.",
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "crossRefTable",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/FileReferenceType"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "File downloaded successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/json": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "text/json": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "File not found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "delete": {
        "tags": [
          "File"
        ],
        "summary": "Delete file",
        "description": "Deletes file from Azure Blob Storage (using BlobFileName mapped to UploadedFileDbId) and soft-deletes database record.",
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "crossRefTable",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/FileReferenceType"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "File deleted"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "File not found"
          }
        }
      }
    },
    "/api/v1/frequency": {
      "get": {
        "tags": [
          "Frequency"
        ],
        "summary": "Get all the Frequencys",
        "description": "Fetches all the Frequencys",
        "responses": {
          "200": {
            "description": "Successfully fetched all Frequencys",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/FrequencyModel"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/geography/countries": {
      "get": {
        "tags": [
          "Geography"
        ],
        "summary": "Get all countries enabled for business",
        "description": "Fetches all the countries enabled for business",
        "responses": {
          "200": {
            "description": "Successfully fetched all countries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CountryModel"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/locations": {
      "get": {
        "tags": [
          "Location"
        ],
        "summary": "Get all audit locations",
        "description": "Fetches all the audit location",
        "responses": {
          "200": {
            "description": "Successfully fetched all locations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LocationViewModel"
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Location"
        ],
        "summary": "Save audit location",
        "description": "Create/Update audit location, based on locationDbId, if found it updates else it create a new one.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveLocationModel"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveLocationModel"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SaveLocationModel"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Audit location created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SaveLocDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/locations/{locationId}": {
      "get": {
        "tags": [
          "Location"
        ],
        "summary": "Get audit location detail",
        "description": "Fetches audit location detail",
        "parameters": [
          {
            "name": "locationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully fetched audit location detail",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SaveLocationModel"
                }
              }
            }
          },
          "404": {
            "description": "Location doesn't exist"
          }
        }
      }
    },
    "/api/v1/locations/search": {
      "get": {
        "tags": [
          "Location"
        ],
        "summary": "Get search locations",
        "description": "Returns a list of locations for search based on the search criteria and whether the source is Vylor or External.",
        "parameters": [
          {
            "name": "searchCriteria",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "isExternal",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get search locations",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchLocationModel"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/locationProfiles/{locationId}": {
      "get": {
        "tags": [
          "LocationProfile"
        ],
        "summary": "Get all the audit profile summary of a location.",
        "description": "Fetches the profile summary of a location.",
        "parameters": [
          {
            "name": "locationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully fetched all profile summary of the location",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProfileSummaryModel"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/profiles/lookups": {
      "get": {
        "tags": [
          "Profile"
        ],
        "summary": "Get profile lookups",
        "description": "Fetches all the profile lookups",
        "responses": {
          "200": {
            "description": "Successfully fetched all profile lookups",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProfileLookupResponse"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/profiles": {
      "get": {
        "tags": [
          "Profile"
        ],
        "summary": "Get all audit profiles",
        "description": "Fetches all the audit profiles",
        "responses": {
          "200": {
            "description": "Successfully fetched all profiles",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProfileViewModel"
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Profile"
        ],
        "summary": "Save audit profile",
        "description": "Create/Update audit profile, based on profileDbId, if found it updates else it create a new one.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProfileModel"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ProfileModel"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ProfileModel"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Audit profile created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SaveProfileDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/profiles/{profileId}": {
      "get": {
        "tags": [
          "Profile"
        ],
        "summary": "Get profile detail",
        "description": "Fetches profile detail",
        "parameters": [
          {
            "name": "profileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully fetched profile detail",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileModel"
                }
              }
            }
          },
          "404": {
            "description": "Profiles doesn't exist"
          }
        }
      }
    },
    "/api/v1/profileAudit/{profileId}": {
      "get": {
        "tags": [
          "ProfileAudit"
        ],
        "summary": "Get audits for the profile.",
        "description": "Fetches audit details for the profile.",
        "parameters": [
          {
            "name": "profileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully fetched all the audit details for the profile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileAuditModel"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/SessionManager/createSession": {
      "post": {
        "tags": [
          "SessionManager"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionManagerModel"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionManagerModel"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SessionManagerModel"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/SessionManager/getSessionByUserId": {
      "get": {
        "tags": [
          "SessionManager"
        ],
        "parameters": [
          {
            "name": "userId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/SessionManager/extendSession": {
      "post": {
        "tags": [
          "SessionManager"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "string"
              }
            },
            "text/json": {
              "schema": {
                "type": "string"
              }
            },
            "application/*+json": {
              "schema": {
                "type": "string"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/SessionManager/invalidateSession": {
      "delete": {
        "tags": [
          "SessionManager"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "string"
              }
            },
            "text/json": {
              "schema": {
                "type": "string"
              }
            },
            "application/*+json": {
              "schema": {
                "type": "string"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/SessionManager/validateSession": {
      "post": {
        "tags": [
          "SessionManager"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "string"
              }
            },
            "text/json": {
              "schema": {
                "type": "string"
              }
            },
            "application/*+json": {
              "schema": {
                "type": "string"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/standardizedDays": {
      "get": {
        "tags": [
          "Standardized"
        ],
        "summary": "Get all the StandardizedDays",
        "description": "Fetches all the Standardized",
        "responses": {
          "200": {
            "description": "Successfully fetched all StandardizedDays",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/StandardizedModel"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/subArea/{id}": {
      "get": {
        "tags": [
          "SubArea"
        ],
        "summary": "Get all the Sub Areas based upon AreaId",
        "description": "Fetches LocationType all the SubAreas",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully fetched all SubAreas based on LocationType",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SubAreaModel"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ActionPlanRequest": {
        "required": [
          "description",
          "dueDate",
          "responsiblePerson"
        ],
        "type": "object",
        "properties": {
          "actionPlanDbId": {
            "type": "integer",
            "format": "int32"
          },
          "description": {
            "minLength": 1,
            "type": "string"
          },
          "responsiblePerson": {
            "minLength": 1,
            "type": "string"
          },
          "dueDate": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "ActionPlanResponse": {
        "type": "object",
        "properties": {
          "actionPlanDbId": {
            "type": "integer",
            "format": "int32"
          },
          "planId": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "responsiblePerson": {
            "type": "string",
            "nullable": true
          },
          "dueDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "createdOn": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "AreaModel": {
        "type": "object",
        "properties": {
          "areaDbId": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "AuditCrops": {
        "type": "object",
        "properties": {
          "auditId": {
            "type": "integer",
            "format": "int32"
          },
          "crops": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "AuditDetailResponse": {
        "type": "object",
        "properties": {
          "auditDetails": {
            "$ref": "#/components/schemas/SaveAuditRequest"
          },
          "auditReport": {
            "$ref": "#/components/schemas/AuditReportEntity"
          },
          "agenda": {
            "$ref": "#/components/schemas/UploadedFileResponse"
          }
        },
        "additionalProperties": false
      },
      "AuditEmployeeCount": {
        "type": "object",
        "properties": {
          "auditId": {
            "type": "integer",
            "format": "int32"
          },
          "numberOfFullTimeEmployees": {
            "type": "integer",
            "format": "int32"
          },
          "numberOfTempEmployees": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "AuditEmployeeModel": {
        "type": "object",
        "properties": {
          "auditId": {
            "type": "integer",
            "format": "int32"
          },
          "numberOfFullTimeEmployees": {
            "type": "integer",
            "format": "int32"
          },
          "numberOfTempEmployees": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "AuditFindingsLookup": {
        "type": "object",
        "properties": {
          "findingType": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Lookup"
            },
            "nullable": true
          },
          "findingTier1": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Lookup"
            },
            "nullable": true
          },
          "findingTier2": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Lookup"
            },
            "nullable": true
          },
          "findingTextField": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Lookup"
            },
            "nullable": true
          },
          "auditCIAStatus": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Lookup"
            },
            "nullable": true
          },
          "lowMedHigh": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Lookup"
            },
            "nullable": true
          },
          "yesNo": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Lookup"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "AuditLookupResponse": {
        "type": "object",
        "properties": {
          "auditFirm": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Lookup"
            },
            "nullable": true
          },
          "dateConfirmed": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Lookup"
            },
            "nullable": true
          },
          "duration": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Lookup"
            },
            "nullable": true
          },
          "contactType": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Lookup"
            },
            "nullable": true
          },
          "auditTextFields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Lookup"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "AuditPersonnel": {
        "required": [
          "auditId",
          "contacts"
        ],
        "type": "object",
        "properties": {
          "auditId": {
            "type": "integer",
            "format": "int32"
          },
          "contacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactRequest"
            }
          },
          "meetingAttendees": {
            "$ref": "#/components/schemas/TextFieldModel"
          }
        },
        "additionalProperties": false
      },
      "AuditReportEntity": {
        "type": "object",
        "properties": {
          "isAuditCompleted": {
            "type": "boolean"
          },
          "isReportStarted": {
            "type": "boolean"
          },
          "isReportInProgress": {
            "type": "boolean"
          },
          "isReportCompleted": {
            "type": "boolean"
          },
          "isAuditClosed": {
            "type": "boolean"
          },
          "workflow": {
            "type": "integer",
            "format": "int32"
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "updatedOn": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "AuditReportLookupResponse": {
        "type": "object",
        "properties": {
          "auditObjective": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Lookup"
            },
            "nullable": true
          },
          "auditQMS": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Lookup"
            },
            "nullable": true
          },
          "auditCriteria": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Lookup"
            },
            "nullable": true
          },
          "auditProcess": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Lookup"
            },
            "nullable": true
          },
          "auditCompliance": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Lookup"
            },
            "nullable": true
          },
          "auditReportStatus": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Lookup"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "AuditReportStatus": {
        "type": "object",
        "properties": {
          "auditId": {
            "type": "integer",
            "format": "int32"
          },
          "reportStatusId": {
            "type": "integer",
            "format": "int32"
          },
          "dateOfAcceptance": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "actualAuditDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "AuditReportSummary": {
        "required": [
          "auditId",
          "reportSummary"
        ],
        "type": "object",
        "properties": {
          "auditId": {
            "type": "integer",
            "format": "int32"
          },
          "reportSummary": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TextFieldModel"
            }
          }
        },
        "additionalProperties": false
      },
      "AuditTypeDto": {
        "type": "object",
        "properties": {
          "auditFirmId": {
            "type": "integer",
            "format": "int32"
          },
          "auditType": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Lookup"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CIADashboardDto": {
        "required": [
          "auditId"
        ],
        "type": "object",
        "properties": {
          "auditId": {
            "type": "integer",
            "format": "int32"
          },
          "findingId": {
            "type": "integer",
            "format": "int32"
          },
          "auditProfile": {
            "type": "string",
            "nullable": true
          },
          "dueDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "findingType": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CIAResponse": {
        "type": "object",
        "properties": {
          "ciaDbId": {
            "type": "integer",
            "format": "int32"
          },
          "findingId": {
            "type": "integer",
            "format": "int32"
          },
          "statusDbId": {
            "type": "integer",
            "format": "int32"
          },
          "immediateActionDbId": {
            "type": "integer",
            "format": "int32"
          },
          "immediateActionDescription": {
            "type": "string",
            "nullable": true
          },
          "impactOnQualityDbId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "chanceOfRecurrenceDbId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "rootCauseAnalysis": {
            "type": "string",
            "nullable": true
          },
          "auditorComments": {
            "type": "string",
            "nullable": true
          },
          "actionPlans": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ActionPlanResponse"
            },
            "nullable": true
          },
          "rootCauseFiles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RootCauseFileResponse"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ContactModel": {
        "type": "object",
        "properties": {
          "personnelNumber": {
            "type": "string",
            "nullable": true
          },
          "employeeDbId": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ContactRequest": {
        "type": "object",
        "properties": {
          "personnelNumber": {
            "type": "string",
            "nullable": true
          },
          "type": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "CountryModel": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "country": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CreateAuditReportPdfDTO": {
        "type": "object",
        "properties": {
          "auditId": {
            "type": "integer",
            "format": "int32"
          },
          "ironPdfKey": {
            "type": "string",
            "nullable": true
          },
          "baseUrl": {
            "type": "string",
            "nullable": true
          },
          "auditDate": {
            "type": "string",
            "nullable": true
          },
          "numberOfFullTimeEmployees": {
            "type": "string",
            "nullable": true
          },
          "numberOfTempEmployees": {
            "type": "string",
            "nullable": true
          },
          "primaryAuditor": {
            "type": "string",
            "nullable": true
          },
          "secondaryAuditor": {
            "type": "string",
            "nullable": true
          },
          "topic": {
            "type": "string",
            "nullable": true
          },
          "comments": {
            "type": "string",
            "nullable": true
          },
          "crops": {
            "type": "string",
            "nullable": true
          },
          "profileComment": {
            "type": "string",
            "nullable": true
          },
          "primaryContact": {
            "type": "string",
            "nullable": true
          },
          "secondaryContact": {
            "type": "string",
            "nullable": true
          },
          "locationDetail": {
            "type": "string",
            "nullable": true
          },
          "region": {
            "type": "string",
            "nullable": true
          },
          "locationDescription": {
            "type": "string",
            "nullable": true
          },
          "auditType": {
            "type": "string",
            "nullable": true
          },
          "auditObjective": {
            "type": "string",
            "nullable": true
          },
          "auditCriteria": {
            "type": "string",
            "nullable": true
          },
          "auditProcess": {
            "type": "string",
            "nullable": true
          },
          "auditQMS": {
            "type": "string",
            "nullable": true
          },
          "auditCompliance": {
            "type": "string",
            "nullable": true
          },
          "reportSummary": {
            "type": "string",
            "nullable": true
          },
          "otherComments": {
            "type": "string",
            "nullable": true
          },
          "openingMeetingAttendeesText": {
            "type": "string",
            "nullable": true
          },
          "closingMeetingAttendeesText": {
            "type": "string",
            "nullable": true
          },
          "dateOfAcceptance": {
            "type": "string",
            "nullable": true
          },
          "nonConformancesEvidence": {
            "type": "string",
            "nullable": true
          },
          "nonConformancesTier1": {
            "type": "string",
            "nullable": true
          },
          "improvements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FindingDTO"
            },
            "nullable": true
          },
          "nonConformances": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FindingNonConformancesORCorrectionDTO"
            },
            "nullable": true
          },
          "findCorrections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FindingNonConformancesORCorrectionDTO"
            },
            "nullable": true
          },
          "findCommendations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FindingDTO"
            },
            "nullable": true
          },
          "improvementHeader": {
            "type": "string",
            "nullable": true
          },
          "nonConformancesHeader": {
            "type": "string",
            "nullable": true
          },
          "findCorrectionsHeader": {
            "type": "string",
            "nullable": true
          },
          "findCommendationsHeader": {
            "type": "string",
            "nullable": true
          },
          "auditReportStatus": {
            "$ref": "#/components/schemas/AuditReportStatus"
          }
        },
        "additionalProperties": false
      },
      "CropsModel": {
        "type": "object",
        "properties": {
          "dbId": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "FileLookupResponse": {
        "type": "object",
        "properties": {
          "fileType": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Lookup"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "FileReferenceType": {
        "enum": [
          "Audit",
          "Finding",
          "Requirement",
          "LocationProfile"
        ],
        "type": "string"
      },
      "FindingDTO": {
        "type": "object",
        "properties": {
          "findingId": {
            "type": "integer",
            "format": "int32"
          },
          "findingHeader": {
            "type": "string",
            "nullable": true
          },
          "findingSubHeader": {
            "type": "string",
            "nullable": true
          },
          "findingDescription": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "FindingNonConformancesORCorrectionDTO": {
        "type": "object",
        "properties": {
          "findingId": {
            "type": "integer",
            "format": "int32"
          },
          "findingHeader": {
            "type": "string",
            "nullable": true
          },
          "findingSubHeader": {
            "type": "string",
            "nullable": true
          },
          "tier1": {
            "type": "string",
            "nullable": true
          },
          "requirment": {
            "type": "string",
            "nullable": true
          },
          "evidence": {
            "type": "string",
            "nullable": true
          },
          "recommendation": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "FrequencyModel": {
        "type": "object",
        "properties": {
          "dbId": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "LocationViewModel": {
        "required": [
          "city",
          "siteDescription"
        ],
        "type": "object",
        "properties": {
          "locationDbId": {
            "type": "integer",
            "format": "int32"
          },
          "locationCode": {
            "maxLength": 10,
            "type": "string",
            "nullable": true
          },
          "siteDescription": {
            "minLength": 1,
            "pattern": "^[a-zA-Z0-9\\s.&-]{1,}$",
            "type": "string"
          },
          "city": {
            "maxLength": 100,
            "minLength": 1,
            "pattern": "^[a-zA-Z\\s.&]{2,}$",
            "type": "string"
          },
          "region": {
            "maxLength": 100,
            "pattern": "^[a-zA-Z0-9\\s.&-]*$",
            "type": "string",
            "nullable": true
          },
          "buildingCode": {
            "maxLength": 10,
            "type": "string",
            "nullable": true
          },
          "locationType": {
            "type": "string",
            "nullable": true
          },
          "locationProfiles": {
            "type": "integer",
            "format": "int32"
          },
          "country": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Lookup": {
        "type": "object",
        "properties": {
          "dbId": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PositiveFindings": {
        "required": [
          "auditId",
          "findingTypeId"
        ],
        "type": "object",
        "properties": {
          "auditId": {
            "type": "integer",
            "format": "int32"
          },
          "findingId": {
            "type": "integer",
            "format": "int32"
          },
          "findingTypeId": {
            "type": "integer",
            "format": "int32"
          },
          "textFieldId": {
            "type": "integer",
            "format": "int32"
          },
          "textFieldContent": {
            "type": "string",
            "nullable": true
          },
          "createdOn": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "ProfileAuditModel": {
        "type": "object",
        "properties": {
          "locationProfileDbId": {
            "type": "integer",
            "format": "int32"
          },
          "auditDbId": {
            "type": "integer",
            "format": "int32"
          },
          "primaryAuditor": {
            "type": "string",
            "nullable": true
          },
          "confirmed": {
            "type": "string",
            "nullable": true
          },
          "date": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "firm": {
            "type": "string",
            "nullable": true
          },
          "purpose": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ProfileLookupResponse": {
        "type": "object",
        "properties": {
          "auditFrequency": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Lookup"
            },
            "nullable": true
          },
          "standardizedDays": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Lookup"
            },
            "nullable": true
          },
          "crops": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Lookup"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ProfileModel": {
        "type": "object",
        "properties": {
          "locationTypeId": {
            "type": "integer",
            "format": "int32"
          },
          "locationDbId": {
            "type": "integer",
            "format": "int32"
          },
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "areaDbId": {
            "type": "integer",
            "format": "int32"
          },
          "subAreaDbId": {
            "type": "integer",
            "format": "int32"
          },
          "frequencyDbId": {
            "type": "integer",
            "format": "int32"
          },
          "standardizedDaysDbId": {
            "type": "integer",
            "format": "int32"
          },
          "primaryContact": {
            "type": "string",
            "nullable": true
          },
          "secondaryContact": {
            "type": "string",
            "nullable": true
          },
          "comments": {
            "type": "string",
            "nullable": true
          },
          "crop": {
            "type": "string",
            "nullable": true
          },
          "locationProfileDbId": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "ProfileSummaryModel": {
        "type": "object",
        "properties": {
          "locationProfileDbId": {
            "type": "integer",
            "format": "int32"
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "primaryAuditor": {
            "type": "string",
            "nullable": true
          },
          "numberOfAudits": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "ProfileViewModel": {
        "type": "object",
        "properties": {
          "locationType": {
            "type": "string",
            "nullable": true
          },
          "locationDbId": {
            "type": "integer",
            "format": "int32"
          },
          "buildingCode": {
            "type": "string",
            "nullable": true
          },
          "locationCode": {
            "type": "string",
            "nullable": true
          },
          "siteDescription": {
            "type": "string",
            "nullable": true
          },
          "country": {
            "type": "string",
            "nullable": true
          },
          "area": {
            "type": "string",
            "nullable": true
          },
          "subArea": {
            "type": "string",
            "nullable": true
          },
          "locationProfileDbId": {
            "type": "integer",
            "format": "int32"
          },
          "lastAuditDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ReportCriteria": {
        "type": "object",
        "properties": {
          "auditId": {
            "type": "integer",
            "format": "int32"
          },
          "auditObjective": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "auditCompliance": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "nullable": true
          },
          "auditCriteria": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "nullable": true
          },
          "auditProcess": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "nullable": true
          },
          "auditQMS": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "RootCauseFileResponse": {
        "type": "object",
        "properties": {
          "uploadedFileDbId": {
            "type": "integer",
            "format": "int32"
          },
          "fileName": {
            "type": "string",
            "nullable": true
          },
          "fileType": {
            "type": "string",
            "nullable": true
          },
          "fileSize": {
            "type": "integer",
            "format": "int64"
          },
          "uploadedOn": {
            "type": "string",
            "format": "date-time"
          },
          "uploadedBy": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SaveAuditFindingsRequest": {
        "required": [
          "auditId",
          "findingTypeId",
          "statusId",
          "textFields",
          "tier1Id"
        ],
        "type": "object",
        "properties": {
          "findingId": {
            "type": "integer",
            "format": "int32"
          },
          "auditId": {
            "type": "integer",
            "format": "int32"
          },
          "findingTypeId": {
            "type": "integer",
            "format": "int32"
          },
          "tier1Id": {
            "type": "integer",
            "format": "int32"
          },
          "dueDate": {
            "type": "string",
            "description": "Calculated automatically based on DateOfAcceptance and finding type.",
            "format": "date-time",
            "nullable": true
          },
          "statusId": {
            "type": "integer",
            "format": "int32"
          },
          "usesOldTierValues": {
            "type": "boolean"
          },
          "textFields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TextFieldModel"
            }
          }
        },
        "additionalProperties": false
      },
      "SaveAuditRequest": {
        "required": [
          "auditDate",
          "auditingFirmId",
          "auditTypeId"
        ],
        "type": "object",
        "properties": {
          "auditId": {
            "type": "integer",
            "format": "int32"
          },
          "contacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactRequest"
            },
            "nullable": true
          },
          "auditingFirmId": {
            "type": "integer",
            "format": "int32"
          },
          "auditTypeId": {
            "type": "integer",
            "format": "int32"
          },
          "locationProfileId": {
            "type": "integer",
            "format": "int32"
          },
          "auditDate": {
            "type": "string",
            "format": "date-time"
          },
          "durationId": {
            "type": "integer",
            "format": "int32"
          },
          "auditConfirmationId": {
            "type": "integer",
            "format": "int32"
          },
          "addionalInfo": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TextFieldModel"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SaveAuditResponse": {
        "type": "object",
        "properties": {
          "auditId": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "SaveCIARequest": {
        "required": [
          "actionPlans",
          "findingId",
          "immediateActionDbId",
          "statusDbId"
        ],
        "type": "object",
        "properties": {
          "ciaDbId": {
            "type": "integer",
            "format": "int32"
          },
          "findingId": {
            "type": "integer",
            "format": "int32"
          },
          "statusDbId": {
            "type": "integer",
            "format": "int32"
          },
          "immediateActionDbId": {
            "type": "integer",
            "format": "int32"
          },
          "immediateActionDescription": {
            "type": "string",
            "nullable": true
          },
          "impactOnQualityDbId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "chanceOfRecurrenceDbId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "rootCauseAnalysis": {
            "type": "string",
            "nullable": true
          },
          "auditorComments": {
            "type": "string",
            "nullable": true
          },
          "actionPlans": {
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ActionPlanRequest"
            }
          }
        },
        "additionalProperties": false
      },
      "SaveCIAResponse": {
        "type": "object",
        "properties": {
          "ciaDbId": {
            "type": "integer",
            "format": "int32"
          },
          "findingId": {
            "type": "integer",
            "format": "int32"
          },
          "success": {
            "type": "boolean"
          },
          "message": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SaveLocDto": {
        "type": "object",
        "properties": {
          "locationId": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "SaveLocationModel": {
        "required": [
          "address1",
          "city",
          "countryId",
          "siteDescription"
        ],
        "type": "object",
        "properties": {
          "locationDbId": {
            "type": "integer",
            "format": "int32"
          },
          "locationCode": {
            "maxLength": 10,
            "type": "string",
            "nullable": true
          },
          "siteDescription": {
            "minLength": 1,
            "pattern": "^[a-zA-Z0-9\\s.&-]{1,}$",
            "type": "string"
          },
          "city": {
            "maxLength": 100,
            "minLength": 1,
            "pattern": "^[a-zA-Z\\s.&]{2,}$",
            "type": "string"
          },
          "region": {
            "maxLength": 100,
            "pattern": "^[a-zA-Z0-9\\s.&-]*$",
            "type": "string",
            "nullable": true
          },
          "buildingCode": {
            "maxLength": 10,
            "type": "string",
            "nullable": true
          },
          "businessUnitRegion": {
            "pattern": "^[a-zA-Z0-9\\s.&-]*$",
            "type": "string",
            "nullable": true
          },
          "address1": {
            "maxLength": 100,
            "minLength": 1,
            "pattern": "^[a-zA-Z0-9\\s.,#&-]{1,}$",
            "type": "string"
          },
          "address2": {
            "maxLength": 100,
            "pattern": "^[a-zA-Z0-9\\s.,#&-]*$",
            "type": "string",
            "nullable": true
          },
          "numberOfFullTimeEmployees": {
            "pattern": "^[0-9]+$",
            "type": "integer",
            "format": "int32"
          },
          "isExternal": {
            "type": "boolean",
            "description": "true indicates an External location false indicates Vylor location"
          },
          "countryId": {
            "type": "integer",
            "description": "Use geography api to fetch all the countries and provide the id of country",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "SavePositiveFindings": {
        "required": [
          "auditId",
          "findingTypeId"
        ],
        "type": "object",
        "properties": {
          "auditId": {
            "type": "integer",
            "format": "int32"
          },
          "findingId": {
            "type": "integer",
            "format": "int32"
          },
          "findingTypeId": {
            "type": "integer",
            "format": "int32"
          },
          "textFieldId": {
            "type": "integer",
            "format": "int32"
          },
          "textFieldContent": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SaveProfileDto": {
        "type": "object",
        "properties": {
          "locationProfileDbId": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "SearchLocationModel": {
        "type": "object",
        "properties": {
          "locationDbId": {
            "type": "integer",
            "format": "int32"
          },
          "locationCode": {
            "type": "string",
            "nullable": true
          },
          "siteDescription": {
            "type": "string",
            "nullable": true
          },
          "address": {
            "type": "string",
            "nullable": true
          },
          "city": {
            "type": "string",
            "nullable": true
          },
          "region": {
            "type": "string",
            "nullable": true
          },
          "numberOfEmployees": {
            "type": "integer",
            "format": "int32"
          },
          "country": {
            "type": "integer",
            "format": "int32"
          },
          "isExternal": {
            "type": "boolean"
          },
          "businessUnitRegion": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SessionManagerModel": {
        "required": [
          "sessionId",
          "userId"
        ],
        "type": "object",
        "properties": {
          "sessionId": {
            "minLength": 1,
            "type": "string"
          },
          "userId": {
            "minLength": 1,
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "StandardizedModel": {
        "type": "object",
        "properties": {
          "dbId": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SubAreaModel": {
        "type": "object",
        "properties": {
          "subAreaDbId": {
            "type": "integer",
            "format": "int32"
          },
          "areaDbId": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TextFieldModel": {
        "type": "object",
        "properties": {
          "textFieldId": {
            "type": "integer",
            "format": "int32"
          },
          "textFieldContent": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "UploadedFileResponse": {
        "type": "object",
        "properties": {
          "uploadedFileDbId": {
            "type": "integer",
            "format": "int32"
          },
          "fileName": {
            "type": "string",
            "nullable": true
          },
          "fileType": {
            "type": "string",
            "nullable": true
          },
          "recordTypeDbId": {
            "type": "integer",
            "format": "int32"
          },
          "crossRefTable": {
            "type": "string",
            "nullable": true
          },
          "crossRefDbId": {
            "type": "integer",
            "format": "int32"
          },
          "savedBy": {
            "type": "string",
            "nullable": true
          },
          "hash": {
            "type": "string",
            "nullable": true
          },
          "blobFileName": {
            "type": "string",
            "nullable": true
          },
          "blobUrl": {
            "type": "string",
            "nullable": true
          },
          "updatedOn": {
            "type": "string",
            "format": "date-time"
          },
          "updatedBy": {
            "type": "string",
            "nullable": true
          },
          "fileSize": {
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "oauth2": {
        "type": "oauth2",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://login.microsoftonline.com/db505480-8ec6-495c-b579-32c58ed84a01/oauth2/v2.0/authorize",
            "tokenUrl": "https://login.microsoftonline.com/db505480-8ec6-495c-b579-32c58ed84a01/oauth2/v2.0/token",
            "scopes": {
              "api://60b09d7c-e1dc-4c19-a257-abcb8e7b9d52/atlas.api.access": "Atlas API access"
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "oauth2": [
        "api://60b09d7c-e1dc-4c19-a257-abcb8e7b9d52/.default"
      ]
    }
  ],
  "tags": [
    {
      "name": "Area"
    },
    {
      "name": "Atlas.Api"
    },
    {
      "name": "Audit"
    },
    {
      "name": "AuditFindings"
    },
    {
      "name": "AuditReport"
    },
    {
      "name": "CIA"
    },
    {
      "name": "Contacts"
    },
    {
      "name": "Crops"
    },
    {
      "name": "File"
    },
    {
      "name": "Frequency"
    },
    {
      "name": "Geography"
    },
    {
      "name": "Location"
    },
    {
      "name": "LocationProfile"
    },
    {
      "name": "Profile"
    },
    {
      "name": "ProfileAudit"
    },
    {
      "name": "SessionManager"
    },
    {
      "name": "Standardized"
    },
    {
      "name": "SubArea"
    }
  ]
}