From f17ad44155b3566c6231b81be966af702f71edbb Mon Sep 17 00:00:00 2001 From: Harkamal Randhawa Date: Tue, 7 Apr 2026 16:16:11 -0600 Subject: [PATCH] fix alias folder ordering and request bodies in Postman collection --- backend/petshop-api.postman_collection.json | 148 ++++++++++---------- 1 file changed, 76 insertions(+), 72 deletions(-) diff --git a/backend/petshop-api.postman_collection.json b/backend/petshop-api.postman_collection.json index 330585a6..e3418fff 100644 --- a/backend/petshop-api.postman_collection.json +++ b/backend/petshop-api.postman_collection.json @@ -3844,6 +3844,43 @@ } ] }, + { + "name": "Create Customer - admin 201", + "request": { + "method": "POST", + "url": "{{baseUrl}}/api/v1/customers", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer {{adminToken}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"firstName\": \"Alias\",\n \"lastName\": \"Customer\",\n \"fullName\": \"Alias Customer\",\n \"email\": \"alias.customer.{{}}@example.com\",\n \"phone\": \"555-200-3000\",\n \"role\": \"CUSTOMER\",\n \"active\": true\n}" + } + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "pm.test('Status code is 201', function () {", + " pm.response.to.have.status(201);", + "});", + "var jsonData = pm.response.json();", + "if (jsonData.id !== undefined) pm.collectionVariables.set('customerId', jsonData.id);" + ] + } + } + ] + }, { "name": "Get Customer - staff 200", "request": { @@ -3906,41 +3943,6 @@ } ] }, - { - "name": "Create Customer - admin 201", - "request": { - "method": "POST", - "url": "{{baseUrl}}/api/v1/customers", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Authorization", - "value": "Bearer {{adminToken}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"firstName\": \"Alias\",\n \"lastName\": \"Customer\",\n \"email\": \"alias.cust@example.com\",\n \"password\": \"Test1234!\",\n \"role\": \"CUSTOMER\"\n}" - } - }, - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "pm.test('Status code is 201', function () {", - " pm.response.to.have.status(201);", - "});" - ] - } - } - ] - }, { "name": "Update Customer - admin 200", "request": { @@ -3959,7 +3961,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"firstName\": \"AliasUpdated\"\n}" + "raw": "{\n \"firstName\": \"Alias\",\n \"lastName\": \"CustomerUpdated\",\n \"fullName\": \"Alias CustomerUpdated\",\n \"email\": \"alias.customer.updated.{{}}@example.com\",\n \"phone\": \"555-200-3001\",\n \"role\": \"CUSTOMER\",\n \"active\": true\n}" } }, "event": [ @@ -4621,6 +4623,43 @@ } ] }, + { + "name": "Create Employee - admin 201", + "request": { + "method": "POST", + "url": "{{baseUrl}}/api/v1/employees", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer {{adminToken}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"username\": \"aliasemployee{{}}\",\n \"password\": \"Test1234!\",\n \"firstName\": \"Alias\",\n \"lastName\": \"Employee\",\n \"fullName\": \"Alias Employee\",\n \"email\": \"alias.employee.{{}}@petshop.com\",\n \"phone\": \"403-555-0300\",\n \"role\": \"STAFF\",\n \"staffRole\": \"GROOMER\",\n \"primaryStoreId\": 1,\n \"active\": true\n}" + } + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "pm.test('Status code is 201', function () {", + " pm.response.to.have.status(201);", + "});", + "var jsonData = pm.response.json();", + "if (jsonData.id !== undefined) pm.collectionVariables.set('employeeId', jsonData.id);" + ] + } + } + ] + }, { "name": "Get Employee - admin 200", "request": { @@ -4652,41 +4691,6 @@ } ] }, - { - "name": "Create Employee - admin 201", - "request": { - "method": "POST", - "url": "{{baseUrl}}/api/v1/employees", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Authorization", - "value": "Bearer {{adminToken}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"firstName\": \"Alias\",\n \"lastName\": \"Employee\",\n \"email\": \"alias.staff@example.com\",\n \"password\": \"Test1234!\",\n \"role\": \"STAFF\"\n}" - } - }, - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "pm.test('Status code is 201', function () {", - " pm.response.to.have.status(201);", - "});" - ] - } - } - ] - }, { "name": "Update Employee - admin 200", "request": { @@ -4705,7 +4709,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"firstName\": \"AliasUpdated\"\n}" + "raw": "{\n \"firstName\": \"Alias\",\n \"lastName\": \"EmployeeUpdated\",\n \"fullName\": \"Alias EmployeeUpdated\",\n \"email\": \"alias.employee.updated.{{}}@petshop.com\",\n \"phone\": \"403-555-0301\",\n \"role\": \"STAFF\",\n \"staffRole\": \"VET\",\n \"primaryStoreId\": 1,\n \"active\": true\n}" } }, "event": [