mts-backend/postman/mts-api.postman_collection.json
2026-04-15 18:39:01 +03:00

364 lines
9.6 KiB
JSON

{
"info": {
"name": "MTS API",
"_postman_id": "9f880ad6-2aa0-4aa0-b772-3ba822afc3f0",
"description": "Collection for auth and order endpoints.",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"variable": [
{
"key": "baseUrl",
"value": "http://localhost:8080"
},
{
"key": "orderId",
"value": "00000000-0000-0000-0000-000000000000"
},
{
"key": "managerId",
"value": "00000000-0000-0000-0000-000000000000"
}
],
"item": [
{
"name": "Auth",
"item": [
{
"name": "Register Senior Manager",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"login\": \"senior1\",\n \"password\": \"password123\",\n \"name\": \"Senior Manager\",\n \"role\": \"SENIOR_MANAGER\"\n}"
},
"url": {
"raw": "{{baseUrl}}/api/auth/register",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"auth",
"register"
]
}
}
},
{
"name": "Register Manager",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"login\": \"manager1\",\n \"password\": \"password123\",\n \"name\": \"Manager\",\n \"role\": \"MANAGER\"\n}"
},
"url": {
"raw": "{{baseUrl}}/api/auth/register",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"auth",
"register"
]
}
}
},
{
"name": "Login Senior Manager",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"login\": \"senior1\",\n \"password\": \"password123\"\n}"
},
"url": {
"raw": "{{baseUrl}}/api/auth/login",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"auth",
"login"
]
}
}
},
{
"name": "Login Manager",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"login\": \"manager1\",\n \"password\": \"password123\"\n}"
},
"url": {
"raw": "{{baseUrl}}/api/auth/login",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"auth",
"login"
]
}
}
},
{
"name": "Get Current User",
"request": {
"method": "GET",
"url": {
"raw": "{{baseUrl}}/api/auth/me",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"auth",
"me"
]
}
}
},
{
"name": "Logout",
"request": {
"method": "POST",
"url": {
"raw": "{{baseUrl}}/api/auth/logout",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"auth",
"logout"
]
}
}
}
]
},
{
"name": "Orders",
"item": [
{
"name": "Create Order (JSON)",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"customerName\": \"Ivan Ivanov\",\n \"phoneNumber\": \"+79991234567\",\n \"email\": \"ivan@example.com\",\n \"items\": [\n {\n \"productId\": \"11111111-1111-1111-1111-111111111111\",\n \"quantity\": 1\n },\n {\n \"productId\": \"22222222-2222-2222-2222-222222222222\",\n \"quantity\": 2\n }\n ]\n}"
},
"url": {
"raw": "{{baseUrl}}/api/orders",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"orders"
]
}
}
},
{
"name": "Create Order (Form Urlencoded)",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/x-www-form-urlencoded"
}
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "customerName",
"value": "Ivan Ivanov",
"type": "text"
},
{
"key": "phoneNumber",
"value": "+79991234567",
"type": "text"
},
{
"key": "email",
"value": "ivan@example.com",
"type": "text"
},
{
"key": "items[0].productId",
"value": "11111111-1111-1111-1111-111111111111",
"type": "text"
},
{
"key": "items[0].quantity",
"value": "1",
"type": "text"
},
{
"key": "items[1].productId",
"value": "22222222-2222-2222-2222-222222222222",
"type": "text"
},
{
"key": "items[1].quantity",
"value": "2",
"type": "text"
}
]
},
"url": {
"raw": "{{baseUrl}}/api/orders",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"orders"
]
}
}
},
{
"name": "Get Orders (by role)",
"request": {
"method": "GET",
"url": {
"raw": "{{baseUrl}}/api/orders",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"orders"
]
}
}
},
{
"name": "Assign Manager to Order (Senior Session)",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"managerId\": \"{{managerId}}\"\n}"
},
"url": {
"raw": "{{baseUrl}}/api/orders/{{orderId}}/manager",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"orders",
"{{orderId}}",
"manager"
]
}
}
},
{
"name": "Edit Order (Manager Session)",
"request": {
"method": "PUT",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"customerName\": \"Ivan Ivanov\",\n \"phoneNumber\": \"+79991234567\",\n \"email\": \"ivan@example.com\",\n \"items\": [\n {\n \"productId\": \"11111111-1111-1111-1111-111111111111\",\n \"quantity\": 3\n }\n ]\n}"
},
"url": {
"raw": "{{baseUrl}}/api/orders/{{orderId}}",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"orders",
"{{orderId}}"
]
}
}
},
{
"name": "Change Order Status (Manager Session)",
"request": {
"method": "PATCH",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"status\": \"PLACED\"\n}"
},
"url": {
"raw": "{{baseUrl}}/api/orders/{{orderId}}/status",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"orders",
"{{orderId}}",
"status"
]
}
}
}
]
}
]
}