{
  "openapi": "3.1.0",
  "info": {
    "title": "Bulgaristan Vatandaşlık Dosya Takip API",
    "version": "1.0.0",
    "description": "Bulgaristan Adalet Bakanlığı (publicbg.mjs.bg) resmi sistemiyle entegre gerçek zamanlı dosya sorgulama ve Telegram bildirim API'si."
  },
  "servers": [
    {
      "url": "https://bgsorgulama.bulgaristanvatandas.com",
      "description": "Canlı Üretim Sunucusu"
    }
  ],
  "paths": {
    "/api/status": {
      "get": {
        "summary": "Dosya Durumu Sorgula",
        "description": "Mülakat dosya numarası ve 6 haneli PIN kodu ile vatandaşlık başvurusunun anlık resmi durumunu, Türkçe açıklamasını ve Ukaz durumunu döndürür.",
        "parameters": [
          {
            "name": "reqNum",
            "in": "query",
            "required": true,
            "description": "Dosya numarası (örn: 14820/2023). Alternatif olarak caseNumber kullanılabilir.",
            "schema": {
              "type": "string"
            },
            "example": "14820/2023"
          },
          {
            "name": "pin",
            "in": "query",
            "required": true,
            "description": "6 haneli gizli başvuru PIN kodu.",
            "schema": {
              "type": "string"
            },
            "example": "582910"
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı sorgu yanıtı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": { "type": "boolean", "example": true },
                    "caseNumber": { "type": "string", "example": "14820/2023" },
                    "pinProvided": { "type": "boolean", "example": true },
                    "statusBulgarian": { "type": "string", "example": "Преписката се намира в процедура по задължително съгласуване." },
                    "statusTurkish": { "type": "string", "example": "Dosyanız ilgili güvenlik kurumlarının (İçişleri Bakanlığı MVR ve DANS) zorunlu koordinasyon ve tahkikat sürecindedir." },
                    "isDecree": { "type": "boolean", "example": false },
                    "decreeNum": { "type": ["string", "null"], "example": null },
                    "officialSource": { "type": "string", "example": "https://publicbg.mjs.bg/BgInfo/" },
                    "telegramBot": { "type": "string", "example": "https://t.me/Bulgaristanbot?start=req_14820_2023" },
                    "queriedAt": { "type": "string", "format": "date-time" }
                  },
                  "required": ["success", "caseNumber", "statusBulgarian", "statusTurkish", "isDecree", "telegramBot"]
                }
              }
            }
          },
          "400": {
            "description": "Eksik parametre hatası"
          },
          "404": {
            "description": "Dosya numarası veya PIN bulunamadı"
          },
          "503": {
            "description": "Resmi sunucu yoğun güvenlik korumasında veya bakımda"
          }
        }
      }
    }
  }
}
