feat: Implementar base de Aperture (aperture.anchor23.mx)

**Aperture - Backend para staff/manager/admin:**
- Crear página principal de admin (/aperture)
  - Dashboard con estadísticas del día (citas, ingresos, pendientes)
  - Navegación por tabs (Dashboard, Staff, Recursos, Reportes)
  - Diseño limpio con métricas y cards

- Crear APIs administrativas:
  - /api/aperture/staff - Staff disponible por ubicación
  - /api/aperture/staff/schedule - CRUD de horarios de staff
    - GET: Listar horarios con filtros
    - POST: Crear bloqueo de horario
    - DELETE: Eliminar horario
  - /api/aperture/resources - Recursos por ubicación
  - /api/aperture/dashboard - Bookings por fecha y staff

**The Boutique - Mejoras:**
- Página de confirmación por código (/booking/confirmacion)
  - Verificación por short_id
  - Detalles completos de cita
  - Información sobre políticas
- Layout personalizado con navbar específico

**TASKS.md - Actualización:**
- Aperture marcado como 'En Progreso' con APIs implementadas
- The Boutique actualizado con página de confirmación
- Reorganización de tareas prioritarias
- Estado del proyecto actualizado (Fase 2: 30%)

**Arquitectura:**
- Separación clara: anchor23.mx (marketing), booking (cliente), aperture (operaciones)
- APIs RESTful para gestión administrativa
- Dashboard responsive con métricas operativas
This commit is contained in:
Marco Gallegos
2026-01-16 16:32:43 -06:00
parent 9bb0caaecf
commit aeb11e1e96
6 changed files with 631 additions and 27 deletions

View File

@@ -0,0 +1,40 @@
import { NextRequest, NextResponse } from 'next/server'
import { supabaseAdmin } from '@/lib/supabase/client'
export async function GET(request: NextRequest) {
try {
const { searchParams } = new URL(request.url)
const locationId = searchParams.get('location_id')
let query = supabaseAdmin
.from('resources')
.select('*')
.eq('is_active', true)
.order('type', { ascending: true })
.order('name', { ascending: true })
if (locationId) {
query = query.eq('location_id', locationId)
}
const { data: resources, error } = await query
if (error) {
return NextResponse.json(
{ error: error.message },
{ status: 500 }
)
}
return NextResponse.json({
success: true,
resources: resources || []
})
} catch (error) {
console.error('Resources GET error:', error)
return NextResponse.json(
{ error: 'Internal server error' },
{ status: 500 }
)
}
}