From b098c2329161cca17320529dc3d55d070ab971a2 Mon Sep 17 00:00:00 2001 From: Hanzo_dev <2002samudiojohan@gmail.com> Date: Tue, 3 Mar 2026 11:45:36 -0500 Subject: [PATCH] Integrated AuthGuard in Discover and Shuttles, updated Business types and translations --- frontend/src/components/common/AuthGuard.vue | 218 ++++++++++++++++++ frontend/src/i18n/locales/es.json | 2 + frontend/src/services/businessService.ts | 4 +- frontend/src/types/index.ts | 2 + frontend/src/views/BusinessDetailsView.vue | 55 ++++- frontend/src/views/CouponsView.vue | 61 ++--- frontend/src/views/DiscoverView.vue | 136 +++++------ frontend/src/views/PromoterDashboard.vue | 18 +- .../src/views/transporte/ViajesTuristicos.vue | 121 +++++----- 9 files changed, 458 insertions(+), 159 deletions(-) create mode 100644 frontend/src/components/common/AuthGuard.vue diff --git a/frontend/src/components/common/AuthGuard.vue b/frontend/src/components/common/AuthGuard.vue new file mode 100644 index 0000000..b6a2523 --- /dev/null +++ b/frontend/src/components/common/AuthGuard.vue @@ -0,0 +1,218 @@ + + + + + diff --git a/frontend/src/i18n/locales/es.json b/frontend/src/i18n/locales/es.json index 363a113..00e0053 100644 --- a/frontend/src/i18n/locales/es.json +++ b/frontend/src/i18n/locales/es.json @@ -242,6 +242,7 @@ } }, "business": { + "aboutUs": "Sobre Nosotros", "detailsTitle": "Explora Nuestra Historia Para Una Cocina Refinada Y Un Ambiente Atemporal", "detailsDescription": "Nuestra historia es una de crecimiento, exploración y recuerdos culinarios inflamables, donde cada capítulo se sirve con elegancia.", "timelessHeritage": "Herencia Atemporal", @@ -257,6 +258,7 @@ "socialMedia": "Redes Sociales", "availableOffers": "Ofertas Disponibles", "viewBusiness": "Ver Negocio", + "getDirections": "Cómo llegar", "loadingPremium": "Cargando experiencia premium..." }, "profile": { diff --git a/frontend/src/services/businessService.ts b/frontend/src/services/businessService.ts index 704cd64..12bfc1e 100644 --- a/frontend/src/services/businessService.ts +++ b/frontend/src/services/businessService.ts @@ -18,14 +18,14 @@ export const businessService = { /** Get all businesses */ async getAllBusinesses(): Promise { - const { data, error } = await supabase.from('businesses').select('id, name, address, phone, image_url, social_media, category, latitude, longitude, area, updated_at') + const { data, error } = await supabase.from('businesses').select('id, name, address, phone, image_url, social_media, category, latitude, longitude, area, description, website, updated_at') if (error) throw new Error(error.message) return data as Business[] }, /** Get a single business by ID */ async getBusiness(id: string): Promise { - const { data, error } = await supabase.from('businesses').select('id, name, address, phone, image_url, social_media, category, latitude, longitude, area, updated_at').eq('id', id).single() + const { data, error } = await supabase.from('businesses').select('id, name, address, phone, image_url, social_media, category, latitude, longitude, area, description, website, updated_at').eq('id', id).single() if (error) throw new Error(error.message) return data as Business }, diff --git a/frontend/src/types/index.ts b/frontend/src/types/index.ts index 4ddf2e6..e5e593c 100644 --- a/frontend/src/types/index.ts +++ b/frontend/src/types/index.ts @@ -95,6 +95,8 @@ export interface Business { latitude?: number | null longitude?: number | null area?: string | null + description?: string | null + website?: string | null updated_at?: string } diff --git a/frontend/src/views/BusinessDetailsView.vue b/frontend/src/views/BusinessDetailsView.vue index be743df..4505a52 100644 --- a/frontend/src/views/BusinessDetailsView.vue +++ b/frontend/src/views/BusinessDetailsView.vue @@ -47,6 +47,14 @@ function getImageUrl(path: string | null | undefined) { const goBack = () => router.back() +function openDirections() { + if (business.value?.latitude && business.value?.longitude) { + window.open(`https://www.google.com/maps/dir/?api=1&destination=${business.value.latitude},${business.value.longitude}`, '_blank') + } else if (business.value?.address) { + window.open(`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(business.value.address + ' ' + (business.value.area || ''))}`, '_blank') + } +} +