{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/daon/json-schema/daon-process-instance-details-dto-schema.json",
  "title": "ProcessInstanceDetailsDto",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/daon-process-instances-api-openapi.yml#/components/schemas/ProcessInstanceDetailsDto",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "tenantId": {
      "type": "string"
    },
    "processDefnId": {
      "type": "string"
    },
    "processDefnName": {
      "type": "string"
    },
    "processDefnVersion": {
      "type": "integer",
      "format": "int32"
    },
    "lastName": {
      "type": "string"
    },
    "firstName": {
      "type": "string"
    },
    "phoneNumber": {
      "type": "string"
    },
    "email": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "elapsedMilliseconds": {
      "type": "integer",
      "format": "int64"
    },
    "status": {
      "type": "string"
    },
    "statusMapped": {
      "type": "string"
    },
    "results": {
      "type": "object",
      "additionalProperties": {}
    },
    "externalSources": {
      "$ref": "#/$defs/ExternalSources"
    },
    "retentionDays": {
      "type": "integer",
      "format": "int32",
      "description": "The retention days for the process instance. This is derived from the retention defined on the Process Definition.",
      "readOnly": true
    },
    "expiringDtm": {
      "type": "string",
      "format": "date-time",
      "description": "The date after which a process instance is eligible for deletion. The date is calculated based on when the process instance was created and retentionDays.",
      "readOnly": true
    },
    "reviewedBy": {
      "type": "string"
    },
    "fraudState": {
      "type": "string",
      "description": "Fraud review outcome recorded for this process instance. This field is returned only after a fraud state has been reported. Values: FRAUD_CONFIRMED, FRAUD_SUSPECTED, or NO_FRAUD_INDICATED. To change this value, use the fraud-state endpoint for the process instance.",
      "enum": [
        "FRAUD_CONFIRMED",
        "FRAUD_SUSPECTED",
        "NO_FRAUD_INDICATED"
      ],
      "readOnly": true
    },
    "fraudStateLastUpdated": {
      "type": "string",
      "format": "date-time",
      "description": "Date and time, in UTC, when the fraud state was last reported or changed. This field is returned only after a fraud state has been reported.",
      "readOnly": true
    },
    "fraudStateLastUpdatedBy": {
      "type": "string",
      "description": "Identifier of the authenticated caller that last reported or changed the fraud state. This field is returned only after a fraud state has been reported.",
      "readOnly": true
    },
    "fraudStateNote": {
      "type": "string",
      "description": "Optional note supplied with the latest fraud-state report. This field is returned only when a note was provided. To change this value, use the fraud-state endpoint for the process instance.",
      "maxLength": 2000,
      "readOnly": true
    },
    "archives": {
      "type": "array",
      "description": "Archives associated with this process instance (one entry per archive tracking record, across all policies and statuses). Empty when the process instance has no archives.",
      "items": {
        "$ref": "#/$defs/ProcessInstanceArchiveSummaryDto"
      },
      "readOnly": true
    }
  },
  "$defs": {
    "DocumentUpload": {
      "type": "object",
      "properties": {
        "documentFormat": {
          "type": "string",
          "description": "Document Format",
          "enum": [
            "PDF"
          ],
          "minLength": 1,
          "readOnly": true
        },
        "documentCaptureKey": {
          "type": "string",
          "description": "The document capture key",
          "readOnly": true
        },
        "pageCaptureKey": {
          "type": "string",
          "description": "The document page capture key",
          "readOnly": true
        },
        "uploadUrl": {
          "type": "string",
          "description": "The location to which the document should be uploaded",
          "readOnly": true
        },
        "uploadHeaders": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "The upload headers that must be set when uploading the document",
          "readOnly": true
        }
      },
      "required": [
        "documentFormat"
      ]
    },
    "ExternalSources": {
      "type": "object",
      "properties": {
        "faceUploads": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/Upload"
          },
          "description": "External Face Uploads. This is a map based on a face key and the upload.",
          "readOnly": true
        },
        "documentUploads": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/DocumentUpload"
          },
          "description": "External Document Uploads. This is a map based on a doc key and the upload.",
          "readOnly": true
        }
      }
    },
    "ProcessInstanceArchiveSummaryDto": {
      "type": "object",
      "properties": {
        "statusCode": {
          "type": "string",
          "description": "Current archive status: QUEUED, PENDING, COMPLETED, FAILED or RETRYING."
        },
        "lastUpdated": {
          "type": "string",
          "format": "date-time",
          "description": "Date and time, in UTC, when this archive record was last updated."
        },
        "policyName": {
          "type": "string",
          "description": "Name of the archive policy that produced this archive."
        },
        "policyVersion": {
          "type": "integer",
          "format": "int32",
          "description": "Version of the archive policy that produced this archive."
        },
        "policyId": {
          "type": "string",
          "description": "Identifier of the archive policy that produced this archive."
        },
        "location": {
          "type": "string",
          "description": "Relative storage location of the written archive. Populated only once the archive has been successfully written (status COMPLETED)."
        }
      },
      "readOnly": true
    },
    "Upload": {
      "type": "object",
      "properties": {
        "imageFormat": {
          "type": "string",
          "description": "Image Format",
          "enum": [
            "JPEG"
          ],
          "minLength": 1,
          "readOnly": true
        },
        "captureKey": {
          "type": "string",
          "description": "The image capture key",
          "readOnly": true
        },
        "uploadUrl": {
          "type": "string",
          "description": "The location to which the face image should be uploaded",
          "readOnly": true
        },
        "uploadHeaders": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "The upload headers that must be set when uploading the images",
          "readOnly": true
        }
      },
      "required": [
        "imageFormat"
      ]
    }
  }
}