{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/publiq/json-schema/publiq-report-schema.json",
  "title": "Report",
  "description": "The status of a report export.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/publiq-financial-reports-api-openapi.yml#/components/schemas/Report",
  "type": "object",
  "x-tags": [
    "Models"
  ],
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "STARTED",
        "AVAILABLE",
        "FAILED"
      ],
      "description": "Whether the report has started (but not ready yet), is available for download, or failed to be created."
    },
    "id": {
      "type": "integer",
      "description": "Unique ID of the report export. Can be used to retrieve the status of the export."
    },
    "message": {
      "type": "string",
      "description": "Included if `status` is `FAILED`. Describes why it was not possible to export the report."
    },
    "period": {
      "$ref": "#/$defs/ReportPeriod"
    },
    "creationDate": {
      "type": "string",
      "format": "date-time",
      "description": "Date that the report export was initially requested."
    }
  },
  "required": [
    "status",
    "id",
    "creationDate"
  ],
  "$defs": {
    "ReportPeriod": {
      "title": "ReportPeriod",
      "type": "object",
      "description": "Date range for which to export a list of financial transactions.",
      "properties": {
        "startDate": {
          "type": "string",
          "format": "date",
          "description": "Minimum date of all transactions to include in the report. (Inclusive)"
        },
        "endDate": {
          "type": "string",
          "format": "date",
          "description": "Maximum date of all transactions to include in the report. (Inclusive)"
        }
      },
      "required": [
        "startDate",
        "endDate"
      ],
      "x-tags": [
        "Models"
      ]
    }
  }
}