{
  "info": {
    "name": "TesterStay \u00b7 Junior QA",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "description": "Start with an existing web session: select the supplied environment and paste its token into token. Create separate session replaces the active environment token; use only when you want a fresh dataset. Read the candidate brief. Add your own boundary requests and assertions. These examples do not reveal the answer key."
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{token}}",
        "type": "string"
      }
    ]
  },
  "item": [
    {
      "name": "01 \u00b7 Connect",
      "item": [
        {
          "name": "Health",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{baseUrl}}/api/health",
            "auth": {
              "type": "noauth"
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Service is healthy\", () => { pm.response.to.have.status(200); pm.expect(pm.response.json().status).to.eql(\"ok\"); });"
                ]
              }
            }
          ]
        },
        {
          "name": "Create separate session (optional)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{baseUrl}}/api/sessions",
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "auth": {
              "type": "noauth"
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Session created\", () => pm.response.to.have.status(201));",
                  "if (pm.response.code === 201) { pm.environment.set(\"token\", pm.response.json().token); }"
                ]
              }
            }
          ]
        },
        {
          "name": "Session",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{baseUrl}}/api/session"
          }
        },
        {
          "name": "Rooms",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{baseUrl}}/api/rooms"
          }
        }
      ]
    },
    {
      "name": "02 \u00b7 Reservations",
      "item": [
        {
          "name": "List bookings",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{baseUrl}}/api/bookings"
          }
        },
        {
          "name": "List confirmed",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{baseUrl}}/api/bookings?status=confirmed"
          }
        },
        {
          "name": "Quote a stay",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{baseUrl}}/api/quotes",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"roomId\": \"r2\",\n  \"checkIn\": \"2026-10-25\",\n  \"checkOut\": \"2026-10-27\",\n  \"guests\": 2\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Create booking",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{baseUrl}}/api/bookings",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"roomId\": \"r2\",\n  \"guestName\": \"Sam Parker\",\n  \"checkIn\": \"2026-10-25\",\n  \"checkOut\": \"2026-10-27\",\n  \"guests\": 2,\n  \"source\": \"postman\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Booking created\", () => pm.response.to.have.status(201));",
                  "if (pm.response.code === 201) { pm.environment.set(\"bookingId\", pm.response.json().id); }",
                  "// Add your own response-value and type assertions here."
                ]
              }
            }
          ]
        },
        {
          "name": "Read booking",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{baseUrl}}/api/bookings/{{bookingId}}"
          }
        },
        {
          "name": "Cancel booking",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{baseUrl}}/api/bookings/{{bookingId}}/cancel",
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Read after cancellation",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{baseUrl}}/api/bookings/{{bookingId}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Cancellation persisted\", () => { pm.response.to.have.status(200); pm.expect(pm.response.json().status).to.eql(\"cancelled\"); });"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "03 \u00b7 Data investigation",
      "item": [
        {
          "name": "Imported reservation",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{baseUrl}}/api/bookings/B1003"
          }
        },
        {
          "name": "Database schema",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{baseUrl}}/api/database/schema"
          }
        },
        {
          "name": "Read reservation data",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{baseUrl}}/api/database/query",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"sql\": \"SELECT * FROM bookings WHERE id = 'B1003';\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "iOS comparison reservation",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{baseUrl}}/api/bookings/B1002"
          }
        }
      ]
    },
    {
      "name": "04 \u00b7 Reset (destructive to your session)",
      "item": [
        {
          "name": "Reset session \u2014 save evidence first",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{baseUrl}}/api/session/reset",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"confirm\": \"RESET\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    }
  ]
}
