- Teacher picks a day of the month in Settings; an hourly job creates the
fees of all monthly groups on that day in the teacher's time zone
(one run per teacher and month, partial unique index per attendee/period).
- One Mercado Pago link per payer (PaymentCheckout): the adult in charge
bundles their kids and their own fees; external_reference chk_<id>,
dedicated webhook and reconciliation mark every fee PAID at once.
- Person.payWithMercadoPago toggle (default on): off creates the fee
without a link so the student pays by transfer.
- A fee paid some other way supersedes its combined link and expires the
preference; renewing rebuilds the combined link or a single one.
- Optional WhatsApp delivery (PAYMENT_LINK kind, new Kapso template);
weekly reminders now go once per combined link.
- Web: auto charge settings card, per-student toggle, combined link label
in Cobros and "Pay all" in the student app, in the four locales.
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>
- 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>
- 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.