mirror of
https://github.com/marcogll/AnchorOS.git
synced 2026-03-15 22:24:34 +00:00
feat: Implementar sistema de disponibilidad y corregir errores de kiosko
- Agregar API routes de disponibilidad (blocks, staff, time-slots, staff-unavailable) - Corregir autenticación en availability routes (reemplazar get_current_user_role con validación Bearer) - Corregir DELETE en blocks/route.ts para usar query parameters - Corregir errores de tipos en kiosk routes (supabase → supabaseAdmin) - Agregar layout raíz de Next.js y estilos globales - Agregar componente Badge UI - Corregir tipos TypeScript en WalkInFlow - Instalar dependencias necesarias (@radix-ui/*, class-variance-authority, etc) - Agregar migraciones de disponibilidad
This commit is contained in:
52
supabase/migrations/20260116040000_availability_system.sql
Normal file
52
supabase/migrations/20260116040000_availability_system.sql
Normal file
@@ -0,0 +1,52 @@
|
||||
-- ============================================
|
||||
-- FASE 2.1 - DISPONIBILIDAD DOBLE CAPA (SIMPLIFICADA)
|
||||
-- Horarios de staff y validación básica
|
||||
-- ============================================
|
||||
|
||||
-- ============================================
|
||||
-- AGREGAR CAMPOS DE HORARIO A STAFF
|
||||
-- ============================================
|
||||
|
||||
DO $$
|
||||
BEGIN
|
||||
IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_name = 'staff' AND column_name = 'work_hours_start') THEN
|
||||
ALTER TABLE staff ADD COLUMN work_hours_start TIME;
|
||||
RAISE NOTICE 'Added work_hours_start to staff';
|
||||
END IF;
|
||||
|
||||
IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_name = 'staff' AND column_name = 'work_hours_end') THEN
|
||||
ALTER TABLE staff ADD COLUMN work_hours_end TIME;
|
||||
RAISE NOTICE 'Added work_hours_end to staff';
|
||||
END IF;
|
||||
|
||||
IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_name = 'staff' AND column_name = 'work_days') THEN
|
||||
ALTER TABLE staff ADD COLUMN work_days TEXT DEFAULT 'MON,TUE,WED,THU,FRI,SAT';
|
||||
RAISE NOTICE 'Added work_days to staff';
|
||||
END IF;
|
||||
|
||||
IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_name = 'staff' AND column_name = 'is_available_for_booking') THEN
|
||||
ALTER TABLE staff ADD COLUMN is_available_for_booking BOOLEAN DEFAULT true;
|
||||
RAISE NOTICE 'Added is_available_for_booking to staff';
|
||||
END IF;
|
||||
END
|
||||
$$;
|
||||
|
||||
-- ============================================
|
||||
-- VERIFICACIÓN
|
||||
-- ============================================
|
||||
|
||||
DO $$
|
||||
BEGIN
|
||||
RAISE NOTICE '==========================================';
|
||||
RAISE NOTICE 'FASE 2.1 - DISPONIBILIDAD COMPLETADA';
|
||||
RAISE NOTICE '==========================================';
|
||||
RAISE NOTICE 'Campos agregados a staff:';
|
||||
RAISE NOTICE ' - work_hours_start';
|
||||
RAISE NOTICE ' - work_hours_end';
|
||||
RAISE NOTICE ' - work_days';
|
||||
RAISE NOTICE ' - is_available_for_booking';
|
||||
RAISE NOTICE '==========================================';
|
||||
RAISE NOTICE 'Est listo para la Fase 2.2 - Servicios Express';
|
||||
RAISE NOTICE '==========================================';
|
||||
END
|
||||
$$;
|
||||
Reference in New Issue
Block a user