
  "openapi": "3.0.0",
  "info": {
    "title": "Originations Data Storage MicroService APIs",
    "description": "Originations Data Storage MicroService APIs",
    "version": "v0.9.0",
    "contact": {
      "email": "shyamjith@temenos.com"
    }
  },
  "externalDocs": {
    "url": "https://docs.temenos.com/docs/Solutions/Infinity/Microservices/Modules/Microservices/Originations Data Storage/Misc/Overview.html",
    "description": "Find more information here"
  },
  "servers": [
    {
      "url": "http://localhost:8010/ms-storage-api/api/v0.9.0"
    }
  ],
  "paths": {
    "/origination/storage/entityDefinitions/": {
      "post": {
        "operationId": "createEntityDefinition",
        "description": "Creates a new version of an Entity Definition",
        "summary": "Creates a new Entity Definition",
        "tags": [
          "EntityDefinition"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EntityDefinition"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Status for the creation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardEntityWithIdResponse"
                }
              }
            }
          },
          "default": {
            "description": "Get the error message",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateEntityDefinitionByCode",
        "description": "Updates an Entity Definition by code",
        "summary": "Updates an Entity Definition by code",
        "tags": [
          "EntityDefinition"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "entityDefCode",
            "description": "Entity Definition Code",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "version",
            "description": "Entity Definition Version, i.e. 12 or latest if not specified",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EntityDefinition"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Status for the update operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardEntityWithCodeResponse"
                }
              }
            }
          },
          "default": {
            "description": "Get the error message",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "getEntityDefinitionByCode",
        "summary": "Retrieves the latest version of an Entity Definition based on code",
        "description": "Returns an Entity Definition based on code",
        "tags": [
          "EntityDefinition"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "entityDefCode",
            "description": "Entity Definition Code",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "version",
            "description": "Entity Definition Version, i.e. 12 or latest if not specified",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Status for the retrieval operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EntityDefinition"
                }
              }
            }
          },
          "default": {
            "description": "Get the error message",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteEntityDefinitionByCode",
        "summary": "Deletes an Entity Definition based on code if there are no associated Entity Items",
        "tags": [
          "EntityDefinition"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "entityDefCode",
            "description": "Entity Definition Code",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "version",
            "description": "Entity Definition Version, i.e. 12 or latest if not specified",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The Entity Definition was deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardEntityWithCodeResponse"
                }
              }
            }
          },
          "default": {
            "description": "Get the error message",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/origination/storage/entityDefinitions/{entityDefId}/": {
      "put": {
        "operationId": "updateEntityDefinitionById",
        "description": "Updates an Entity Definition",
        "summary": "Updates an Entity Definition by id",
        "tags": [
          "EntityDefinition"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "entityDefId",
            "description": "Entity Definition Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EntityDefinition"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Status for the update operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardEntityWithIdResponse"
                }
              }
            }
          },
          "default": {
            "description": "Get the error message",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "getEntityDefinitionById",
        "summary": "Retrieves the latest version of an Entity Definition by id",
        "description": "Returns an Entity Definition by id",
        "tags": [
          "EntityDefinition"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "entityDefId",
            "description": "Entity Definition Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Status for the retrieval operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EntityDefinition"
                }
              }
            }
          },
          "default": {
            "description": "Get the error message",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteEntityDefinitionById",
        "summary": "Deletes an Entity Definition based on id if there are no associated Entity Items",
        "tags": [
          "EntityDefinition"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "entityDefId",
            "description": "Entity Definition Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The Entity Definition was deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardEntityWithIdResponse"
                }
              }
            }
          },
          "default": {
            "description": "Get the error message",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/origination/storage/entityItems/": {
      "post": {
        "operationId": "createEntityItem",
        "description": "Creates a new version of an Entity Item",
        "summary": "Creates a new Entity Item",
        "tags": [
          "EntityItem"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EntityItems"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Status for the creation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardEntitiesWithKeyIdResponse"
                }
              }
            }
          },
          "default": {
            "description": "Get the error message",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/origination/storage/entityItemGroup/{key}": {
      "get": {
        "operationId": "getEntityItemGroupByKey",
        "description": "Retrieves an Entity Item Group by key",
        "tags": [
          "EntityGroup"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "key",
            "description": "Entity Item Group Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Status for the retrieval operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EntityItemGroup"
                }
              }
            }
          },
          "default": {
            "description": "Get the error message",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/origination/storage/entityDefinitions/{entityDefCode}/entityItems/": {
      "get": {
        "operationId": "getEntityItems",
        "summary": "Retrieves the Entity Items based on Definition, Keys, Name, Type & (optional) Version.",
        "description": "Valid parameters are [[key1, key2, ...]], [[key1, key2, ...], name], [[key1, key2, ...], name, type], [[key1, key2, ...], name, type, version]",
        "tags": [
          "EntityItem"
        ],
        "parameters": [
          {
            "name": "entityDefCode",
            "in": "path",
            "description": "Entity Definition Code",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "key",
            "in": "query",
            "description": "Entity Item Keys",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "name",
            "in": "query",
            "description": "Entity Item Name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "Entity Item Type, i.e. JSON",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entityItemDefinitionName",
            "in": "query",
            "description": "Entity Item Definition Name",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "version",
            "in": "query",
            "description": "Entity Item Version, i.e. 12 or latest if not specified",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "description": "Start date",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "End date",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Status for the retrieval operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EntityItemsResponse"
                }
              }
            }
          },
          "default": {
            "description": "Get the error message",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteEntityItems",
        "description": "Deletes an Entity Items based on Definition, Key, Name, Type & (optional) Version.",
        "summary": "Valid parameters are [key], [key, name], [key, name, type], [key, name, type, version]",
        "tags": [
          "EntityItem"
        ],
        "parameters": [
          {
            "name": "entityDefCode",
            "in": "path",
            "description": "Entity Definition Code",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "key",
            "in": "query",
            "description": "Entity Item Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "query",
            "description": "Entity Item Name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "Entity Item Type, i.e. JSON",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "deletedReason",
            "in": "query",
            "description": "Reason for the deletion",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "ABANDONED",
                "COMPLETED",
                "PURGED"
              ]
            }
          },
          {
            "name": "billingRef",
            "in": "query",
            "description": "Billing Reference",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "version",
            "in": "query",
            "description": "Entity Item Version, i.e. 12 or latest if not specified",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The Entity Item was deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardResponse"
                }
              }
            }
          },
          "default": {
            "description": "Get the error message",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/origination/storage/entityItems/{entityItemId}/": {
      "put": {
        "operationId": "updateEntityItemById",
        "description": "Updates an Entity Item by id",
        "summary": "Updates an Entity Item by id",
        "tags": [
          "EntityItem"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "entityItemId",
            "description": "Entity Item Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EntityItem"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Status for the update operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardEntityWithIdResponse"
                }
              }
            }
          },
          "default": {
            "description": "Get the error message",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "getEntityItemById",
        "summary": "Retrieves the an Entity Item by id",
        "description": "Returns an Entity Item by id",
        "tags": [
          "EntityItem"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "entityItemId",
            "description": "Entity Item Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Status for the retrieval operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EntityItem"
                }
              }
            }
          },
          "default": {
            "description": "Get the error message",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteEntityItemById",
        "summary": "Deletes an Entity Item by id",
        "tags": [
          "EntityItem"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "entityItemId",
            "description": "Entity Item Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "deletedReason",
            "in": "query",
            "description": "Reason for the deletion",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "ABANDONED",
                "COMPLETED",
                "PURGED"
              ]
            }
          },
          {
            "name": "billingRef",
            "in": "query",
            "description": "Billing Reference",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The Entity Item was deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardEntityWithIdResponse"
                }
              }
            }
          },
          "default": {
            "description": "Get the error message",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/origination/storage/entityItems/{entityItemId}/entry/": {
      "put": {
        "operationId": "updateEntityItemEntry",
        "description": "Updates an Entity Item Entry",
        "summary": "Updates an Entity Item Entry",
        "tags": [
          "EntityItem"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "entityItemId",
            "description": "Entity Definition Code",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "The entry for the Entity Item",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EntityItemEntry"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Status for the update",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardEntityWithIdResponse"
                }
              }
            }
          },
          "default": {
            "description": "Get the error message",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/origination/storage/entityItems/searchExtract": {
      "get": {
        "operationId": "getSearchExtractData",
        "summary": "Retrieves the Entity Item extract data based on a search criteria.",
        "description": "Retrieves the Entity Item extract data based on a search criteria.",
        "tags": [
          "EntityItem"
        ],
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "description": "Extract Search JSON query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Status for the retrieval operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchExtractsResponse"
                }
              }
            }
          },
          "default": {
            "description": "Get the error message",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/origination/storage/maintenance/entityItems": {
      "put": {
        "operationId": "updateEntityItemsToLatest",
        "description": "Updates all entityItems for a given entity Definition to the latest version.",
        "summary": "Updates all entityItems for a given entity Definition to the latest version.",
        "tags": [
          "Maintenance"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "entityDefCode",
            "description": "Entity Definition Code",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Entity Items have been successfully updated to the latest Definition version.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardEntityWithCodeResponse"
                }
              }
            }
          },
          "default": {
            "description": "Get the error message",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "purgeEntityItems",
        "description": "Deletes an Entity Items based on EntityDefCode, AnchorPoint & purgeDuration.",
        "summary": "Deletes an Entity Items based on EntityDefCode, AnchorPoint & purgeDuration.",
        "tags": [
          "Maintenance"
        ],
        "parameters": [
          {
            "name": "entityDefCode",
            "in": "query",
            "description": "Entity Definition Code",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "purgeAnchorPoint",
            "in": "query",
            "description": "Entity Item purgeAnchorPoint",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "createdDate",
                "updatedDate"
              ]
            }
          },
          {
            "name": "purgeDuration",
            "in": "query",
            "description": "Entity Item purgeDuration",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "deletedReason",
            "in": "query",
            "description": "Reason for the deletion",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "ABANDONED",
                "COMPLETED",
                "PURGED"
              ]
            }
          },
          {
            "name": "billingRef",
            "in": "query",
            "description": "Billing Reference",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "key",
            "in": "query",
            "description": "Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The Entity Item was deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardResponse"
                }
              }
            }
          },
          "default": {
            "description": "Get the error message",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/origination/storage/maintenance/processors/": {
      "delete": {
        "operationId": "purgeProcessor",
        "description": "Iterates through all Entity Definitions deleting Entity Items that are ready to be purged.",
        "summary": "Iterates through all Entity Definitions deleting Entity Items that are ready to be purged.",
        "tags": [
          "Maintenance"
        ],
        "responses": {
          "200": {
            "description": "The Entity Item Purge Processor was successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardResponse"
                }
              }
            }
          },
          "default": {
            "description": "Get the error message",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "reminderProcessor",
        "description": "Generate purge reminder event based around specified reminder times.",
        "summary": "Generate purge reminder event based around specified reminder times.",
        "tags": [
          "Maintenance"
        ],
        "responses": {
          "200": {
            "description": "The Entity Item Reminder Processor was successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardResponse"
                }
              }
            }
          },
          "default": {
            "description": "Get the error message",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "StandardResponse": {
        "properties": {
          "status": {
            "type": "string",
            "description": "Specifies microservice response code",
            "example": "Success"
          },
          "message": {
            "type": "string",
            "description": "Specifies the text that provide more details and corrective actions"
          }
        }
      },
      "StandardEntityWithIdResponse": {
        "properties": {
          "id": {
            "description": "Unique identifier",
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "Specifies microservice response code",
            "example": "Success"
          },
          "message": {
            "type": "string",
            "description": "Specifies the text that provide more details and corrective actions"
          }
        }
      },
      "StandardEntityWithKeyIdResponse": {
        "properties": {
          "name": {
            "description": "Entity Name",
            "type": "string"
          },
          "id": {
            "description": "Unique identifier",
            "type": "string"
          },
          "key": {
            "description": "Entity Item Key",
            "type": "string",
            "example": "HF7XE1P3"
          },
          "status": {
            "type": "string",
            "description": "Specifies microservice response code",
            "example": "Success"
          },
          "message": {
            "type": "string",
            "description": "Specifies the text that provide more details and corrective actions"
          }
        }
      },
      "StandardEntitiesWithKeyIdResponse": {
        "properties": {
          "entityItemGroup": {
            "$ref": "#/components/schemas/EntityItemGroup"
          },
          "StandardEntityWithKeyIdResponses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StandardEntityWithKeyIdResponse"
            }
          }
        }
      },
      "StandardEntityWithCodeResponse": {
        "properties": {
          "code": {
            "description": "Unique identifier",
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "Specifies microservice response code",
            "example": "Success"
          },
          "message": {
            "type": "string",
            "description": "Specifies the text that provide more details and corrective actions"
          }
        }
      },
      "StandardErrorResponse": {
        "properties": {
          "errorCode": {
            "type": "string"
          },
          "errorDescription": {
            "type": "string"
          }
        }
      },
      "EntryCondition": {
        "description": "Defines an entry condition",
        "type": "object",
        "properties": {
          "key": {
            "description": "The JSON key",
            "type": "string",
            "example": "Status"
          },
          "operand": {
            "description": "The operand for comparison",
            "type": "string",
            "enum": [
              "E",
              "NE"
            ],
            "example": "E"
          },
          "targetValues": {
            "description": "The values for comparison",
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": "[InProgress]"
          },
          "valueChangedOnUpdate": {
            "description": "Has the value changed",
            "type": "boolean",
            "example": "true"
          }
        }
      },
      "EventTask": {
        "description": "Defines an Event Task",
        "type": "object",
        "properties": {
          "eventType": {
            "description": "The type of event",
            "type": "string",
            "enum": [
              "CREATED",
              "UPDATED"
            ],
            "example": "CREATED"
          },
          "dependsOn": {
            "description": "The event task that must pass for this event task to be processed",
            "type": "string",
            "example": "FUND_STARTED_EVENT"
          },
          "userType": {
            "description": "Defines which user type to validate the condition within the Journey",
            "type": "string",
            "example": "MetaData"
          },
          "entryCondition": {
            "description": "The entry condition",
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/EntryCondition"
            }
          }
        }
      },
      "EntityItemGroup": {
        "description": "Defines an Entity Item Group that can have multiple Entity Items",
        "properties": {
          "id": {
            "description": "The id of the Entity Item Group",
            "type": "string",
            "example": "507f191e810c19729de860ea"
          },
          "key": {
            "description": "Unique key of the Entity Item within the Entity Definition",
            "type": "string",
            "example": "AGH8DX"
          },
          "entityDefinitionCode": {
            "description": "The unique code for the Entity Definition",
            "type": "string",
            "example": "OnboardingJourneyABC"
          },
          "entityDefinitionVersion": {
            "description": "The version number of the parent entity definition",
            "type": "integer",
            "example": 12
          },
          "firstCreatedDate": {
            "description": "First created date for the Entity Item(s) within the group",
            "type": "string",
            "example": "2020-08-21T10:32:28Z"
          },
          "lastUpdatedDate": {
            "description": "Last updated date for the Entity Item(s) within the group",
            "type": "string",
            "example": "2020-08-21T10:32:28Z"
          },
          "purgeDate": {
            "description": "Purge date for the Entity Item(s) within the group",
            "type": "string",
            "example": "2020-08-21T10:32:28Z"
          },
          "purgeReminderDate": {
            "description": "Purge reminder date for the Entity Item(s) within the group",
            "type": "string",
            "example": "2020-08-21T10:32:28Z"
          },
          "reminderSentDate": {
            "description": "Date the reminder was sent for the Entity Item(s) within the group",
            "type": "string",
            "example": "2020-08-21T10:32:28Z"
          }
        }
      },
      "EntityItem": {
        "description": "Defines an entry payload of values for the schema structure",
        "properties": {
          "id": {
            "description": "The id of the Entity Item",
            "type": "string",
            "example": "507f191e810c19729de860ea"
          },
          "key": {
            "description": "Unique key of the Entity Item within the Entity Definition",
            "type": "string",
            "example": "AGH8DX"
          },
          "name": {
            "description": "Name of the Entity Item",
            "type": "string",
            "example": "onboardingDataFlow"
          },
          "type": {
            "description": "Type of the Entity Item (only JSON supported currently)",
            "type": "string",
            "enum": [
              "JSON",
              "DOCUMENT"
            ],
            "example": "JSON"
          },
          "userType": {
            "description": "An optional user defined unique generic type",
            "type": "string",
            "example": "MetaData"
          },
          "entityItemDefinitionName": {
            "description": "Entity Item Definition Name",
            "type": "string"
          },
          "entry": {
            "description": "The value of the structure entry, could be an EntityFieldDefinition or another key/value",
            "type": "string"
          },
          "entryHash": {
            "description": "The hash of the entry payload",
            "type": "string",
            "example": "3277cbad7cdddfb2b198e00326dd9f06"
          },
          "version": {
            "description": "The version number",
            "type": "integer",
            "example": 12
          },
          "createdDate": {
            "description": "Date created",
            "type": "string",
            "example": "2020-08-21T10:32:28Z"
          },
          "createdById": {
            "description": "Created by id",
            "type": "string",
            "example": "43242"
          },
          "updatedDate": {
            "description": "Date updated",
            "type": "string",
            "example": "2020-08-21T10:32:28Z"
          },
          "updatedById": {
            "description": "Updated by id",
            "type": "string",
            "example": "54234"
          },
          "locked": {
            "description": "If true, no further edits can be performed",
            "type": "boolean",
            "example": "false"
          },
          "integrityValue": {
            "description": "Reminder duration in days",
            "type": "integer",
            "format": "int64",
            "example": "10023"
          }
        }
      },
      "EntityItems": {
        "properties": {
          "entityItemGroup": {
            "$ref": "#/components/schemas/EntityItemGroup"
          },
          "entityItems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EntityItem"
            }
          }
        }
      },
      "EntityItemsResponse": {
        "properties": {
          "entityItems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EntityItem"
            }
          }
        }
      },
      "EntityItemEntry": {
        "properties": {
          "entityItemEntry": {
            "type": "object"
          }
        }
      },
      "SearchExtractData": {
        "properties": {
          "entityItemId": {
            "description": "The entityItemId of the Extract Data entry",
            "type": "string",
            "example": "507f191e810c19729de860ea"
          },
          "searchPath": {
            "description": "Search Key",
            "type": "string",
            "example": "OnboardingJourneyABC"
          },
          "value": {
            "description": "The extract data entry value",
            "type": "string",
            "example": "Firstname: john"
          },
          "key": {
            "description": "The Journey Key",
            "type": "string",
            "example": "AGH8DX"
          },
          "entityDefCode": {
            "description": "Parent entity definition code",
            "type": "string",
            "example": "OnboardingJourneyABC"
          },
          "returnEntityItemEntry": {
            "description": "Flag for returning the associated item entry for the extract",
            "type": "boolean"
          },
          "entityItemEntry": {
            "description": "Full Entity Item Entry from associated Entity Item",
            "type": "string"
          }
        }
      },
      "SearchExtractsResponse": {
        "properties": {
          "searchExtracts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SearchExtractData"
            }
          }
        }
      },
      "EntityItemDefinition": {
        "description": "Defines an optional Entity Item Definition configuration for an Entity Item name/type",
        "type": "object",
        "properties": {
          "type": {
            "description": "Type of the Entity Item",
            "type": "string",
            "example": "JSON"
          },
          "seed": {
            "description": "The seed data (JSON or XML)",
            "type": "string"
          },
          "validationSchema": {
            "description": "The JSON or XML Schema used for validation of the payload",
            "type": "string"
          },
          "applyValidation": {
            "description": "If true the validationSchema is applied to the payload",
            "type": "boolean"
          },
          "validateSeed": {
            "description": "If true the seed will be validated based on type i.e. JSON",
            "type": "boolean"
          },
          "validateEntry": {
            "description": "If true, the Entity Item Entry will be validated based on type i.e. JSON",
            "type": "boolean"
          }
        }
      },
      "SearchPath": {
        "description": "Search Path entry for search data extract configuration",
        "type": "object",
        "properties": {
          "searchPath": {
            "description": "Search path value",
            "type": "string",
            "example": "contact.phone.phone1"
          },
          "returnEntityItemEntry": {
            "description": "Flag to allow the return of the full entity item entry",
            "type": "boolean"
          }
        }
      },
      "EntityDefinition": {
        "description": "Defines an Entity Definition",
        "properties": {
          "id": {
            "description": "The id of the Entity Definition",
            "type": "string",
            "example": "507f191e810c19729de860ea"
          },
          "code": {
            "description": "Unique entity code",
            "type": "string",
            "example": "OnboardingJourneyABC"
          },
          "purgeAnchorPoint": {
            "description": "Purge anchor point",
            "type": "string",
            "enum": [
              "createdDate",
              "updatedDate"
            ],
            "nullable": false,
            "example": "createdDate or updatedDate"
          },
          "purgeDuration": {
            "description": "Purge duration in days",
            "type": "integer",
            "minimum": 0,
            "example": "60"
          },
          "reminderAnchorPoint": {
            "description": "Reminder anchor point",
            "type": "string",
            "example": "createdDate or updatedDate",
            "enum": [
              "createdDate",
              "updatedDate"
            ]
          },
          "reminderDuration": {
            "description": "Reminder duration in days",
            "type": "integer",
            "example": "53"
          },
          "searchPaths": {
            "description": "Entity Item Entry Search Paths",
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/SearchPath"
            },
            "example": {
              "PHONE1": {
                "searchPath": "contact.phone.phone1",
                "returnEntityItemEntry": "true"
              },
              "CITY": {
                "searchPath": "contact.address.city",
                "returnEntityItemEntry": "true"
              }
            }
          },
          "entityItemDefinitions": {
            "description": "The Entity Item Definitions",
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/EntityItemDefinition"
            },
            "example": {
              "PII": {
                "type": "JSON",
                "seed": {
                  "firstName": "",
                  "lastName": "",
                  "age": ""
                },
                "validationSchema": {
                  "$schema": "http://json-schema.org/draft-07/schema#",
                  "$id": "http://example.com/product.schema.json",
                  "title": "PII JSON Schema",
                  "description": "PII Details for onboarding application",
                  "type": "object",
                  "properties": {
                    "firstName": {
                      "type": "string",
                      "description": "The person's first name."
                    },
                    "lastName": {
                      "type": "string",
                      "description": "The person's last name."
                    },
                    "age": {
                      "description": "Age in years which must be equal to or greater than zero.",
                      "type": "integer",
                      "minimum": 0
                    }
                  }
                },
                "applyValidation": true
              },
              "ADDRESS": {
                "type": "JSON",
                "seed": {
                  "street": "",
                  "suburb": "",
                  "state": "",
                  "country": ""
                },
                "validationSchema": "",
                "applyValidation": false
              },
              "PERSONAL": {
                "type": "JSON",
                "seed": {
                  "street1": "",
                  "suburb": "",
                  "state": "",
                  "country": ""
                },
                "validationSchema": "",
                "applyValidation": false
              }
            }
          },
          "eventTasks": {
            "description": "The Event Tasks for this Entity Definition, the key is the topic to emit when the conditions have all passed",
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/EventTask"
            }
          },
          "version": {
            "description": "Version Number",
            "type": "integer",
            "example": "1"
          },
          "createdDate": {
            "description": "Date created",
            "type": "string",
            "example": "2020-07-21T17:32:28Z"
          },
          "createdById": {
            "description": "Created by id",
            "type": "string",
            "example": "32423"
          },
          "updatedDate": {
            "description": "Date updated UTC",
            "type": "string",
            "example": "2020-08-21T10:32:28Z"
          },
          "updatedById": {
            "description": "Updated by id",
            "type": "string",
            "example": "54323"
          },
          "integrityValue": {
            "description": "Reminder duration in days",
            "type": "integer",
            "format": "int64",
            "example": "10023"
          },
          "purgeEmail": {
            "description": "Purge email",
            "type": "string",
            "example": "jhon@doe.com"
          }
        }
      }
    }
  }

