apskel-pos-backend/product-recipe-postman-collection.json

469 lines
9.4 KiB
JSON
Raw Normal View History

2025-08-10 21:46:44 +07:00
{
"info": {
"_postman_id": "product-recipe-collection",
"name": "Product Recipe API",
"description": "Complete CRUD operations for Product Recipe management",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "12345678"
},
"item": [
{
"name": "Authentication",
"item": [
{
"name": "Login",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"email\": \"admin@example.com\",\n \"password\": \"password123\"\n}"
},
"url": {
"raw": "{{base_url}}/api/v1/auth/login",
"host": [
"{{base_url}}"
],
"path": [
"api",
"v1",
"auth",
"login"
]
}
},
"response": []
}
]
},
{
"name": "Product Recipe Management",
"item": [
{
"name": "Create Product Recipe",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"product_id\": \"{{product_id}}\",\n \"variant_id\": \"{{variant_id}}\",\n \"ingredient_id\": \"{{ingredient_id}}\",\n \"quantity\": 2.5,\n \"outlet_id\": \"{{outlet_id}}\"\n}"
},
"url": {
"raw": "{{base_url}}/api/v1/product-recipes",
"host": [
"{{base_url}}"
],
"path": [
"api",
"v1",
"product-recipes"
]
}
},
"response": []
},
{
"name": "Create Product Recipe (No Variant)",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"product_id\": \"{{product_id}}\",\n \"ingredient_id\": \"{{ingredient_id}}\",\n \"quantity\": 1.0\n}"
},
"url": {
"raw": "{{base_url}}/api/v1/product-recipes",
"host": [
"{{base_url}}"
],
"path": [
"api",
"v1",
"product-recipes"
]
}
},
"response": []
},
{
"name": "Bulk Create Product Recipes",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"recipes\": [\n {\n \"product_id\": \"{{product_id}}\",\n \"variant_id\": \"{{variant_id}}\",\n \"ingredient_id\": \"{{ingredient_id_1}}\",\n \"quantity\": 2.0\n },\n {\n \"product_id\": \"{{product_id}}\",\n \"variant_id\": \"{{variant_id}}\",\n \"ingredient_id\": \"{{ingredient_id_2}}\",\n \"quantity\": 1.5\n },\n {\n \"product_id\": \"{{product_id}}\",\n \"ingredient_id\": \"{{ingredient_id_3}}\",\n \"quantity\": 0.5\n }\n ]\n}"
},
"url": {
"raw": "{{base_url}}/api/v1/product-recipes/bulk",
"host": [
"{{base_url}}"
],
"path": [
"api",
"v1",
"product-recipes",
"bulk"
]
}
},
"response": []
},
{
"name": "Get Product Recipe by ID",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
}
],
"url": {
"raw": "{{base_url}}/api/v1/product-recipes/{{recipe_id}}",
"host": [
"{{base_url}}"
],
"path": [
"api",
"v1",
"product-recipes",
"{{recipe_id}}"
]
}
},
"response": []
},
{
"name": "Get Product Recipes by Product ID",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
}
],
"url": {
"raw": "{{base_url}}/api/v1/product-recipes/product/{{product_id}}",
"host": [
"{{base_url}}"
],
"path": [
"api",
"v1",
"product-recipes",
"product",
"{{product_id}}"
]
}
},
"response": []
},
{
"name": "Get Product Recipes by Product ID and Variant ID",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
}
],
"url": {
"raw": "{{base_url}}/api/v1/product-recipes/product/{{product_id}}?variant_id={{variant_id}}",
"host": [
"{{base_url}}"
],
"path": [
"api",
"v1",
"product-recipes",
"product",
"{{product_id}}"
],
"query": [
{
"key": "variant_id",
"value": "{{variant_id}}"
}
]
}
},
"response": []
},
{
"name": "Get Product Recipes by Ingredient ID",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
}
],
"url": {
"raw": "{{base_url}}/api/v1/product-recipes/ingredient/{{ingredient_id}}",
"host": [
"{{base_url}}"
],
"path": [
"api",
"v1",
"product-recipes",
"ingredient",
"{{ingredient_id}}"
]
}
},
"response": []
},
{
"name": "Update Product Recipe",
"request": {
"method": "PUT",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"quantity\": 3.0,\n \"variant_id\": \"{{new_variant_id}}\",\n \"outlet_id\": \"{{outlet_id}}\"\n}"
},
"url": {
"raw": "{{base_url}}/api/v1/product-recipes/{{recipe_id}}",
"host": [
"{{base_url}}"
],
"path": [
"api",
"v1",
"product-recipes",
"{{recipe_id}}"
]
}
},
"response": []
},
{
"name": "Delete Product Recipe",
"request": {
"method": "DELETE",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
}
],
"url": {
"raw": "{{base_url}}/api/v1/product-recipes/{{recipe_id}}",
"host": [
"{{base_url}}"
],
"path": [
"api",
"v1",
"product-recipes",
"{{recipe_id}}"
]
}
},
"response": []
}
]
},
{
"name": "Supporting Data",
"item": [
{
"name": "Get Products",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
}
],
"url": {
"raw": "{{base_url}}/api/v1/products",
"host": [
"{{base_url}}"
],
"path": [
"api",
"v1",
"products"
]
}
},
"response": []
},
{
"name": "Get Ingredients",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
}
],
"url": {
"raw": "{{base_url}}/api/v1/ingredients",
"host": [
"{{base_url}}"
],
"path": [
"api",
"v1",
"ingredients"
]
}
},
"response": []
},
{
"name": "Get Product by ID (with variants)",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
}
],
"url": {
"raw": "{{base_url}}/api/v1/products/{{product_id}}",
"host": [
"{{base_url}}"
],
"path": [
"api",
"v1",
"products",
"{{product_id}}"
]
}
},
"response": []
}
]
}
],
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
],
"variable": [
{
"key": "base_url",
"value": "http://localhost:8080",
"type": "string"
},
{
"key": "access_token",
"value": "",
"type": "string"
},
{
"key": "product_id",
"value": "",
"type": "string"
},
{
"key": "variant_id",
"value": "",
"type": "string"
},
{
"key": "ingredient_id",
"value": "",
"type": "string"
},
{
"key": "ingredient_id_1",
"value": "",
"type": "string"
},
{
"key": "ingredient_id_2",
"value": "",
"type": "string"
},
{
"key": "ingredient_id_3",
"value": "",
"type": "string"
},
{
"key": "recipe_id",
"value": "",
"type": "string"
},
{
"key": "outlet_id",
"value": "",
"type": "string"
},
{
"key": "new_variant_id",
"value": "",
"type": "string"
}
]
}