import { NextRequest, NextResponse } from 'next/server' /** * @description Test links page - Access to all AnchorOS pages and API endpoints * @param {NextRequest} request * @returns {NextResponse} HTML page with links to all pages and APIs */ export async function GET(request: NextRequest) { const baseUrl = process.env.NEXT_PUBLIC_APP_URL || 'http://localhost:2311' const pages = [ // anchor23.mx - Frontend Institucional { name: 'Home (Landing)', url: '/' }, { name: 'Servicios', url: '/servicios' }, { name: 'Historia', url: '/historia' }, { name: 'Contacto', url: '/contacto' }, { name: 'Franquicias', url: '/franchises' }, { name: 'Membresías', url: '/membresias' }, { name: 'Privacy Policy', url: '/privacy-policy' }, { name: 'Legal', url: '/legal' }, // booking.anchor23.mx - The Boutique (Frontend de Reservas) { name: 'Booking - Servicios', url: '/booking/servicios' }, { name: 'Booking - Cita', url: '/booking/cita' }, { name: 'Booking - Confirmación', url: '/booking/confirmacion' }, { name: 'Booking - Registro', url: '/booking/registro' }, { name: 'Booking - Login', url: '/booking/login' }, { name: 'Booking - Perfil', url: '/booking/perfil' }, { name: 'Booking - Mis Citas', url: '/booking/mis-citas' }, // aperture.anchor23.mx - Dashboard Administrativo { name: 'Aperture - Login', url: '/aperture/login' }, { name: 'Aperture - Dashboard', url: '/aperture' }, { name: 'Aperture - Calendario', url: '/aperture/calendar' }, // kiosk.anchor23.mx - Sistema de Autoservicio { name: 'Kiosk - [locationId]', url: '/kiosk/LOCATION_ID_HERE' }, // Admin & Enrollment { name: 'HQ Dashboard (Antiguo)', url: '/hq' }, { name: 'Admin Enrollment', url: '/admin/enrollment' }, ] const apis = [ // APIs Públicas { name: 'Services', url: '/api/services', method: 'GET' }, { name: 'Locations', url: '/api/locations', method: 'GET' }, { name: 'Customers (List)', url: '/api/customers', method: 'GET' }, { name: 'Customers (Create)', url: '/api/customers', method: 'POST' }, { name: 'Availability', url: '/api/availability', method: 'GET' }, { name: 'Availability Time Slots', url: '/api/availability/time-slots', method: 'GET' }, { name: 'Public Availability', url: '/api/public/availability', method: 'GET' }, { name: 'Availability Blocks', url: '/api/availability/blocks', method: 'GET' }, { name: 'Bookings (List)', url: '/api/bookings', method: 'GET' }, { name: 'Bookings (Create)', url: '/api/bookings', method: 'POST' }, // Kiosk APIs { name: 'Kiosk - Authenticate', url: '/api/kiosk/authenticate', method: 'POST' }, { name: 'Kiosk - Available Resources', url: '/api/kiosk/resources/available', method: 'GET' }, { name: 'Kiosk - Bookings', url: '/api/kiosk/bookings', method: 'POST' }, { name: 'Kiosk - Walkin', url: '/api/kiosk/walkin', method: 'POST' }, // Payment APIs { name: 'Create Payment Intent', url: '/api/create-payment-intent', method: 'POST' }, // Aperture APIs { name: 'Aperture - Dashboard', url: '/api/aperture/dashboard', method: 'GET' }, { name: 'Aperture - Stats', url: '/api/aperture/stats', method: 'GET' }, { name: 'Aperture - Calendar', url: '/api/aperture/calendar', method: 'GET' }, { name: 'Aperture - Staff (List)', url: '/api/aperture/staff', method: 'GET' }, { name: 'Aperture - Staff (Create)', url: '/api/aperture/staff', method: 'POST' }, { name: 'Aperture - Resources', url: '/api/aperture/resources', method: 'GET' }, { name: 'Aperture - Payroll', url: '/api/aperture/payroll', method: 'GET' }, { name: 'Aperture - POS', url: '/api/aperture/pos', method: 'POST' }, { name: 'Aperture - Close Day', url: '/api/aperture/pos/close-day', method: 'POST' }, // Client Management (FASE 5) { name: 'Aperture - Clients (List)', url: '/api/aperture/clients', method: 'GET' }, { name: 'Aperture - Clients (Create)', url: '/api/aperture/clients', method: 'POST' }, { name: 'Aperture - Client Details', url: '/api/aperture/clients/[id]', method: 'GET' }, { name: 'Aperture - Client Notes', url: '/api/aperture/clients/[id]/notes', method: 'POST' }, { name: 'Aperture - Client Photos', url: '/api/aperture/clients/[id]/photos', method: 'GET' }, // Loyalty System (FASE 5) { name: 'Aperture - Loyalty', url: '/api/aperture/loyalty', method: 'GET' }, { name: 'Aperture - Loyalty History', url: '/api/aperture/loyalty/[customerId]', method: 'GET' }, // Webhooks (FASE 6) { name: 'Stripe Webhooks', url: '/api/webhooks/stripe', method: 'POST' }, // Cron Jobs (FASE 6) { name: 'Reset Invitations (Cron)', url: '/api/cron/reset-invitations', method: 'GET' }, { name: 'Detect No-Shows (Cron)', url: '/api/cron/detect-no-shows', method: 'GET' }, // Bookings Actions (FASE 6) { name: 'Bookings - Check-in', url: '/api/aperture/bookings/check-in', method: 'POST' }, { name: 'Bookings - No-Show', url: '/api/aperture/bookings/no-show', method: 'POST' }, // Finance (FASE 6) { name: 'Aperture - Finance Summary', url: '/api/aperture/finance', method: 'GET' }, { name: 'Aperture - Daily Closing', url: '/api/aperture/finance/daily-closing', method: 'GET' }, { name: 'Aperture - Expenses (List)', url: '/api/aperture/finance/expenses', method: 'GET' }, { name: 'Aperture - Expenses (Create)', url: '/api/aperture/finance/expenses', method: 'POST' }, { name: 'Aperture - Staff Performance', url: '/api/aperture/finance/staff-performance', method: 'GET' }, ] const html = ` AnchorOS - Test Links

🥂 AnchorOS - Test Links

Complete directory of all pages and API endpoints

⚠️ Note: Replace LOCATION_ID_HERE with actual UUID from your database. For cron jobs, use: curl -H "Authorization: Bearer YOUR_CRON_SECRET"

📄 Pages

${pages.map(page => `

${page.name}

${baseUrl}${page.url}
`).join('')}

🔌 API Endpoints

${apis.map(api => `
${api.method} ${api.name.includes('FASE') ? `${api.name.match(/FASE \d+/)?.[0] || 'FASE'}` : ''}

${api.name}

${baseUrl}${api.url}
`).join('')}
` return new NextResponse(html, { headers: { 'Content-Type': 'text/html; charset=utf-8', }, }) }