- Add the `kidsGroups` plan feature (Pro) and `Group.audience` (ADULTS | KIDS);
creating or switching a group to KIDS requires the feature, existing KIDS
groups keep working after a downgrade.
- Model the adult in charge as a Person linked through `person_guardians`;
migrate the old guardian_name/guardian_phone columns and drop them.
- Kids quick add: kid + guardian form, guardian lookup by phone to pick an
existing kid or add a sibling; backend rejects KIDS adds without guardian.
- Attendee page: "Adulto a cargo" section with siblings, editable via
PATCH /groups/:gid/attendees/:aid/guardian.
- Contact phone (WhatsApp jobs, attention, student access invite, students at
risk, attendee actions) prefers the guardian's phone.
- Edit group screen (PATCH /groups/:gid, owner only); switching back to ADULTS
is blocked while kids have no phone of their own.
- Hide bulk import in KIDS groups until it carries guardian data.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Plans:
- Plan limits and Pro prices per country live in the database
(plan_configs, plan_prices, seeded with the previous constants) and are
read through PlanCatalog (30 s cache, defaults as fallback).
- /admin/plans edits limits (with the count of accounts that would become
read-only) and prices, optionally pushing the new price to live
subscriptions from their next charge (MP preapproval amount, Stripe item
without proration) via the ApplyPriceChanges job, with an email and a
notice on /billing.
- GET /billing/plans feeds the onboarding and the billing screen.
Mercado Pago:
- The Pro checkout returns through GET /billing/return on API_PUBLIC_URL,
since MP refuses a back_url on localhost.
- The OAuth callback bounces from the tunnel to BETTER_AUTH_URL to find the
session, requires the session to own the state, and redirects instead of
answering JSON on unexpected errors.
- Checkout Pro links skip auto_return off public HTTPS and carry a
notification_url to POST /payments/webhooks/mp/:paymentId, which confirms
the payment with the owner's token (same rule as the polling job, which
stays as fallback). The search now prefers the approved attempt.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
i18next + react-i18next con es-AR (fuente), es-419, pt-BR y en; el idioma
sale del dispositivo (fallback a inglés) y se puede cambiar en Ajustes.
La elección se guarda en localStorage y, para el profe, en users.locale.
Las validaciones de shared pasan a claves y los errores de la API se
traducen por code (con params para límites de plan y cupo).
Migrados: layout, Ajustes, auth, PWA y lib/format.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Nuevo modelo `Person` (`people`): contacto y notas por profe, con
teléfono único (índice parcial `people_owner_phone_key`). `Attendee`
pasa a ser la membresía (`group_id` + `person_id`, único por grupo).
- La cuenta de la app de alumnos se vincula a la persona
(`student_account_people`): una sola cuenta ve todos sus grupos.
- Migración unifica attendees del mismo profe y teléfono, y fusiona sus
cuentas de alumno (conserva la usada más recientemente).
- `POST /groups/:gid/attendees/:aid/add-to-group` y
`GET /people/lookup` para detectar personas existentes al cargar;
el alta responde `409 person_exists` y acepta `personId`. Bulk, lista
de espera y preinscripciones vinculan solas.
- El límite del plan cuenta personas con al menos un grupo activo.
- Web: "Agregar a otro grupo", sección "También está en" en la ficha y
aviso "Ya tenés a esta persona" en el alta individual.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Acceso del alumno o tutor con link de un solo uso (hash SHA-256, consumo
atómico, el GET no consume), sesión propia de 90 días deslizante, passkeys
opcionales (SimpleWebAuthn) y mail de recuperación con rate limit.
- Lado alumno (/i/:token, /acceso, /alumno/*): inicio, clases, avisar falta,
pagos, informar pago con comprobante (S3 privado, magic bytes) y perfil.
- Lado profe: acceso a la app en la ficha del alumno (invitar/reinvitar),
"Pagos para verificar" en Cobros con badge, faltas avisadas en la ficha de
grupo y datos para transferir en Ajustes.
- "Requiere atención" y el recordatorio de WhatsApp excluyen cuotas informadas.
- Zona horaria por defecto: Buenos Aires.
- Migración add_student_access, tests contra Postgres real (test:db) y docs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Grupos: subtítulo con resumen (grupos · alumnos · lugares libres),
sección "Requiere atención" con los 4 alumnos más urgentes y tarjetas
con avatares (punteados por lugar libre en grupos chicos, superpuestos
con "+N" en grandes; con alerta primero y anillo de gravedad).
- Pantalla nueva /groups/attention: filtros Todos/Asistencia/Pagos,
secciones Urgente y A vigilar, Contactar / Enviar recordatorio por
wa.me y "Resuelto" persistente con update optimista.
- FAB "Nuevo grupo" que se pliega al scrollear (respeta reduced motion);
los toasts en mobile suben para no quedar debajo.
- Alertas centralizadas en computeStudentAlerts (shared). La regla de
asistencia pasa a: urgente = 3 seguidas o 4 de las últimas 6; a vigilar
= 2 de las últimas 4 (sin inactividad por días ni tendencia). Cuotas:
1 vencida vigilar, 2+ urgente.
- Backend: GET /attention y POST /attention/:attendeeId/resolve; tabla
attendee_alert_resolutions (la alerta vuelve si cambia la firma).
- Tokens de gravedad para claro y oscuro; se quita el indicador de pills.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Puerto BillingProvider con adaptadores de Mercado Pago (/preapproval) y
Stripe (Checkout en modo suscripción, fetch plano). El país elige proveedor
solo para suscripciones nuevas; sync, cancel y webhook usan row.provider.
- Migración add_billing_providers (provider, checkout_ref, ids genéricos).
- fix: /authorized_payments/search respondía 400 "Invalid value for limit";
se pagina por offset sin limit.
- fix: si falla la consulta de cobros, la sync guarda igual el estado de la
suscripción (ya no queda PENDING tras autorizar) y reintenta los cobros.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Módulo billing: suscripción Pro mensual vía /preapproval con credenciales
de plataforma por país, webhook firmado y reconciliación por polling.
- PlanGuard en los use-cases que crean grupos/alumnos, cobran con MP o
activan automatizaciones (402 plan_limit_reached / plan_feature_required /
plan_read_only), detrás de BILLING_ENFORCEMENT.
- Onboarding: paso Plan obligatorio (POST /onboarding/plan); con Free se
saltean Cobros y WhatsApp.
- Web: pantalla /billing, aviso de Pro desde el MutationCache.
- Migración billing_subscriptions y docs/billing.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- 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>
- Introduced CountryStep component for selecting the country during onboarding, affecting payment currency.
- Updated FirstGroupStep to include country information.
- Enhanced PaymentsProvider to manage payment states and renewals.
- Created PaymentRow component for displaying individual payment details.
- Implemented PaymentsView for listing and filtering payments by group and status.
- Added API endpoints for fetching and creating payments, including batch processing.
- Defined payment schemas for validation and data handling.
- Updated GroupHeader and GroupDetailView to include charging functionality for group members.
- Implemented MpReauthNotice component to notify users when reauthorization is needed.
- Created MpStatusCard component to display the current status of the Mercado Pago account.
- Added utility functions and constants for handling Mercado Pago status and messages.
- Introduced hooks for managing the connection and disconnection of Mercado Pago accounts.
- Developed a disconnect confirmation modal for user actions.
- Added tests for the new functionality and utility functions.
- Defined schemas for Mercado Pago account status and callback reasons in shared package.
- Add API endpoints for managing group pre-registrations, including approval and rejection.
- Create database migration for `group_pre_registrations` table and associated enum for status.
- Implement use cases for listing, approving, and rejecting pre-registrations.
- Add frontend components for displaying pre-registration details and managing approvals/rejections.
- Update shared schemas to include pre-registration data structures and validation.
- Remove obsolete `WaitlistNoticeCard` component and replace with `PreRegistrationNoticeCard`.
- Implemented AbsenceNotifyView for notifying absence with session details.
- Created AnalyticsView for displaying group analytics and managing students at risk.
- Added ClassAttendanceView for marking attendance in classes.
- Defined new schemas for analytics and attendance in shared package.
- Introduced GroupWaitlistEntry model in Prisma schema to manage waitlisted users for groups.
- Implemented API route to add users to the group waitlist with validation.
- Enhanced attendee creation logic to handle group capacity and waitlisting scenarios.
- Added new problem builders for handling waitlist-related errors.
- Updated frontend to support waitlist interactions, including modals for capacity warnings.
- Created tests for waitlist functionality, ensuring proper handling of full groups and existing waitlist entries.