diff --git a/add_real_recipes.sh b/add_real_recipes.sh deleted file mode 100755 index 4f7412b5..00000000 --- a/add_real_recipes.sh +++ /dev/null @@ -1,142 +0,0 @@ -#!/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!" \ No newline at end of file diff --git a/add_sample_recipes.sh b/add_sample_recipes.sh deleted file mode 100755 index 4e83d64c..00000000 --- a/add_sample_recipes.sh +++ /dev/null @@ -1,145 +0,0 @@ -#!/bin/bash - -# Add sample recipes using the API -TENANT_ID="c464fb3e-7af2-46e6-9e43-85318f34199a" -API_BASE="http://localhost:8009" - -echo "đ§ Adding sample recipes via API..." -echo "đ Tenant ID: $TENANT_ID" -echo "đ API Base: $API_BASE" -echo "=" | tr -d '\n' && printf '%.0s=' {1..50} && echo - -# Sample finished product IDs (these should exist in your system) -PRODUCT_ID_1="550e8400-e29b-41d4-a716-446655440001" -PRODUCT_ID_2="550e8400-e29b-41d4-a716-446655440002" -PRODUCT_ID_3="550e8400-e29b-41d4-a716-446655440003" -PRODUCT_ID_4="550e8400-e29b-41d4-a716-446655440004" - -# Sample ingredient IDs (these should exist in your system) -ING_ID_1="660e8400-e29b-41d4-a716-446655440001" # Harina integral -ING_ID_2="660e8400-e29b-41d4-a716-446655440002" # Agua -ING_ID_3="660e8400-e29b-41d4-a716-446655440003" # Levadura -ING_ID_4="660e8400-e29b-41d4-a716-446655440004" # Sal -ING_ID_5="660e8400-e29b-41d4-a716-446655440005" # Harina de fuerza -ING_ID_6="660e8400-e29b-41d4-a716-446655440006" # Mantequilla -ING_ID_7="660e8400-e29b-41d4-a716-446655440007" # Leche -ING_ID_8="660e8400-e29b-41d4-a716-446655440008" # AzĂșcar -ING_ID_9="660e8400-e29b-41d4-a716-446655440009" # Manzanas -ING_ID_10="660e8400-e29b-41d4-a716-446655440010" # Huevos -ING_ID_11="660e8400-e29b-41d4-a716-446655440011" # LimĂłn - -# Recipe 1: Pan de Molde Integral -echo "Creating Recipe 1: Pan de Molde Integral..." -curl -X POST "$API_BASE/api/v1/recipes/" \ - -H "Content-Type: application/json" \ - -H "x-tenant-id: $TENANT_ID" \ - -d '{ - "name": "Pan de Molde Integral", - "recipe_code": "PAN001", - "finished_product_id": "'$PRODUCT_ID_1'", - "description": "Pan integral artesanal con semillas, perfecto para desayunos saludables.", - "category": "bread", - "difficulty_level": 2, - "yield_quantity": 1, - "yield_unit": "units", - "prep_time_minutes": 120, - "cook_time_minutes": 35, - "total_time_minutes": 155, - "is_signature_item": false, - "target_margin_percentage": 40.0, - "ingredients": [ - {"ingredient_id": "'$ING_ID_1'", "quantity": 500, "unit": "g", "is_optional": false, "ingredient_order": 1}, - {"ingredient_id": "'$ING_ID_2'", "quantity": 300, "unit": "ml", "is_optional": false, "ingredient_order": 2}, - {"ingredient_id": "'$ING_ID_3'", "quantity": 10, "unit": "g", "is_optional": false, "ingredient_order": 3}, - {"ingredient_id": "'$ING_ID_4'", "quantity": 8, "unit": "g", "is_optional": false, "ingredient_order": 4} - ] - }' - -echo -e "\n\n" - -# Recipe 2: Croissants de Mantequilla -echo "Creating Recipe 2: Croissants de Mantequilla..." -curl -X POST "$API_BASE/api/v1/recipes/" \ - -H "Content-Type: application/json" \ - -H "x-tenant-id: $TENANT_ID" \ - -d '{ - "name": "Croissants de Mantequilla", - "recipe_code": "CRO001", - "finished_product_id": "'$PRODUCT_ID_2'", - "description": "Croissants franceses tradicionales con laminado de mantequilla.", - "category": "pastry", - "difficulty_level": 3, - "yield_quantity": 12, - "yield_unit": "units", - "prep_time_minutes": 480, - "cook_time_minutes": 20, - "total_time_minutes": 500, - "is_signature_item": true, - "target_margin_percentage": 52.8, - "ingredients": [ - {"ingredient_id": "'$ING_ID_5'", "quantity": 500, "unit": "g", "is_optional": false, "ingredient_order": 1}, - {"ingredient_id": "'$ING_ID_6'", "quantity": 250, "unit": "g", "is_optional": false, "ingredient_order": 2}, - {"ingredient_id": "'$ING_ID_7'", "quantity": 150, "unit": "ml", "is_optional": false, "ingredient_order": 3}, - {"ingredient_id": "'$ING_ID_8'", "quantity": 50, "unit": "g", "is_optional": false, "ingredient_order": 4} - ] - }' - -echo -e "\n\n" - -# Recipe 3: Tarta de Manzana -echo "Creating Recipe 3: Tarta de Manzana..." -curl -X POST "$API_BASE/api/v1/recipes/" \ - -H "Content-Type: application/json" \ - -H "x-tenant-id: $TENANT_ID" \ - -d '{ - "name": "Tarta de Manzana", - "recipe_code": "TAR001", - "finished_product_id": "'$PRODUCT_ID_3'", - "description": "Tarta casera de manzana con canela y masa quebrada.", - "category": "cake", - "difficulty_level": 1, - "yield_quantity": 8, - "yield_unit": "portions", - "prep_time_minutes": 45, - "cook_time_minutes": 40, - "total_time_minutes": 85, - "is_signature_item": false, - "target_margin_percentage": 65.0, - "ingredients": [ - {"ingredient_id": "'$ING_ID_9'", "quantity": 1000, "unit": "g", "is_optional": false, "ingredient_order": 1}, - {"ingredient_id": "'$ING_ID_1'", "quantity": 250, "unit": "g", "is_optional": false, "ingredient_order": 2}, - {"ingredient_id": "'$ING_ID_6'", "quantity": 125, "unit": "g", "is_optional": false, "ingredient_order": 3}, - {"ingredient_id": "'$ING_ID_8'", "quantity": 100, "unit": "g", "is_optional": false, "ingredient_order": 4} - ] - }' - -echo -e "\n\n" - -# Recipe 4: Magdalenas de LimĂłn -echo "Creating Recipe 4: Magdalenas de LimĂłn..." -curl -X POST "$API_BASE/api/v1/recipes/" \ - -H "Content-Type: application/json" \ - -H "x-tenant-id: $TENANT_ID" \ - -d '{ - "name": "Magdalenas de LimĂłn", - "recipe_code": "MAG001", - "finished_product_id": "'$PRODUCT_ID_4'", - "description": "Magdalenas suaves y esponjosas con ralladura de limĂłn.", - "category": "pastry", - "difficulty_level": 1, - "yield_quantity": 12, - "yield_unit": "units", - "prep_time_minutes": 20, - "cook_time_minutes": 25, - "total_time_minutes": 45, - "is_signature_item": false, - "target_margin_percentage": 57.8, - "ingredients": [ - {"ingredient_id": "'$ING_ID_1'", "quantity": 200, "unit": "g", "is_optional": false, "ingredient_order": 1}, - {"ingredient_id": "'$ING_ID_10'", "quantity": 3, "unit": "units", "is_optional": false, "ingredient_order": 2}, - {"ingredient_id": "'$ING_ID_8'", "quantity": 150, "unit": "g", "is_optional": false, "ingredient_order": 3}, - {"ingredient_id": "'$ING_ID_11'", "quantity": 2, "unit": "units", "is_optional": false, "ingredient_order": 4} - ] - }' - -echo -e "\n\nđ Sample recipes creation completed!" \ No newline at end of file diff --git a/frontend/src/locales/es/auth.json b/frontend/src/locales/es/auth.json index 71fcd6bc..eefc9821 100644 --- a/frontend/src/locales/es/auth.json +++ b/frontend/src/locales/es/auth.json @@ -145,6 +145,12 @@ "cashier": "Cajero", "assistant": "Asistente" }, + "global_roles": { + "user": "Usuario", + "admin": "Administrador", + "manager": "Gestor", + "super_admin": "Super Administrador" + }, "permissions": { "read": "Lectura", "write": "Escritura", diff --git a/frontend/src/pages/app/settings/profile/ProfilePage.tsx b/frontend/src/pages/app/settings/profile/ProfilePage.tsx index 55836f5e..cfb8a35e 100644 --- a/frontend/src/pages/app/settings/profile/ProfilePage.tsx +++ b/frontend/src/pages/app/settings/profile/ProfilePage.tsx @@ -7,6 +7,7 @@ import { useCurrentTenant } from '../../../../stores'; import { useToast } from '../../../../hooks/ui/useToast'; import { useAuthProfile, useUpdateProfile, useChangePassword } from '../../../../api/hooks/auth'; import { subscriptionService, type UsageSummary, type AvailablePlans } from '../../../../api'; +import { useTranslation } from 'react-i18next'; interface ProfileFormData { first_name: string; @@ -78,6 +79,7 @@ interface NotificationPreferences { const ProfilePage: React.FC = () => { const user = useAuthUser(); + const { t } = useTranslation('auth'); const { addToast } = useToast(); const { data: profile, isLoading: profileLoading, error: profileError } = useAuthProfile(); @@ -596,6 +598,11 @@ const ProfilePage: React.FC = () => { {profileData.first_name} {profileData.last_name}
{profileData.email}
+ {user?.role && ( ++ {t(`global_roles.${user.role}`)} +
+ )}