{
  "openapi": "3.0.3",
  "info": {
    "title": "iyzidis API",
    "description": "Darphane İDİS (İnşaat Demiri İzleme Sistemi) entegrasyonu, toplu mal kabul, plaka bazlı sevk bildirimi ve irsaliye/WhatsApp belgesi parser servisleri.",
    "version": "1.0.0",
    "contact": {
      "name": "iyzidis Destek",
      "email": "info@iyzidis.com",
      "url": "https://iyzidis.com"
    }
  },
  "servers": [
    {
      "url": "https://iyzidis.com",
      "description": "Üretim Sunucusu"
    }
  ],
  "paths": {
    "/api/auth/register": {
      "post": {
        "summary": "Yeni Kullanıcı Kaydı",
        "description": "Platforma yeni bir hesap oluşturur.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": { "type": "string", "format": "email" },
                  "password": { "type": "string", "minLength": 6 },
                  "name": { "type": "string" },
                  "phone": { "type": "string" }
                },
                "required": ["email", "password", "name"]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Başarıyla kayıt olundu."
          }
        }
      }
    },
    "/api/auth/login": {
      "post": {
        "summary": "Kullanıcı Girişi",
        "description": "Kullanıcı kimlik doğrulaması yaparak JWT token döndürür.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": { "type": "string", "format": "email" },
                  "password": { "type": "string" }
                },
                "required": ["email", "password"]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Giriş başarılı, yetkilendirme tokenı oluşturuldu."
          }
        }
      }
    },
    "/api/parse-document": {
      "post": {
        "summary": "Belge veya Metin Parser",
        "description": "Excel, PDF, Fotoğraf, XML veya WhatsApp irsaliye metnindeki inşaat demiri İDİS etiket numaralarını otomatik bulur ve ayıklar.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "Taranacak irsaliye dosyası (.xlsx, .pdf, .png, .jpg, .xml)"
                  },
                  "text": {
                    "type": "string",
                    "description": "WhatsApp veya irsaliyeden kopyalanan ham metin"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ayıklanan etiketler listelendi.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": { "type": "boolean" },
                    "codes": {
                      "type": "array",
                      "items": { "type": "string" }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/idis/mal-kabul": {
      "post": {
        "summary": "İDİS Toplu Mal Kabulü",
        "description": "Doğrulanmış etiketleri toplu olarak resmi Darphane envanterinize (mal kabul) kaydeder.",
        "security": [
          { "BearerAuth": [] }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "codes": {
                    "type": "array",
                    "items": { "type": "string" },
                    "description": "Darphane envanterine alınacak etiket listesi"
                  }
                },
                "required": ["codes"]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Mal kabul işlemi başarıyla Darphane sistemine iletildi."
          }
        }
      }
    },
    "/api/idis/sevk": {
      "post": {
        "summary": "İDİS Toplu Sevk Bildirimi",
        "description": "Envanterinizdeki etiketleri nakliye plakasına toplu olarak sevk eder.",
        "security": [
          { "BearerAuth": [] }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "plate": { "type": "string", "description": "Tır / Nakliye Plakası" },
                  "codes": {
                    "type": "array",
                    "items": { "type": "string" },
                    "description": "Sevk edilecek etiket listesi"
                  }
                },
                "required": ["plate", "codes"]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sevk işlemi başarıyla Darphane sistemine iletildi."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  }
}
