{"info":{"_postman_id":"8f16bfe0-5d1c-4699-a961-5b233d22fa0f","name":"Asset Tracking API Tests","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"description":"<html><head></head><body></body></html>","owner":"44230207","collectionId":"8f16bfe0-5d1c-4699-a961-5b233d22fa0f","publishedId":"2sB2cd5e13","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2025-04-19T12:08:44.000Z"},"item":[{"name":"Authentication","item":[{"name":"Login User","event":[{"listen":"test","script":{"id":"7e0ea5dc-7624-450a-ae91-54f19b7bfa98","exec":["pm.test(\"Status code is 200 OK\", function () {\r","    pm.response.to.have.status(200);\r","});\r","\r","pm.test(\"Response contains access_token\", function () {\r","    var jsonData = pm.response.json();\r","    pm.expect(jsonData).to.have.property(\"access_token\");\r","    pm.expect(jsonData.access_token).to.be.a('string');\r","});\r","\r","pm.test(\"Set authToken environment variable\", function () {\r","    var jsonData = pm.response.json();\r","    if (jsonData.access_token) {\r","        pm.environment.set(\"authToken\", jsonData.access_token);\r","        console.log(\"Auth Token set.\");\r","    } else {\r","        console.error(\"Access token not found in response.\");\r","    }\r","});\r","\r","pm.test(\"Response should have Set-Cookie headers\", function () {\r","    // Check if cookies are being set as well\r","    pm.expect(pm.response.headers.has('Set-Cookie')).to.be.true;\r","    // More specific cookie checks can be added if needed\r","});"],"type":"text/javascript","packages":{}}}],"id":"9abcf550-b364-467e-89da-c7c4d4775f42","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"email\": \"{{userEmail}}\",\r\n    \"password\": \"{{userPassword}}\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/api/login","description":"<h1 id=\"login-api\">Login API</h1>\n<p>This API endpoint is used to authenticate and login a user.</p>\n<h2 id=\"request\">Request</h2>\n<ul>\n<li><p>Method: POST</p>\n</li>\n<li><p>Endpoint: {{baseURL}}/api/login</p>\n</li>\n<li><p>Content-Type: application/json</p>\n</li>\n</ul>\n<h3 id=\"request-body-parameters\">Request Body Parameters</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>email</td>\n<td>string</td>\n<td>The email address of the user</td>\n</tr>\n<tr>\n<td>password</td>\n<td>string</td>\n<td>The password of the user</td>\n</tr>\n</tbody>\n</table>\n</div><p>Example:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"email\": \"{{userEmail}}\",\n    \"password\": \"{{userPassword}}\"\n}\n## Response\nThe response for this request is a JSON object with the following schema:\n```json\n{\n    \"type\": \"object\",\n    \"properties\": {\n        \"token\": {\n            \"type\": \"string\"\n        }\n    }\n}\n\n</code></pre>\n<p>The response contains a token which can be used for further authenticated requests.</p>\n","urlObject":{"path":["api","login"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"9abcf550-b364-467e-89da-c7c4d4775f42"},{"name":"Identify User","event":[{"listen":"test","script":{"id":"ec5bdad1-8904-4901-a7de-a1b53c3d8744","exec":["pm.test(\"Status code is 200 OK\", function () {\r","    pm.response.to.have.status(200);\r","});\r","\r","pm.test(\"Response body contains user identifier\", function () {\r","    var jsonData = pm.response.json();\r","    // Example: Check if the message contains the user's email or ID\r","    // Adjust based on your actual response structure\r","     pm.expect(jsonData.message).to.include(pm.environment.get(\"userEmail\"));\r","    // or check for ID if it's included\r","    // pm.expect(jsonData.message).to.include(\"id\");\r","});"],"type":"text/javascript","packages":{}}}],"id":"c2517d7e-46cc-410d-a5d0-a2981a744c90","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{authToken}}","type":"text"}],"url":"{{baseURL}}/api/identify","description":"<h3 id=\"identify-api\">Identify API</h3>\n<p>This API endpoint sends an HTTP GET request to the specified URL in order to identify the resource.</p>\n<h4 id=\"request\">Request</h4>\n<p>The request does not require a request body. It only includes the base URL and the endpoint URL.</p>\n<ul>\n<li><code>baseURL</code> (string, required): The base URL for the API.</li>\n</ul>\n<h4 id=\"response\">Response</h4>\n<p>The response for this request is a JSON schema describing the structure of the response data.</p>\n","urlObject":{"path":["api","identify"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"c2517d7e-46cc-410d-a5d0-a2981a744c90"},{"name":"Logout User","event":[{"listen":"test","script":{"id":"00ec9ddd-f352-4ccb-9320-3ba6a0a06afc","exec":["pm.test(\"Status code is 302 Found (Redirect)\", function () {\r","    // Flask redirect usually returns 302\r","    pm.response.to.have.status(302);\r","});\r","\r","pm.test(\"Response should clear the 'access_token' cookie\", function () {\r","    // --- Configuration ---\r","    // Set the exact name of the cookie you expect to be cleared.\r","    // This should match your Flask config's JWT_ACCESS_COOKIE_NAME.\r","    const targetCookieName = \"access_token\";\r","    // --- End Configuration ---\r","\r","    let cookieCleared = false;\r","    let foundMatchingCookieHeader = false;\r","    const receivedSetCookieHeaders = [];\r","\r","    // 1. Iterate through all response headers\r","    pm.response.headers.all().forEach(header => {\r","        // 2. Check if it's a 'Set-Cookie' header (case-insensitive)\r","        if (header.key.toLowerCase() === 'set-cookie') {\r","            const cookieString = header.value;\r","            receivedSetCookieHeaders.push(cookieString); // Store for debugging\r","\r","            // 3. Check if this specific header targets our cookie\r","            //    It must start with \"cookieName=\"\r","            if (cookieString.trim().startsWith(targetCookieName + \"=\")) {\r","                foundMatchingCookieHeader = true; // We found a header for our cookie\r","\r","                // 4. Check if this header contains instructions to clear the cookie\r","                //    Method A: Max-Age=0\r","                const hasMaxAgeZero = cookieString.includes('Max-Age=0');\r","\r","                //    Method B: Expires date in the past (specifically checking Unix epoch start)\r","                //    Adjust the date string if your server uses a slightly different past date format\r","                const hasPastExpires = cookieString.includes('Expires=Thu, 01 Jan 1970');\r","\r","                if (hasMaxAgeZero || hasPastExpires) {\r","                    cookieCleared = true;\r","                    // We found a header that both targets the cookie AND clears it.\r","                    // We can technically stop checking now, but looping through all is fine.\r","                }\r","            }\r","        }\r","    });\r","\r","    // 5. Assertion and Debugging Output\r","    if (!cookieCleared) {\r","        // Log detailed information only if the test fails\r","        console.error(`TEST FAILED: Did not find a valid clearing directive for the '${targetCookieName}' cookie.`);\r","        if (!foundMatchingCookieHeader) {\r","            console.log(`  - Reason: No 'Set-Cookie' header starting with '${targetCookieName}=' was found.`);\r","        } else {\r","            console.log(`  - Reason: Found 'Set-Cookie' header(s) for '${targetCookieName}', but none contained 'Max-Age=0' or 'Expires=Thu, 01 Jan 1970...'.`);\r","        }\r","        console.log(\"  - Received 'Set-Cookie' Headers were:\");\r","        if (receivedSetCookieHeaders.length > 0) {\r","            receivedSetCookieHeaders.forEach((h, index) => console.log(`    [${index}]: ${h}`));\r","        } else {\r","            console.log(\"    (None)\");\r","        }\r","    }\r","\r","    // The actual assertion\r","    pm.expect(cookieCleared, `Expected a Set-Cookie header to clear the '${targetCookieName}' cookie via Max-Age=0 or Expires=past_date`).to.be.true;\r","});\r","\r","pm.test(\"Clear authToken environment variable\", function () {\r","    pm.environment.unset(\"authToken\");\r","    console.log(\"Auth Token cleared.\");\r","});"],"type":"text/javascript","packages":{}}}],"id":"abe12be2-4c5a-46a1-b80b-9ae223668709","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{authToken}}","type":"text"}],"url":"{{baseURL}}/logout","description":"<p>This endpoint sends an HTTP GET request to {{baseURL}}/logout to log the user out of the system.</p>\n<p>The response of this request can be documented as a JSON schema:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"type\": \"object\",\n  \"properties\": {\n    \"status\": {\n      \"type\": \"string\"\n    },\n    \"message\": {\n      \"type\": \"string\"\n    }\n  }\n}\n\n</code></pre>\n","urlObject":{"path":["logout"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"abe12be2-4c5a-46a1-b80b-9ae223668709"},{"name":"Identify User (After Logout)","event":[{"listen":"test","script":{"id":"1eeff02b-3e45-4a73-99af-cba02298c3fe","exec":["pm.test(\"Status code is 401 Unauthorized\", function () {\r","    pm.response.to.have.status(401);\r","});"],"type":"text/javascript","packages":{}}}],"id":"a7fed656-4055-4e90-b5de-ed30be66c25d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{baseURL}}/api/identify","description":"<h3 id=\"identify-api\">Identify API</h3>\n<p>This API endpoint makes an HTTP GET request to {{baseURL}}/api/identify in order to identify the user.</p>\n<h4 id=\"request\">Request</h4>\n<p>The request does not require any specific parameters.</p>\n<h4 id=\"response\">Response</h4>\n<p>The response for this request is a JSON object containing the identification details of the user. You can refer to the JSON schema below for the structure of the response:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"type\": \"object\",\n  \"properties\": {\n    \"userId\": {\n      \"type\": \"string\"\n    },\n    \"userName\": {\n      \"type\": \"string\"\n    },\n    \"userType\": {\n      \"type\": \"string\"\n    }\n  }\n}\n\n</code></pre>\n","urlObject":{"path":["api","identify"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"a7fed656-4055-4e90-b5de-ed30be66c25d"},{"name":"Login for rest of test","event":[{"listen":"test","script":{"id":"7e0ea5dc-7624-450a-ae91-54f19b7bfa98","exec":["pm.test(\"Status code is 200 OK\", function () {\r","    pm.response.to.have.status(200);\r","});\r","\r","pm.test(\"Response contains access_token\", function () {\r","    var jsonData = pm.response.json();\r","    pm.expect(jsonData).to.have.property(\"access_token\");\r","    pm.expect(jsonData.access_token).to.be.a('string');\r","});\r","\r","pm.test(\"Set authToken environment variable\", function () {\r","    var jsonData = pm.response.json();\r","    if (jsonData.access_token) {\r","        pm.environment.set(\"authToken\", jsonData.access_token);\r","        console.log(\"Auth Token set.\");\r","    } else {\r","        console.error(\"Access token not found in response.\");\r","    }\r","});\r","\r","pm.test(\"Response should have Set-Cookie headers\", function () {\r","    // Check if cookies are being set as well\r","    pm.expect(pm.response.headers.has('Set-Cookie')).to.be.true;\r","    // More specific cookie checks can be added if needed\r","});"],"type":"text/javascript","packages":{}}}],"id":"e0505836-4ff8-4b82-ba63-4142598d9383","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"email\": \"{{userEmail}}\",\r\n    \"password\": \"{{userPassword}}\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/api/login","description":"<h3 id=\"login-api\">Login API</h3>\n<p>This API endpoint is used to authenticate and login a user.</p>\n<h4 id=\"request-body\">Request Body</h4>\n<ul>\n<li><p><code>email</code> (string) - The email of the user.</p>\n</li>\n<li><p><code>password</code> (string) - The password of the user.</p>\n</li>\n</ul>\n<h4 id=\"response\">Response</h4>\n<p>The response will include the authentication token and user information upon successful login.</p>\n","urlObject":{"path":["api","login"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"e0505836-4ff8-4b82-ba63-4142598d9383"}],"id":"fba2f404-067e-4e45-ba71-a3e28e26627d","_postman_id":"fba2f404-067e-4e45-ba71-a3e28e26627d","description":""},{"name":"Assets","item":[{"name":"Get All Assets","event":[{"listen":"test","script":{"id":"0ce4dec0-5d51-4888-a6df-22ee3677bf39","exec":["pm.test(\"Status code is 200 OK\", function () {\r","    pm.response.to.have.status(200);\r","});\r","\r","pm.test(\"Response is a JSON array\", function () {\r","    pm.response.to.be.json;\r","    pm.expect(pm.response.json()).to.be.an('array');\r","});\r","\r","pm.test(\"Assets have expected properties\", function () {\r","    const assets = pm.response.json();\r","    if (assets.length > 0) {\r","        pm.expect(assets[0]).to.have.property('id');\r","        pm.expect(assets[0]).to.have.property('description');\r","        pm.expect(assets[0]).to.have.property('room_id');\r","        pm.expect(assets[0]).to.have.property('status');\r","        pm.expect(assets[0]).to.have.property('assignee_name'); // Check enriched data\r","        pm.expect(assets[0]).to.have.property('room_name'); // Check enriched data\r","    }\r","});"],"type":"text/javascript","packages":{}}}],"id":"67561beb-55b7-46a6-83bb-04ca6f4f5866","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{authToken}}","type":"text"}],"url":"{{baseURL}}/api/assets","description":"<h3 id=\"retrieve-assets\">Retrieve Assets</h3>\n<p>This endpoint is used to retrieve a list of assets.</p>\n<h4 id=\"request\">Request</h4>\n<ul>\n<li><p>Method: GET</p>\n</li>\n<li><p>URL: <code>{{baseURL}}/api/assets</code></p>\n</li>\n</ul>\n<h4 id=\"response\">Response</h4>\n<p>The response for this request follows the JSON schema below:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"type\": \"object\",\n  \"properties\": {\n    \"assets\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"assetId\": {\n            \"type\": \"string\"\n          },\n          \"assetName\": {\n            \"type\": \"string\"\n          },\n          \"assetType\": {\n            \"type\": \"string\"\n          },\n          \"location\": {\n            \"type\": \"string\"\n          }\n          // ... additional properties\n        }\n      }\n    }\n  }\n}\n\n</code></pre>\n","urlObject":{"path":["api","assets"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"67561beb-55b7-46a6-83bb-04ca6f4f5866"},{"name":"Create New Asset","event":[{"listen":"test","script":{"id":"b273dc74-dddd-42be-8ea8-690bf5c762dd","exec":["pm.test(\"Status code is 201 Created\", function () {\r","    pm.response.to.have.status(201);\r","});\r","\r","pm.test(\"Response indicates success\", function () {\r","    var jsonData = pm.response.json();\r","    pm.expect(jsonData.success).to.be.true;\r","    pm.expect(jsonData).to.have.property('asset');\r","    pm.expect(jsonData.asset).to.have.property('id');\r","});\r","\r","pm.test(\"Set newAssetId environment variable\", function () {\r","    var jsonData = pm.response.json();\r","    if (jsonData.asset && jsonData.asset.id) {\r","        pm.environment.set(\"newAssetId\", jsonData.asset.id);\r","        console.log(\"New Asset ID set:\", jsonData.asset.id);\r","    } else {\r","         console.error(\"Could not find asset ID in response to save.\");\r","    }\r","});"],"type":"text/javascript","packages":{}}},{"listen":"prerequest","script":{"id":"9a2bacbb-884d-4804-9e87-e0bbec5e543e","exec":[],"type":"text/javascript"}}],"id":"aa8ba741-2cc3-412d-9a47-2e2f7fbffcb3","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{authToken}}","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"id\": \"PM_TEST_1786989274\", // Unique ID using Postman variable\r\n    \"description\": \"Postman Test Asset\",\r\n    \"brand\": \"TestBrand\",\r\n    \"model\": \"TestModel\",\r\n    \"serial_number\": \"PM727\",\r\n    \"room_id\": \"1\", // Use a valid room ID from your defaults\r\n    \"assignee_name\": \"John Doe\", // Use a valid assignee name from your defaults\r\n    \"notes\": \"Created via Postman test\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/api/asset/add","description":"<p>This endpoint allows you to add a new asset by sending an HTTP POST request to {{baseURL}}/api/asset/add. The request should include the following parameters in the request body:</p>\n<ul>\n<li><p><code>id</code> (string): The unique identifier for the asset, which can be set using the format \"PM_TEST_1786989274\" to include a timestamp in the ID.</p>\n</li>\n<li><p><code>description</code> (string): A brief description of the asset, such as \"Postman Test Asset\".</p>\n</li>\n<li><p><code>brand</code> (string): The brand of the asset, for example, \"TestBrand\".</p>\n</li>\n<li><p><code>model</code> (string): The model of the asset, e.g., \"TestModel\".</p>\n</li>\n<li><p><code>serial_number</code> (string): The serial number of the asset, which can be set using the format \"PM673\" to include a random integer in the serial number.</p>\n</li>\n<li><p><code>room_id</code> (string): The ID of the room where the asset is located, such as \"1\".</p>\n</li>\n<li><p><code>assignee_name</code> (string): The name of the person assigned to the asset, for example, \"John Doe\".</p>\n</li>\n<li><p><code>notes</code> (string): Any additional notes or comments related to the asset, such as \"Created via Postman test\".</p>\n</li>\n</ul>\n<p>The response to this request will provide information about the newly added asset.</p>\n","urlObject":{"path":["api","asset","add"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"aa8ba741-2cc3-412d-9a47-2e2f7fbffcb3"},{"name":"Get Created Asset","event":[{"listen":"test","script":{"id":"174f4c68-0a2e-4158-9f2d-cdc3267cfacd","exec":["pm.test(\"Status code is 200 OK\", function () {\r","    pm.response.to.have.status(200);\r","});\r","\r","pm.test(\"Response contains the correct asset ID\", function () {\r","    var jsonData = pm.response.json();\r","     // Asset ID might be in 'id' or 'id:' depending on your get_json\r","    const idKey = jsonData.hasOwnProperty('id') ? 'id' : 'id:';\r","    pm.expect(jsonData[idKey]).to.eql(pm.environment.get(\"newAssetId\"));\r","});\r","\r"," pm.test(\"Response contains enriched data (room_name, assignee_name)\", function () {\r","    var jsonData = pm.response.json();\r","    pm.expect(jsonData).to.have.property('room_name');\r","    pm.expect(jsonData).to.have.property('assignee_name');\r","});"],"type":"text/javascript","packages":{}}},{"listen":"prerequest","script":{"id":"a3539c82-76cc-4978-a5a0-3c3f364af109","exec":[],"type":"text/javascript"}}],"id":"3d8242fa-30ef-4ab5-88a9-f3e3957679ba","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"{{authToken}}","type":"text"}],"url":"{{baseURL}}/api/asset/{{newAssetId}}","description":"<p>This endpoint retrieves information about a specific asset identified by the provided asset ID. The request does not contain a request body, as it is a GET request. The response will include details about the asset such as its name, type, location, and other relevant information.</p>\n","urlObject":{"path":["api","asset","{{newAssetId}}"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"3d8242fa-30ef-4ab5-88a9-f3e3957679ba"},{"name":"Update Asset Details","event":[{"listen":"test","script":{"id":"12f18995-9f9e-4fe1-ba28-4eda7cab7d41","exec":["pm.test(\"Status code is 200 OK\", function () {\r","    pm.response.to.have.status(200);\r","});\r","\r","pm.test(\"Response indicates success\", function () {\r","    var jsonData = pm.response.json();\r","    pm.expect(jsonData.success).to.be.true;\r","    pm.expect(jsonData.message).to.include(\"updated successfully\");\r","});\r","\r","pm.test(\"Response contains updated asset data\", function () {\r","    var jsonData = pm.response.json();\r","    pm.expect(jsonData.asset.description).to.eql(\"Updated Postman Test Asset\");\r","    pm.expect(jsonData.asset.assignee_id).to.eql(2); // Check if assignee ID changed\r","});"],"type":"text/javascript","packages":{}}},{"listen":"prerequest","script":{"id":"2c84eed7-787f-4a04-8241-8a2742c195fe","exec":[],"type":"text/javascript"}}],"id":"9176c01f-1bd2-4a93-b4a8-f4b0cd42f015","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"},{"key":"Authorization","value":"Bearer {{authToken}}","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"description\": \"Updated Postman Test Asset\",\r\n    \"brand\": \"UpdatedBrand\",\r\n    \"model\": \"UpdatedModel\",\r\n    \"serial_number\": \"PM265_UPD\",\r\n    \"assignee_id\": 2, // Change assignee\r\n    \"notes\": \"Updated via Postman test\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/api/asset/{{newAssetId}}/update","description":"<h3 id=\"update-asset\">Update Asset</h3>\n<p>This endpoint is used to update an existing asset with the provided details.</p>\n<h4 id=\"request-body\">Request Body</h4>\n<ul>\n<li><p><code>description</code> (string): Updated description of the asset.</p>\n</li>\n<li><p><code>brand</code> (string): Updated brand of the asset.</p>\n</li>\n<li><p><code>model</code> (string): Updated model of the asset.</p>\n</li>\n<li><p><code>serial_number</code> (string): Updated serial number of the asset.</p>\n</li>\n<li><p><code>assignee_id</code> (integer): ID of the user to whom the asset is assigned.</p>\n</li>\n<li><p><code>notes</code> (string): Additional notes or comments for the asset.</p>\n</li>\n</ul>\n<h4 id=\"response\">Response</h4>\n<p>The response for this request will be a JSON object conforming to the following schema:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"type\": \"object\",\n  \"properties\": {\n    \"status\": {\n      \"type\": \"string\"\n    },\n    \"message\": {\n      \"type\": \"string\"\n    }\n  }\n}\n\n</code></pre>\n","urlObject":{"path":["api","asset","{{newAssetId}}","update"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"9176c01f-1bd2-4a93-b4a8-f4b0cd42f015"},{"name":"Mark Asset Found (Example Status Change)","event":[{"listen":"test","script":{"id":"d7e372be-d116-46b5-aa43-5fb92e34f0b9","exec":["pm.test(\"Status code is 200 OK\", function () {\r","    pm.response.to.have.status(200);\r","});\r","\r","pm.test(\"Response indicates success\", function () {\r","    var jsonData = pm.response.json();\r","    pm.expect(jsonData.success).to.be.true;\r","});\r","\r","pm.test(\"Asset status is now 'Good'\", function () {\r","    var jsonData = pm.response.json();\r","    pm.expect(jsonData.asset.status).to.eql(\"Good\");\r","});"],"type":"text/javascript","packages":{}}},{"listen":"prerequest","script":{"id":"691007b2-67cb-43f1-91ec-190d9eeb7084","exec":[],"type":"text/javascript"}}],"id":"1aa69987-63b0-4cb2-b1a5-cebba51597e9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{authToken}}","type":"text"}],"url":"{{baseURL}}/api/asset/{{newAssetId}}/mark-found","description":"<h3 id=\"mark-asset-as-found\">Mark Asset as Found</h3>\n<p>This endpoint is used to mark a specific asset as found.</p>\n<h4 id=\"request-body\">Request Body</h4>\n<ul>\n<li><code>foundDate</code> (string, required): The date when the asset was found.</li>\n</ul>\n<h4 id=\"response-body\">Response Body</h4>\n<p>The response of this request is a JSON schema. Please refer to the schema for details.</p>\n","urlObject":{"path":["api","asset","{{newAssetId}}","mark-found"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"1aa69987-63b0-4cb2-b1a5-cebba51597e9"},{"name":"Upload Assets CSV (Structure Only)","event":[{"listen":"test","script":{"id":"67ed2193-a5be-444e-b2fc-0a8ce8b05734","exec":["pm.test(\"Status code is 200 OK\", function () {\r","    // This might be 400 if the file is invalid, adjust as needed\r","    pm.expect(pm.response.code).to.be.oneOf([200, 400]);\r","});\r","\r","pm.test(\"Response indicates success or failure with details\", function () {\r","    var jsonData = pm.response.json();\r","    pm.expect(jsonData).to.have.property('success'); // Should be true or false\r","    pm.expect(jsonData).to.have.property('message');\r","    pm.expect(jsonData).to.have.property('details'); // Contains import/skip counts, errors\r","});"],"type":"text/javascript","packages":{}}},{"listen":"prerequest","script":{"id":"849b0b78-4e25-4ec6-998d-737f9234f766","exec":[],"type":"text/javascript"}}],"id":"8abd7aa3-d805-4108-acc2-bedc045ed728","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{authToken}}","type":"text"}],"body":{"mode":"formdata","formdata":[{"key":"csvFile","type":"file","uuid":"957d2370-76be-4fa0-ade8-716c25bfb9c4","src":"postman-cloud:///1f01ce93-b35e-41b0-94eb-364df7230545"}]},"url":"{{baseURL}}/api/upload/assets-csv","description":"<h3 id=\"upload-assets-csv\">Upload Assets CSV</h3>\n<p>This endpoint allows you to upload a CSV file containing assets data.</p>\n<h4 id=\"request\">Request</h4>\n<p>The request should be made using the HTTP POST method to the following URL: <code>{{baseURL}}/api/upload/assets-csv</code></p>\n<h5 id=\"request-body\">Request Body</h5>\n<ul>\n<li><code>csvFile</code> (file): The CSV file containing assets data.</li>\n</ul>\n<h4 id=\"response\">Response</h4>\n<p>The response for this request is a JSON object conforming to the following schema:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"type\": \"object\",\n  \"properties\": {\n    // Define the properties of the response JSON schema here\n  }\n}\n\n</code></pre>\n","urlObject":{"path":["api","upload","assets-csv"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"8abd7aa3-d805-4108-acc2-bedc045ed728"}],"id":"0ab961b7-6d89-4dbf-99cb-b31d6d9893d9","_postman_id":"0ab961b7-6d89-4dbf-99cb-b31d6d9893d9","description":""},{"name":"Locations","item":[{"name":"Clean deletion","item":[{"name":"Create Building for Deletion Test","event":[{"listen":"test","script":{"id":"4173c556-ba5f-44ed-995a-5a2d78d68fc8","exec":["pm.test(\"Status code is 200 OK\", function () {\r","    pm.response.to.have.status(200);\r","});\r","pm.test(\"Response indicates success and returns building data\", function () {\r","    const jsonData = pm.response.json();\r","    pm.expect(jsonData.success).to.be.true;\r","    pm.expect(jsonData).to.have.property('building');\r","    pm.expect(jsonData.building).to.have.property('building_id');\r","    // Use a dedicated variable for this test sequence\r","    pm.environment.set(\"testBuildingId\", jsonData.building.building_id);\r","    console.log(\"Test Building ID set:\", jsonData.building.building_id);\r","});"],"type":"text/javascript","packages":{}}}],"id":"d29ee188-8c5e-48be-bf0e-2127524e2ba3","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"},{"key":"Authorization","value":"Bearer {{authToken}}","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"building_name\": \"BuildingToDelete_1786989274\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/api/building/add","description":"<p>This endpoint allows you to add a new building to the system. The request should be sent as an HTTP POST to {{baseURL}}/api/building/add with the following payload in the raw request body:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"building_name\": \"BuildingToDelete_{{$timestamp} ...\"\n}\n\n</code></pre>\n<p>Upon successful execution, the response will include the details of the newly added building.</p>\n","urlObject":{"path":["api","building","add"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"d29ee188-8c5e-48be-bf0e-2127524e2ba3"},{"name":"Create Floor for Deletion Test","event":[{"listen":"test","script":{"id":"36e0f60b-b5c2-437b-a768-44f374beac8d","exec":["pm.test(\"Status code is 200 OK\", function () {\r","    pm.response.to.have.status(200);\r","});\r","pm.test(\"Response indicates success and returns floor data\", function () {\r","    const jsonData = pm.response.json();\r","    pm.expect(jsonData.success).to.be.true;\r","    pm.expect(jsonData).to.have.property('floor');\r","    pm.expect(jsonData.floor).to.have.property('floor_id');\r","    pm.expect(jsonData.floor.building_id).to.eql(pm.environment.get(\"testBuildingId\"));\r","    // Use a dedicated variable for this test sequence\r","    pm.environment.set(\"testFloorId\", jsonData.floor.floor_id);\r","    console.log(\"Test Floor ID set:\", jsonData.floor.floor_id);\r","});"],"type":"text/javascript","packages":{}}}],"id":"a16a6abc-fe1c-4751-b5eb-d8810b9bb422","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"building_id\": \"{{testBuildingId}}\", // Use the specific ID for this test\r\n    \"floor_name\": \"FloorToDelete_1786989274\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/api/floor/add?Content-Type=application/json&Authorization=Bearer {{authToken}}","description":"<h2 id=\"add-floor\">Add Floor</h2>\n<p>This endpoint allows the user to add a new floor to a building.</p>\n<h3 id=\"request\">Request</h3>\n<ul>\n<li><p>Method: POST</p>\n</li>\n<li><p>Base URL: {{baseURL}}</p>\n</li>\n<li><p>Path: /api/floor/add</p>\n</li>\n<li><p>Headers:</p>\n<ul>\n<li><p>Content-Type: application/json</p>\n</li>\n<li><p>Authorization: Bearer {{authToken}}</p>\n</li>\n</ul>\n</li>\n<li><p>Body:</p>\n<ul>\n<li><p>building_id (string, required): The ID of the building to which the floor belongs.</p>\n</li>\n<li><p>floor_name (string, required): The name of the floor to be added.</p>\n</li>\n</ul>\n</li>\n</ul>\n<p>Example:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"building_id\": \"{{testBuildingId}}\",\n  \"floor_name\": \"FloorToDelete_1786989274\"\n}\n### Response\nThe response for this request will be a JSON object with the schema:\n```json\n{\n  \"type\": \"object\",\n  \"properties\": {\n    // Response properties here\n  }\n}\n\n</code></pre>\n","urlObject":{"path":["api","floor","add"],"host":["{{baseURL}}"],"query":[{"key":"Content-Type","value":"application/json"},{"key":"Authorization","value":"Bearer {{authToken}}"}],"variable":[]}},"response":[],"_postman_id":"a16a6abc-fe1c-4751-b5eb-d8810b9bb422"},{"name":"Create Room for Deletion Test","event":[{"listen":"test","script":{"id":"455bd704-12fb-497a-83d7-f0bf34641f36","exec":["pm.test(\"Status code is 200 OK\", function () {\r","    pm.response.to.have.status(200);\r","});\r","pm.test(\"Response indicates success and returns room data\", function () {\r","    const jsonData = pm.response.json();\r","    pm.expect(jsonData.success).to.be.true;\r","    pm.expect(jsonData).to.have.property('room');\r","    pm.expect(jsonData.room).to.have.property('room_id');\r","    pm.expect(jsonData.room.floor_id).to.eql(pm.environment.get(\"testFloorId\"));\r","    // Use a dedicated variable for this test sequence\r","    pm.environment.set(\"testRoomId\", jsonData.room.room_id);\r","    console.log(\"Test Room ID set:\", jsonData.room.room_id);\r","});"],"type":"text/javascript","packages":{}}}],"id":"0a23596a-920b-4351-979f-f02b3a94d3d6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"floor_id\": \"{{testFloorId}}\", // Use the specific ID for this test\r\n    \"room_name\": \"RoomToDelete_1786989274\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/api/room/add?Content-Type=application/json&Authorization=Bearer {{authToken}}","description":"<p>The endpoint allows the addition of a new room via an HTTP POST request to {{baseURL}}/api/room/add. The request should include the \"Content-Type\" header set to \"application/json\" and the \"Authorization\" header with a bearer token in the format \"Bearer {{authToken}}\".</p>\n<p>The request body should be in raw JSON format and include the \"floor_id\" and \"room_name\" parameters. The \"floor_id\" should contain the ID of the floor where the room is to be added, and the \"room_name\" should specify the name of the room. The \"room_name\" parameter supports the use of 1786989274 as a placeholder for the current timestamp.</p>\n<p>The response to this request will be documented as a JSON schema.</p>\n","urlObject":{"path":["api","room","add"],"host":["{{baseURL}}"],"query":[{"key":"Content-Type","value":"application/json"},{"key":"Authorization","value":"Bearer {{authToken}}"}],"variable":[]}},"response":[],"_postman_id":"0a23596a-920b-4351-979f-f02b3a94d3d6"},{"name":"Delete the Newly Created (Empty) Room","event":[{"listen":"test","script":{"id":"ac885cbb-92ac-448a-b66b-a6a54ab48556","exec":["// Test: Expect SUCCESSFUL deletion (200 OK) because this room should be empty\r","pm.test(\"Status code is 200 OK (Successful Deletion Expected)\", function () {\r","    pm.response.to.have.status(200);\r","});\r","\r","// Test: Check the response message for success\r","pm.test(\"Response message indicates successful deletion\", function () {\r","    const jsonData = pm.response.json();\r","    pm.expect(jsonData.success).to.be.true;\r","    pm.expect(jsonData.message).to.eql(\"Room deleted successfully\");\r","});\r","\r","// Test: Clear the environment variable now that it's deleted\r","pm.test(\"Clear testRoomId environment variable\", function () {\r","    pm.environment.unset(\"testRoomId\");\r","    console.log(\"Cleared testRoomId.\");\r","});"],"type":"text/javascript","packages":{}}}],"id":"5f9e6ffd-f888-4b86-bde5-891d143900c9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer {{authToken}}","type":"text"}],"url":"{{baseURL}}/api/room/{{testRoomId}}/delete","description":"<h3 id=\"delete-room\">Delete Room</h3>\n<p>This endpoint is used to delete a specific room.</p>\n<h4 id=\"request-body\">Request Body</h4>\n<ul>\n<li>No request body is required for this endpoint.</li>\n</ul>\n<h4 id=\"response\">Response</h4>\n<ul>\n<li>The response will not contain a body, but will return a status code to indicate the success or failure of the deletion operation.</li>\n</ul>\n","urlObject":{"path":["api","room","{{testRoomId}}","delete"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"5f9e6ffd-f888-4b86-bde5-891d143900c9"},{"name":"Floor is Empty","event":[{"listen":"test","script":{"id":"d0996c09-f8b4-4395-a454-d4011b48f278","exec":["pm.test(\"Status code is 200 OK\", function () {\r","    pm.response.to.have.status(200);\r","});\r","pm.test(\"Response body is an empty array\", function () {\r","    const rooms = pm.response.json();\r","    pm.expect(rooms).to.be.an('array').with.lengthOf(0, \"Expected no rooms left on this floor after room deletion\");\r","});"],"type":"text/javascript","packages":{}}},{"listen":"prerequest","script":{"id":"59b312ee-2e93-4351-9d69-52227192bf87","exec":[],"type":"text/javascript"}}],"id":"1b29c3a7-b4d1-4054-8501-3160740b4e08","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{authToken}}","type":"text"}],"url":"{{baseURL}}/api/rooms/{{testFloorId}}","description":"<p>This endpoint makes an HTTP GET request to retrieve information about a specific room on the specified floor. The request should include the floor ID in the URL path.</p>\n<h3 id=\"request-body\">Request Body</h3>\n<p>This request does not require a request body.</p>\n<h3 id=\"response-body\">Response Body</h3>\n<ul>\n<li><p><code>roomId</code> (string): The unique identifier of the room.</p>\n</li>\n<li><p><code>roomName</code> (string): The name or number of the room.</p>\n</li>\n<li><p><code>roomCapacity</code> (integer): The maximum capacity of the room in terms of number of people.</p>\n</li>\n<li><p><code>roomStatus</code> (string): The current status of the room (e.g., available, occupied).</p>\n</li>\n<li><p><code>roomFeatures</code> (array of strings): The list of features available in the room.</p>\n</li>\n</ul>\n","urlObject":{"path":["api","rooms","{{testFloorId}}"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"1b29c3a7-b4d1-4054-8501-3160740b4e08"},{"name":"Delete the Test Floor","event":[{"listen":"test","script":{"id":"ad5eaa3f-c18c-4e88-9636-5cc9a5ffea71","exec":["pm.test(\"Status code is 200 OK (Successful Deletion Expected)\", function () {\r","     // Since the room was deleted, floor deletion should succeed\r","    pm.response.to.have.status(200);\r","});\r","pm.test(\"Response indicates success\", function () {\r","    const jsonData = pm.response.json();\r","     pm.expect(jsonData.success).to.be.true;\r","     pm.expect(jsonData.message).to.eql(\"Floor deleted successfully\");\r","});\r","pm.test(\"Clear testFloorId environment variable\", function () {\r","     pm.environment.unset(\"testFloorId\");\r","     console.log(\"Cleared testFloorId.\");\r","});"],"type":"text/javascript","packages":{}}},{"listen":"prerequest","script":{"id":"93e21295-c409-4b96-9e10-35e03a5680ae","exec":[],"type":"text/javascript"}}],"id":"8a72e185-f946-40aa-bf10-dac8e60cfa70","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer {{authToken}}","type":"text"}],"url":"{{baseURL}}/api/floor/{{testFloorId}}/delete","description":"<h3 id=\"delete-floor\">Delete Floor</h3>\n<p>This endpoint is used to delete a specific floor.</p>\n<h4 id=\"request\">Request</h4>\n<ul>\n<li><p>Method: DELETE</p>\n</li>\n<li><p>URL: <code>{{baseURL}}/api/floor/{{testFloorId}}/delete</code></p>\n</li>\n<li><p>Path Parameters:</p>\n<ul>\n<li><code>testFloorId</code>: The unique identifier of the floor to be deleted.</li>\n</ul>\n</li>\n</ul>\n<h4 id=\"response\">Response</h4>\n<p>The response for this request is a JSON object conforming to the following schema:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"type\": \"object\",\n  \"properties\": {\n    \"message\": {\n      \"type\": \"string\"\n    }\n  }\n}\n\n</code></pre>\n<p>The response body contains a <code>message</code> property which provides information about the success or failure of the deletion operation.</p>\n","urlObject":{"path":["api","floor","{{testFloorId}}","delete"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"8a72e185-f946-40aa-bf10-dac8e60cfa70"},{"name":"Delete the Test Building","event":[{"listen":"test","script":{"id":"63f0bddf-5ccc-4b15-8048-d2b4691e9c92","exec":["pm.test(\"Status code is 200 OK (Successful Deletion Expected)\", function () {\r","    // Since the floor was deleted, building deletion should succeed\r","    pm.response.to.have.status(200);\r","});\r","pm.test(\"Response indicates success\", function () {\r","     const jsonData = pm.response.json();\r","     pm.expect(jsonData.success).to.be.true;\r","     pm.expect(jsonData.message).to.eql(\"Building deleted successfully\");\r","});\r","pm.test(\"Clear testBuildingId environment variable\", function () {\r","     pm.environment.unset(\"testBuildingId\");\r","     console.log(\"Cleared testBuildingId.\");\r","});"],"type":"text/javascript","packages":{}}},{"listen":"prerequest","script":{"id":"bf91ac8d-3bf7-4cdf-abb0-1451ce6f0844","exec":[],"type":"text/javascript"}}],"id":"e452e70e-e0f2-4f37-92ab-5e9dfadd74f5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer {{authToken}}","type":"text"}],"url":"{{baseURL}}/api/building/{{testBuildingId}}/delete","description":"<h3 id=\"delete-apibuildingtestbuildingiddelete\">DELETE /api/building/{{testBuildingId}}/delete</h3>\n<p>This endpoint is used to delete a specific building identified by the <code>testBuildingId</code>.</p>\n<h4 id=\"request\">Request</h4>\n<ul>\n<li>No request body is required for this endpoint.</li>\n</ul>\n<h4 id=\"response\">Response</h4>\n<p>The response for this request is a JSON schema representing the success or failure of the deletion operation. The schema includes the following properties:</p>\n<ul>\n<li><p><code>status</code>: (string) Indicates the status of the deletion operation.</p>\n</li>\n<li><p><code>message</code>: (string) Provides a message related to the deletion operation.</p>\n</li>\n</ul>\n<p>Example Response:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"status\": \"success\",\n  \"message\": \"Building deleted successfully\"\n}\n\n</code></pre>\n","urlObject":{"path":["api","building","{{testBuildingId}}","delete"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"e452e70e-e0f2-4f37-92ab-5e9dfadd74f5"}],"id":"2638aaae-25db-4dfe-8a18-6fc35ab87ee5","_postman_id":"2638aaae-25db-4dfe-8a18-6fc35ab87ee5","description":""},{"name":"Get All Buildings","event":[{"listen":"test","script":{"id":"ceb3aa51-0ffc-4862-b093-24738e1deb85","exec":["pm.test(\"Status code is 200 OK\", function () {\r","    pm.response.to.have.status(200);\r","});\r","pm.test(\"Response is a JSON array\", function () {\r","    pm.expect(pm.response.json()).to.be.an('array');\r","});"],"type":"text/javascript","packages":{}}}],"id":"ad3b196f-6019-4f61-ac78-6f08c5c0292c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":" Bearer {{authToken}}","type":"text"}],"url":"{{baseURL}}/api/buildings","description":"<h3 id=\"get-buildings\">Get Buildings</h3>\n<p>This endpoint is used to retrieve a list of buildings.</p>\n<h4 id=\"request-body\">Request Body</h4>\n<p>This request does not require a request body.</p>\n<h4 id=\"response\">Response</h4>\n<ul>\n<li><code>buildings</code>: An array of building objects containing information about each building, such as building name, address, and other details.</li>\n</ul>\n<p>Example:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"buildings\": [\n        {\n            \"name\": \"Building 1\",\n            \"address\": \"123 Main Street\",\n            ...\n        },\n        {\n            \"name\": \"Building 2\",\n            \"address\": \"456 Elm Street\",\n            ...\n        },\n        ...\n    ]\n}\n\n</code></pre>\n","urlObject":{"path":["api","buildings"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"ad3b196f-6019-4f61-ac78-6f08c5c0292c"},{"name":"Create New Building","event":[{"listen":"test","script":{"id":"42bfc66b-b3f3-40c9-8455-0cac73074044","exec":["pm.test(\"Status code is 200 OK\", function () { // API returns 200 based on code\r","    pm.response.to.have.status(200);\r","});\r","pm.test(\"Response indicates success and returns building data\", function () {\r","    const jsonData = pm.response.json();\r","    pm.expect(jsonData.success).to.be.true;\r","    pm.expect(jsonData).to.have.property('building');\r","    pm.expect(jsonData.building).to.have.property('building_id');\r","    pm.environment.set(\"newBuildingId\", jsonData.building.building_id);\r","    console.log(\"New Building ID set:\", jsonData.building.building_id);\r","});"],"type":"text/javascript","packages":{}}}],"id":"49a440fe-41c3-486d-99a9-e047b9563c33","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"},{"key":"Authorization","value":"Bearer {{authToken}}","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"building_name\": \"Postman Test Building 680\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/api/building/add","description":"<h3 id=\"add-building\">Add Building</h3>\n<p>This endpoint allows the addition of a new building.</p>\n<h4 id=\"request-body\">Request Body</h4>\n<ul>\n<li><code>building_name</code> (string, required): The name of the building.</li>\n</ul>\n<h4 id=\"response\">Response</h4>\n<p>The response for this request follows the JSON schema below:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"type\": \"object\",\n  \"properties\": {\n    \"status\": {\n      \"type\": \"string\"\n    },\n    \"message\": {\n      \"type\": \"string\"\n    }\n  }\n}\n\n</code></pre>\n","urlObject":{"path":["api","building","add"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"49a440fe-41c3-486d-99a9-e047b9563c33"},{"name":"Create New Floor","event":[{"listen":"test","script":{"id":"effcbb6f-daa6-4f3a-b060-98289c7b8b90","exec":["pm.test(\"Status code is 200 OK\", function () { // API returns 200\r","    pm.response.to.have.status(200);\r","});\r","pm.test(\"Response indicates success and returns floor data\", function () {\r","    const jsonData = pm.response.json();\r","    pm.expect(jsonData.success).to.be.true;\r","    pm.expect(jsonData).to.have.property('floor');\r","    pm.expect(jsonData.floor).to.have.property('floor_id');\r","    pm.expect(jsonData.floor.building_id).to.eql(pm.environment.get(\"newBuildingId\"));\r","\r","    // Save the new floor ID for subsequent requests\r","    pm.environment.set(\"newFloorId\", jsonData.floor.floor_id);\r","    console.log(\"New Floor ID set:\", jsonData.floor.floor_id);\r","});"],"type":"text/javascript","packages":{}}}],"id":"7bda26e7-2980-4120-9f46-bcd2488b458b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"},{"key":"Authorization","value":"Bearer {{authToken}}","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"building_id\": \"{{newBuildingId}}\", // Assumes newBuildingId was set by \"Create New Building\"\r\n    \"floor_name\": \"PM Floor 354\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/api/floor/add","description":"<h3 id=\"add-floor\">Add Floor</h3>\n<p>This endpoint allows the addition of a new floor to a building.</p>\n<h4 id=\"request\">Request</h4>\n<ul>\n<li><p>Method: POST</p>\n</li>\n<li><p>URL: <code>{{baseURL}}/api/floor/add</code></p>\n</li>\n<li><p>Body:</p>\n<ul>\n<li><p><code>building_id</code> (string, required): The ID of the building to which the floor belongs.</p>\n</li>\n<li><p><code>floor_name</code> (string, required): The name of the new floor.</p>\n</li>\n</ul>\n</li>\n</ul>\n<h4 id=\"response\">Response</h4>\n<p>The response for this request is a JSON object with the following schema:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"type\": \"object\",\n    \"properties\": {\n        \"status\": {\n            \"type\": \"string\"\n        },\n        \"message\": {\n            \"type\": \"string\"\n        },\n        \"floor_id\": {\n            \"type\": \"string\"\n        }\n    }\n}\n\n</code></pre>\n<ul>\n<li><p><code>status</code> (string): The status of the response.</p>\n</li>\n<li><p><code>message</code> (string): A message providing information about the operation.</p>\n</li>\n<li><p><code>floor_id</code> (string): The ID of the newly added floor.</p>\n</li>\n</ul>\n","urlObject":{"path":["api","floor","add"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"7bda26e7-2980-4120-9f46-bcd2488b458b"},{"name":"Get Floors for Building","event":[{"listen":"test","script":{"id":"4992199a-1b5a-43b6-9905-bf2773a7f437","exec":["pm.test(\"Status code is 200 OK\", function () {\r","    pm.response.to.have.status(200);\r","});\r","pm.test(\"Response is a JSON array\", function () {\r","    pm.expect(pm.response.json()).to.be.an('array');\r","});\r","pm.test(\"Response includes the newly created floor\", function () {\r","    const floors = pm.response.json();\r","    const newFloorId = pm.environment.get(\"newFloorId\");\r","    if (newFloorId) {\r","        const found = floors.some(floor => floor.floor_id === newFloorId);\r","        pm.expect(found, \"Newly created floor ID should be in the list\").to.be.true;\r","    } else {\r","        console.warn(\"Skipping floor check: newFloorId not set in environment.\");\r","    }\r","});"],"type":"text/javascript","packages":{}}}],"id":"482ce455-3402-49f4-a1ae-ea975073b019","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{authToken}}","type":"text"}],"url":"{{baseURL}}/api/floors/{{newBuildingId}}","description":"<h3 id=\"get-building-floors\">Get Building Floors</h3>\n<p>This endpoint retrieves the floors of a specific building.</p>\n<h4 id=\"request\">Request</h4>\n<ul>\n<li><p>Method: GET</p>\n</li>\n<li><p>URL: <code>{{baseURL}}/api/floors/{{newBuildingId}}</code></p>\n</li>\n</ul>\n<h4 id=\"response\">Response</h4>\n<p>The response for this request can be documented as a JSON schema. The schema will describe the structure of the response body returned by the API endpoint.</p>\n","urlObject":{"path":["api","floors","{{newBuildingId}}"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"482ce455-3402-49f4-a1ae-ea975073b019"},{"name":"Create New Room","event":[{"listen":"test","script":{"id":"c3d5c41b-0a66-45cd-86ef-50fb815b6c88","exec":["pm.test(\"Status code is 200 OK\", function () { // API returns 200\r","    pm.response.to.have.status(200);\r","});\r","pm.test(\"Response indicates success and returns room data\", function () {\r","    const jsonData = pm.response.json();\r","    pm.expect(jsonData.success).to.be.true;\r","    pm.expect(jsonData).to.have.property('room');\r","    pm.expect(jsonData.room).to.have.property('room_id');\r","    pm.expect(jsonData.room.floor_id).to.eql(pm.environment.get(\"newFloorId\"));\r","\r","    // Save the new room ID\r","    pm.environment.set(\"newRoomId\", jsonData.room.room_id);\r","    console.log(\"New Room ID set:\", jsonData.room.room_id);\r","});"],"type":"text/javascript","packages":{}}}],"id":"b62fc87e-d1d9-4603-92d0-7f24444689fd","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"},{"key":"Authorization","value":"Bearer {{authToken}}","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"floor_id\": \"{{newFloorId}}\", // Assumes newFloorId was set by \"Create New Floor\"\r\n    \"room_name\": \"PM Room 540\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/api/room/add","description":"<h3 id=\"add-room\">Add Room</h3>\n<p>This endpoint allows you to add a new room to a specific floor.</p>\n<h4 id=\"request\">Request</h4>\n<ul>\n<li><p>Method: POST</p>\n</li>\n<li><p>URL: <code>{{baseURL}}/api/room/add</code></p>\n</li>\n<li><p>Body:</p>\n<ul>\n<li><p><code>floor_id</code> (string, required): The ID of the floor to which the room belongs.</p>\n</li>\n<li><p><code>room_name</code> (string, required): The name of the room.</p>\n</li>\n</ul>\n</li>\n</ul>\n<h4 id=\"response\">Response</h4>\n<p>The response for this request is a JSON object following the schema below:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"type\": \"object\",\n  \"properties\": {\n    \"status\": {\n      \"type\": \"string\"\n    },\n    \"message\": {\n      \"type\": \"string\"\n    },\n    \"room_id\": {\n      \"type\": \"string\"\n    }\n  }\n}\n\n</code></pre>\n","urlObject":{"path":["api","room","add"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"b62fc87e-d1d9-4603-92d0-7f24444689fd"},{"name":"Get Rooms for Floor","event":[{"listen":"test","script":{"id":"ad0ac3f6-9039-45a3-8d3d-4a695213b0a8","exec":["pm.test(\"Status code is 200 OK\", function () {\r","    pm.response.to.have.status(200);\r","});\r","pm.test(\"Response is a JSON array\", function () {\r","    pm.expect(pm.response.json()).to.be.an('array');\r","});\r","pm.test(\"Response includes the newly created room\", function () {\r","    const rooms = pm.response.json();\r","    const newRoomId = pm.environment.get(\"newRoomId\");\r","    if (newRoomId) {\r","        const found = rooms.some(room => room.room_id === newRoomId);\r","        pm.expect(found, \"Newly created room ID should be in the list\").to.be.true;\r","    } else {\r","        console.warn(\"Skipping room check: newRoomId not set in environment.\");\r","    }\r","});"],"type":"text/javascript","packages":{}}},{"listen":"prerequest","script":{"id":"8b411926-8042-41c1-b8f3-24b717738f72","exec":[],"type":"text/javascript"}}],"id":"6f3b9fe7-cd81-4c29-af14-cacbc8eb1fba","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{authToken}}","type":"text"}],"url":"{{baseURL}}/api/rooms/{{newFloorId}}","description":"<p>This endpoint makes an HTTP GET request to retrieve information about a specific room on the specified floor. The request URL should be in the format {{baseURL}}/api/rooms/{{newFloorId}}.</p>\n<h3 id=\"request\">Request</h3>\n<p>No request body is required for this request. The <code>newFloorId</code> parameter should be included in the request URL to specify the floor for which the room information is being retrieved.</p>\n<h3 id=\"response\">Response</h3>\n<p>The response will be a JSON object representing the details of the room on the specified floor. The JSON schema for the response can be documented as follows:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"type\": \"object\",\n  \"properties\": {\n    \"roomId\": {\n      \"type\": \"string\"\n    },\n    \"roomName\": {\n      \"type\": \"string\"\n    },\n    \"roomCapacity\": {\n      \"type\": \"integer\"\n    },\n    \"roomStatus\": {\n      \"type\": \"string\"\n    }\n    // Additional properties may be included based on the specific room details\n  }\n}\n\n</code></pre>\n","urlObject":{"path":["api","rooms","{{newFloorId}}"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"6f3b9fe7-cd81-4c29-af14-cacbc8eb1fba"},{"name":"Update Room","event":[{"listen":"test","script":{"id":"012af02e-9e00-4fdb-b783-9f61198a0025","exec":["pm.test(\"Status code is 200 OK\", function () {\r","    pm.response.to.have.status(200);\r","});\r","pm.test(\"Response indicates success\", function () {\r","    const jsonData = pm.response.json();\r","    pm.expect(jsonData.success).to.be.true;\r","    pm.expect(jsonData.message).to.eql(\"Room updated successfully\");\r","});"],"type":"text/javascript","packages":{}}},{"listen":"prerequest","script":{"id":"b8c792b1-2dd0-489f-8a49-0eaf5a507b63","exec":[],"type":"text/javascript"}}],"id":"2db8089e-3a1e-4cd8-8a99-afd4afc3867c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"},{"key":"Authorization","value":"Bearer {{authToken}}","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"floor_id\": \"{{newFloorId}}\",\r\n    \"room_name\": \"Updated PM Room 113\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/api/room/{{newRoomId}}/update","description":"<p>This endpoint is used to update a specific room identified by the <code>newRoomId</code> within the API. The HTTP POST request should be made to <code>{{baseURL}}/api/room/{{newRoomId}}/update</code>. The request body should be in raw format and include the following parameters:</p>\n<ul>\n<li><p><code>floor_id</code>: The ID of the new floor to which the room will be assigned.</p>\n</li>\n<li><p><code>room_name</code>: The updated name for the room.</p>\n</li>\n</ul>\n<p>The response to this request will contain the updated details of the room, including its ID, floor assignment, and name.</p>\n","urlObject":{"path":["api","room","{{newRoomId}}","update"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"2db8089e-3a1e-4cd8-8a99-afd4afc3867c"},{"name":"Delete Room","event":[{"listen":"test","script":{"id":"81603f56-0bb6-4fe7-b31b-fb4f4ee244f9","exec":["// Test: Check for expected status codes (Success or Failure)\r","pm.test(\"Status code is 200 OK (Success) or 400 Bad Request (Failure)\", function () {\r","    // Allow either 200 (if deletion succeeds) or 400 (if deletion fails due to usage)\r","    pm.expect(pm.response.code).to.be.oneOf([200, 400]);\r","});\r","\r","// Test: Check the response message based on the status code\r","pm.test(\"Response message matches status\", function () {\r","    const jsonData = pm.response.json();\r","    pm.expect(jsonData).to.have.property('success'); // Should always have success key\r","    pm.expect(jsonData).to.have.property('message'); // Should always have message key\r","\r","    if (pm.response.code === 200) {\r","        // If status is 200, expect success\r","        pm.expect(jsonData.success).to.be.true;\r","        pm.expect(jsonData.message).to.eql(\"Room deleted successfully\");\r","    } else if (pm.response.code === 400) {\r","        // If status is 400, expect failure and the specific message\r","        pm.expect(jsonData.success).to.be.false;\r","        pm.expect(jsonData.message).to.include(\"Failed to delete room\"); // Check includes part of the message\r","        pm.expect(jsonData.message).to.include(\"in use by assets\"); // Check includes part of the message\r","    } else {\r","        // If status is something else entirely, fail the test explicitly\r","        pm.expect.fail(`Unexpected status code: ${pm.response.code}`);\r","    }\r","});\r","\r","// Test: Clear environment variable ONLY on successful deletion\r","pm.test(\"Clear newRoomId environment variable on success\", function () {\r","    if (pm.response.code === 200) {\r","        pm.environment.unset(\"newRoomId\");\r","        console.log(\"Cleared newRoomId because deletion was successful.\");\r","    } else if (pm.response.code === 400) {\r","         console.log(\"Did not clear newRoomId because deletion failed (room likely in use).\");\r","    } else {\r","         console.warn(`Did not clear newRoomId due to unexpected status code: ${pm.response.code}`);\r","    }\r","    // This test doesn't strictly assert anything, but logs the action.\r","    // If you wanted to assert it was *not* cleared on 400, you could add:\r","    // else if (pm.response.code === 400) {\r","    //     pm.expect(pm.environment.has(\"newRoomId\")).to.be.true;\r","    // }\r","});"],"type":"text/javascript","packages":{}}},{"listen":"prerequest","script":{"id":"a7784c27-d41c-44ca-829d-ad43903f39a8","exec":[],"type":"text/javascript"}}],"id":"edfbf146-642c-4ac1-bf43-2ce6cbb20641","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer {{authToken}}","type":"text"}],"url":"{{baseURL}}/api/room/{{newRoomId}}/delete","description":"<h3 id=\"delete-room\">Delete Room</h3>\n<p>This endpoint is used to delete a specific room.</p>\n<h4 id=\"request\">Request</h4>\n<ul>\n<li><p>Method: DELETE</p>\n</li>\n<li><p>URL: <code>{{baseURL}}/api/room/{{newRoomId}}/delete</code></p>\n</li>\n<li><p>Path Parameters:</p>\n<ul>\n<li><code>newRoomId</code>: The ID of the room to be deleted.</li>\n</ul>\n</li>\n</ul>\n<h4 id=\"response\">Response</h4>\n<p>The response for this request is a JSON schema. The schema includes the following properties:</p>\n<ul>\n<li><p><code>status</code>: The status of the request, indicating success or failure.</p>\n</li>\n<li><p><code>message</code>: A message providing information about the result of the request.</p>\n</li>\n</ul>\n<p>Example Response:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"status\": \"success\",\n  \"message\": \"Room deleted successfully\"\n}\n\n</code></pre>\n","urlObject":{"path":["api","room","{{newRoomId}}","delete"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"edfbf146-642c-4ac1-bf43-2ce6cbb20641"},{"name":"Update Floor","event":[{"listen":"test","script":{"id":"0ae2b477-0efc-496f-beb3-b0d42c0fbad2","exec":["pm.test(\"Status code is 200 OK\", function () {\r","    pm.response.to.have.status(200);\r","});\r","pm.test(\"Response indicates success\", function () {\r","    const jsonData = pm.response.json();\r","    pm.expect(jsonData.success).to.be.true;\r","    pm.expect(jsonData.message).to.eql(\"Floor updated successfully\");\r","});"],"type":"text/javascript","packages":{}}}],"id":"811c09ba-8d70-4fd7-8700-1bf86848dc5e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"},{"key":"Authorization","value":"Bearer {{authToken}}","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"building_id\": \"{{newBuildingId}}\",\r\n    \"floor_name\": \"Updated PM Floor 816\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/api/floor/{{newFloorId}}/update","description":"<h3 id=\"update-floor\">Update Floor</h3>\n<p>This endpoint is used to update a specific floor in a building.</p>\n<h4 id=\"request\">Request</h4>\n<ul>\n<li><p>Method: POST</p>\n</li>\n<li><p>URL: {{baseURL}}/api/floor/{{newFloorId}}/update</p>\n</li>\n<li><p>Headers:</p>\n<ul>\n<li>Content-Type: application/json</li>\n</ul>\n</li>\n<li><p>{ \"building_id\": \"{{newBuildingId}}\", \"floor_name\": \"Updated PM Floor {{$randomInt} ...\"}</p>\n</li>\n</ul>\n<h4 id=\"response\">Response</h4>\n<p>The response for this request is a JSON object following the schema below:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"type\": \"object\",\n  \"properties\": {\n    \"status\": {\n      \"type\": \"string\"\n    },\n    \"message\": {\n      \"type\": \"string\"\n    }\n  }\n}\n\n</code></pre>\n","urlObject":{"path":["api","floor","{{newFloorId}}","update"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"811c09ba-8d70-4fd7-8700-1bf86848dc5e"},{"name":"Delete Floor","event":[{"listen":"test","script":{"id":"957b9214-a08d-4b0e-9e94-942ee030368b","exec":["pm.test(\"Status code is 200 OK (assuming room was deleted first)\", function () {\r","     // If the previous Delete Room request failed or was skipped,\r","     // this might return 400 because the floor isn't empty.\r","     pm.expect(pm.response.code).to.be.oneOf([200, 400]);\r","});\r","\r","pm.test(\"Check success message if status is 200\", function () {\r","    if(pm.response.code === 200){\r","        const jsonData = pm.response.json();\r","        pm.expect(jsonData.success).to.be.true;\r","        pm.expect(jsonData.message).to.eql(\"Floor deleted successfully\");\r","\r","        // Clear variable only on successful delete\r","        pm.environment.unset(\"newFloorId\");\r","        console.log(\"Cleared newFloorId\");\r","    } else {\r","         console.warn(\"Floor deletion likely skipped or failed (expected 400?), not clearing newFloorId.\");\r","    }\r","});"],"type":"text/javascript","packages":{}}}],"id":"4e1bd48f-4190-427f-b6c9-fcf5214503c7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer {{authToken}}","type":"text"}],"url":"{{baseURL}}/api/floor/{{newFloorId}}/delete","description":"<h3 id=\"delete-floor\">Delete Floor</h3>\n<p>This endpoint is used to delete a specific floor by providing the <code>newFloorId</code> in the URL path.</p>\n<h4 id=\"request\">Request</h4>\n<ul>\n<li><p>Method: DELETE</p>\n</li>\n<li><p>URL: <code>{{baseURL}}/api/floor/{{newFloorId}}/delete</code></p>\n</li>\n</ul>\n<h4 id=\"response\">Response</h4>\n<p>The response for this request is a JSON schema that represents the structure of the response body. It includes the properties and data types of the response object.</p>\n","urlObject":{"path":["api","floor","{{newFloorId}}","delete"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"4e1bd48f-4190-427f-b6c9-fcf5214503c7"},{"name":"Update Building","event":[{"listen":"test","script":{"id":"ed00c83c-c83a-4b21-89ac-f841b6b510e6","exec":["pm.test(\"Status code is 200 OK\", function () {\r","    pm.response.to.have.status(200);\r","});\r","pm.test(\"Response indicates success\", function () {\r","    pm.expect(pm.response.json().success).to.be.true;\r","});"],"type":"text/javascript","packages":{}}}],"id":"b9ecacb3-2651-4964-9fbd-e11e865e64ab","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"},{"key":"Authorization","value":"Bearer {{authToken}}","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"building_name\": \"Updated Postman Building 655\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/api/building/{{newBuildingId}}/update","description":"<p>The API endpoint <code>POST /api/building/{{newBuildingId}}/update</code> is used to update a specific building with the provided ID. The request should include the updated details of the building in the request body.</p>\n<h3 id=\"request-body\">Request Body</h3>\n<ul>\n<li><code>building_name</code> (string, required): The updated name of the building.</li>\n</ul>\n<h3 id=\"response\">Response</h3>\n<p>The response of this request is a JSON schema representing the structure of the response data. It will define the properties and data types of the response object.</p>\n<p>Example JSON Schema:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"type\": \"object\",\n  \"properties\": {\n    \"status\": {\n      \"type\": \"string\"\n    },\n    \"message\": {\n      \"type\": \"string\"\n    },\n    \"data\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"building_id\": {\n          \"type\": \"string\"\n        },\n        \"building_name\": {\n          \"type\": \"string\"\n        },\n        \"updated_at\": {\n          \"type\": \"string\",\n          \"format\": \"date-time\"\n        }\n      }\n    }\n  }\n}\n\n</code></pre>\n","urlObject":{"path":["api","building","{{newBuildingId}}","update"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"b9ecacb3-2651-4964-9fbd-e11e865e64ab"},{"name":"Delete Building","event":[{"listen":"test","script":{"id":"1440bb41-b10d-475d-802e-8d38ac1d2266","exec":["pm.test(\"Status code is 200 OK\", function () {\r","    pm.response.to.have.status(200);\r","});\r","pm.test(\"Response indicates success\", function () {\r","     pm.expect(pm.response.json().success).to.be.true;\r","});\r","pm.test(\"Clear newBuildingId environment variable\", function () {\r","     pm.environment.unset(\"newBuildingId\");\r","});"],"type":"text/javascript","packages":{}}}],"id":"57308920-5c83-474e-a99a-5eb9e17c1dd6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer {{authToken}}","type":"text"}],"url":"{{baseURL}}/api/building/{{newBuildingId}}/delete","description":"<h3 id=\"delete-building\">Delete Building</h3>\n<p>This endpoint is used to delete a specific building by providing the ID of the building to be deleted.</p>\n<h4 id=\"request-body\">Request Body</h4>\n<ul>\n<li>No request body is required for this DELETE request.</li>\n</ul>\n<h4 id=\"response\">Response</h4>\n<ul>\n<li>The response will indicate the success or failure of the deletion operation.</li>\n</ul>\n","urlObject":{"path":["api","building","{{newBuildingId}}","delete"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"57308920-5c83-474e-a99a-5eb9e17c1dd6"},{"name":"Upload Locations CSV","event":[{"listen":"test","script":{"id":"52f0408c-8099-4b42-ba53-68dd41c42343","exec":["pm.test(\"Status code is 200 OK or 400 Bad Request\", function () {\r","    // Expect 200 for success, 400 for validation errors in the file\r","     pm.expect(pm.response.code).to.be.oneOf([200, 400]);\r","});\r","\r","pm.test(\"Response includes success status and message\", function () {\r","    var jsonData = pm.response.json();\r","    pm.expect(jsonData).to.have.property('success'); // true or false\r","    pm.expect(jsonData).to.have.property('message');\r","});\r","\r","pm.test(\"Response includes details about the import\", function () {\r","    var jsonData = pm.response.json();\r","    pm.expect(jsonData).to.have.property('buildings_created');\r","    pm.expect(jsonData).to.have.property('floors_created');\r","    pm.expect(jsonData).to.have.property('rooms_created');\r","    pm.expect(jsonData).to.have.property('skipped_rows');\r","    pm.expect(jsonData).to.have.property('errors'); // Array, possibly empty\r","});"],"type":"text/javascript","packages":{}}}],"id":"087c56a6-29fa-470e-b50d-9bc54c70d0ba","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{authToken}}","type":"text"}],"body":{"mode":"formdata","formdata":[{"key":"csvFile","type":"file","uuid":"f72d8011-7677-487a-9ded-18803c74a024","src":"postman-cloud:///1f01ced0-dbb7-4020-a9ab-331ec158bbda"}]},"url":"{{baseURL}}/api/upload/locations-csv","description":"<p>This endpoint allows you to upload a CSV file containing location data. The HTTP POST request should be made to {{baseURL}}/api/upload/locations-csv. The request body should be of form-data type, with a key \"csvFile\" that contains the CSV file to be uploaded.</p>\n<p>Upon successful upload, the response will include the status of the upload operation and any relevant information about the uploaded file.</p>\n","urlObject":{"path":["api","upload","locations-csv"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"087c56a6-29fa-470e-b50d-9bc54c70d0ba"}],"id":"89fdbe7a-63e3-4678-9ea7-3a6af208f5e4","_postman_id":"89fdbe7a-63e3-4678-9ea7-3a6af208f5e4","description":""},{"name":"User","item":[{"name":"Get All Users","event":[{"listen":"test","script":{"id":"b79e2c26-01c8-4f5f-86ea-dffc5dfd9738","exec":["pm.test(\"Status code is 200 OK\", function () {\r","    pm.response.to.have.status(200);\r","});\r","pm.test(\"Response is a JSON array\", function () {\r","    pm.expect(pm.response.json()).to.be.an('array');\r","});"],"type":"text/javascript","packages":{}}},{"listen":"prerequest","script":{"id":"b46a4354-e4d1-4fb6-bddf-a9aa32400bb0","exec":[],"type":"text/javascript"}}],"id":"8fc7e219-dc71-4a6b-a103-fc65df8161d7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{authToken}}","type":"text"}],"url":"{{baseURL}}/api/users","description":"<p>This endpoint makes an HTTP GET request to retrieve a list of users from the API. The request does not include a request body as it is a GET request. The response will include an array of user objects, each containing information about a specific user, such as their ID, name, email, and any other relevant details.</p>\n","urlObject":{"path":["api","users"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"8fc7e219-dc71-4a6b-a103-fc65df8161d7"},{"name":"Create New User","event":[{"listen":"test","script":{"id":"0cd1f5bb-3356-48c7-be96-388b923dff2f","exec":["pm.test(\"Status code is 200 OK\", function () { // API returns 200 based on code\r","    pm.response.to.have.status(200);\r","});\r","pm.test(\"Response indicates success\", function () {\r","    const jsonData = pm.response.json();\r","    pm.expect(jsonData.success).to.be.true;\r","    pm.expect(jsonData).to.have.property('user');\r","    pm.expect(jsonData.user).to.have.property('id');\r","    pm.environment.set(\"newUserId\", jsonData.user.id);\r","    console.log(\"New User ID set:\", jsonData.user.id);\r","});"],"type":"text/javascript","packages":{}}},{"listen":"prerequest","script":{"id":"5be929ad-e530-4ad3-89c9-2a60886f096c","exec":[],"type":"text/javascript"}}],"id":"a7a2f25f-d55f-4a64-b8da-acc468da3594","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"},{"key":"Authorization","value":"Bearer {{authToken}}","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"email\": \"postman_test_203@mail.com\",\r\n    \"username\": \"pm_user_265\",\r\n    \"password\": \"testpassword123\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/api/users/create","description":"<h3 id=\"create-user\">Create User</h3>\n<p>This endpoint allows the creation of a new user.</p>\n<h4 id=\"request-body\">Request Body</h4>\n<ul>\n<li><p><code>email</code> (string) - The email address of the user.</p>\n</li>\n<li><p><code>username</code> (string) - The username for the user.</p>\n</li>\n<li><p><code>password</code> (string) - The password for the user.</p>\n</li>\n</ul>\n<p>Example:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"email\": \"postman_test_123@example.com\",\n  \"username\": \"pm_user_123\",\n  \"password\": \"testpassword123\"\n}\n\n</code></pre>\n<h4 id=\"response\">Response</h4>\n<p>The response will contain the details of the newly created user.</p>\n","urlObject":{"path":["api","users","create"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"a7a2f25f-d55f-4a64-b8da-acc468da3594"},{"name":"Delete Created User","event":[{"listen":"test","script":{"id":"67aad4ad-d76e-4c8b-904e-949236c71e79","exec":["pm.test(\"Status code is 200 OK\", function () {\r","    pm.response.to.have.status(200);\r","});\r","pm.test(\"Response indicates success\", function () {\r","     pm.expect(pm.response.json().success).to.be.true;\r","});\r"," pm.test(\"Clear newUserId environment variable\", function () {\r","     pm.environment.unset(\"newUserId\");\r","});"],"type":"text/javascript","packages":{}}},{"listen":"prerequest","script":{"id":"04acef15-4cd5-4647-979d-c60b99eb2c8f","exec":[],"type":"text/javascript"}}],"id":"eb2c1b6e-b372-41c2-aa9c-f8d7adba0c97","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{authToken}}","type":"text"}],"url":"{{baseURL}}/api/users/{{newUserId}}/delete","description":"<h3 id=\"delete-user\">Delete User</h3>\n<p>This endpoint is used to delete a specific user by their ID.</p>\n<h4 id=\"request-body\">Request Body</h4>\n<ul>\n<li><code>reason</code> (text, required): A brief explanation for deleting the user.</li>\n</ul>\n<h4 id=\"response\">Response</h4>\n<p>The response will not contain a message body. A successful deletion will return a 204 No Content status code.</p>\n","urlObject":{"path":["api","users","{{newUserId}}","delete"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"eb2c1b6e-b372-41c2-aa9c-f8d7adba0c97"}],"id":"1bea350a-804a-4add-8fed-a57407c8c83a","_postman_id":"1bea350a-804a-4add-8fed-a57407c8c83a","description":""}]}