{
    "info": {
        "name": "AKİA Arxiv API v1",
        "description": "AKİA Rəqəmsal Arxiv sistemi üçün REST API v1.\n\nDoc: docs/API.md\n\nQeyd: `base_url` və `token` Environment Variable-ları istifadə olunur.",
        "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
        "_postman_id": "akia-arxiv-api-v1"
    },
    "auth": {
        "type": "bearer",
        "bearer": [
            { "key": "token", "value": "{{token}}", "type": "string" }
        ]
    },
    "variable": [
        { "key": "base_url", "value": "http://localhost:8000", "type": "string" },
        { "key": "token", "value": "PASTE-TOKEN-HERE", "type": "string" }
    ],
    "item": [
        {
            "name": "1. Health check",
            "request": {
                "method": "GET",
                "header": [
                    { "key": "Accept", "value": "application/json" }
                ],
                "url": {
                    "raw": "{{base_url}}/api/v1/health",
                    "host": ["{{base_url}}"],
                    "path": ["api", "v1", "health"]
                }
            }
        },
        {
            "name": "2. Departments — siyahı",
            "request": {
                "method": "GET",
                "header": [
                    { "key": "Accept", "value": "application/json" }
                ],
                "url": {
                    "raw": "{{base_url}}/api/v1/departments",
                    "host": ["{{base_url}}"],
                    "path": ["api", "v1", "departments"]
                }
            }
        },
        {
            "name": "3. Departments — Kredit detalı",
            "request": {
                "method": "GET",
                "header": [
                    { "key": "Accept", "value": "application/json" }
                ],
                "url": {
                    "raw": "{{base_url}}/api/v1/departments/kredit-sobesi",
                    "host": ["{{base_url}}"],
                    "path": ["api", "v1", "departments", "kredit-sobesi"]
                },
                "description": "Cavabdakı `data.types[].id`, `data.statuses[].id`, `data.shelves[].id`, `data.document_folders[].id`, `data.folders[].children[].id`, `data.fields[].id` — bunları POST appeals-də istifadə edirsən."
            }
        },
        {
            "name": "4. Appeals — yeni sənəd yarat (Kredit)",
            "request": {
                "method": "POST",
                "header": [
                    { "key": "Accept", "value": "application/json" }
                ],
                "url": {
                    "raw": "{{base_url}}/api/v1/appeals",
                    "host": ["{{base_url}}"],
                    "path": ["api", "v1", "appeals"]
                },
                "body": {
                    "mode": "formdata",
                    "formdata": [
                        { "key": "department_id",      "value": "1",         "type": "text", "description": "Kredit şöbəsi" },
                        { "key": "folder_id",          "value": "2",         "type": "text", "description": "Texnika/Kapitalbank" },
                        { "key": "type_id",            "value": "1",         "type": "text", "description": "Akt" },
                        { "key": "status_id",          "value": "1",         "type": "text", "description": "Rəfdədir" },
                        { "key": "shelf_id",           "value": "1",         "type": "text", "description": "R1" },
                        { "key": "document_folder_id", "value": "2",         "type": "text", "description": "Q1" },
                        { "key": "application_date",   "value": "2026-05-27","type": "text", "description": "YYYY-MM-DD" },
                        { "key": "application_number", "value": "KR-2026-001","type": "text","description": "Unikal nömrə, boş qoymaq olar (auto-gen)" },
                        { "key": "description",        "value": "Postman test",            "type": "text" },
                        { "key": "custom_fields[8]",   "value": "Sarkhan Babayev Kamran",   "type": "text", "description": "Müraciət a.s.a (məcburi)" },
                        { "key": "custom_fields[9]",   "value": "1234567890",               "type": "text", "description": "VÖEN (məcburi)" },
                        { "key": "custom_fields[10]",  "value": "7FZLRSL",                  "type": "text", "description": "FİN (ixtiyari)" },
                        { "key": "custom_fields[11]",  "value": "200000",                   "type": "text", "description": "Kredit məbləği (ixtiyari)" },
                        { "key": "custom_fields[12]",  "value": "5000",                     "type": "text", "description": "Güzəşt məbləği (ixtiyari)" },
                        { "key": "file",               "type": "file",       "src": [],     "description": "Əsas sənəd faylı (PDF/JPG/PNG, max 50 MB) — File seç düyməsindən yüklə" },
                        { "key": "attachments[]",      "type": "file",       "src": [],     "description": "Qoşma fayl (ixtiyari, çox ola bilər)", "disabled": true }
                    ]
                },
                "description": "Kredit şöbəsinə yeni sənəd əlavə edir. Bütün ID-lər cari DB-yə uyğundur — DB dəyişərsə, əvvəlcə request #3-dən aktual ID-ləri öyrən."
            }
        },
        {
            "name": "5. Appeals — siyahı (API mənbəli)",
            "request": {
                "method": "GET",
                "header": [
                    { "key": "Accept", "value": "application/json" }
                ],
                "url": {
                    "raw": "{{base_url}}/api/v1/appeals?source=api&per_page=20",
                    "host": ["{{base_url}}"],
                    "path": ["api", "v1", "appeals"],
                    "query": [
                        { "key": "source",        "value": "api", "description": "web/api/ipsiz" },
                        { "key": "per_page",      "value": "20",  "description": "1-100" },
                        { "key": "department_id", "value": "1",   "disabled": true, "description": "Yalnız Kredit (ixtiyari)" }
                    ]
                }
            }
        },
        {
            "name": "6. Appeals — tək sənədin detalı",
            "request": {
                "method": "GET",
                "header": [
                    { "key": "Accept", "value": "application/json" }
                ],
                "url": {
                    "raw": "{{base_url}}/api/v1/appeals/1",
                    "host": ["{{base_url}}"],
                    "path": ["api", "v1", "appeals", "1"]
                },
                "description": "URL-dəki `1` rəqəmini real appeal id ilə əvəzlə."
            }
        },
        {
            "name": "7. Appeals — status polling",
            "request": {
                "method": "GET",
                "header": [
                    { "key": "Accept", "value": "application/json" }
                ],
                "url": {
                    "raw": "{{base_url}}/api/v1/appeals/1/status",
                    "host": ["{{base_url}}"],
                    "path": ["api", "v1", "appeals", "1", "status"]
                },
                "description": "OCR status izləmək üçün light-weight endpoint. URL-dəki `1`-i real id ilə əvəzlə."
            }
        }
    ]
}
