import type { Ticket } from "@/lib/schemas/ticket"

export const VISIT_KEYWORDS = ["visita", "visitas", "in loco"]

export function isVisitTicket(ticket: Ticket): boolean {
  const queueName = ticket.queue?.toLowerCase() ?? ""
  if (VISIT_KEYWORDS.some((keyword) => queueName.includes(keyword))) {
    return true
  }
  const tags = Array.isArray(ticket.tags) ? ticket.tags : []
  return tags.some((tag) => VISIT_KEYWORDS.some((keyword) => tag.toLowerCase().includes(keyword)))
}
