{
  "info": {
    "name": "SDET Practice Lab",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://YOUR-DOMAIN"
    }
  ],
  "item": [
    {
      "name": "Read claim",
      "request": {
        "method": "GET",
        "url": "{{baseUrl}}/api.php?route=claims/1001",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Authorization",
            "value": "Bearer reader-token"
          }
        ]
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test(\"Expected status\", () => pm.response.to.have.status(200));"
            ]
          }
        }
      ]
    },
    {
      "name": "Missing auth",
      "request": {
        "method": "GET",
        "url": "{{baseUrl}}/api.php?route=claims/1001",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ]
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test(\"Expected status\", () => pm.response.to.have.status(401));"
            ]
          }
        }
      ]
    },
    {
      "name": "Forbidden",
      "request": {
        "method": "GET",
        "url": "{{baseUrl}}/api.php?route=admin/claims",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Authorization",
            "value": "Bearer reader-token"
          }
        ]
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test(\"Expected status\", () => pm.response.to.have.status(403));"
            ]
          }
        }
      ]
    },
    {
      "name": "Missing claim",
      "request": {
        "method": "GET",
        "url": "{{baseUrl}}/api.php?route=claims/9999",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Authorization",
            "value": "Bearer reader-token"
          }
        ]
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test(\"Expected status\", () => pm.response.to.have.status(404));"
            ]
          }
        }
      ]
    },
    {
      "name": "Create",
      "request": {
        "method": "POST",
        "url": "{{baseUrl}}/api.php?route=claims",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Authorization",
            "value": "Bearer admin-token"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\"claimId\": 2001, \"memberId\": 501, \"claimAmount\": 250}"
        }
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test(\"Expected status\", () => pm.response.to.have.status(201));"
            ]
          }
        }
      ]
    },
    {
      "name": "Update",
      "request": {
        "method": "PATCH",
        "url": "{{baseUrl}}/api.php?route=claims/2001",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Authorization",
            "value": "Bearer admin-token"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\"status\": \"Approved\"}"
        }
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test(\"Expected status\", () => pm.response.to.have.status(200));"
            ]
          }
        }
      ]
    },
    {
      "name": "Delete",
      "request": {
        "method": "DELETE",
        "url": "{{baseUrl}}/api.php?route=claims/2001",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Authorization",
            "value": "Bearer admin-token"
          }
        ]
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test(\"Expected status\", () => pm.response.to.have.status(204));"
            ]
          }
        }
      ]
    },
    {
      "name": "Fault",
      "request": {
        "method": "GET",
        "url": "{{baseUrl}}/api.php?route=fault",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Authorization",
            "value": "Bearer admin-token"
          }
        ]
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test(\"Expected status\", () => pm.response.to.have.status(500));"
            ]
          }
        }
      ]
    },
    {
      "name": "Reset",
      "request": {
        "method": "POST",
        "url": "{{baseUrl}}/api.php?route=reset",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Authorization",
            "value": "Bearer admin-token"
          }
        ]
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test(\"Expected status\", () => pm.response.to.have.status(200));"
            ]
          }
        }
      ]
    }
  ]
}