{
  "info": {
    "name": "Maintenance Technical Offer API AYA",
    "description": "Complete API collection for Maintenance Technical Offer endpoints AYA",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "BASE_URL",
      "value": "http://localhost:8000/api/v1",
      "type": "string"
    },
    {
      "key": "token",
      "value": "your_auth_token_here",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "1. List All Technical Offers",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{access_token}}",
            "type": "text"
          },
          {
            "key": "Accept",
            "value": "application/json",
            "type": "text"
          }
        ],
        "url": {
          "raw": "{{BASE_URL}}/maintenance/technical-offers?per_page=15&customer_id=&status=&contract_type=",
          "host": ["{{BASE_URL}}"],
          "path": ["maintenance", "technical-offers"],
          "query": [
            {
              "key": "per_page",
              "value": "15",
              "disabled": false
            },
            {
              "key": "page",
              "value": "1",
              "disabled": true
            },
            {
              "key": "customer_id",
              "value": "",
              "disabled": true
            },
            {
              "key": "status",
              "value": "",
              "disabled": true
            },
            {
              "key": "contract_type",
              "value": "",
              "disabled": true
            }
          ]
        },
        "description": "Retrieve paginated list of all technical offers with optional filters"
      }
    },
    {
      "name": "2. Create Technical Offer from Report",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{access_token}}",
            "type": "text"
          },
          {
            "key": "Content-Type",
            "value": "application/json",
            "type": "text"
          },
          {
            "key": "Accept",
            "value": "application/json",
            "type": "text"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"customer_id\": 1,\n  \"maintenance_report_id\": 5,\n  \"contract_type\": \"preventive\",\n  \"visit_count\": 4,\n  \"visit_frequency\": \"quarterly\",\n  \"description\": \"تقديم عرض فني شامل لصيانة أجهزة التكييف\",\n  \"assets\": [\n    {\n      \"asset_id\": 10,\n      \"asset_code\": \"AC-001\",\n      \"asset_name\": \"مكيف هواء LG\",\n      \"serial_number\": \"SN123456\",\n      \"location\": \"المكتب الرئيسي - الطابق الثاني\",\n      \"technical_condition\": \"good\",\n      \"notes\": \"يحتاج تنظيف المرشح الهواء\"\n    },\n    {\n      \"asset_id\": 11,\n      \"asset_code\": \"AC-002\",\n      \"asset_name\": \"مكيف هواء Daikin\",\n      \"serial_number\": \"SN789012\",\n      \"location\": \"غرفة الاجتماعات\",\n      \"technical_condition\": \"fair\",\n      \"notes\": \"بحاجة لإصلاح الكمبروسور\"\n    }\n  ],\n  \"work_scopes\": [\n    {\n      \"work_scope_id\": 1,\n      \"work_scope_name\": \"تنظيف شامل\",\n      \"description\": \"تنظيف كامل الوحدة الداخلية والخارجية\"\n    },\n    {\n      \"work_scope_id\": 2,\n      \"work_scope_name\": \"صيانة دورية\",\n      \"description\": \"فحص وتشحيم الأجزاء المتحركة\"\n    }\n  ]\n}"
        },
        "url": {
          "raw": "{{BASE_URL}}/maintenance/technical-offers/from-report",
          "host": ["{{BASE_URL}}"],
          "path": ["maintenance", "technical-offers", "from-report"]
        },
        "description": "Create a new technical offer from a maintenance report with assets and work scopes"
      }
    },
    {
      "name": "3. Create Technical Offer from Request",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{access_token}}",
            "type": "text"
          },
          {
            "key": "Content-Type",
            "value": "application/json",
            "type": "text"
          },
          {
            "key": "Accept",
            "value": "application/json",
            "type": "text"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"customer_id\": 2,\n  \"maintenance_request_id\": 3,\n  \"contract_type\": \"corrective\",\n  \"description\": \"عرض فني لإصلاح الأجهزة المعطلة\",\n  \"assets\": [\n    {\n      \"asset_id\": 12,\n      \"asset_code\": \"PUMP-001\",\n      \"asset_name\": \"مضخة مياه\",\n      \"serial_number\": \"SN345678\",\n      \"location\": \"الطابق السفلي\",\n      \"technical_condition\": \"poor\",\n      \"notes\": \"معطلة تماماً\"\n    }\n  ],\n  \"work_scopes\": [\n    {\n      \"work_scope_id\": 3,\n      \"work_scope_name\": \"إصلاح وتعويض قطع الغيار\",\n      \"description\": \"إصلاح شامل مع تعويض جميع الأجزاء المعطلة\"\n    }\n  ]\n}"
        },
        "url": {
          "raw": "{{BASE_URL}}/maintenance/technical-offers/from-request",
          "host": ["{{BASE_URL}}"],
          "path": ["maintenance", "technical-offers", "from-request"]
        },
        "description": "Create a new technical offer from a maintenance request"
      }
    },
    {
      "name": "4. Get Technical Offer Details",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{access_token}}",
            "type": "text"
          },
          {
            "key": "Accept",
            "value": "application/json",
            "type": "text"
          }
        ],
        "url": {
          "raw": "{{BASE_URL}}/maintenance/technical-offers/1",
          "host": ["{{BASE_URL}}"],
          "path": ["maintenance", "technical-offers", "1"]
        },
        "description": "Retrieve detailed information of a specific technical offer"
      }
    },
    {
      "name": "5. Update Technical Offer",
      "request": {
        "method": "PUT",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{access_token}}",
            "type": "text"
          },
          {
            "key": "Content-Type",
            "value": "application/json",
            "type": "text"
          },
          {
            "key": "Accept",
            "value": "application/json",
            "type": "text"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"customer_id\": 1,\n  \"contract_type\": \"comprehensive\",\n  \"visit_count\": 6,\n  \"visit_frequency\": \"monthly\",\n  \"description\": \"عرض فني محدث مع شروط أفضل\"\n}"
        },
        "url": {
          "raw": "{{BASE_URL}}/maintenance/technical-offers/1",
          "host": ["{{BASE_URL}}"],
          "path": ["maintenance", "technical-offers", "1"]
        },
        "description": "Update an existing technical offer"
      }
    },
    {
      "name": "6. Add Assets to Technical Offer",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{access_token}}",
            "type": "text"
          },
          {
            "key": "Content-Type",
            "value": "application/json",
            "type": "text"
          },
          {
            "key": "Accept",
            "value": "application/json",
            "type": "text"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"assets\": [\n    {\n      \"asset_id\": 15,\n      \"asset_code\": \"HEATER-001\",\n      \"asset_name\": \"سخان مياه\",\n      \"serial_number\": \"SN456789\",\n      \"location\": \"حمام المكتب\",\n      \"technical_condition\": \"excellent\",\n      \"notes\": \"حديث وفي حالة جيدة\"\n    },\n    {\n      \"asset_id\": 16,\n      \"asset_code\": \"HEATER-002\",\n      \"asset_name\": \"سخان مياه آخر\",\n      \"serial_number\": \"SN567890\",\n      \"location\": \"حمام المستودع\",\n      \"technical_condition\": \"fair\",\n      \"notes\": \"يحتاج معايرة\"\n    }\n  ]\n}"
        },
        "url": {
          "raw": "{{BASE_URL}}/maintenance/technical-offers/1/assets",
          "host": ["{{BASE_URL}}"],
          "path": ["maintenance", "technical-offers", "1", "assets"]
        },
        "description": "Add one or more assets to an existing technical offer"
      }
    },
    {
      "name": "7. Update Assets in Technical Offer",
      "request": {
        "method": "PUT",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{access_token}}",
            "type": "text"
          },
          {
            "key": "Content-Type",
            "value": "application/json",
            "type": "text"
          },
          {
            "key": "Accept",
            "value": "application/json",
            "type": "text"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"assets\": [\n    {\n      \"asset_id\": 10,\n      \"asset_code\": \"AC-001-UPDATED\",\n      \"asset_name\": \"مكيف هواء LG محدث\",\n      \"serial_number\": \"SN123456-V2\",\n      \"location\": \"المكتب الرئيسي - الطابق الثالث\",\n      \"technical_condition\": \"excellent\",\n      \"notes\": \"تم تحديث البيانات\"\n    }\n  ]\n}"
        },
        "url": {
          "raw": "{{BASE_URL}}/maintenance/technical-offers/1/assets",
          "host": ["{{BASE_URL}}"],
          "path": ["maintenance", "technical-offers", "1", "assets"]
        },
        "description": "Update assets information in a technical offer"
      }
    },
    {
      "name": "8. Add Work Scopes to Technical Offer",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{access_token}}",
            "type": "text"
          },
          {
            "key": "Content-Type",
            "value": "application/json",
            "type": "text"
          },
          {
            "key": "Accept",
            "value": "application/json",
            "type": "text"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"work_scopes\": [\n    {\n      \"work_scope_id\": 4,\n      \"work_scope_name\": \"استبدال الأجزاء المعطلة\",\n      \"description\": \"استبدال كامل للأجزاء المعطلة بأجزاء أصلية\"\n    },\n    {\n      \"work_scope_id\": 5,\n      \"work_scope_name\": \"اختبار الأداء\",\n      \"description\": \"اختبار شامل بعد الصيانة\"\n    }\n  ]\n}"
        },
        "url": {
          "raw": "{{BASE_URL}}/maintenance/technical-offers/1/work-scopes",
          "host": ["{{BASE_URL}}"],
          "path": ["maintenance", "technical-offers", "1", "work-scopes"]
        },
        "description": "Add work scopes to a technical offer"
      }
    },
    {
      "name": "9. Update Work Scopes in Technical Offer",
      "request": {
        "method": "PUT",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{access_token}}",
            "type": "text"
          },
          {
            "key": "Content-Type",
            "value": "application/json",
            "type": "text"
          },
          {
            "key": "Accept",
            "value": "application/json",
            "type": "text"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"work_scopes\": [\n    {\n      \"work_scope_id\": 1,\n      \"work_scope_name\": \"تنظيف متقدم\",\n      \"description\": \"تنظيف متقدم مع استخدام معدات متخصصة\"\n    },\n    {\n      \"work_scope_id\": 2,\n      \"work_scope_name\": \"صيانة دورية محسّنة\",\n      \"description\": \"صيانة دورية مع فحوصات إضافية\"\n    }\n  ]\n}"
        },
        "url": {
          "raw": "{{BASE_URL}}/maintenance/technical-offers/1/work-scopes",
          "host": ["{{BASE_URL}}"],
          "path": ["maintenance", "technical-offers", "1", "work-scopes"]
        },
        "description": "Update work scopes in a technical offer"
      }
    },
    {
      "name": "10. Save Technical Offer as Draft",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{access_token}}",
            "type": "text"
          },
          {
            "key": "Accept",
            "value": "application/json",
            "type": "text"
          }
        ],
        "url": {
          "raw": "{{BASE_URL}}/maintenance/technical-offers/1/draft",
          "host": ["{{BASE_URL}}"],
          "path": ["maintenance", "technical-offers", "1", "draft"]
        },
        "description": "Save a technical offer as draft (no body required)"
      }
    },
    {
      "name": "11. Finalize Technical Offer",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{access_token}}",
            "type": "text"
          },
          {
            "key": "Accept",
            "value": "application/json",
            "type": "text"
          }
        ],
        "url": {
          "raw": "{{BASE_URL}}/maintenance/technical-offers/1/finalize",
          "host": ["{{BASE_URL}}"],
          "path": ["maintenance", "technical-offers", "1", "finalize"]
        },
        "description": "Finalize a technical offer (no body required)"
      }
    },
    {
      "name": "12. Approve Technical Offer",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{access_token}}",
            "type": "text"
          },
          {
            "key": "Accept",
            "value": "application/json",
            "type": "text"
          }
        ],
        "url": {
          "raw": "{{BASE_URL}}/maintenance/technical-offers/1/approve",
          "host": ["{{BASE_URL}}"],
          "path": ["maintenance", "technical-offers", "1", "approve"]
        },
        "description": "Approve a technical offer (no body required)"
      }
    },
    {
      "name": "13. Reject Technical Offer",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{access_token}}",
            "type": "text"
          },
          {
            "key": "Content-Type",
            "value": "application/json",
            "type": "text"
          },
          {
            "key": "Accept",
            "value": "application/json",
            "type": "text"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"rejection_reason\": \"السعر أعلى من الميزانية المتاحة\"\n}"
        },
        "url": {
          "raw": "{{BASE_URL}}/maintenance/technical-offers/1/reject",
          "host": ["{{BASE_URL}}"],
          "path": ["maintenance", "technical-offers", "1", "reject"]
        },
        "description": "Reject a technical offer with optional rejection reason"
      }
    },
    {
      "name": "14. Delete Technical Offer",
      "request": {
        "method": "DELETE",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{access_token}}",
            "type": "text"
          },
          {
            "key": "Accept",
            "value": "application/json",
            "type": "text"
          }
        ],
        "url": {
          "raw": "{{BASE_URL}}/maintenance/technical-offers/1",
          "host": ["{{BASE_URL}}"],
          "path": ["maintenance", "technical-offers", "1"]
        },
        "description": "Delete a technical offer (no body required)"
      }
    }
  ]
}
