{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/fis/main/json-schema/fis-data-status-response-dto-schema.json",
  "title": "DataStatusResponseDto",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/fis-data-api-openapi.yml#/components/schemas/DataStatusResponseDto",
  "type": "object",
  "properties": {
    "meta": {
      "readOnly": true,
      "allOf": [
        {
          "$ref": "#/$defs/DataSyncMeta"
        }
      ]
    },
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/DataSyncData"
      }
    }
  },
  "required": [
    "meta"
  ],
  "$defs": {
    "DataSyncData": {
      "type": "object",
      "properties": {
        "connectionId": {
          "type": "string",
          "readOnly": true
        },
        "dataTypes": {
          "readOnly": true,
          "type": "array",
          "items": {
            "$ref": "#/$defs/DataType"
          }
        },
        "syncTime": {
          "type": "number"
        },
        "percentageCompleted": {
          "type": "number"
        }
      },
      "required": [
        "connectionId",
        "dataTypes"
      ]
    },
    "DataSyncMeta": {
      "type": "object",
      "properties": {
        "serviceName": {
          "type": "string",
          "readOnly": true,
          "enum": [
            "quickbooks",
            "xero",
            "freshbooks",
            "quickbooksDesktop",
            "sageIntacct",
            "sageBusinessCloud",
            "oracleNetsuite",
            "dynamicsBusinessCentral",
            "dynamics365Finance",
            "wave",
            "zohoBooks",
            "myob"
          ]
        },
        "businessName": {
          "type": "string",
          "readOnly": true
        }
      },
      "required": [
        "serviceName",
        "businessName"
      ]
    },
    "DataType": {
      "type": "object",
      "properties": {
        "dataType": {
          "type": "string",
          "readOnly": true
        },
        "lastSyncDate": {
          "type": "string"
        },
        "lastUpdatedDate": {
          "type": "string"
        },
        "reports": {
          "readOnly": true,
          "type": "array",
          "items": {
            "$ref": "#/$defs/Report"
          }
        }
      },
      "required": [
        "dataType",
        "reports"
      ]
    },
    "Report": {
      "type": "object",
      "properties": {
        "startDate": {
          "type": "string"
        },
        "endDate": {
          "type": "string"
        },
        "lastSuccessfulSync": {
          "type": "string"
        },
        "reportFrequency": {
          "type": "string"
        },
        "currentStatus": {
          "type": "string",
          "enum": [
            "success",
            "failed",
            "pending",
            "empty"
          ]
        },
        "latestReportId": {
          "type": "string"
        },
        "latestSuccessfulReportId": {
          "type": "string"
        },
        "accountingMethod": {
          "type": "string"
        },
        "reconstructed": {
          "type": "boolean"
        }
      }
    }
  }
}