{
  "info": {
    "_postman_id": "maintenance-visit-comments-api",
    "name": "Maintenance Visit Comments API",
    "description": "API Collection for Maintenance Visit Comments Management",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "item": [
    {
      "name": "Comments",
      "item": [
        {
          "name": "Get All Comments",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/maintenance/visits/{{visitId}}/comments?per_page=15",
              "host": [
                "{{BASE_URL}}"
              ],
              "path": [
                "maintenance",
                "visits",
                "{{visitId}}",
                "comments"
              ],
              "query": [
                {
                  "key": "per_page",
                  "value": "15"
                }
              ]
            },
            "description": "Get paginated list of comments for a maintenance visit"
          },
          "response": []
        },
        {
          "name": "Create Comment",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"comment\": \"The equipment needs urgent maintenance. Check the oil level and bearing condition.\",\n  \"attachment_type\": null\n}"
            },
            "url": {
              "raw": "{{BASE_URL}}/maintenance/visits/{{visitId}}/comments",
              "host": [
                "{{BASE_URL}}"
              ],
              "path": [
                "maintenance",
                "visits",
                "{{visitId}}",
                "comments"
              ]
            },
            "description": "Create a new comment on a maintenance visit"
          },
          "response": []
        },
        {
          "name": "Create Comment with Attachment",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "comment",
                  "value": "Here are the diagnostic photos and maintenance report",
                  "type": "text"
                },
                {
                  "key": "attachment_type",
                  "value": "image",
                  "type": "text"
                },
                {
                  "key": "attachments",
                  "type": "file",
                  "src": []
                }
              ]
            },
            "url": {
              "raw": "{{BASE_URL}}/maintenance/visits/{{visitId}}/comments",
              "host": [
                "{{BASE_URL}}"
              ],
              "path": [
                "maintenance",
                "visits",
                "{{visitId}}",
                "comments"
              ]
            },
            "description": "Create a comment with file attachments"
          },
          "response": []
        },
        {
          "name": "Get Comment Details",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/maintenance/visits/{{visitId}}/comments/{{commentId}}",
              "host": [
                "{{BASE_URL}}"
              ],
              "path": [
                "maintenance",
                "visits",
                "{{visitId}}",
                "comments",
                "{{commentId}}"
              ]
            },
            "description": "Get details of a specific comment"
          },
          "response": []
        },
        {
          "name": "Update Comment",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"comment\": \"Updated comment: The equipment has been inspected and maintenance completed successfully.\"\n}"
            },
            "url": {
              "raw": "{{BASE_URL}}/maintenance/visits/{{visitId}}/comments/{{commentId}}",
              "host": [
                "{{BASE_URL}}"
              ],
              "path": [
                "maintenance",
                "visits",
                "{{visitId}}",
                "comments",
                "{{commentId}}"
              ]
            },
            "description": "Update a comment (only author can update)"
          },
          "response": []
        },
        {
          "name": "Delete Comment",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/maintenance/visits/{{visitId}}/comments/{{commentId}}",
              "host": [
                "{{BASE_URL}}"
              ],
              "path": [
                "maintenance",
                "visits",
                "{{visitId}}",
                "comments",
                "{{commentId}}"
              ]
            },
            "description": "Soft delete a comment (only author or admin)"
          },
          "response": []
        },
        {
          "name": "Restore Comment",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/maintenance/visits/{{visitId}}/comments/{{commentId}}/restore",
              "host": [
                "{{BASE_URL}}"
              ],
              "path": [
                "maintenance",
                "visits",
                "{{visitId}}",
                "comments",
                "{{commentId}}",
                "restore"
              ]
            },
            "description": "Restore a soft deleted comment"
          },
          "response": []
        }
      ]
    }
  ],
  "variable": [
    {
      "key": "BASE_URL",
      "value": "http://localhost:8000/api/v1",
      "type": "string"
    },
    {
      "key": "token",
      "value": "your_bearer_token_here",
      "type": "string"
    },
    {
      "key": "visitId",
      "value": "1",
      "type": "string"
    },
    {
      "key": "commentId",
      "value": "1",
      "type": "string"
    }
  ]
}
