Commit Graph

19 Commits

Author SHA1 Message Date
Jose Selesan
58c776e18c feat(groups): kids groups with an adult in charge
- 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>
2026-11-11 13:27:13 -03:00
Jose Selesan
aac142d324 feat(billing): configurable plans from the backoffice and MP payment notifications
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>
2026-11-11 07:50:14 -03:00
Jose Selesan
2d80af082f feat(web): redesign onboarding and home after design critique
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>
2026-11-06 09:58:08 -03:00
Jose Selesan
70702ba852 feat(i18n): traducir el backoffice
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 14:07:03 -03:00
Jose Selesan
4d50b46399 feat(i18n): traducir la app de alumnos (con selector de idioma en Perfil)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 14:05:21 -03:00
Jose Selesan
486fbaf2ca feat(i18n): traducir el acceso de alumnos (links, passkey, recuperación)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 14:02:56 -03:00
Jose Selesan
b615c17a16 feat(i18n): traducir inscripción por link y aviso de ausencia público
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 14:02:02 -03:00
Jose Selesan
243530fab2 feat(i18n): traducir perfil y seguridad
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 14:00:14 -03:00
Jose Selesan
dfb6951d7c feat(i18n): traducir el onboarding (nombres de país desde Intl)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 13:59:41 -03:00
Jose Selesan
e2d9ddf569 feat(i18n): traducir WhatsApp
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 13:57:44 -03:00
Jose Selesan
700b9fb91d feat(i18n): traducir Mercado Pago
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 13:56:08 -03:00
Jose Selesan
e3dca305a4 feat(i18n): traducir el plan (billing)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 13:55:20 -03:00
Jose Selesan
7db9414f12 feat(i18n): traducir Cobros
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 13:53:40 -03:00
Jose Selesan
13723d5bb9 feat(i18n): traducir la toma de asistencia
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 12:30:52 -03:00
Jose Selesan
8a5768e0c0 feat(i18n): traducir la ficha del alumno
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 12:30:11 -03:00
Jose Selesan
ecdbbbbca6 feat(i18n): traducir Requiere atención y redactar las alertas en cada idioma
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>
2026-11-03 12:27:17 -03:00
Jose Selesan
96661fb807 feat(i18n): traducir Grupos (lista, ficha, alta de miembros y estadísticas)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 12:25:21 -03:00
Jose Selesan
09647672b8 feat(i18n): traducir Inicio
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 12:16:16 -03:00
Jose Selesan
cb872eb8bc feat: soporte multi idioma en la web (infraestructura)
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>
2026-11-03 12:14:59 -03:00