feat(whatsapp): mensajes automáticos semanales con proveedor intercambiable

- Puerto MessagingProvider con adaptadores OpenWA (MVP, QR) y Kapso
  (setup link de Meta + templates), elegido con WHATSAPP_PROVIDER.
- Vinculación del WhatsApp del profesor en el onboarding y en Ajustes.
- Job semanal (lunes 10:00 AR): recordatorio de pago y reenganche a
  alumnos en riesgo (cooldown 14 días), con switches por grupo.
- Idempotencia por (kind, attendee, semana ISO), webhooks firmados con
  HMAC y deduplicados, normalización de teléfonos a E.164.
- Servicio openwa en docker-compose y guía en docs/whatsapp.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jose Selesan
2026-10-22 08:38:09 -03:00
parent 8c5caecdda
commit ec65c2198d
90 changed files with 6784 additions and 117 deletions

View File

@@ -7,3 +7,4 @@ export { Modal, type ModalProps } from './modal'
export { type Toast, ToastProvider, type ToastType, useToast } from './toast'
export { Tooltip, type TooltipProps } from './tooltip'
export { Switch, type SwitchProps } from './switch'

View File

@@ -0,0 +1,40 @@
import { cn } from '../../lib/utils'
export type SwitchProps = {
checked: boolean
onCheckedChange: (checked: boolean) => void
disabled?: boolean
/** Nombre accesible, cuando no hay un `<label>` asociado. */
'aria-label'?: string
'aria-describedby'?: string
id?: string
}
/** Interruptor on/off accesible (`role="switch"`), sin Radix. */
export function Switch({ checked, onCheckedChange, disabled, id, ...aria }: SwitchProps) {
return (
<button
id={id}
type="button"
role="switch"
aria-checked={checked}
disabled={disabled}
onClick={() => onCheckedChange(!checked)}
className={cn(
'relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors',
'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent',
'disabled:cursor-not-allowed disabled:opacity-50',
checked ? 'bg-accent' : 'bg-foreground/20',
)}
{...aria}
>
<span
aria-hidden="true"
className={cn(
'inline-block size-5 rounded-full bg-white shadow transition-transform',
checked ? 'translate-x-5' : 'translate-x-0.5',
)}
/>
</button>
)
}