{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/daon/json-schema/daon-trend-process-instances-response-dto-schema.json",
  "title": "TrendProcessInstancesResponseDto",
  "description": "Response containing a slice of process instances that share a given trend value",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/daon-trends-api-openapi.yml#/components/schemas/TrendProcessInstancesResponseDto",
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "description": "Trend type used for the query"
    },
    "value": {
      "type": "string",
      "description": "Raw trend value used for the query (no normalization applied)"
    },
    "page": {
      "type": "integer",
      "format": "int32",
      "description": "Zero-based page index of the returned data"
    },
    "size": {
      "type": "integer",
      "format": "int32",
      "description": "Page size used for the query"
    },
    "processInstances": {
      "$ref": "#/$defs/SliceTrendsProcessInstanceSearchResult",
      "description": "Process instances that share the given trend value. Exposed as a Spring Data Slice, including pagination metadata and hasNext flag."
    }
  },
  "$defs": {
    "PageableObject": {
      "type": "object",
      "properties": {
        "sort": {
          "$ref": "#/$defs/SortObject"
        },
        "pageSize": {
          "type": "integer",
          "format": "int32"
        },
        "pageNumber": {
          "type": "integer",
          "format": "int32"
        },
        "paged": {
          "type": "boolean"
        },
        "unpaged": {
          "type": "boolean"
        },
        "offset": {
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "SliceTrendsProcessInstanceSearchResult": {
      "type": "object",
      "properties": {
        "first": {
          "type": "boolean"
        },
        "sort": {
          "$ref": "#/$defs/SortObject"
        },
        "number": {
          "type": "integer",
          "format": "int32"
        },
        "numberOfElements": {
          "type": "integer",
          "format": "int32"
        },
        "pageable": {
          "$ref": "#/$defs/PageableObject"
        },
        "last": {
          "type": "boolean"
        },
        "size": {
          "type": "integer",
          "format": "int32"
        },
        "content": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/TrendsProcessInstanceSearchResult"
          }
        },
        "empty": {
          "type": "boolean"
        }
      }
    },
    "SortObject": {
      "type": "object",
      "properties": {
        "sorted": {
          "type": "boolean"
        },
        "unsorted": {
          "type": "boolean"
        },
        "empty": {
          "type": "boolean"
        }
      }
    },
    "TrendsProcessInstanceSearchResult": {
      "type": "object",
      "description": "The result of a process instance search for a trend record, containing key details about the process instance and navigation links.",
      "properties": {
        "processDefnId": {
          "type": "string",
          "description": "The process definition ID"
        },
        "processDefnName": {
          "type": "string",
          "description": "The process definition name"
        },
        "processDefnVersion": {
          "type": "integer",
          "format": "int32",
          "description": "The process definition version"
        },
        "processInstanceId": {
          "type": "string",
          "description": "The process instance ID"
        },
        "applicantName": {
          "type": "string",
          "description": "The applicant's full name"
        },
        "applicantEmail": {
          "type": "string",
          "description": "The applicant's email address"
        },
        "applicantPhoneNumber": {
          "type": "string",
          "description": "The applicant's phone number"
        },
        "processInstanceStatus": {
          "type": "string",
          "description": "The current status of the process instance"
        },
        "processInstanceStatusMapped": {
          "type": "string",
          "description": "The mapped/display status of the process instance"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "description": "The date and time the process instance was created"
        },
        "lastUpdatedDtm": {
          "type": "string",
          "format": "date-time",
          "description": "The date and time the process instance was last updated"
        },
        "elapsedMilliseconds": {
          "type": "integer",
          "format": "int64",
          "description": "The elapsed time in milliseconds since the process instance was created"
        },
        "lastUpdatedBy": {
          "type": "string",
          "description": "The user who last updated the process instance"
        },
        "reviewedBy": {
          "type": "string",
          "description": "The user who reviewed the process instance"
        }
      }
    }
  }
}