From b423912a9a5419da8d0fd0a39056f5f1eda9e114 Mon Sep 17 00:00:00 2001 From: Harkamal Randhawa Date: Tue, 7 Apr 2026 15:19:25 -0600 Subject: [PATCH] update postman collection --- backend/petshop-api.postman_collection.json | 480 ++++++++++++++------ 1 file changed, 339 insertions(+), 141 deletions(-) diff --git a/backend/petshop-api.postman_collection.json b/backend/petshop-api.postman_collection.json index 3b36221b..5ab9bd98 100644 --- a/backend/petshop-api.postman_collection.json +++ b/backend/petshop-api.postman_collection.json @@ -128,6 +128,14 @@ }, { "key": "employeeId", + "value": "3" + }, + { + "key": "myPetId", + "value": "" + }, + { + "key": "adoptionPetId", "value": "" } ], @@ -442,7 +450,7 @@ "name": "Get My Avatar File", "request": { "method": "GET", - "url": "{{baseUrl}}{{avatarUrl}}", + "url": "{{baseUrl}}/api/v1/auth/me/avatar/file", "header": [ { "key": "Authorization", @@ -837,11 +845,8 @@ "script": { "type": "text/javascript", "exec": [ - "pm.test('Status code is 200', function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Pet image response is an image', function () {", - " pm.expect(pm.response.headers.get('Content-Type')).to.include('image/');", + "pm.test('Status code is 403', function () {", + " pm.response.to.have.status(403);", "});" ] } @@ -1099,6 +1104,192 @@ } ] }, + { + "name": "My Pets", + "item": [ + { + "name": "List My Pets", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer {{customerToken}}", + "type": "text" + } + ], + "url": "{{baseUrl}}/api/v1/my-pets" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "pm.test('Status code is 200', function () {", + " pm.response.to.have.status(200);", + "});" + ] + } + } + ] + }, + { + "name": "Create My Pet", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer {{customerToken}}", + "type": "text" + } + ], + "url": "{{baseUrl}}/api/v1/my-pets", + "body": { + "mode": "raw", + "raw": "{\n \"petName\": \"Postman Home Pet\",\n \"species\": \"Dog\",\n \"breed\": \"Mixed\"\n}", + "options": { + "raw": { + "language": "json" + } + } + } + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "pm.test('Status code is 200', function () {", + " pm.response.to.have.status(200);", + "});", + "var jsonData = pm.response.json();", + "if (jsonData.customerPetId !== undefined) pm.collectionVariables.set('myPetId', jsonData.customerPetId);" + ] + } + } + ] + }, + { + "name": "Update My Pet", + "request": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer {{customerToken}}", + "type": "text" + } + ], + "url": "{{baseUrl}}/api/v1/my-pets/{{myPetId}}", + "body": { + "mode": "raw", + "raw": "{\n \"petName\": \"Postman Home Pet Updated\",\n \"species\": \"Dog\",\n \"breed\": \"Retriever Mix\"\n}", + "options": { + "raw": { + "language": "json" + } + } + } + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "pm.test('Status code is 200', function () {", + " pm.response.to.have.status(200);", + "});" + ] + } + } + ] + }, + { + "name": "Upload My Pet Image", + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{customerToken}}", + "type": "text" + } + ], + "url": "{{baseUrl}}/api/v1/my-pets/{{myPetId}}/image", + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "image", + "type": "file", + "src": "{{avatarFile}}" + } + ] + } + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "pm.test('Status code is 200', function () {", + " pm.response.to.have.status(200);", + "});" + ] + } + } + ] + }, + { + "name": "Delete My Pet", + "request": { + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer {{customerToken}}", + "type": "text" + } + ], + "url": "{{baseUrl}}/api/v1/my-pets/{{myPetId}}" + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "pm.test('Status code is 204', function () {", + " pm.response.to.have.status(204);", + "});" + ] + } + } + ] + } + ] + }, { "name": "Products", "item": [ @@ -2186,7 +2377,7 @@ "name": "Check Appointment Availability", "request": { "method": "GET", - "url": "{{baseUrl}}/api/v1/appointments/availability?storeId={{storeId}}&serviceId={{serviceId}}&date=2026-12-20", + "url": "{{baseUrl}}/api/v1/appointments/availability?storeId=1&serviceId=1&date=2026-12-20", "header": [ { "key": "Content-Type", @@ -2341,7 +2532,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"customerId\": {{customerId}},\n \"storeId\": {{storeId}},\n \"serviceId\": {{serviceId}},\n \"appointmentDate\": \"2026-12-20\",\n \"appointmentTime\": \"10:00:00\",\n \"appointmentStatus\": \"Booked\",\n \"petId\": {{petId}}\n}", + "raw": "{\n \"customerId\": 1,\n \"storeId\": 1,\n \"serviceId\": 1,\n \"employeeId\": 3,\n \"appointmentDate\": \"2026-12-20\",\n \"appointmentTime\": \"10:00:00\",\n \"appointmentStatus\": \"Booked\",\n \"petId\": 1\n}", "options": { "raw": { "language": "json" @@ -2383,7 +2574,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"customerId\": {{customerId}},\n \"storeId\": {{storeId}},\n \"serviceId\": {{serviceId}},\n \"appointmentDate\": \"2026-12-20\",\n \"appointmentTime\": \"11:00:00\",\n \"appointmentStatus\": \"Booked\",\n \"petId\": {{petId}}\n}", + "raw": "{\n \"customerId\": 1,\n \"storeId\": 1,\n \"serviceId\": 1,\n \"employeeId\": 3,\n \"appointmentDate\": \"2026-12-20\",\n \"appointmentTime\": \"11:00:00\",\n \"appointmentStatus\": \"Booked\",\n \"petId\": 1\n}", "options": { "raw": { "language": "json" @@ -2501,7 +2692,9 @@ "exec": [ "pm.test('Status code is 200', function () {", " pm.response.to.have.status(200);", - "});" + "});", + "var jsonData = pm.response.json();", + "if (Array.isArray(jsonData) && jsonData.length > 0 && jsonData[0].id !== undefined) pm.collectionVariables.set('adoptionPetId', jsonData[0].id);" ] } } @@ -2587,7 +2780,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"petId\": {{adoptedPetId}},\n \"customerId\": {{customerId}},\n \"adoptionDate\": \"2026-12-21\",\n \"adoptionStatus\": \"Pending\",\n \"sourceStoreId\": {{storeId}}\n}", + "raw": "{\n \"petId\": {{adoptionPetId}},\n \"customerId\": 1,\n \"adoptionDate\": \"2026-12-21\",\n \"adoptionStatus\": \"Pending\",\n \"sourceStoreId\": 1\n}", "options": { "raw": { "language": "json" @@ -2629,7 +2822,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"petId\": {{adoptedPetId}},\n \"customerId\": {{customerId}},\n \"adoptionDate\": \"2026-12-22\",\n \"adoptionStatus\": \"Completed\",\n \"sourceStoreId\": {{storeId}}\n}", + "raw": "{\n \"petId\": {{adoptionPetId}},\n \"customerId\": 1,\n \"adoptionDate\": \"2026-12-22\",\n \"adoptionStatus\": \"Completed\",\n \"sourceStoreId\": 1\n}", "options": { "raw": { "language": "json" @@ -3263,7 +3456,7 @@ ] }, { - "name": "Customers", + "name": "Customers (Direct Users API)", "item": [ { "name": "Get Customers Dropdown", @@ -3300,7 +3493,7 @@ "name": "List Customers", "request": { "method": "GET", - "url": "{{baseUrl}}/api/v1/customers", + "url": "{{baseUrl}}/api/v1/users?role=CUSTOMER", "header": [ { "key": "Content-Type", @@ -3308,7 +3501,7 @@ }, { "key": "Authorization", - "value": "Bearer {{staffToken}}", + "value": "Bearer {{adminToken}}", "type": "text" } ] @@ -3331,7 +3524,7 @@ "name": "Get Customer", "request": { "method": "GET", - "url": "{{baseUrl}}/api/v1/customers/{{customerId}}", + "url": "{{baseUrl}}/api/v1/users/{{customerId}}", "header": [ { "key": "Content-Type", @@ -3339,7 +3532,7 @@ }, { "key": "Authorization", - "value": "Bearer {{staffToken}}", + "value": "Bearer {{adminToken}}", "type": "text" } ] @@ -3362,7 +3555,7 @@ "name": "Create Customer", "request": { "method": "POST", - "url": "{{baseUrl}}/api/v1/customers", + "url": "{{baseUrl}}/api/v1/users", "header": [ { "key": "Content-Type", @@ -3370,13 +3563,13 @@ }, { "key": "Authorization", - "value": "Bearer {{staffToken}}", + "value": "Bearer {{adminToken}}", "type": "text" } ], "body": { "mode": "raw", - "raw": "{\n \"firstName\": \"Postman\",\n \"lastName\": \"Customer\",\n \"email\": \"postman.customer.{{$guid}}@example.com\",\n \"phone\": \"555-100-2000\"\n}", + "raw": "{\n \"firstName\": \"Postman\",\n \"lastName\": \"Customer\",\n \"fullName\": \"Postman Customer\",\n \"email\": \"postman.customer.{{$guid}}@example.com\",\n \"phone\": \"555-100-2000\",\n \"role\": \"CUSTOMER\",\n \"active\": true\n}", "options": { "raw": { "language": "json" @@ -3394,7 +3587,7 @@ " pm.response.to.have.status(201);", "});", "var jsonData = pm.response.json();", - "if (jsonData.customerId !== undefined) pm.collectionVariables.set('customerId', jsonData.customerId);" + "if (jsonData.id !== undefined) pm.collectionVariables.set('customerId', jsonData.id);" ] } } @@ -3404,7 +3597,7 @@ "name": "Update Customer", "request": { "method": "PUT", - "url": "{{baseUrl}}/api/v1/customers/{{customerId}}", + "url": "{{baseUrl}}/api/v1/users/{{customerId}}", "header": [ { "key": "Content-Type", @@ -3412,13 +3605,13 @@ }, { "key": "Authorization", - "value": "Bearer {{staffToken}}", + "value": "Bearer {{adminToken}}", "type": "text" } ], "body": { "mode": "raw", - "raw": "{\n \"firstName\": \"Postman\",\n \"lastName\": \"Customer Updated\",\n \"email\": \"postman.customer.updated.{{$timestamp}}@example.com\",\n \"phone\": \"555-100-2001\"\n}", + "raw": "{\n \"firstName\": \"Postman\",\n \"lastName\": \"Customer Updated\",\n \"fullName\": \"Postman Customer Updated\",\n \"email\": \"postman.customer.updated.{{$timestamp}}@example.com\",\n \"phone\": \"555-100-2001\",\n \"role\": \"CUSTOMER\",\n \"active\": true\n}", "options": { "raw": { "language": "json" @@ -3444,7 +3637,7 @@ "name": "Delete Customer", "request": { "method": "DELETE", - "url": "{{baseUrl}}/api/v1/customers/{{customerId}}", + "url": "{{baseUrl}}/api/v1/users/{{customerId}}", "header": [ { "key": "Content-Type", @@ -3452,7 +3645,7 @@ }, { "key": "Authorization", - "value": "Bearer {{staffToken}}", + "value": "Bearer {{adminToken}}", "type": "text" } ] @@ -3475,7 +3668,7 @@ "name": "Create Customer For Bulk Delete", "request": { "method": "POST", - "url": "{{baseUrl}}/api/v1/customers", + "url": "{{baseUrl}}/api/v1/users", "header": [ { "key": "Content-Type", @@ -3483,13 +3676,13 @@ }, { "key": "Authorization", - "value": "Bearer {{staffToken}}", + "value": "Bearer {{adminToken}}", "type": "text" } ], "body": { "mode": "raw", - "raw": "{\n \"firstName\": \"Postman\",\n \"lastName\": \"Customer\",\n \"email\": \"postman.customer.{{$guid}}@example.com\",\n \"phone\": \"555-100-2000\"\n}", + "raw": "{\n \"firstName\": \"Postman\",\n \"lastName\": \"Customer\",\n \"fullName\": \"Postman Customer\",\n \"email\": \"postman.bulk.customer.{{$guid}}@example.com\",\n \"phone\": \"555-100-2002\",\n \"role\": \"CUSTOMER\",\n \"active\": true\n}", "options": { "raw": { "language": "json" @@ -3507,7 +3700,7 @@ " pm.response.to.have.status(201);", "});", "var jsonData = pm.response.json();", - "if (jsonData.customerId !== undefined) pm.collectionVariables.set('bulkCustomerId', jsonData.customerId);" + "if (jsonData.id !== undefined) pm.collectionVariables.set('bulkCustomerId', jsonData.id);" ] } } @@ -3516,8 +3709,8 @@ { "name": "Bulk Delete Customers", "request": { - "method": "POST", - "url": "{{baseUrl}}/api/v1/customers/bulk-delete", + "method": "DELETE", + "url": "{{baseUrl}}/api/v1/users", "header": [ { "key": "Content-Type", @@ -3525,13 +3718,18 @@ }, { "key": "Authorization", - "value": "Bearer {{staffToken}}", + "value": "Bearer {{adminToken}}", "type": "text" } ], "body": { "mode": "raw", - "raw": "{\n \"ids\": [\n {{bulkCustomerId}}\n ]\n}" + "raw": "{\n \"ids\": [\n {{bulkCustomerId}}\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } } }, "event": [ @@ -3738,7 +3936,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"username\": \"postman_user_{{$guid}}\",\n \"password\": \"secret123\",\n \"fullName\": \"Postman User\",\n \"email\": \"postman.user.{{$guid}}@example.com\",\n \"role\": \"STAFF\",\n \"active\": true\n}", + "raw": "{\n \"username\": \"postman_user_{{$guid}}\",\n \"password\": \"secret123\",\n \"firstName\": \"Postman\",\n \"lastName\": \"User\",\n \"fullName\": \"Postman User\",\n \"email\": \"postman.user.{{$guid}}@example.com\",\n \"role\": \"STAFF\",\n \"primaryStoreId\": 1,\n \"active\": true\n}", "options": { "raw": { "language": "json" @@ -3780,7 +3978,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"username\": \"postman_user_{{$timestamp}}\",\n \"password\": \"secret123\",\n \"fullName\": \"Postman User Updated\",\n \"email\": \"postman.user.updated.{{$timestamp}}@example.com\",\n \"role\": \"STAFF\",\n \"active\": true\n}", + "raw": "{\n \"username\": \"postman_user_{{$timestamp}}\",\n \"password\": \"secret123\",\n \"firstName\": \"Postman\",\n \"lastName\": \"User Updated\",\n \"fullName\": \"Postman User Updated\",\n \"email\": \"postman.user.updated.{{$timestamp}}@example.com\",\n \"role\": \"STAFF\",\n \"primaryStoreId\": 1,\n \"active\": true\n}", "options": { "raw": { "language": "json" @@ -3851,7 +4049,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"username\": \"postman_user_{{$guid}}\",\n \"password\": \"secret123\",\n \"fullName\": \"Postman User\",\n \"email\": \"postman.user.{{$guid}}@example.com\",\n \"role\": \"STAFF\",\n \"active\": true\n}", + "raw": "{\n \"username\": \"pb{{$timestamp}}\",\n \"password\": \"secret123\",\n \"firstName\": \"Postman\",\n \"lastName\": \"User\",\n \"fullName\": \"Postman User\",\n \"email\": \"postman.bulk.user.{{$guid}}@example.com\",\n \"role\": \"STAFF\",\n \"primaryStoreId\": 1,\n \"active\": true\n}", "options": { "raw": { "language": "json" @@ -3918,13 +4116,13 @@ ] }, { - "name": "Employees", + "name": "Employees (Direct Users API)", "item": [ { "name": "List Employees", "request": { "method": "GET", - "url": "{{baseUrl}}/api/v1/employees", + "url": "{{baseUrl}}/api/v1/users?role=STAFF", "header": [ { "key": "Content-Type", @@ -3955,7 +4153,7 @@ "name": "Get Employee by ID", "request": { "method": "GET", - "url": "{{baseUrl}}/api/v1/employees/{{employeeId}}", + "url": "{{baseUrl}}/api/v1/users/{{employeeId}}", "header": [ { "key": "Content-Type", @@ -3986,7 +4184,7 @@ "name": "Create Employee", "request": { "method": "POST", - "url": "{{baseUrl}}/api/v1/employees", + "url": "{{baseUrl}}/api/v1/users", "header": [ { "key": "Content-Type", @@ -4000,7 +4198,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"username\": \"employee{{$timestamp}}\",\n \"password\": \"employee123\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Smith\",\n \"email\": \"employee{{$timestamp}}@petshop.com\",\n \"phone\": \"403-555-0200\",\n \"role\": \"STAFF\",\n \"staffRole\": \"GROOMER\",\n \"primaryStoreId\": 1,\n \"active\": true\n}", + "raw": "{\n \"username\": \"employee{{$timestamp}}\",\n \"password\": \"employee123\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Smith\",\n \"fullName\": \"Jane Smith\",\n \"email\": \"employee{{$timestamp}}@petshop.com\",\n \"phone\": \"403-555-0200\",\n \"role\": \"STAFF\",\n \"staffRole\": \"GROOMER\",\n \"primaryStoreId\": 1,\n \"active\": true\n}", "options": { "raw": { "language": "json" @@ -4018,7 +4216,7 @@ " pm.response.to.have.status(201);", "});", "var jsonData = pm.response.json();", - "if (jsonData.id) pm.collectionVariables.set('employeeId', jsonData.id);" + "if (jsonData.id !== undefined) pm.collectionVariables.set('employeeId', jsonData.id);" ] } } @@ -4028,7 +4226,7 @@ "name": "Update Employee", "request": { "method": "PUT", - "url": "{{baseUrl}}/api/v1/employees/{{employeeId}}", + "url": "{{baseUrl}}/api/v1/users/{{employeeId}}", "header": [ { "key": "Content-Type", @@ -4042,7 +4240,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"firstName\": \"Jane\",\n \"lastName\": \"Smith\",\n \"email\": \"employee.updated@petshop.com\",\n \"phone\": \"403-555-0201\",\n \"role\": \"STAFF\",\n \"staffRole\": \"VET\",\n \"primaryStoreId\": 1,\n \"active\": true\n}", + "raw": "{\n \"firstName\": \"Jane\",\n \"lastName\": \"Smith\",\n \"fullName\": \"Jane Smith\",\n \"email\": \"employee.updated{{$timestamp}}@petshop.com\",\n \"phone\": \"403-555-0201\",\n \"role\": \"STAFF\",\n \"staffRole\": \"VET\",\n \"primaryStoreId\": 1,\n \"active\": true\n}", "options": { "raw": { "language": "json" @@ -4068,7 +4266,7 @@ "name": "Delete Employee", "request": { "method": "DELETE", - "url": "{{baseUrl}}/api/v1/employees/{{employeeId}}", + "url": "{{baseUrl}}/api/v1/users/{{employeeId}}", "header": [ { "key": "Content-Type", @@ -4505,11 +4703,53 @@ } ] }, + { + "name": "Create Inventory", + "request": { + "method": "POST", + "url": "{{baseUrl}}/api/v1/inventory", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer {{adminToken}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"prodId\": 1,\n \"quantity\": 10,\n \"storeId\": 1\n}", + "options": { + "raw": { + "language": "json" + } + } + } + }, + "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.inventoryId !== undefined) pm.collectionVariables.set('inventoryId', jsonData.inventoryId);" + ] + } + } + ] + }, { "name": "Get Inventory Item", "request": { "method": "GET", - "url": "{{baseUrl}}/api/v1/inventory/1", + "url": "{{baseUrl}}/api/v1/inventory/{{inventoryId}}", "header": [ { "key": "Content-Type", @@ -4536,48 +4776,6 @@ } ] }, - { - "name": "Create Inventory", - "request": { - "method": "POST", - "url": "{{baseUrl}}/api/v1/inventory", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Authorization", - "value": "Bearer {{adminToken}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"prodId\": {{productId}},\n \"quantity\": 10,\n \"storeId\": {{storeId}}\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "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.inventoryId !== undefined) pm.collectionVariables.set('inventoryId', jsonData.inventoryId);" - ] - } - } - ] - }, { "name": "Update Inventory", "request": { @@ -4596,7 +4794,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"prodId\": {{productId}},\n \"quantity\": 12,\n \"storeId\": {{storeId}}\n}", + "raw": "{\n \"prodId\": 1,\n \"quantity\": 12,\n \"storeId\": 1\n}", "options": { "raw": { "language": "json" @@ -4667,7 +4865,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"prodId\": {{productId}},\n \"quantity\": 10,\n \"storeId\": {{storeId}}\n}", + "raw": "{\n \"prodId\": 1,\n \"quantity\": 10,\n \"storeId\": 1\n}", "options": { "raw": { "language": "json" @@ -4898,8 +5096,8 @@ "script": { "type": "text/javascript", "exec": [ - "pm.test('Status code is 403', function () {", - " pm.response.to.have.status(403);", + "pm.test('Status code is 204', function () {", + " pm.response.to.have.status(204);", "});" ] } @@ -4933,8 +5131,8 @@ "script": { "type": "text/javascript", "exec": [ - "pm.test('Status code is 403', function () {", - " pm.response.to.have.status(403);", + "pm.test('Status code is 400', function () {", + " pm.response.to.have.status(400);", "});" ] } @@ -5129,6 +5327,46 @@ } ] }, + { + "name": "Create Product Supplier", + "request": { + "method": "POST", + "url": "{{baseUrl}}/api/v1/product-suppliers", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer {{adminToken}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"productId\": 1,\n \"supplierId\": 1,\n \"cost\": 7.50\n}", + "options": { + "raw": { + "language": "json" + } + } + } + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "pm.test('Status code is 201', function () {", + " pm.response.to.have.status(201);", + "});" + ] + } + } + ] + }, { "name": "Get Product Supplier", "request": { @@ -5160,51 +5398,11 @@ } ] }, - { - "name": "Create Product Supplier", - "request": { - "method": "POST", - "url": "{{baseUrl}}/api/v1/product-suppliers", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Authorization", - "value": "Bearer {{adminToken}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"productId\": {{productId}},\n \"supplierId\": {{supplierId}},\n \"cost\": 7.50\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "pm.test('Status code is 201', function () {", - " pm.response.to.have.status(201);", - "});" - ] - } - } - ] - }, { "name": "Update Product Supplier", "request": { "method": "PUT", - "url": "{{baseUrl}}/api/v1/product-suppliers/{{productId}}/{{supplierId}}", + "url": "{{baseUrl}}/api/v1/product-suppliers/1/1", "header": [ { "key": "Content-Type", @@ -5218,7 +5416,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"productId\": {{productId}},\n \"supplierId\": {{supplierId}},\n \"cost\": 7.75\n}", + "raw": "{\n \"productId\": 1,\n \"supplierId\": 1,\n \"cost\": 7.75\n}", "options": { "raw": { "language": "json" @@ -5244,7 +5442,7 @@ "name": "Delete Product Supplier", "request": { "method": "DELETE", - "url": "{{baseUrl}}/api/v1/product-suppliers/{{productId}}/{{supplierId}}", + "url": "{{baseUrl}}/api/v1/product-suppliers/1/1", "header": [ { "key": "Content-Type", @@ -5289,7 +5487,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"productId\": {{productId}},\n \"supplierId\": {{supplierId}},\n \"cost\": 7.50\n}", + "raw": "{\n \"productId\": 1,\n \"supplierId\": 1,\n \"cost\": 7.50\n}", "options": { "raw": { "language": "json" @@ -5329,7 +5527,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"keys\": [\n {\"productId\": {{productId}}, \"supplierId\": {{supplierId}}}\n ]\n}" + "raw": "{\n \"keys\": [\n {\"productId\": 1, \"supplierId\": 1}\n ]\n}" } }, "event": [ @@ -5385,4 +5583,4 @@ ] } ] -} \ No newline at end of file +}