142 lines
5.2 KiB
Bash
142 lines
5.2 KiB
Bash
|
|
#!/bin/bash
|
||
|
|
|
||
|
|
# Add real recipes using actual inventory data
|
||
|
|
TENANT_ID="c464fb3e-7af2-46e6-9e43-85318f34199a"
|
||
|
|
USER_ID="550e8400-e29b-41d4-a716-446655440000" # User UUID format
|
||
|
|
API_BASE="http://localhost:8009"
|
||
|
|
|
||
|
|
echo "🧁 Adding real recipes with actual inventory data..."
|
||
|
|
echo "📍 Tenant ID: $TENANT_ID"
|
||
|
|
echo "🌐 API Base: $API_BASE"
|
||
|
|
echo "=" | tr -d '\n' && printf '%.0s=' {1..50} && echo
|
||
|
|
|
||
|
|
# Real finished product IDs from inventory
|
||
|
|
CROISSANT_ID="c9a049b7-d1ae-4bf5-99cc-ed2c46f0a509"
|
||
|
|
NAPOLITANA_ID="72c1020f-64be-4b42-8857-e774908204d9"
|
||
|
|
PALMERA_ID="9e888a05-9dda-488b-a06c-0c60a4479e67"
|
||
|
|
PAN_TOSTADO_ID="368fba0e-8ec5-4048-a2f1-79b63f9e11cf"
|
||
|
|
|
||
|
|
# Real ingredient IDs from inventory
|
||
|
|
HARINA_TRIGO_ID="1e1d496f-c041-4f42-82a9-2ae7837c9231" # Harina de Trigo
|
||
|
|
LEVADURA_ID="de2f0852-75f5-4b18-8f0e-7c707f79a9f9" # Levadura Fresca
|
||
|
|
MANTEQUILLA_ID="89e6224a-a055-4148-a2f1-86a5091becec" # Mantequilla
|
||
|
|
|
||
|
|
# Recipe 1: Croissant de Mantequilla
|
||
|
|
echo "Creating Recipe 1: Croissant de Mantequilla..."
|
||
|
|
curl -X POST "$API_BASE/api/v1/recipes/" \
|
||
|
|
-H "Content-Type: application/json" \
|
||
|
|
-H "x-tenant-id: $TENANT_ID" \
|
||
|
|
-H "x-user-id: $USER_ID" \
|
||
|
|
-d '{
|
||
|
|
"name": "Croissant de Mantequilla",
|
||
|
|
"recipe_code": "CRO001",
|
||
|
|
"finished_product_id": "'$CROISSANT_ID'",
|
||
|
|
"description": "Croissant clásico francés con mantequilla, hojaldrado perfecto y textura crujiente",
|
||
|
|
"category": "pastry",
|
||
|
|
"difficulty_level": 3,
|
||
|
|
"yield_quantity": 12,
|
||
|
|
"yield_unit": "units",
|
||
|
|
"prep_time_minutes": 240,
|
||
|
|
"cook_time_minutes": 18,
|
||
|
|
"total_time_minutes": 258,
|
||
|
|
"is_signature_item": true,
|
||
|
|
"target_margin_percentage": 65.0,
|
||
|
|
"ingredients": [
|
||
|
|
{"ingredient_id": "'$HARINA_TRIGO_ID'", "quantity": 500, "unit": "g", "is_optional": false, "ingredient_order": 1},
|
||
|
|
{"ingredient_id": "'$MANTEQUILLA_ID'", "quantity": 300, "unit": "g", "is_optional": false, "ingredient_order": 2},
|
||
|
|
{"ingredient_id": "'$LEVADURA_ID'", "quantity": 12, "unit": "g", "is_optional": false, "ingredient_order": 3}
|
||
|
|
]
|
||
|
|
}'
|
||
|
|
|
||
|
|
echo -e "\n\n"
|
||
|
|
|
||
|
|
# Recipe 2: Napolitana de Chocolate
|
||
|
|
echo "Creating Recipe 2: Napolitana de Chocolate..."
|
||
|
|
curl -X POST "$API_BASE/api/v1/recipes/" \
|
||
|
|
-H "Content-Type: application/json" \
|
||
|
|
-H "x-tenant-id: $TENANT_ID" \
|
||
|
|
-H "x-user-id: $USER_ID" \
|
||
|
|
-d '{
|
||
|
|
"name": "Napolitana de Chocolate",
|
||
|
|
"recipe_code": "NAP001",
|
||
|
|
"finished_product_id": "'$NAPOLITANA_ID'",
|
||
|
|
"description": "Hojaldre relleno de chocolate, dulce y crujiente, perfecto para merienda",
|
||
|
|
"category": "pastry",
|
||
|
|
"difficulty_level": 2,
|
||
|
|
"yield_quantity": 8,
|
||
|
|
"yield_unit": "units",
|
||
|
|
"prep_time_minutes": 45,
|
||
|
|
"cook_time_minutes": 20,
|
||
|
|
"total_time_minutes": 65,
|
||
|
|
"is_signature_item": false,
|
||
|
|
"target_margin_percentage": 70.0,
|
||
|
|
"ingredients": [
|
||
|
|
{"ingredient_id": "'$HARINA_TRIGO_ID'", "quantity": 300, "unit": "g", "is_optional": false, "ingredient_order": 1},
|
||
|
|
{"ingredient_id": "'$MANTEQUILLA_ID'", "quantity": 200, "unit": "g", "is_optional": false, "ingredient_order": 2}
|
||
|
|
]
|
||
|
|
}'
|
||
|
|
|
||
|
|
echo -e "\n\n"
|
||
|
|
|
||
|
|
# Recipe 3: Palmera de Azúcar
|
||
|
|
echo "Creating Recipe 3: Palmera de Azúcar..."
|
||
|
|
curl -X POST "$API_BASE/api/v1/recipes/" \
|
||
|
|
-H "Content-Type: application/json" \
|
||
|
|
-H "x-tenant-id: $TENANT_ID" \
|
||
|
|
-H "x-user-id: $USER_ID" \
|
||
|
|
-d '{
|
||
|
|
"name": "Palmera de Azúcar",
|
||
|
|
"recipe_code": "PAL001",
|
||
|
|
"finished_product_id": "'$PALMERA_ID'",
|
||
|
|
"description": "Palmera de hojaldre con azúcar caramelizado, dulce y crujiente",
|
||
|
|
"category": "pastry",
|
||
|
|
"difficulty_level": 2,
|
||
|
|
"yield_quantity": 10,
|
||
|
|
"yield_unit": "units",
|
||
|
|
"prep_time_minutes": 30,
|
||
|
|
"cook_time_minutes": 15,
|
||
|
|
"total_time_minutes": 45,
|
||
|
|
"is_signature_item": false,
|
||
|
|
"target_margin_percentage": 75.0,
|
||
|
|
"ingredients": [
|
||
|
|
{"ingredient_id": "'$HARINA_TRIGO_ID'", "quantity": 400, "unit": "g", "is_optional": false, "ingredient_order": 1},
|
||
|
|
{"ingredient_id": "'$MANTEQUILLA_ID'", "quantity": 150, "unit": "g", "is_optional": false, "ingredient_order": 2}
|
||
|
|
]
|
||
|
|
}'
|
||
|
|
|
||
|
|
echo -e "\n\n"
|
||
|
|
|
||
|
|
# Recipe 4: Pan Tostado Artesanal
|
||
|
|
echo "Creating Recipe 4: Pan Tostado Artesanal..."
|
||
|
|
curl -X POST "$API_BASE/api/v1/recipes/" \
|
||
|
|
-H "Content-Type: application/json" \
|
||
|
|
-H "x-tenant-id: $TENANT_ID" \
|
||
|
|
-H "x-user-id: $USER_ID" \
|
||
|
|
-d '{
|
||
|
|
"name": "Pan Tostado Artesanal",
|
||
|
|
"recipe_code": "PAN001",
|
||
|
|
"finished_product_id": "'$PAN_TOSTADO_ID'",
|
||
|
|
"description": "Pan artesanal con corteza crujiente y miga tierna, perfecto para tostadas",
|
||
|
|
"category": "bread",
|
||
|
|
"difficulty_level": 2,
|
||
|
|
"yield_quantity": 2,
|
||
|
|
"yield_unit": "units",
|
||
|
|
"prep_time_minutes": 180,
|
||
|
|
"cook_time_minutes": 35,
|
||
|
|
"total_time_minutes": 215,
|
||
|
|
"is_signature_item": true,
|
||
|
|
"target_margin_percentage": 60.0,
|
||
|
|
"ingredients": [
|
||
|
|
{"ingredient_id": "'$HARINA_TRIGO_ID'", "quantity": 600, "unit": "g", "is_optional": false, "ingredient_order": 1},
|
||
|
|
{"ingredient_id": "'$LEVADURA_ID'", "quantity": 15, "unit": "g", "is_optional": false, "ingredient_order": 2}
|
||
|
|
]
|
||
|
|
}'
|
||
|
|
|
||
|
|
echo -e "\n\n🎉 Real recipes creation completed!"
|
||
|
|
echo "✅ Created recipes for existing products:"
|
||
|
|
echo " • Croissant de Mantequilla"
|
||
|
|
echo " • Napolitana de Chocolate"
|
||
|
|
echo " • Palmera de Azúcar"
|
||
|
|
echo " • Pan Tostado Artesanal"
|
||
|
|
echo ""
|
||
|
|
echo "🔗 All recipes are linked to real products and ingredients from inventory!"
|