{
  "info": {
    "name": "نظام إدارة الأصول والهيكليات المؤسساتية",
    "description": "API Documentation for Assets & Organizational Structure Management System",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "version": "1.0.0"
  },
  "variable": [
    {
      "key": "base_url",
      "value": "http://localhost:8000/api",
      "type": "string"
    },
    {
      "key": "token",
      "value": "",
      "type": "string"
    }
  ],
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{token}}",
        "type": "string"
      }
    ]
  },
  "item": [
    {
      "name": "Authentication",
      "item": [
        {
          "name": "Login",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n    \"email\": \"admin@system.com\",\n    \"password\": \"password\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/login",
              "host": ["{{base_url}}"],
              "path": ["login"]
            }
          }
        },
        {
          "name": "Get User Info",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/user",
              "host": ["{{base_url}}"],
              "path": ["user"]
            }
          }
        }
      ]
    },
    {
      "name": "Organizations",
      "item": [
        {
          "name": "List Organizations",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/organizations",
              "host": ["{{base_url}}"],
              "path": ["organizations"]
            }
          }
        },
        {
          "name": "Create Organization",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n    \"name\": \"الهيئة العامة\",\n    \"code\": \"HEA01\",\n    \"sequence\": 1\n}"
            },
            "url": {
              "raw": "{{base_url}}/organizations",
              "host": ["{{base_url}}"],
              "path": ["organizations"]
            }
          }
        },
        {
          "name": "Get Organization",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/organizations/1",
              "host": ["{{base_url}}"],
              "path": ["organizations", "1"]
            }
          }
        },
        {
          "name": "Update Organization",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n    \"name\": \"الهيئة العامة المحدثة\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/organizations/1",
              "host": ["{{base_url}}"],
              "path": ["organizations", "1"]
            }
          }
        },
        {
          "name": "Delete Organization",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{base_url}}/organizations/1",
              "host": ["{{base_url}}"],
              "path": ["organizations", "1"]
            }
          }
        },
        {
          "name": "Get Organizations Tree",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/organizations/tree",
              "host": ["{{base_url}}"],
              "path": ["organizations", "tree"]
            }
          }
        }
      ]
    },
    {
      "name": "Departments",
      "item": [
        {
          "name": "List Departments",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/departments?organization_id=1",
              "host": ["{{base_url}}"],
              "path": ["departments"],
              "query": [
                {
                  "key": "organization_id",
                  "value": "1"
                }
              ]
            }
          }
        },
        {
          "name": "Create Department",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n    \"organization_id\": 1,\n    \"name\": \"قسم تقنية المعلومات\",\n    \"code\": \"DEPT01\",\n    \"sequence\": 1\n}"
            },
            "url": {
              "raw": "{{base_url}}/departments",
              "host": ["{{base_url}}"],
              "path": ["departments"]
            }
          }
        },
        {
          "name": "Get Department",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/departments/1",
              "host": ["{{base_url}}"],
              "path": ["departments", "1"]
            }
          }
        },
        {
          "name": "Update Department",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n    \"name\": \"قسم تقنية المعلومات المحدث\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/departments/1",
              "host": ["{{base_url}}"],
              "path": ["departments", "1"]
            }
          }
        },
        {
          "name": "Delete Department",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{base_url}}/departments/1",
              "host": ["{{base_url}}"],
              "path": ["departments", "1"]
            }
          }
        }
      ]
    },
    {
      "name": "Units",
      "item": [
        {
          "name": "List Units",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/units?department_id=1",
              "host": ["{{base_url}}"],
              "path": ["units"],
              "query": [
                {
                  "key": "department_id",
                  "value": "1"
                }
              ]
            }
          }
        },
        {
          "name": "Create Unit",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n    \"department_id\": 1,\n    \"name\": \"شعبة الشبكات\",\n    \"code\": \"UNIT01\",\n    \"details\": \"مسؤولة عن إدارة البنية التحتية للشبكات\",\n    \"sequence\": 1\n}"
            },
            "url": {
              "raw": "{{base_url}}/units",
              "host": ["{{base_url}}"],
              "path": ["units"]
            }
          }
        },
        {
          "name": "Get Unit",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/units/1",
              "host": ["{{base_url}}"],
              "path": ["units", "1"]
            }
          }
        },
        {
          "name": "Update Unit",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n    \"name\": \"شعبة الشبكات المحدثة\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/units/1",
              "host": ["{{base_url}}"],
              "path": ["units", "1"]
            }
          }
        },
        {
          "name": "Delete Unit",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{base_url}}/units/1",
              "host": ["{{base_url}}"],
              "path": ["units", "1"]
            }
          }
        }
      ]
    },
    {
      "name": "Items",
      "item": [
        {
          "name": "List Items",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/items",
              "host": ["{{base_url}}"],
              "path": ["items"]
            }
          }
        },
        {
          "name": "Create Item",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n    \"organization_id\": 1,\n    \"department_id\": 1,\n    \"unit_id\": 1,\n    \"name\": \"أجهزة كمبيوتر مكتبية\",\n    \"item_type\": \"أجهزة\",\n    \"material_type\": \"إلكترونيات\",\n    \"quantity\": 10,\n    \"details\": \"أجهزة Dell OptiPlex\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/items",
              "host": ["{{base_url}}"],
              "path": ["items"]
            }
          }
        },
        {
          "name": "Get Item",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/items/1",
              "host": ["{{base_url}}"],
              "path": ["items", "1"]
            }
          }
        },
        {
          "name": "Update Item",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n    \"quantity\": 15\n}"
            },
            "url": {
              "raw": "{{base_url}}/items/1",
              "host": ["{{base_url}}"],
              "path": ["items", "1"]
            }
          }
        },
        {
          "name": "Delete Item",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{base_url}}/items/1",
              "host": ["{{base_url}}"],
              "path": ["items", "1"]
            }
          }
        }
      ]
    },
    {
      "name": "Barcodes",
      "item": [
        {
          "name": "List Barcodes",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/barcodes",
              "host": ["{{base_url}}"],
              "path": ["barcodes"]
            }
          }
        },
        {
          "name": "Generate Barcodes",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n    \"quantity\": 5,\n    \"barcode_type\": \"code128\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/barcodes/generate/1",
              "host": ["{{base_url}}"],
              "path": ["barcodes", "generate", "1"]
            }
          }
        },
        {
          "name": "Get Barcode",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/barcodes/1",
              "host": ["{{base_url}}"],
              "path": ["barcodes", "1"]
            }
          }
        },
        {
          "name": "Get Barcode Image",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/barcodes/1/image?format=png",
              "host": ["{{base_url}}"],
              "path": ["barcodes", "1", "image"],
              "query": [
                {
                  "key": "format",
                  "value": "png"
                }
              ]
            }
          }
        },
        {
          "name": "Mark Barcode as Printed",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{base_url}}/barcodes/1/mark-printed",
              "host": ["{{base_url}}"],
              "path": ["barcodes", "1", "mark-printed"]
            }
          }
        },
        {
          "name": "Print Barcodes PDF",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n    \"barcode_ids\": [1, 2, 3, 4, 5],\n    \"layout\": 8\n}"
            },
            "url": {
              "raw": "{{base_url}}/barcodes/print-pdf",
              "host": ["{{base_url}}"],
              "path": ["barcodes", "print-pdf"]
            }
          }
        },
        {
          "name": "Delete Barcode",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{base_url}}/barcodes/1",
              "host": ["{{base_url}}"],
              "path": ["barcodes", "1"]
            }
          }
        }
      ]
    },
    {
      "name": "Devices",
      "item": [
        {
          "name": "List Devices",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/devices",
              "host": ["{{base_url}}"],
              "path": ["devices"]
            }
          }
        },
        {
          "name": "Create Device",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n    \"organization_id\": 1,\n    \"department_id\": 1,\n    \"unit_id\": 1,\n    \"name\": \"سيرفر البيانات الرئيسي\",\n    \"device_type\": \"خادم\",\n    \"serial_number\": \"SRV-001-2024\",\n    \"status\": \"active\",\n    \"received_date\": \"2024-04-01\",\n    \"notes\": \"سيرفر رئيسي لقاعدة البيانات\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/devices",
              "host": ["{{base_url}}"],
              "path": ["devices"]
            }
          }
        },
        {
          "name": "Get Device",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/devices/1",
              "host": ["{{base_url}}"],
              "path": ["devices", "1"]
            }
          }
        },
        {
          "name": "Update Device",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n    \"status\": \"under_maintenance\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/devices/1",
              "host": ["{{base_url}}"],
              "path": ["devices", "1"]
            }
          }
        },
        {
          "name": "Delete Device",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{base_url}}/devices/1",
              "host": ["{{base_url}}"],
              "path": ["devices", "1"]
            }
          }
        }
      ]
    },
    {
      "name": "Maintenance",
      "item": [
        {
          "name": "List Maintenance Records",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/maintenance",
              "host": ["{{base_url}}"],
              "path": ["maintenance"]
            }
          }
        },
        {
          "name": "Create Maintenance Record",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n    \"device_id\": 1,\n    \"maintenance_date\": \"2024-10-11\",\n    \"maintenance_type\": \"صيانة دورية\",\n    \"performed_by\": \"فريق الصيانة\",\n    \"notes\": \"فحص دوري وتنظيف\",\n    \"results\": \"تم الفحص بنجاح\",\n    \"next_maintenance_date\": \"2025-01-11\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/maintenance",
              "host": ["{{base_url}}"],
              "path": ["maintenance"]
            }
          }
        },
        {
          "name": "Get Maintenance Record",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/maintenance/1",
              "host": ["{{base_url}}"],
              "path": ["maintenance", "1"]
            }
          }
        },
        {
          "name": "Update Maintenance Record",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n    \"results\": \"تم الفحص بنجاح - لا توجد مشاكل\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/maintenance/1",
              "host": ["{{base_url}}"],
              "path": ["maintenance", "1"]
            }
          }
        },
        {
          "name": "Delete Maintenance Record",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{base_url}}/maintenance/1",
              "host": ["{{base_url}}"],
              "path": ["maintenance", "1"]
            }
          }
        },
        {
          "name": "Get Maintenance Reports",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/maintenance/reports?from=2024-01-01&to=2024-12-31",
              "host": ["{{base_url}}"],
              "path": ["maintenance", "reports"],
              "query": [
                {
                  "key": "from",
                  "value": "2024-01-01"
                },
                {
                  "key": "to",
                  "value": "2024-12-31"
                }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Tree Structure",
      "item": [
        {
          "name": "Get Complete Tree",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/tree",
              "host": ["{{base_url}}"],
              "path": ["tree"]
            }
          }
        },
        {
          "name": "Get Organization Tree",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/tree/organization/1",
              "host": ["{{base_url}}"],
              "path": ["tree", "organization", "1"]
            }
          }
        },
        {
          "name": "Get Department Tree",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/tree/department/1",
              "host": ["{{base_url}}"],
              "path": ["tree", "department", "1"]
            }
          }
        },
        {
          "name": "Get Breadcrumb",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/tree/breadcrumb/unit/1",
              "host": ["{{base_url}}"],
              "path": ["tree", "breadcrumb", "unit", "1"]
            }
          }
        }
      ]
    },
    {
      "name": "Reports",
      "item": [
        {
          "name": "Dashboard Statistics",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/reports/dashboard",
              "host": ["{{base_url}}"],
              "path": ["reports", "dashboard"]
            }
          }
        },
        {
          "name": "Items Report",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/reports/items?organization_id=1",
              "host": ["{{base_url}}"],
              "path": ["reports", "items"],
              "query": [
                {
                  "key": "organization_id",
                  "value": "1"
                }
              ]
            }
          }
        },
        {
          "name": "Devices Report",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/reports/devices?status=active",
              "host": ["{{base_url}}"],
              "path": ["reports", "devices"],
              "query": [
                {
                  "key": "status",
                  "value": "active"
                }
              ]
            }
          }
        },
        {
          "name": "Maintenance Report",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/reports/maintenance?from=2024-01-01&to=2024-12-31",
              "host": ["{{base_url}}"],
              "path": ["reports", "maintenance"],
              "query": [
                {
                  "key": "from",
                  "value": "2024-01-01"
                },
                {
                  "key": "to",
                  "value": "2024-12-31"
                }
              ]
            }
          }
        },
        {
          "name": "Export Items to Excel",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/reports/export/items",
              "host": ["{{base_url}}"],
              "path": ["reports", "export", "items"]
            }
          }
        },
        {
          "name": "Export Devices to Excel",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/reports/export/devices",
              "host": ["{{base_url}}"],
              "path": ["reports", "export", "devices"]
            }
          }
        },
        {
          "name": "Export Maintenance to Excel",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/reports/export/maintenance",
              "host": ["{{base_url}}"],
              "path": ["reports", "export", "maintenance"]
            }
          }
        }
      ]
    }
  ]
}

