- Inviting a kid with an adult in charge links the account to the adult
(a legacy account linked to the kid moves to the adult and is renamed).
- `linkedPersonWhere` lets the account reach the kids of a linked adult, so
the adult sees and manages all their kids, including ones added later.
- /me, link info and access status follow the adult; siblings share state.
- Web: greeting uses the account holder, profile lists each kid's group, and
the invitation sheet/message address the adult.
- DB tests for the adult account flow.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The phone row in the attendee contact and guardian sections was a single
tel: link. It now shows WhatsApp and call icon buttons for that number.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- 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>
Stop publishing web on host port 8080, which clashed between stacks; Traefik
reaches port 80 of the container through dokploy-network. Local testing now
uses docker-compose.local.yml to publish the port.
Proxy nginx to a `gruperly-api` alias that only exists on the stack's own
network: the `api` service name is also registered on dokploy-network, so
with two stacks nginx could reach the other environment's API.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Onboarding:
- Keep the current step in ?step= so the device back gesture moves one
step back; effectiveStep guards skipping the plan and re-opening the
group form after the group exists. Show Back on mobile.
- Format prices with the chosen country's currency (form prefix and
confirmation).
- Welcome describes the real flow and previews the WhatsApp payment
reminder; the last step shares the group's invite link instead of
listing settings chores.
- Accessibility: named stepper steps with aria-current, focus moves to
the new step heading, alerts on errors, reduced-motion and
direction-aware step animation, 48px primary actions.
- Group form split into "classes" and "billing", due day hidden for
per-class billing; Stripe skips the empty Pro confirmation; Free
features read "in Pro" instead of struck through.
Home:
- Payments section follows the plan: Free gets a locked preview with
an upgrade link and is never asked to link Mercado Pago.
- Secondary text meets 4.5:1 contrast; accent-fg for links in dark.
- Class times use a 24h clock in Spanish and Portuguese.
- Drop the summary tiles; one hero for the current or next class, the
rest of the day as compact rows; two columns on desktop.
- "Para atender" reads the shared ['attention'] query, so resolved
alerts match "Requiere atención", with WhatsApp shortcuts and a link
to the full list.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Las alertas de shared suman razon + valores para que la web las redacte;
etiqueta/detalle se mantienen en español para el backend.
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>
- `POST /groups/:gid/attendees/:aid/move` mueve al mismo attendee a otro
grupo del profesor: conserva historial, cuotas (siguen del grupo anterior)
y acceso a la app de alumnos. Cancela las faltas avisadas y libera lo
reservado en clases futuras del grupo anterior.
- Cupo y teléfono duplicado se validan con `checkCanJoinGroup`, compartido
con el paso desde la lista de espera.
- Ficha del miembro: "Cambiar de grupo" abre un diálogo con el selector de
grupo destino y navega a la ficha en el grupo nuevo.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- `POST /groups/:gid/waitlist/:entryId/promote` acepta `targetGroupId`
opcional (por defecto, el grupo en el que se anotó). El destino tiene que
ser del mismo profesor; cupo y teléfono duplicado se validan ahí.
- Detalle de la lista de espera: selector "Asignar a" con los grupos llenos
deshabilitados.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- El listado de grupos devuelve `unpaidPaymentsCount` (PENDING y OVERDUE).
- Cobros: nuevo selector de grupo (GroupFilter) junto a los filtros de estado;
con un grupo filtrado no se repite su nombre en cada card.
- Sheet: entra deslizando desde abajo en mobile (salvo reduced motion).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
/acceso → /access, /alumno/* → /student/* (welcome, classes, payments,
profile, notify-absence, report-payment). El link del mail de confirmación
pasa a /access/email/:token. AGENTS.md documenta que los paths van en inglés.
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>
- Ficha de grupo: "Agregar miembro" a todo el ancho y debajo Estadísticas,
Cobrar y Compartir con icono y texto (antes iconos sueltos en mobile).
Los mensajes automáticos de WhatsApp quedan en una fila plegable que
arranca cerrada si no hay ninguno activo.
- Historial del alumno: arranca en la primera clase registrada si es
anterior al alta, como la lista y la regla de riesgo ("1 de 5" en ambos).
- Nuevo grupo: cupo 10 por defecto, precio vacío obligatorio y foco
inicial en el nombre.
- Ajustes: chevron en Seguridad; el botón de tema del header queda solo
en desktop (en mobile vive en Apariencia).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Estadísticas ("Alumnos en riesgo") y el job de reenganche usan la misma
regla de dominio que la lista de grupos e Inicio
(summarizeMemberAttendance). El armado del historial por alumno vive en
analytics/lib/member-attendance.ts y se borra el clasificador viejo
(racha o asistencia mensual < 50%).
- El badge de alumnos en riesgo muestra el motivo real (faltas seguidas,
días sin venir o asistencia en baja).
- GET /home devuelve pendingPreRegistrations por grupo (en la misma
consulta de grupos) y "Para atender" las lista con link a la ficha en
la pestaña Pendientes (?section=pending).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Inicio: saludo con fecha, estadísticas compactas en fila (arregla el
"0 / 0 por cobrar"), sección "Para atender" (alumnos en riesgo alto y
cobros vencidos), tarjeta de clase de hoy con CTA a todo el ancho y
estado vacío de cobros que lleva a vincular Mercado Pago.
- Riesgo: la inactividad se mide desde la última presencia hasta la última
clase faltada, no contra hoy; un grupo sin clases registradas ya no pone
a todos sus miembros en riesgo alto.
- Tarjeta de grupo: el aviso usa el motivo real ("12 días sin venir") en
vez de "0 faltas".
- Días del horario en orden de calendario (sortWeekDays).
- Toast por encima del BottomNav en mobile; ficha de alumno sin flecha de
volver en mobile.
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>
Desde el teléfono no se puede escanear el QR de la propia pantalla. Con
OpenWA el profesor ahora puede escribir su número y recibir un código de
8 caracteres para ingresar en WhatsApp (POST /whatsapp/connect/pairing-code).
En mobile el modal arranca por el número y en desktop por el QR.
- Puerto: requestPairingCode opcional (Kapso no lo implementa).
- OpenWA: reintenta el 409 mientras la sesión arranca.
- Número normalizado con el país del profesor (toWhatsappE164).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ajustes y el paso del onboarding mostraban "no está disponible" ante
cualquier fallo de GET /whatsapp/status. Ahora solo un 503 da ese
mensaje; el resto muestra el código del error.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
OpenWA se instala por separado: la API le habla por OPENWA_API_URL (sin
default). La guía documenta el compose recomendado y el alta de la key.
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.
- Added payment presentation logic to display payment status and due dates.
- Introduced AttendeeNotesSection and AttendeePaymentsSection components for managing notes and payments.
- Implemented forms for editing contact information and notes with validation.
- Updated API to support attendee updates and added corresponding tests.
- Improved attendance summary logic to reflect all visible sessions.
- Enhanced UI with loading states and error handling for better user experience.
- Translated comments from Spanish to English in vite.config.ts, docker-compose.yml, attendance-risk.ts, analytics.ts, attendance.ts, attendees.ts, enums.ts, groups.ts, and onboarding.ts.
- Improved descriptions for better understanding of code functionality and purpose.
- Ensured uniformity in terminology and phrasing throughout the codebase.