{
  "info": {
    "_postman_id": "maintenance-visits-new-endpoints",
    "name": "Maintenance Visits - New Endpoints",
    "description": "New endpoints for visit assets, spare parts, activity log, and rescheduling",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "_exporter_id": "12345"
  },
  "item": [
    {
      "name": "Visit Assets",
      "item": [
        {
          "name": "Add Asset to Visit",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"maintenance_asset_id\": 1\n}"
            },
            "url": {
              "raw": "{{BASE_URL}}/maintenance/visits/{{visit_id}}/assets",
              "host": [
                "{{BASE_URL}}"
              ],
              "path": [
                "maintenance",
                "visits",
                "{{visit_id}}",
                "assets"
              ]
            },
            "description": "Add an asset to a specific visit"
          }
        },
        {
          "name": "Remove Asset from Visit",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/maintenance/visits/{{visit_id}}/assets",
              "host": [
                "{{BASE_URL}}"
              ],
              "path": [
                "maintenance",
                "visits",
                "{{visit_id}}",
                "assets"
              ]
            },
            "description": "Remove an asset from a specific visit"
          }
        }
      ]
    },
    {
      "name": "Visit Spare Parts",
      "item": [
        {
          "name": "Get Spare Parts by Visit",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/maintenance/visits/{{visit_id}}/spare-parts",
              "host": [
                "{{BASE_URL}}"
              ],
              "path": [
                "maintenance",
                "visits",
                "{{visit_id}}",
                "spare-parts"
              ]
            },
            "description": "Get all spare parts for a specific visit"
          }
        },
        {
          "name": "Add Spare Part to Visit",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"maintenance_visit_id\": {{visit_id}},\n  \"spare_part_name\": \"Filter Replacement\",\n  \"part_number\": \"FR-001\",\n  \"quantity\": 2,\n  \"unit_cost\": 150.00,\n  \"source\": \"internal\",\n  \"approval_status\": \"pending\",\n  \"notes\": \"Standard filter replacement\",\n  \"is_for_next_visit\": false\n}"
            },
            "url": {
              "raw": "{{BASE_URL}}/maintenance/visits/{{visit_id}}/spare-parts",
              "host": [
                "{{BASE_URL}}"
              ],
              "path": [
                "maintenance",
                "visits",
                "{{visit_id}}",
                "spare-parts"
              ]
            },
            "description": "Add a new spare part to a visit"
          }
        },
        {
          "name": "Get Spare Part by ID",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/maintenance/visit-spare-parts/{{spare_part_id}}",
              "host": [
                "{{BASE_URL}}"
              ],
              "path": [
                "maintenance",
                "visit-spare-parts",
                "{{spare_part_id}}"
              ]
            },
            "description": "Get a specific spare part by ID"
          }
        },
        {
          "name": "Update Spare Part",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"spare_part_name\": \"Updated Filter Replacement\",\n  \"quantity\": 3,\n  \"unit_cost\": 175.00,\n  \"notes\": \"Updated notes\"\n}"
            },
            "url": {
              "raw": "{{BASE_URL}}/maintenance/visit-spare-parts/{{spare_part_id}}",
              "host": [
                "{{BASE_URL}}"
              ],
              "path": [
                "maintenance",
                "visit-spare-parts",
                "{{spare_part_id}}"
              ]
            },
            "description": "Update a spare part"
          }
        },
        {
          "name": "Delete Spare Part",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/maintenance/visit-spare-parts/{{spare_part_id}}",
              "host": [
                "{{BASE_URL}}"
              ],
              "path": [
                "maintenance",
                "visit-spare-parts",
                "{{spare_part_id}}"
              ]
            },
            "description": "Delete a spare part"
          }
        }
      ]
    },
    {
      "name": "Visit Activity Log",
      "item": [
        {
          "name": "Get Visit Activity Log",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/maintenance/visits/{{visit_id}}/activity-log",
              "host": [
                "{{BASE_URL}}"
              ],
              "path": [
                "maintenance",
                "visits",
                "{{visit_id}}",
                "activity-log"
              ]
            },
            "description": "Get activity log for a specific visit"
          }
        }
      ]
    },
    {
      "name": "Reschedule Visit",
      "item": [
        {
          "name": "Reschedule Visit",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"scheduled_at\": \"2024-12-25 10:00:00\",\n  \"notes\": \"Rescheduled due to technician availability\"\n}"
            },
            "url": {
              "raw": "{{BASE_URL}}/maintenance/visits/{{visit_id}}/reschedule",
              "host": [
                "{{BASE_URL}}"
              ],
              "path": [
                "maintenance",
                "visits",
                "{{visit_id}}",
                "reschedule"
              ]
            },
            "description": "Reschedule a visit to a new date and time"
          }
        }
      ]
    }
  ],
  "variable": [
    {
      "key": "BASE_URL",
      "value": "http://localhost:8000/api",
      "type": "string"
    },
    {
      "key": "access_token",
      "value": "",
      "type": "string"
    },
    {
      "key": "visit_id",
      "value": "1",
      "type": "string"
    },
    {
      "key": "spare_part_id",
      "value": "1",
      "type": "string"
    }
  ]
}

