/**
 * WhatsApp Routes
 * ERP Transportistas
 *
 * Route configuration for WhatsApp notification endpoints.
 * Sprint: S5 - TASK-007
 * Module: WhatsApp Integration
 */

import { Router } from 'express';
import { DataSource } from 'typeorm';
import { createWhatsAppController } from './controllers';

/**
 * Create WhatsApp routes
 * @param dataSource - TypeORM DataSource instance
 * @returns Express Router with WhatsApp endpoints
 */
export function createWhatsAppRoutes(dataSource: DataSource): Router {
  const router = Router();

  // WhatsApp notification endpoints
  // POST /configurar - Configure API credentials
  // GET /estado - Get service status
  // POST /enviar - Send single notification
  // POST /enviar-lote - Send batch notifications
  // POST /viaje-asignado - Notify trip assignment
  // POST /viaje-confirmado - Notify shipment confirmation
  // POST /eta-actualizado - Notify ETA update
  // POST /viaje-completado - Notify trip completion
  // POST /alerta-retraso - Notify delay alert
  // POST /asignacion-carrier - Notify carrier assignment
  // POST /recordatorio-mantenimiento - Notify maintenance reminder
  router.use('/', createWhatsAppController(dataSource));

  return router;
}

export default createWhatsAppRoutes;
