{
  "openapi": "3.0.0",
  "info": {
    "title": "Document Storage Microservice API",
    "description": "Temenos Document Storage Microservice",
    "version": "1.0.0"
  },
  "tags": [
    {
      "name": "admins",
      "description": "Operations available to the internal admins"
    },
    {
      "name": "owners",
      "description": "Operations available to the document owner systems"
    }
  ],
  "servers": [
    {
      "url": "http://localhost:8006/ms-document-api/api/v1.0.0"
    }
  ],
  "paths": {
    "/evidences/{evidenceId}": {
      "put": {
        "operationId": "updateExistingEvidence",
        "summary": "Update an existing evidence using three action headers that are VALIDITY,REUSE,REVIEW",
        "tags": [
          "Evidences"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "JWT token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "evidenceId",
            "in": "path",
            "description": "Evidence id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "action",
            "in": "header",
            "description": "VALIDITY, REUSE, REVIEW",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Evidence category fields.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateExistingEvidenceRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Evidences categories response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateExistingEvidenceResponse"
                }
              }
            }
          },
          "default": {
            "description": "Standard Error Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/evidences/application/{applicationId}": {
      "delete": {
        "operationId": "deleteEvidencesOfApplication",
        "summary": "Delete all the evidences linked to application id",
        "tags": [
          "Application"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "JWT token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "description": "application Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Evidences categories response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteEvidencesOfApplicationResponse"
                }
              }
            }
          },
          "default": {
            "description": "Standard Error Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/evidences/owner/{ownerId}": {
      "delete": {
        "operationId": "deleteEvidencesOfOwner",
        "summary": "Delete evidences of owner",
        "tags": [
          "Evidences"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "JWT token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ownerId",
            "in": "path",
            "description": "Owner Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Evidences categories response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteEvidencesOfOwnerResponse"
                }
              }
            }
          },
          "default": {
            "description": "Standard Error Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "getEvidencesOfOwner",
        "summary": "Get all the evidences of given ownerId.",
        "tags": [
          "Evidences"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "JWT token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ownerId",
            "in": "path",
            "description": "JWT token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Evidences response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetEvidences"
                }
              }
            }
          },
          "default": {
            "description": "Standard Error Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updatePartyIdForEvidences",
        "summary": "Update owner id(prospect id) with party id",
        "tags": [
          "Evidences"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "JWT token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ownerId",
            "in": "path",
            "description": "JWT token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Evidence category fields.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequestOwnerId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Evidences categories response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetApplicationEvidences"
                }
              }
            }
          },
          "default": {
            "description": "Standard Error Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/evidences/": {
      "get": {
        "operationId": "getSubmittedEvidences",
        "summary": "Get all the submitted evidences",
        "tags": [
          "Evidences"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "JWT token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Evidences response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetApplicationEvidences"
                }
              }
            }
          },
          "default": {
            "description": "Standard Error Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "submitEvidenceForParty",
        "summary": "Submit an evidences for a party without any fulfilment or requirement",
        "tags": [
          "Evidences"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "JWT token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ownersystemid",
            "in": "header",
            "description": "Owner System ID (Fabric Application ID)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "documentgroup",
            "in": "header",
            "description": "Document group (Journey ID can be the value of the document group in the format of journey-ownerSystemId-journeyID)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "File to upload",
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/ApplicationEvidence"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Evidences categories response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationEvidenceResponse"
                }
              }
            }
          },
          "default": {
            "description": "Standard Error Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/evidences/categories": {
      "get": {
        "operationId": "getEvidencesCategories",
        "summary": "Get all the evidence categories.",
        "tags": [
          "owners"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "JWT token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Evidences categories response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidencesCategories"
                }
              }
            }
          },
          "default": {
            "description": "Standard Error Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createEvidenceCategory",
        "summary": "Create new evidence category",
        "tags": [
          "admins"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "JWT token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Evidence category fields.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EvidenceCategory"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Evidences categories response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidenceCategory"
                }
              }
            }
          },
          "default": {
            "description": "Standard Error Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/evidences/categories/{categoryId}": {
      "put": {
        "operationId": "updateEvidenceCategory",
        "summary": "Update an evidence category name and description",
        "tags": [
          "admins"
        ],
        "parameters": [
          {
            "name": "categoryId",
            "in": "path",
            "description": "Category Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Evidence category fields.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EvidenceCategory"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Evidences categories response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidenceCategory"
                }
              }
            }
          },
          "default": {
            "description": "Standard Error Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteEvidenceCategory",
        "summary": "Delete evidence category",
        "tags": [
          "admins"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "JWT token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "categoryId",
            "in": "path",
            "description": "Category Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Evidences categories response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidenceCategory"
                }
              }
            }
          },
          "default": {
            "description": "Standard Error Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/evidences/types": {
      "get": {
        "operationId": "getEvidenceTypes",
        "summary": "Get all the evidence types.",
        "tags": [
          "owners"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "JWT token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Evidences types response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidenceTypes"
                }
              }
            }
          },
          "default": {
            "description": "Standard Error Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createEvidenceType",
        "summary": "Create new evidence type",
        "tags": [
          "admins"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "JWT token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Evidence type fields.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EvidenceType"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Evidences types response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidenceType"
                }
              }
            }
          },
          "default": {
            "description": "Standard Error Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/evidences/types/{typeId}": {
      "put": {
        "operationId": "updateEvidenceType",
        "summary": "Update evidence type",
        "tags": [
          "admins"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "JWT token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "typeId",
            "in": "path",
            "description": "Type Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Evidence type fields.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EvidenceType"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Evidences types response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidenceType"
                }
              }
            }
          },
          "default": {
            "description": "Standard Error Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "getEvidenceType",
        "summary": "Get evidence type.",
        "tags": [
          "owners"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "JWT token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "typeId",
            "in": "path",
            "description": "Type Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Evidences type response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidenceType"
                }
              }
            }
          },
          "default": {
            "description": "Standard Error Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteEvidenceType",
        "summary": "Delete evidence type",
        "tags": [
          "admins"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "JWT token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "typeId",
            "in": "path",
            "description": "Type Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Evidences types response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidenceType"
                }
              }
            }
          },
          "default": {
            "description": "Standard Error Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/documents/info/{documentId}": {
      "get": {
        "operationId": "getDocumentInfo",
        "summary": "Get Document info (For internal use)",
        "tags": [
          "admins"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "JWT token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "documentId",
            "in": "path",
            "description": "Document Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Document Info Requested",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentInfo"
                }
              }
            }
          },
          "404": {
            "description": "Document Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NoDocumentFoundErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Standard Error Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/documents/": {
      "post": {
        "operationId": "uploadDocument",
        "summary": "Upload a new document",
        "tags": [
          "owners"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "JWT token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ownersystemid",
            "in": "header",
            "description": "Owner System ID (Fabric Application ID)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "documentgroup",
            "in": "header",
            "description": "Document group (Journey ID can be the value of the document group in the format of journey-ownerSystemId-journeyID)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "file to upload",
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/DocumentUpload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Document Uploaded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadDocumentResponse"
                }
              }
            }
          },
          "400": {
            "description": "File Size Limit Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileSizeLimitErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "File Has Virus Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileHasVirusErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Standard Error Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateDocument",
        "summary": "Update document (3 actions are supported DELIVERY, ADD_METADATA and UPDATE_METADATA. DELIVERY action is to promote temporary journey document from the Infinity channel to the core banking channel. ADD_METADATA is for adding new search metadata to the existing set of metadata, and the UPDATE_METADATA is for replacing the current set of document search metadata with the new set.)",
        "tags": [
          "owners"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "JWT token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ownersystemid",
            "in": "header",
            "description": "Owner System ID (Fabric Application ID)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "documentgroup",
            "in": "header",
            "description": "Document group. (For example - journey ID can be the value of the document group in the format of journey-ownerSystemId-journeyID.)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Document update body include the document id and new set of search metadata.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deliver the document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateDocumentResponse"
                }
              }
            }
          },
          "404": {
            "description": "Document Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NoDocumentFoundErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Standard Error Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/documents/owner/{ownerId}": {
      "delete": {
        "operationId": "deleteDocumentsByOwner",
        "summary": "Delete documents by owner id",
        "tags": [
          "owners"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "JWT token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ownerId",
            "in": "path",
            "description": "owner Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Delete document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteDocumentResponses"
                }
              }
            }
          },
          "404": {
            "description": "Document Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NoDocumentFoundErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Standard Error Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/documents/{documentId}": {
      "get": {
        "operationId": "downloadDocument",
        "summary": "Download a document",
        "tags": [
          "owners"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "JWT token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ownersystemid",
            "in": "header",
            "description": "Owner System ID (Fabric Application ID)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "documentgroup",
            "in": "header",
            "description": "Document group. (For example - journey ID can be the value of the document group in the format of journey-ownerSystemId-journeyID.)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "documentId",
            "in": "path",
            "description": "Document Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Document download as binary file.",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "$ref": "#/components/schemas/DownloadDocumentResponse"
                }
              }
            }
          },
          "404": {
            "description": "Document Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NoDocumentFoundErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Standard Error Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteDocument",
        "summary": "Delete a document",
        "tags": [
          "owners"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "JWT token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ownersystemid",
            "in": "header",
            "description": "Owner System ID (Fabric Application ID)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "documentgroup",
            "in": "header",
            "description": "Document group. (For example - journey ID can be the value of the document group in the format of journey-ownerSystemId-journeyID.)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "documentId",
            "in": "path",
            "description": "Document Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Delete the document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteDocumentResponse"
                }
              }
            }
          },
          "404": {
            "description": "Document Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NoDocumentFoundErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Standard Error Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/documents": {
      "get": {
        "operationId": "searchDocuments",
        "summary": "Search Document(s) info",
        "tags": [
          "owners"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "JWT token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ownersystemid",
            "in": "header",
            "description": "Owner System ID (Fabric Application ID)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "documentgroup",
            "in": "header",
            "description": "Document group. (For example - journey ID can be the value of the document group in the format of journey-ownerSystemId-journeyID.)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Search Metadata as JSON String Object. All Keys must match predefined search metadata when uploading document. For optimized search, provide your most unique key first. Example, {\"transactionId\":\"ABCDEFG\",\"documentType\":\"attachment\"}",
            "required": true,
            "schema": {
              "type": "string"
            },
            "style": "form",
            "explode": true
          }
        ],
        "responses": {
          "200": {
            "description": "Document Info Requested",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchDocumentResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid Search Error Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidSearchErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Standard Error Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/documents/generation": {
      "post": {
        "operationId": "generateDocument",
        "summary": "Generate document",
        "tags": [
          "owners"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "JWT token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Document generation",
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/DocumentGeneration"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Document generation response.",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentGenerationResponse"
                }
              }
            }
          },
          "default": {
            "description": "Standard Error Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/evidences/fulfilments": {
      "post": {
        "operationId": "createApplicationFulfilment",
        "summary": "Create an evidence fulfilment checklist for the current application",
        "tags": [
          "Application Fulfilment"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "JWT token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "file to upload",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplicationFulfilment"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Application Fulfilment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationFulfilmentResponse"
                }
              }
            }
          },
          "default": {
            "description": "Standard Error Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/evidences/fulfilments/{appFulfilmentId}": {
      "get": {
        "operationId": "getApplicationFulfilment",
        "summary": "Get an evidence fulfilment checklist for the current application",
        "tags": [
          "Application Fulfilment"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "JWT token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "appFulfilmentId",
            "in": "path",
            "description": "Application Fulfilment Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ownerId",
            "in": "header",
            "description": "Owner ID (partyId)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Application Fulfilment Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetApplicationFulfilmentResponse"
                }
              }
            }
          },
          "default": {
            "description": "Standard Error Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/evidences/fulfilments/{appFulfilmentId}/appevidences": {
      "post": {
        "operationId": "submitApplicationEvidence",
        "summary": "Submit an evidences for a evidence type and requirement",
        "tags": [
          "Application Fulfilment"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "JWT token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "appFulfilmentId",
            "in": "path",
            "description": "App fulfilment id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ownersystemid",
            "in": "header",
            "description": "Owner System ID (Fabric Application ID)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "documentgroup",
            "in": "header",
            "description": "Document group (Journey ID can be the value of the document group in the format of journey-ownerSystemId-journeyID)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "File to upload",
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/ApplicationEvidence"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Submit evidence",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubmitApplicationEvidenceResponse"
                }
              }
            }
          },
          "default": {
            "description": "Standard Error Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/evidences/appevidences/{appEvidenceId}": {
      "post": {
        "operationId": "addApplicationEvidence",
        "summary": "Add a document to already submitted evidence using application evidence id",
        "tags": [
          "Application Evidence"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "JWT token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "appEvidenceId",
            "in": "path",
            "description": "App Evidence id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ownersystemid",
            "in": "header",
            "description": "Owner System ID (Fabric Application ID)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "documentgroup",
            "in": "header",
            "description": "Document group (Journey ID can be the value of the document group in the format of journey-ownerSystemId-journeyID)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "file to upload",
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/AddApplicationEvidenceBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Add evidence",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationEvidenceResponse"
                }
              }
            }
          },
          "default": {
            "description": "Standard Error Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/evidences/fulfilments/{appFulfilmentId}/appevidences/{appEvidenceId}": {
      "put": {
        "operationId": "useAcceptedEvidence",
        "summary": "Submit user agreement to use previously accepted evidence (Runtime)",
        "tags": [
          "Application Evidence"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "JWT token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "appEvidenceId",
            "in": "path",
            "description": "App Evidence id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "appFulfilmentId",
            "in": "path",
            "description": "App Fulfilment id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "User accepted evidence request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UseAcceptedEvidenceRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Add evidence",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UseAcceptedEvidenceResponse"
                }
              }
            }
          },
          "default": {
            "description": "Standard Error Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteApplicationEvidence",
        "summary": "Delete an application evidence using app fulfilment id and app evidence id",
        "tags": [
          "Application Evidence"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "JWT token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "appEvidenceId",
            "in": "path",
            "description": "App Evidence id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "appFulfilmentId",
            "in": "path",
            "description": "App Fulfilment id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Add evidence",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteApplicationEvidenceResponse"
                }
              }
            }
          },
          "default": {
            "description": "Standard Error Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "GetApplicationEvidences": {
        "properties": {
          "result": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetApplicationEvidence"
            }
          }
        }
      },
      "DeleteEvidencesOfApplicationResponse": {
        "properties": {
          "applicationId": {
            "type": "string",
            "example": "FGH9KWL",
            "description": "Application id"
          },
          "appFulfilmentIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "AF323232",
              "AF2752732",
              "AF34752"
            ]
          }
        }
      },
      "DeleteEvidencesOfOwnerResponse": {
        "properties": {
          "ownerId": {
            "type": "string",
            "example": 3456789,
            "description": "owner id"
          },
          "ownerType": {
            "type": "string",
            "example": "newProspect",
            "description": "owner type of the owner id provided"
          },
          "evidences": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EvidenceDetails"
            }
          }
        }
      },
      "EvidenceDetails": {
        "properties": {
          "evidenceId": {
            "type": "string",
            "example": "EV8273733",
            "description": "Evidence id"
          },
          "documentIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "32334343-34343-3434343",
              "4343434-4343434-343434"
            ]
          }
        }
      },
      "GetApplicationEvidence": {
        "properties": {
          "appEvidenceId": {
            "type": "string",
            "example": 3456789,
            "description": "owner type of the owner id provided"
          },
          "evidenceId": {
            "type": "string",
            "example": 2345676543,
            "description": "evidence id"
          },
          "evidenceType": {
            "type": "string",
            "example": "passport",
            "description": "evidence type"
          },
          "evidenceDescription": {
            "type": "string",
            "example": "Description",
            "description": "Description of the evidence"
          },
          "ownerId": {
            "type": "string",
            "example": 2345454,
            "description": "Party id"
          },
          "ownerType": {
            "type": "string",
            "example": "party",
            "description": "party/newProspect"
          },
          "status": {
            "type": "string",
            "example": "submitted",
            "description": "status of the evidence"
          },
          "documentIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "12345432-12341-1231",
              "234321-232123-123432"
            ]
          }
        }
      },
      "GetEvidences": {
        "properties": {
          "result": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetEvidence"
            }
          }
        }
      },
      "RequestOwnerId": {
        "properties": {
          "ownerId": {
            "type": "string",
            "example": 4434343,
            "description": "New Party id generated"
          }
        }
      },
      "GetEvidence": {
        "properties": {
          "evidenceId": {
            "type": "string",
            "example": "valid",
            "description": "Make the current status valid or invalid"
          },
          "evidenceType": {
            "type": "string",
            "example": true,
            "description": "Change the current reusable status"
          },
          "evidenceDescription": {
            "type": "string",
            "example": "document no longer valid",
            "description": "Reason for change"
          },
          "evidenceProperties": {
            "type": "object",
            "description": "evidence properties could either come from the extracted data once accepted, or from initial submission provided by end user",
            "example": {
              "statementYear": "2020",
              "statementMonth": "10"
            }
          },
          "ownerId": {
            "type": "string",
            "example": 23423,
            "description": "Party id"
          },
          "ownerType": {
            "type": "string",
            "example": "party",
            "description": "party or non party"
          },
          "expiryDate": {
            "type": "string",
            "example": "02/02/2022",
            "description": "Reason for change"
          },
          "isValid": {
            "type": "boolean",
            "example": true,
            "description": "Change the current reusable status"
          },
          "isReusable": {
            "type": "boolean",
            "example": true,
            "description": "Change the current reusable status"
          },
          "isExpired": {
            "type": "boolean",
            "example": true,
            "description": "Change the current reusable status"
          },
          "documentIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "123457-1234-12345-1234",
              "2345432-234543-2343"
            ]
          }
        }
      },
      "UpdateExistingEvidenceResponse": {
        "type": "object",
        "description": "Get application fulfilment response",
        "properties": {
          "evidenceId": {
            "type": "string",
            "example": 234567432,
            "description": "Evidence id"
          },
          "evidenceType": {
            "type": "string",
            "example": "passport",
            "description": "Change the current reusable status"
          },
          "isValid": {
            "type": "boolean",
            "example": true,
            "description": "Valid or not"
          },
          "isReusable": {
            "type": "boolean",
            "example": true,
            "description": "Is reusable or not"
          },
          "ownerId": {
            "type": "string",
            "example": 100256,
            "description": "ownerId"
          },
          "ownerType": {
            "type": "string",
            "example": "party",
            "description": "Owner Type"
          },
          "documentIds": {
            "type": "array",
            "description": "DocumentIds",
            "items": {
              "type": "string"
            },
            "example": [
              "10245-10256",
              "10245-102585"
            ]
          },
          "applicationEvidences": {
            "type": "array",
            "description": "list of Application Evidences",
            "items": {
              "$ref": "#/components/schemas/ApplicationEvidenceUpdate"
            }
          }
        }
      },
      "ApplicationEvidenceUpdate": {
        "type": "object",
        "description": "application evidence",
        "properties": {
          "appEvidenceId": {
            "type": "string",
            "example": "valid",
            "description": "Make the current status valid or invalid"
          },
          "evidenceId": {
            "type": "string",
            "example": true,
            "description": "Change the current reusable status"
          },
          "requirementKey": {
            "type": "string",
            "example": "document no longer valid",
            "description": "Reason for change"
          },
          "appFulfilmentId": {
            "type": "string",
            "example": true,
            "description": "Change the current reusable status"
          },
          "status": {
            "type": "string",
            "example": "document no longer valid",
            "description": "Reason for change"
          }
        }
      },
      "UpdateExistingEvidenceRequest": {
        "type": "object",
        "description": "Get application fulfilment response",
        "properties": {
          "validity": {
            "type": "string",
            "example": "valid",
            "description": "Make the current status valid or invalid"
          },
          "reuse": {
            "type": "boolean",
            "example": true,
            "description": "Change the current reusable status"
          },
          "comments": {
            "type": "string",
            "example": "document no longer valid",
            "description": "Reason for change"
          },
          "ownerId": {
            "type": "string",
            "example": 100256,
            "description": "ownerId"
          },
          "extractedData": {
            "type": "object",
            "description": "key-value pair of evidence properties.",
            "example": {
              "statementYear": "2022",
              "statementMonth": "03"
            }
          },
          "validateResult": {
            "type": "string",
            "description": "The application evidence status",
            "example": "accepted"
          },
          "expiryDate": {
            "description": "The application evidence expiry date.",
            "type": "string",
            "format": "date",
            "example": "2022-03-25T00:00:00.000Z"
          },
          "isReusable": {
            "description": "Application evidence reusable for future application",
            "type": "boolean",
            "example": true
          }
        }
      },
      "UseAcceptedEvidenceRequest": {
        "type": "object",
        "description": "Get application fulfilment response",
        "properties": {
          "action": {
            "type": "string",
            "example": "agree",
            "description": "agree/disagree"
          }
        }
      },
      "UseAcceptedEvidenceResponse": {
        "type": "object",
        "description": "Get application fulfilment response",
        "properties": {
          "appEvidenceId": {
            "type": "string",
            "example": 42343243243,
            "description": "generated application evidence id for the request"
          },
          "requirementKey": {
            "type": "string",
            "example": 234567654,
            "description": "requirement Key"
          },
          "status": {
            "type": "string",
            "example": 5543543,
            "description": "accepted/rejected"
          }
        }
      },
      "GetApplicationFulfilmentResponse": {
        "type": "object",
        "description": "Get application fulfilment response",
        "properties": {
          "appFulfilmentId": {
            "type": "string",
            "example": 42343243243,
            "description": "generated application fulfilment id for the request"
          },
          "applicationId": {
            "type": "string",
            "example": "HL49BWG",
            "description": "application id"
          },
          "ownerId": {
            "type": "string",
            "example": 5543543,
            "description": "Temp id for new applicant/ party id for existing customer"
          },
          "requirementFulfilments": {
            "type": "array",
            "description": "list of requirement Fulfilments for the current owner",
            "items": {
              "$ref": "#/components/schemas/RequirementFulfilments"
            }
          }
        }
      },
      "RequirementFulfilments": {
        "type": "object",
        "properties": {
          "requirementKey": {
            "type": "string",
            "example": "id-for-primary"
          },
          "requirementName": {
            "type": "string",
            "example": "Proof of ID for the primary applicant"
          },
          "requirementDescription": {
            "type": "string",
            "example": "Requires 2 evidences from proof of ID category. Types are either passport or Medicare card"
          },
          "evidenceCategory": {
            "type": "string",
            "description": "evidence category",
            "example": "ProofOfIdentity"
          },
          "properties": {
            "type": "object",
            "description": "evidence properties could either come from the extracted data once accepted, or from initial submission provided by end user",
            "example": {
              "statementYear": "2020",
              "statementMonth": "10"
            }
          },
          "validEvidenceTypes": {
            "type": "array",
            "description": "list of requirements for the current owner",
            "example": [
              "Passport"
            ],
            "items": {
              "type": "string"
            }
          },
          "applicationEvidences": {
            "type": "array",
            "description": "list of Application Evidences",
            "items": {
              "$ref": "#/components/schemas/ApplicationEvidenceFulfilment"
            }
          }
        }
      },
      "ApplicationEvidenceFulfilment": {
        "type": "object",
        "required": [
          "appEvidenceId"
        ],
        "properties": {
          "appEvidenceId": {
            "type": "string",
            "description": "application evidence id",
            "example": 3423553
          },
          "evidenceId": {
            "type": "string",
            "description": "evidence id",
            "example": "42533433"
          },
          "documents": {
            "type": "array",
            "description": "one evidence can have multiple documents, front side and back side images of the driver license being one evidence",
            "items": {
              "$ref": "#/components/schemas/DocumentInfo"
            }
          },
          "evidenceType": {
            "type": "string",
            "description": "Evidence type",
            "example": "passport"
          },
          "evidenceDescription": {
            "type": "string",
            "description": "This is the bio page of the passport.",
            "example": "passport"
          },
          "evidenceCategory": {
            "type": "string",
            "description": "evidence category",
            "example": "ProofOfIdentity"
          },
          "evidenceExpiryDate": {
            "type": "string",
            "description": "evidence expiry date",
            "format": "date",
            "example": "19/08/2021"
          },
          "evidenceIsValid": {
            "type": "boolean",
            "example": true,
            "description": "if the evidence is valid or not"
          },
          "evidenceProperties": {
            "type": "object",
            "description": "evidence properties could either come from the extracted data once accepted, or from initial submission provided by end user",
            "example": {
              "statementYear": "2020",
              "statementMonth": "10"
            }
          },
          "status": {
            "type": "string",
            "description": "status",
            "example": "submitted"
          },
          "comments": {
            "type": "string",
            "description": "comments",
            "example": "submitted"
          }
        }
      },
      "DeleteApplicationEvidenceResponse": {
        "type": "object",
        "properties": {
          "appEvidenceId": {
            "type": "string",
            "example": 33223343333,
            "description": "Current application id or journey id"
          },
          "evidenceId": {
            "type": "string",
            "example": 5543543,
            "description": "Evidence if"
          },
          "evidenceType": {
            "type": "string",
            "example": "passport",
            "description": "Evidence type"
          }
        }
      },
      "ApplicationFulfilment": {
        "type": "object",
        "properties": {
          "applicationId": {
            "type": "string",
            "example": "JFHCJ4M",
            "description": "Current application id or journey id"
          },
          "ownerId": {
            "type": "string",
            "example": 5543543,
            "description": "Temp id for new applicant/ party id for existing customer"
          },
          "ownerType": {
            "type": "string",
            "example": "newProspect",
            "description": "owner type of the owner id provided"
          },
          "descritpion": {
            "type": "string",
            "example": "Lending application for individual requires 2 proof of ID and 1 proof of address from primary applicant, 3 proof of  tax statement from the secondary applicant",
            "description": "description for the application fulfilment"
          },
          "requirements": {
            "type": "array",
            "description": "list of requirements for the current owner",
            "items": {
              "$ref": "#/components/schemas/Requirements"
            }
          }
        }
      },
      "Requirements": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "example": "id-for-primary"
          },
          "name": {
            "type": "string",
            "example": "Proof of ID for the primary applicant"
          },
          "description": {
            "type": "string",
            "example": "Requires 2 evidences from proof of ID category. Types are either passport or Medicare card"
          },
          "evidenceCategory": {
            "type": "string",
            "example": "ProofOfAddress",
            "description": "evidence category"
          },
          "validEvidenceTypes": {
            "type": "array",
            "example": [
              "Passport"
            ],
            "description": "list of requirements for the current owner",
            "items": {
              "type": "string"
            }
          },
          "properties": {
            "type": "object",
            "description": "Properties of a requirement",
            "example": {
              "isRequired": true
            }
          }
        }
      },
      "ApplicationFulfilmentResponse": {
        "type": "object",
        "description": "Create application fulfilment response.",
        "properties": {
          "applicationId": {
            "type": "string",
            "example": "JFHCJ4M",
            "description": "application id"
          },
          "appFulfilmentId": {
            "type": "string",
            "example": 42343243243,
            "description": "generated application fulfilment id for the request"
          },
          "ownerId": {
            "type": "string",
            "example": 5543543,
            "description": "Temp id for new applicant/ party id for existing customer"
          },
          "ownerType": {
            "type": "string",
            "example": "newProspect",
            "description": "owner type of the owner id provided"
          }
        }
      },
      "DeleteDocumentResponse": {
        "type": "object",
        "description": "Delete document response.",
        "properties": {
          "documentId": {
            "type": "string",
            "example": "30588fe7-8885-4c81-93a2-d4f9c10d655e"
          },
          "ownerSystemId": {
            "type": "string",
            "example": "corporate-los"
          },
          "channelId": {
            "type": "string",
            "example": "infinity"
          }
        }
      },
      "DeleteDocumentResponses": {
        "type": "array",
        "description": "Delete documents",
        "items": {
          "$ref": "#/components/schemas/DeleteDocumentResponse"
        }
      },
      "UpdateDocumentResponse": {
        "type": "object",
        "description": "Update document response.",
        "properties": {
          "documentId": {
            "type": "string",
            "example": "30588fe7-8885-4c81-93a2-d4f9c10d655e"
          },
          "ownerSystemId": {
            "type": "string",
            "example": "corporate-los"
          },
          "channelId": {
            "type": "string",
            "example": "infinity"
          }
        }
      },
      "DocumentDetails": {
        "type": "object",
        "required": [
          "searchMetadata"
        ],
        "properties": {
          "searchMetadata": {
            "type": "object",
            "description": "key-value pair search Metadata defined by the owner system that attaches to this document. Can be used to search the document later [Max 6 key value pair can be provided].",
            "example": {
              "transactionID": "ABCDE",
              "documentType": "attachment",
              "attachmentType": "passport",
              "ownerID": "john.smith"
            }
          },
          "tempSharedFileLocation": {
            "type": "string",
            "description": "A location where the file is temporarly stored to share across. This is mainly to support uploading a file through the event stream by another Microservice like Receipting MS. You don't need this field when uploading directly through documentFile binary.",
            "example": "/receipt-ms/receipt-22.pdf"
          },
          "documentIdClonedFrom": {
            "type": "string",
            "description": "Existing document ID of the document file to clone instead of providing the binary file data.",
            "example": "7ef0afe0-274c-4c6b-aec2-01a5ab6d7746"
          },
          "mimeType": {
            "type": "string",
            "description": "The mime type of the file. This is mainly to support uploading a file through the event stream by another Microservice like Receipting MS. You don't need this field when uploading directly through documentFile binary.",
            "example": "application/pdf"
          }
        }
      },
      "DocumentGeneration": {
        "type": "object",
        "description": "To generate a document please provide the document generation details instead of the actual binary file (documentFile).",
        "required": [
          "generationDetails"
        ],
        "properties": {
          "generationDetails": {
            "$ref": "#/components/schemas/GenerationDetails"
          }
        }
      },
      "GenerationDetails": {
        "type": "object",
        "required": [
          "templateName",
          "data"
        ],
        "properties": {
          "data": {
            "type": "string",
            "description": "Base64 data payload",
            "example": "PHBkZi1kYXRhPgogICAgICAgICAgICA8ZmFjaWxpdHktY29kZT5JTlIgNTAwMDAwMDA8L2ZhY2lsaXR5LWNvZGU+CiAgICAgICAgICAgIDxmYWNpbGl0eS1uYW1lPnRlcm0gbG9hbiBmYWNpbGl0eTwvZmFjaWxpdHktbmFtZT4KICAgICAgICAgICAgPGRhdGU+MjgvMDgvMjAyMDwvZGF0ZT4KICAgICAgICAgICAgPHBhcnR5PgogICAgICAgICAgICA8Ym9ycm93ZXI+MDg5ODMzNjA8L2JvcnJvd2VyPgogICAgICAgICAgICA8bGVuZGVyPkpvaG4gU21pdGg8L2xlbmRlcj4KICAgICAgICAgICAgPGd1YXJhbnRvcj5EYW4gTGl1PC9ndWFyYW50b3I+CiAgICAgICAgICAgIDxwcm9wZXJ0eT54eDwvcHJvcGVydHk+CiAgICAgICAgICAgIDwvcGFydHk+CiAgICAgICAgICAgIDxmYWNpbGl0eT4KICAgICAgICAgICAgPG5hbWU+VGVybSBMb2FuIEZhY2lsaXR5PC9uYW1lPgogICAgICAgICAgICA8Y3VycmVuY3k+VVNEPC9jdXJyZW5jeT4KICAgICAgICAgICAgPHByaW5jaXBhbC1hbW91bnQ+MTAwMDAwLjAwPC9wcmluY2lwYWwtYW1vdW50PgogICAgICAgICAgICA8dXNhZ2U+PC91c2FnZT4KICAgICAgICAgICAgPGNvbW1pdG1lbnQtcGVyaW9kPkZyb20gdGhlIGRhdGUgb2YgdGhlIGZhY2lsaXR5IGFncmVlbWVudCB1bnRpbCB0aCBlZGF0ZSBmYWxsaW5nIG9uZSBtb250aCBiZWZvcmUgRmluYWwgUmVwYXltZW50IERhdGUuPC9jb21taXRtZW50LXBlcmlvZD4KICAgICAgICAgICAgPGRyYXdpbmctb2YtdGhlLWxvYW4+PC9kcmF3aW5nLW9mLXRoZS1sb2FuPgogICAgICAgICAgICA8ZmluYWwtcmVwYXltZW50LWRhdGU+PC9maW5hbC1yZXBheW1lbnQtZGF0ZT4KICAgICAgICAgICAgPHJlcGF5bWVudD48L3JlcGF5bWVudD4KICAgICAgICAgICAgPC9mYWNpbGl0eT4KICAgICAgICAgICAgPC9wZGYtZGF0YT4="
          },
          "templateName": {
            "type": "string",
            "description": "The generation template name.",
            "example": "receipt-sample"
          }
        }
      },
      "DocumentUpload": {
        "type": "object",
        "required": [
          "documentDetails"
        ],
        "properties": {
          "documentDetails": {
            "$ref": "#/components/schemas/DocumentDetails"
          },
          "generationDetails": {
            "$ref": "#/components/schemas/GenerationDetails"
          },
          "documentFile": {
            "type": "string",
            "format": "binary",
            "description": "The actual file binary. In case file is uploaded through the temporary shared location specified in the documentDetails, this field is not required."
          }
        }
      },
      "ApplicationEvidence": {
        "type": "object",
        "properties": {
          "evidenceDetail": {
            "$ref": "#/components/schemas/EvidenceDetail"
          },
          "fileContent": {
            "type": "string",
            "format": "binary",
            "description": "The actual file binary. In case file is uploaded through the temporary shared location specified in the documentDetails, this field is not required."
          }
        }
      },
      "AddApplicationEvidenceBody": {
        "type": "object",
        "properties": {
          "fileContent": {
            "type": "string",
            "format": "binary",
            "description": "The actual file binary. In case file is uploaded through the temporary shared location specified in the documentDetails, this field is not required."
          }
        }
      },
      "EvidenceDetail": {
        "type": "object",
        "properties": {
          "ownerId": {
            "type": "string",
            "description": "Party id",
            "example": 3432233
          },
          "properties": {
            "type": "object",
            "description": "This is optional evidence properties values end user can provide",
            "example": {
              "firstName": "John",
              "lastName": "Smith"
            }
          },
          "evidenceType": {
            "type": "string",
            "description": "Evidence type.",
            "example": "passport"
          },
          "description": {
            "type": "string",
            "description": "Description of this evidence"
          },
          "forRequirements": {
            "type": "array",
            "description": "which requirement(s) ID this evidence to fulfill",
            "items": {
              "type": "string"
            },
            "example": [
              "id-for-passport",
              "address-for-primary"
            ]
          }
        }
      },
      "DocumentUpdate": {
        "type": "object",
        "required": [
          "updateDetails"
        ],
        "properties": {
          "updateDetails": {
            "$ref": "#/components/schemas/DocumentUpdateDetails"
          }
        }
      },
      "DocumentUpdateDetails": {
        "type": "object",
        "required": [
          "documentId",
          "action",
          "newOwnerSystemId",
          "newDocumentGroup",
          "searchMetadata"
        ],
        "properties": {
          "searchMetadata": {
            "type": "object",
            "description": "key-value pair search Metadata defined by the owner system that attaches to this document. Can be used to search the document later [Max 6 key value pair can be provided].",
            "example": {
              "transactionID": "ABCDE",
              "documentType": "attachment",
              "attachmentType": "passport",
              "ownerID": "john.smith"
            }
          },
          "action": {
            "type": "string",
            "description": "The action key. Currently supported actions are DELIVERY, ADD_METADATA and UPDATE_METADATA.",
            "example": "DELIVERY"
          },
          "documentId": {
            "type": "string",
            "description": "Document Id.",
            "example": "30588fe7-8885-4c81-93a2-d4f9c10d655e"
          },
          "newOwnerSystemId": {
            "type": "string",
            "description": "Update this document with the new ownerSystemId. This input is requited for DELIVERY action only.",
            "example": "party"
          },
          "newDocumentGroup": {
            "type": "string",
            "description": "Update the document with the newDocumentGroup so you can access it after the delivery action is completed. This input is requited for DELIVERY action only.",
            "example": "journey-ownerSystemId-journeyID"
          }
        }
      },
      "UpdateEvidenceDetails": {
        "type": "object",
        "required": [
          "validateResult",
          "isReusable"
        ],
        "properties": {
          "extractedData": {
            "type": "object",
            "description": "key-value pair of evidence properties.",
            "example": {
              "statementYear": "2022",
              "statementMonth": "03"
            }
          },
          "validateResult": {
            "type": "string",
            "description": "The application evidence status",
            "example": "accepted"
          },
          "comments": {
            "type": "string",
            "description": "The comments.",
            "example": "Upload image is too blury, please resubmit;"
          },
          "expiryDate": {
            "description": "The application evidence expiry date.",
            "type": "string",
            "format": "date",
            "example": "2022-03-25T00:00:00.000Z"
          },
          "isReusable": {
            "description": "Application evidence reusable for future application",
            "type": "boolean",
            "example": true
          }
        }
      },
      "SearchDocumentMetadata": {
        "description": "document metadata object",
        "properties": {
          "documentId": {
            "type": "string",
            "example": "30588fe7-8885-4c81-93a2-d4f9c10d655e"
          },
          "fileMetadata": {
            "description": "The file metadata is the file details such as name and size.",
            "type": "object",
            "example": {
              "fileName": "sling.PNG",
              "fileSize": 43522
            }
          },
          "searchMetadata": {
            "description": "key-value pair search Metadata defined by the owner system that attaches to this document.",
            "type": "object",
            "example": {
              "transactionID": "ABCDE",
              "documentType": "attachment",
              "attachmentType": "passport",
              "ownerID": "john.smith"
            }
          }
        },
        "additionalProperties": {
          "type": "string"
        }
      },
      "SearchDocumentResponse": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/SearchDocumentMetadata"
        },
        "example": [
          {
            "documentId": "24ef8b5a-b991-4a3c-bc6a-d089589ec283",
            "fileMetadata": {
              "fileName": "efs.pdf",
              "fileSize": 43522
            },
            "searchMetadata": {
              "attachmentType": "passport",
              "documentType": "attachment",
              "ownerId": "john.smith",
              "transactionId": "ABCDE"
            }
          },
          {
            "documentId": "24ef8b5a-b991-4a3c-bc6a-d089589ec284",
            "fileMetadata": {
              "fileName": "test.pdf",
              "fileSize": 123522
            },
            "searchMetadata": {
              "attachmentType": "driverLicenseFront",
              "documentType": "attachment",
              "ownerId": "john.smith",
              "transactionId": "ABCDE"
            }
          },
          {
            "documentId": "24ef8b5a-b991-4a3c-bc6a-d089589ec285",
            "searchMetadata": {
              "attachmentType": "driverLicenseBack",
              "documentType": "attachment",
              "ownerId": "john.smith",
              "transactionId": "ABCDE"
            }
          }
        ]
      },
      "EvidenceCategory": {
        "type": "object",
        "required": [
          "categoryId",
          "name"
        ],
        "properties": {
          "categoryId": {
            "type": "string",
            "description": "Evidence category id (id, address).",
            "example": "id"
          },
          "name": {
            "type": "string",
            "description": "Evidence category name (Proof of ID, Proof of address).",
            "example": "Proof of ID"
          },
          "description": {
            "description": "Evidence category description.",
            "type": "string"
          }
        }
      },
      "EvidenceType": {
        "type": "object",
        "required": [
          "typeId",
          "name"
        ],
        "properties": {
          "typeId": {
            "type": "string",
            "description": "Evidence type id (passport, dl-au-nsw).",
            "example": "passport"
          },
          "name": {
            "type": "string",
            "description": "Evidence type name (Passport, Driver license).",
            "example": "Passport"
          },
          "description": {
            "description": "Evidence type description.",
            "type": "string"
          },
          "defaultValidPeriod": {
            "description": "Y/M/D - Years, Months, Days",
            "type": "string"
          },
          "allowMultiple": {
            "description": "Allow multiple.",
            "type": "boolean"
          },
          "categories": {
            "type": "array",
            "description": "Set of evidence categories",
            "example": [
              "id",
              "address"
            ],
            "items": {
              "type": "string"
            }
          },
          "properties": {
            "type": "array",
            "description": "Properties to be submitted during evidence submission",
            "items": {
              "$ref": "#/components/schemas/Property"
            }
          }
        }
      },
      "Property": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "example": "dob"
          },
          "description": {
            "type": "string",
            "example": "Date of birth"
          },
          "isMandatory": {
            "type": "boolean",
            "example": true
          }
        }
      },
      "EvidencesCategories": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/EvidenceCategory"
        }
      },
      "EvidenceTypes": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/EvidenceType"
        }
      },
      "DocumentInfo": {
        "type": "object",
        "required": [
          "documentId",
          "documentName",
          "ownerSystemId",
          "channelId",
          "fileName",
          "mimeType",
          "fileSize",
          "filePath",
          "searchMetadata",
          "documentGroup",
          "createdDate",
          "createdBy"
        ],
        "properties": {
          "documentId": {
            "type": "string",
            "example": "30588fe7-8885-4c81-93a2-d4f9c10d655e"
          },
          "ownerSystemId": {
            "description": "Owner System ID (Fabric Application ID)",
            "type": "string",
            "example": "corporate-los"
          },
          "channelId": {
            "description": "The document channel id. Different channels could potentially have different behaviours.",
            "type": "string",
            "example": "infinity"
          },
          "fileName": {
            "description": "File name",
            "type": "string",
            "example": "passport.jpg"
          },
          "mimeType": {
            "description": "File mime type",
            "type": "string",
            "example": "text/plain"
          },
          "fileSize": {
            "description": "File size in bytes.",
            "type": "integer",
            "format": "int64",
            "example": 1020
          },
          "filePath": {
            "description": "File path to the real file.",
            "type": "string",
            "example": "/document-base/25/9a/f5661bfd78a42f9444a0a48234f94e71113b"
          },
          "searchMetadata": {
            "description": "searchMetadata from the owner system that attaches to this document.",
            "type": "object",
            "example": {
              "transactionID": "ABCDE",
              "documentType": "attachment",
              "attachmentType": "passport",
              "ownerID": "john.smith"
            }
          },
          "documentGroup": {
            "description": "Document group (Journey ID can be the value of the document group in the format of journey-ownerSystemId-journeyID)",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "createdDate": {
            "description": "document created date",
            "type": "string",
            "format": "date",
            "example": "2020-06-29 07:08:27.0"
          },
          "updatedDate": {
            "description": "document updated date (not in use)",
            "type": "string",
            "format": "date",
            "example": "2020-06-29 07:10:27.0"
          },
          "createdBy": {
            "description": "which user id created the document info. (not in use)",
            "type": "string",
            "example": "owner"
          },
          "updatedBy": {
            "description": "which user id last updated the document info. (not in use)",
            "type": "string",
            "example": "owner"
          }
        }
      },
      "OwnerSystem": {
        "type": "object",
        "required": [
          "ownerSystemId",
          "ownerSystemName",
          "description"
        ],
        "properties": {
          "ownerSystemId": {
            "description": "Owner System ID (Fabric Application ID)",
            "type": "string",
            "example": "corporate-los"
          },
          "ownerSystemName": {
            "description": "Owner system name",
            "type": "string"
          },
          "description": {
            "description": "Owner system description.",
            "type": "string"
          }
        }
      },
      "DownloadDocumentResponse": {
        "type": "object"
      },
      "DocumentGenerationResponse": {
        "type": "object"
      },
      "InDevelopResponse": {
        "properties": {
          "message": {
            "type": "string",
            "example": "This feature is under development"
          }
        }
      },
      "UploadDocumentResponse": {
        "properties": {
          "documentId": {
            "type": "string",
            "example": "30588fe7-8885-4c81-93a2-d4f9c10d655e"
          },
          "ownerSystemId": {
            "type": "string",
            "example": "corporate-los"
          },
          "channelId": {
            "type": "string",
            "example": "infinity"
          }
        }
      },
      "SubmitApplicationEvidenceResponse": {
        "properties": {
          "result": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApplicationEvidenceResponse"
            }
          }
        }
      },
      "ApplicationEvidenceResponse": {
        "properties": {
          "documentId": {
            "type": "string",
            "description": "Document Id",
            "example": "ad01c70f-2c5d-48fe-a53b-9be73b6fa2a1"
          },
          "appEvidenceId": {
            "type": "string",
            "description": "Application evidence id",
            "example": "432323433322"
          },
          "evidenceType": {
            "type": "string",
            "description": "Evidence type",
            "example": "passport"
          },
          "requirementKey": {
            "type": "string",
            "description": "Requirement id",
            "example": "id-for-primary"
          },
          "status": {
            "type": "string",
            "description": "Status",
            "example": "submitted"
          },
          "evidenceId": {
            "type": "string",
            "description": "Evidence id",
            "example": 234565432
          },
          "ownerId": {
            "type": "string",
            "description": "Owner id",
            "example": 55353
          }
        }
      },
      "UpdateApplicationEvidenceResponse": {
        "properties": {
          "appEvidenceId": {
            "type": "string",
            "description": "Application evidence id",
            "example": "432323433322"
          },
          "evidenceType": {
            "type": "string",
            "description": "Evidence type",
            "example": "passport"
          },
          "requirementId": {
            "type": "string",
            "description": "Requirement id",
            "example": "id-for-primary"
          },
          "status": {
            "type": "string",
            "description": "Status",
            "example": "submitted"
          },
          "evidenceId": {
            "type": "string",
            "description": "Evidence id",
            "example": 234565432
          }
        }
      },
      "StandardErrorSchema": {
        "type": "object",
        "properties": {
          "code": {
            "description": "Error code",
            "type": "string",
            "example": ""
          },
          "message": {
            "description": "Error message",
            "type": "string",
            "example": "Invocation of function implementation com.temenos.microservice.document.function.UploadDocumentImpl failed"
          }
        }
      },
      "StandardErrorResponse": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/StandardErrorSchema"
        }
      },
      "NoDocumentFoundErrorSchema": {
        "type": "object",
        "properties": {
          "code": {
            "description": "Error code",
            "type": "string",
            "example": "NO_DOCUMENT_FOUND"
          },
          "message": {
            "description": "Error message",
            "type": "string",
            "example": "71188dc4-ca4e-49eb-95d4-246167f5712d document not found."
          }
        }
      },
      "NoDocumentFoundErrorResponse": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/NoDocumentFoundErrorSchema"
        }
      },
      "FileSizeLimitErrorSchema": {
        "type": "object",
        "properties": {
          "code": {
            "description": "Error code",
            "type": "string",
            "example": "EXCEED_MAX_FILE_SIZE_LIMIT"
          },
          "message": {
            "type": "string",
            "example": "Exceed max file size limit of filesize MB."
          }
        }
      },
      "FileSizeLimitErrorResponse": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/FileSizeLimitErrorSchema"
        }
      },
      "FileHasVirusErrorSchema": {
        "type": "object",
        "properties": {
          "code": {
            "description": "Error code",
            "type": "string",
            "example": "FILE_HAS_VIRUS"
          },
          "message": {
            "type": "string",
            "example": "The file is rejected, it might contain virus."
          }
        }
      },
      "FileHasVirusErrorResponse": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/FileHasVirusErrorSchema"
        }
      },
      "InvalidSearchErrorSchema": {
        "type": "object",
        "properties": {
          "code": {
            "description": "Error code",
            "type": "string",
            "example": "INVALID_SEARCH"
          },
          "message": {
            "description": "Error message",
            "type": "string",
            "example": "Unable to search document. Search metadata is not valid JSON string."
          }
        }
      },
      "InvalidSearchErrorResponse": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/InvalidSearchErrorSchema"
        }
      }
    }
  }
}