{
  "openapi": "3.0.3",
  "info": {
    "title": "Can Lojistik API",
    "description": "B2B ticari yük taşımacılığı, komple tır (FTL), parsiyel yük (LTL) nakliye teklifi ve operasyonel takip API'si.",
    "version": "1.0.0",
    "contact": {
      "name": "Can Lojistik Destek",
      "url": "https://canlojistik.tr/iletisim/",
      "email": "bilgi@canlojistik.tr"
    }
  },
  "servers": [
    {
      "url": "https://canlojistik.tr",
      "description": "Canlı Üretim Sunucusu"
    }
  ],
  "paths": {
    "/api/quotes": {
      "post": {
        "summary": "Yeni Teklif Talebi Oluştur",
        "description": "Komple tır, kamyon veya parsiyel yük için anlık navlun teklif talebi oluşturur ve takip kodu döner.",
        "operationId": "createQuote",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["customer_name", "customer_phone", "service_type", "origin", "destination"],
                "properties": {
                  "customer_name": { "type": "string", "example": "Ahmet Yılmaz" },
                  "customer_phone": { "type": "string", "example": "05399112451" },
                  "service_type": { "type": "string", "example": "Komple Tır" },
                  "origin": { "type": "string", "example": "İstanbul İMES OSB" },
                  "destination": { "type": "string", "example": "Ankara Ostim OSB" },
                  "details": { "type": "string", "example": "24 ton paletli sanayi malzemesi" }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Teklif talebi başarıyla alındı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": { "type": "boolean", "example": true },
                    "tracking_code": { "type": "string", "example": "CAN-4982" },
                    "message": { "type": "string", "example": "Talebiniz alındı! Takip Kodunuz: CAN-4982" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/quotes/{code}": {
      "get": {
        "summary": "Teklif Durumunu Sorgula",
        "description": "Takip kodu ile mevcut navlun teklifinin durumu, atanmış araç ve fiyat detaylarını sorgular.",
        "operationId": "getQuoteByCode",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": { "type": "string" },
            "example": "CAN-4982"
          }
        ],
        "responses": {
          "200": {
            "description": "Teklif detayları",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Teklif bulunamadı"
          }
        }
      }
    },
    "/api/health": {
      "get": {
        "summary": "Servis Sağlık Durumu",
        "description": "API servisinin canlılık ve sağlık durumunu döner.",
        "operationId": "getHealthStatus",
        "responses": {
          "200": {
            "description": "API sağlıklı çalışıyor",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": { "type": "string", "example": "healthy" },
                    "timestamp": { "type": "string", "format": "date-time" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/yol-gunlugu/posts": {
      "get": {
        "summary": "Operasyon ve Saha Akışı",
        "description": "Sevkiyat ve saha operasyon kayıtlarını listeler.",
        "operationId": "getYolGunluguPosts",
        "responses": {
          "200": {
            "description": "Gönderi listesi",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  }
}
