{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://portal.yesilveri.tr/standart/kades-json/v1.1.0/kades-manifest.schema.json",
  "title": "kadesManifestSemasi",
  "description": "KADES-JSON kades-manifest şeması\n\nKOBİZON Proje Danışmanlık ve Yazılım Tic. Ltd. Şti. — Sürüm 1.1.0",
  "$ref": "#/definitions/kadesManifestSemasi",
  "definitions": {
    "kadesManifestSemasi": {
      "type": "object",
      "properties": {
        "$schema": {
          "type": "string",
          "pattern": "^(?:https:\\/\\/portal\\.yesilveri\\.tr\\/standart\\/kades-json|https:\\/\\/portal\\.kobizon\\.com\\/standart\\/kades-json)\\/v\\d+\\.\\d+\\.\\d+\\/kades-manifest\\.schema\\.json$"
        },
        "surum": {
          "type": "string",
          "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$"
        },
        "paketKimligi": {
          "type": "string",
          "format": "uuid"
        },
        "paketSurumu": {
          "type": "string",
          "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$"
        },
        "semaSurumu": {
          "type": "string",
          "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$"
        },
        "kiraciKimligi": {
          "type": "string",
          "format": "uuid"
        },
        "envanterKimligi": {
          "type": "string",
          "format": "uuid"
        },
        "envanterSurumNo": {
          "type": "integer",
          "minimum": 1
        },
        "donem": {
          "type": "object",
          "properties": {
            "baslangic": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "bitis": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          "required": [
            "baslangic",
            "bitis"
          ],
          "additionalProperties": false
        },
        "uretimTarihi": {
          "type": "string",
          "format": "date-time"
        },
        "uretenSistem": {
          "type": "object",
          "properties": {
            "ad": {
              "type": "string",
              "minLength": 2,
              "maxLength": 200
            },
            "surum": {
              "type": "string",
              "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$"
            }
          },
          "required": [
            "ad",
            "surum"
          ],
          "additionalProperties": false
        },
        "dosyaSayisi": {
          "type": "integer",
          "minimum": 0
        },
        "toplamBoyutBayt": {
          "type": "integer",
          "minimum": 0
        },
        "dosyalar": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "yol": {
                "type": "string",
                "minLength": 1,
                "maxLength": 300,
                "pattern": "^[A-Za-z0-9._-]+(\\/[A-Za-z0-9._-]+)*$"
              },
              "tur": {
                "type": "string",
                "enum": [
                  "kades_envanter",
                  "hesap_izi",
                  "faktor_seti",
                  "metodoloji_notu",
                  "belge",
                  "diger"
                ]
              },
              "icerikTuru": {
                "type": "string",
                "minLength": 3,
                "maxLength": 150
              },
              "boyutBayt": {
                "type": "integer",
                "minimum": 0
              },
              "ozetSha256": {
                "type": "string",
                "pattern": "^[0-9a-f]{64}$"
              },
              "aciklama": {
                "type": "string",
                "minLength": 3,
                "maxLength": 300
              }
            },
            "required": [
              "yol",
              "tur",
              "icerikTuru",
              "boyutBayt",
              "ozetSha256"
            ],
            "additionalProperties": false
          },
          "minItems": 1
        },
        "butunluk": {
          "type": "object",
          "properties": {
            "algoritma": {
              "type": "string",
              "const": "SHA-256"
            },
            "paketOzeti": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^[0-9a-f]{64}$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "imzaAlgoritmasi": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 2,
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ]
            },
            "imzaDosyasi": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "imza.sig"
                },
                {
                  "type": "null"
                }
              ]
            },
            "imzaSertifikaParmakIzi": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^[0-9a-f]{64}$"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "algoritma",
            "paketOzeti",
            "imzaAlgoritmasi",
            "imzaDosyasi",
            "imzaSertifikaParmakIzi"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "$schema",
        "surum",
        "paketKimligi",
        "paketSurumu",
        "semaSurumu",
        "kiraciKimligi",
        "envanterKimligi",
        "envanterSurumNo",
        "donem",
        "uretimTarihi",
        "uretenSistem",
        "dosyaSayisi",
        "toplamBoyutBayt",
        "dosyalar",
        "butunluk"
      ],
      "additionalProperties": false
    }
  }
}
