Commit Graph

15 Commits

Author SHA1 Message Date
Marco Gallegos
1b8ab9fecf docs: Document all Supabase connection fixes and API improvements
- Update README with Node.js 20 requirement and recent fixes
- Enhance API documentation with improved endpoints and troubleshooting
- Add Supabase connection issue resolution to troubleshooting guide
- Document lazy client initialization and enhanced error diagnostics
- Include recent improvements section in README
2026-01-18 09:31:50 -06:00
Marco Gallegos
0f3de32899 🚀 FASE 4 COMPLETADO: Comentarios auditables + Calendario funcional + Gestión staff/recursos
 COMENTARIOS AUDITABLES IMPLEMENTADOS:
- 80+ archivos con JSDoc completo para auditoría manual
- APIs críticas con validaciones business/security/performance
- Componentes con reglas de negocio documentadas
- Funciones core con edge cases y validaciones

 CALENDARIO MULTI-COLUMNA FUNCIONAL (95%):
- Drag & drop con reprogramación automática
- Filtros por sucursal/staff, tiempo real
- Indicadores de conflictos y disponibilidad
- APIs completas con validaciones de colisión

 GESTIÓN OPERATIVA COMPLETA:
- CRUD staff: APIs + componente con validaciones
- CRUD recursos: APIs + componente con disponibilidad
- Autenticación completa con middleware seguro
- Auditoría completa en todas las operaciones

 DOCUMENTACIÓN ACTUALIZADA:
- TASKS.md: FASE 4 95% completado
- README.md: Estado actual y funcionalidades
- API.md: 40+ endpoints documentados

 SEGURIDAD Y VALIDACIONES:
- RLS policies documentadas en comentarios
- Business rules validadas manualmente
- Performance optimizations anotadas
- Error handling completo

Próximos: Nómina/POS/CRM avanzado (FASE 4 final)
2026-01-17 15:31:13 -06:00
Marco Gallegos
46f476a622 docs: Update README.md with complete Aperture documentation
- Add new documentation files to official docs list:
  - APERTURE_SQUARE_UI.md: Square UI style guide
  - DESIGN_SYSTEM.md: Comprehensive design system

- Update Tech Stack section:
  - Add Radix UI as primary UI library
  - Mention Square UI custom styling
  - Update: Tailwind CSS + Radix UI + Square UI

- Update Project State section:
  - Fase 4 redefined: 0% completed (full specs documented)
  - Add 7 phases detailed plan with ~136-171 hours estimate
  - Add complete feature list for Aperture (6 main screens)

- Add new section "Aperture - HQ Dashboard":
  - Technical specs references
  - Complete implementation plan (7 phases)
  - 6 main screens detailed breakdown:
    1. Dashboard Home (KPI Cards, Chart, Top Performers, Activity Feed)
    2. Master Calendar (Drag & Drop, Resize, Dynamic Filters)
    3. Team & Payroll (Staff CRUD, Commissions, Payroll, Shifts)
    4. Clients & Loyalty (CRM, VIP Gallery, Memberships, Points)
    5. Sales, Payments & Invoicing (POS, Cash Close, Finance)
    6. Marketing & Configuration (Campaigns, Dynamic Pricing, Integrations)

- Update Domains section:
  - Add aperture.anchor23.mx with status

- Update Experiences section:
  - Expand The HQ description

- Update Project Structure section:
  - Add complete Aperture route structure:
    - /aperture (Dashboard Home)
    - /aperture/calendar (Master Calendar)
    - /aperture/staff (Staff Management)
    - /aperture/staff/payroll (Payroll Calculation)
    - /aperture/clients (CRM)
    - /aperture/clients/[id] (Client Profile)
    - /aperture/clients/[id]/gallery (VIP Gallery)
    - /aperture/loyalty (Loyalty System)
    - /aperture/loyalty/memberships (Memberships)
    - /aperture/loyalty/rewards (Rewards)
    - /aperture/pos (POS)
    - /aperture/pos/checkout (Checkout)
    - /aperture/finance (Finance)
    - /aperture/finance/close-day (Cash Close)
    - /aperture/admin/settings (Marketing & Config)

- Update "Páginas Implementadas" section:
  - Add complete Aperture routes documentation
  - Document each screen with features breakdown

This commit completes the documentation updates for Aperture with all
domains, routes, and technical specifications properly reflected in README.md
2026-01-17 10:24:33 -06:00
Marco Gallegos
a160a93d8c docs: Update Aperture plan and design system documentation
- Update TASKS.md with complete Aperture implementation plan (7 phases)
  - Define critical, high, medium, and low priority tasks
  - Add timeline estimates: ~136-171 hours total (~17-21 business days)
  - Add sprint structure (6 sprints)

- Create APERTURE_SQUARE_UI.md: Complete Square UI style guide
  - Color palette, typography, borders, shadows
  - Layout patterns, component states
  - Accessibility guidelines
  - Responsive adaptations

- Create DESIGN_SYSTEM.md: Comprehensive design system for AnchorOS
  - Resolve color inconsistency between site_requirements.md and globals.css
  - Document both systems (anchor23.mx and Aperture)
  - Component documentation checklist
  - Implementation guidelines

- Update API.md with undocumented implemented routes:
  - GET /api/availability/blocks
  - GET /api/public/availability
  - POST /api/availability/staff
  - POST /api/kiosk/walkin
  - PATCH /api/bookings/[id]

- Update README.md with current project state:
  - Fase 1-3: 100% completed
  - Fase 4: 0% completed (redefined with full specifications)
  - Add missing feature details (POS, multiple cashiers, etc.)

Based on technical specifications received, Aperture now includes:
- Dashboard Home (KPI cards, performance charts, top performers, activity feed)
- Master Calendar (drag & drop, resize blocks, dynamic filters, visual indicators)
- Team & Payroll (staff CRUD, commissions, payroll calculation, shift management)
- Clients & Loyalty (CRM, VIP gallery, memberships, points system)
- Sales, Payments & Invoicing (POS, daily cash close, finance)
- Marketing & Configuration (campaigns, dynamic pricing, integration placeholders)

Tech stack: Radix UI + Tailwind CSS + Square UI custom styling
2026-01-17 10:16:28 -06:00
Marco Gallegos
e3c4f30648 feat: implement customer registration flow and business hours system
Major changes:
- Add customer registration with email/phone lookup (app/booking/registro)
- Add customers API endpoint (app/api/customers/route)
- Implement business hours for locations (mon-fri 10-7, sat 10-6, sun closed)
- Fix availability function type casting issues
- Add business hours utilities (lib/utils/business-hours.ts)
- Update Location type to include business_hours JSONB
- Add mock payment component for testing
- Remove Supabase auth from booking flow
- Fix /cita redirect path in booking flow

Database migrations:
- Add category column to services table
- Add business_hours JSONB column to locations table
- Fix availability functions with proper type casting
- Update get_detailed_availability to use business_hours

Features:
- Customer lookup by email or phone
- Auto-redirect to registration if customer not found
- Pre-fill customer data if exists
- Business hours per day of week
- Location-specific opening/closing times
2026-01-17 00:48:49 -06:00
Marco Gallegos
fb60178c86 feat: implement public API routes and staff authentication
- Add public API endpoints for locations, services, and availability
- Implement staff login system with password authentication
- Update auth context to support password sign-in
- Protect aperture dashboard with authentication
- Update project documentation with new domains
2026-01-16 21:45:47 -06:00
Marco Gallegos
0f6fe9bf7b docs: update project documentation and types for Jan 2026 kiosk completion 2026-01-16 21:38:53 -06:00
Marco Gallegos
8fc9d3717e docs: add comprehensive code comments, update README and TASKS, create training and troubleshooting guides
- Add JSDoc comments to API routes and business logic functions
- Update README.md with Phase 2 status and deployment/production notes
- Enhance TASKS.md with estimated timelines and dependencies
- Create docs/STAFF_TRAINING.md for team onboarding
- Create docs/CLIENT_ONBOARDING.md for customer experience
- Create docs/OPERATIONAL_PROCEDURES.md for daily operations
- Create docs/TROUBLESHOOTING.md for common setup issues
- Fix TypeScript errors in hq/page.tsx
2026-01-16 18:42:45 -06:00
Marco Gallegos
28e98a2a44 feat: Complete SalonOS implementation with authentication, payments, reports, and documentation
- Implement client authentication with Supabase magic links
- Add Stripe payment integration for deposits
- Complete The Boutique booking flow with payment processing
- Implement Aperture backend with staff/resources management
- Add comprehensive reports: sales, payments, payroll
- Create permissions management system by roles
- Configure kiosk system with enrollment
- Add no-show logic and penalization system
- Update project documentation and API docs
- Enhance README with current project status
2026-01-16 17:35:29 -06:00
Marco Gallegos
fbd3038ace feat: Iniciar implementación de The Boutique (booking.anchor23.mx)
**Frontend (booking.anchor23.mx):**
- Crear página de selección de servicios (/booking/servicios)
  - Catálogo de servicios con precios y duración
  - Selección de ubicación
  - Calendario interactivo para selección de fecha y hora
  - Validación de disponibilidad en tiempo real
  - Resumen de reserva con precio

- Crear página de confirmación de reserva (/booking/cita)
  - Resumen detallado de la cita (servicio, fecha, hora, ubicación)
  - Formulario para datos del cliente (nombre, email, teléfono, notas)
  - Confirmación visual de la reserva
  - Redirección a página de confirmación exitosa

**Backend APIs:**
- Crear /api/services para obtener servicios activos
  - Filtrar por ubicación si se especifica
  - Retornar precio y duración de cada servicio

- Crear /api/locations para obtener ubicaciones activas
  - Retornar lista de locations con timezone

**Documentación:**
- Actualizar TASKS.md con progreso de The Boutique (20%)
- Agregar nuevas tareas pendientes (aperture, api pública)
- Actualizar README.md con:
  - Nueva estructura de rutas (/booking/*)
  - Nuevas APIs (/api/services, /api/locations)
  - Estado actualizado de The Boutique
  - Actualizar Fase 2 al 20% completado

**Estilos:**
- Mantener paleta de colores de anchor23.mx
- Diseño consistente con el resto del sitio
- Responsive para móviles
2026-01-16 16:15:21 -06:00
Marco Gallegos
686a3e19e1 docs: Actualizar configuración de puerto y documentación
- Configurar puerto 2311 por defecto en package.json
- Actualizar README.md con puerto local 2311
- Actualizar DOMAIN_CONFIGURATION.md con puerto 2311
- Actualizar comandos ngrok para usar puerto correcto
- Actualizar URLs de acceso local
2026-01-16 16:05:15 -06:00
Marco Gallegos
133b4f6c42 docs: Actualizar documentación del proyecto
- Actualizar README.md con estado actual del proyecto
- Agregar sección de anchor23.mx frontend institucional
- Actualizar estructura de rutas y carpetas
- Actualizar fase actual (95% Fase 1, 60% Fase 2)
- Crear documento DOMAIN_CONFIGURATION.md con guía de dominios
- Crear documento ANCHOR23_FRONTEND.md con detalles técnicos
- Agregar referencias cruzadas en README

Completados recientes:
 Frontend institucional anchor23.mx (todas las páginas)
 Sistema de disponibilidad completo
 API de reservas para clientes
 HQ Dashboard con calendario multi-columna
2026-01-16 15:51:53 -06:00
Marco Gallegos
fed5cb6850 feat: Implementar sistema de kiosko, enrollment e integración Telegram
## Sistema de Kiosko 
- Nuevo rol 'kiosk' en enum user_role
- Tabla kiosks con autenticación por API key (64 caracteres)
- Funciones SQL: generate_kiosk_api_key(), is_kiosk(), get_available_resources_with_priority()
- API Routes: authenticate, bookings (GET/POST), confirm, resources/available, walkin
- Componentes UI: BookingConfirmation, WalkInFlow, ResourceAssignment
- Página kiosko: /kiosk/[locationId]/page.tsx

## Sistema de Enrollment 
- API routes para administración: /api/admin/users, /api/admin/kiosks, /api/admin/locations
- Frontend enrollment: /admin/enrollment con autenticación por ADMIN_KEY
- Creación de staff (admin, manager, staff, artist) con Supabase Auth
- Creación de kiosks con generación automática de API key
- Componentes UI: card, button, input, label, select, tabs

## Actualización de Recursos 
- Reemplazo de recursos con códigos estándarizados
- Estructura por location: 3 mkup, 1 lshs, 4 pedi, 4 mani
- Migración de limpieza: elimina duplicados
- Total: 12 recursos por location

## Integración Telegram y Scoring 
- Campos agregados a staff: telegram_id, email, gmail, google_account, telegram_chat_id
- Sistema de scoring: performance_score, total_bookings_completed, total_guarantees_count
- Tablas: telegram_notifications, telegram_groups, telegram_bots
- Funciones: update_staff_performance_score(), get_top_performers(), get_performance_summary()
- Triggers automáticos: notificaciones al crear/confirmar/completar booking
- Cálculo de score: base 50 +10 por booking +5 por garantía +1 por $100

## Actualización de Tipos 
- UserRole: agregado 'kiosk'
- CustomerTier: agregado 'black', 'VIP'
- Nuevas interfaces: Kiosk

## Documentación 
- KIOSK_SYSTEM.md: Documentación completa del sistema
- KIOSK_IMPLEMENTATION.md: Guía rápida
- ENROLLMENT_SYSTEM.md: Sistema de enrollment
- RESOURCES_UPDATE.md: Actualización de recursos
- PROJECT_UPDATE_JAN_2026.md: Resumen de proyecto

## Componentes UI (7)
- button.tsx, card.tsx, input.tsx, label.tsx, select.tsx, tabs.tsx

## Migraciones SQL (4)
- 20260116000000_add_kiosk_system.sql
- 20260116010000_update_resources.sql
- 20260116020000_cleanup_and_fix_resources.sql
- 20260116030000_telegram_integration.sql

## Métricas
- ~7,500 líneas de código
- 32 archivos creados/modificados
- 7 componentes UI
- 10 API routes
- 4 migraciones SQL
2026-01-16 10:51:12 -06:00
Marco Gallegos
11c0a43b61 Update project name in README 2026-01-15 11:57:59 -06:00
Marco Gallegos
3a31ed31a4 first commit 2026-01-15 11:57:12 -06:00