Commit Graph

78 Commits

Author SHA1 Message Date
Jose Selesan
b12ffdda37 feat(web): rediseño de Inicio en mobile y criterio de inactividad por clases faltadas
- 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>
2026-10-27 11:18:18 -03:00
Jose Selesan
9617447e05 feat(billing): proveedores intercambiables (Mercado Pago en AR, Stripe en el resto)
- 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>
2026-10-26 17:01:07 -03:00
Jose Selesan
cd82a1e549 feat: add subscription plans. Add admin panel. Add password recovery 2026-10-24 18:31:55 -03:00
Jose Selesan
f5e77c99f6 feat(billing): planes Free/Pro con Suscripciones de Mercado Pago
- 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>
2026-10-23 15:49:27 -03:00
Jose Selesan
f4d2c26e29 feat(whatsapp): vincular con el número de teléfono además del QR
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>
2026-10-22 19:15:02 -03:00
Jose Selesan
bef4056f8e fix(web): distinguir WhatsApp no configurado de otros errores de estado
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>
2026-10-22 19:02:14 -03:00
Jose Selesan
2467ebc0f6 chore(whatsapp): sacar OpenWA del docker-compose
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>
2026-10-22 09:34:53 -03:00
Jose Selesan
ec65c2198d 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>
2026-10-22 08:38:09 -03:00
Jose Selesan
8c5caecdda feat: add country selection during onboarding and implement payment management features
- 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.
2026-10-08 11:42:13 -03:00
b11dd47534 Merge pull request 'feat(mp): add Mercado Pago reauthorization notice and status card components' (#10) from feat/add-mercado-pago into development
Reviewed-on: #10
2026-10-07 15:03:36 +00:00
Jose Selesan
21a4c69f38 feat(mp): add Mercado Pago reauthorization notice and status card components
- 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.
2026-10-07 12:00:38 -03:00
e03f510874 Merge pull request 'feat/improve-member-details' (#9) from feat/improve-member-details into development
Reviewed-on: #9
2026-10-02 12:58:07 +00:00
Jose Selesan
59a4d18ce6 feat: enhance MembersWaitlistSection and PendingView for improved layout and sticky controls 2026-10-02 09:42:11 -03:00
Jose Selesan
faf949fc9b feat(attendee-detail): enhance attendee detail view with payment and notes sections
- 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.
2026-10-01 18:41:55 -03:00
Jose Selesan
6d120f4b1f feat: rename camelCase columns to snake_case in database models for consistency 2026-10-01 17:09:12 -03:00
Jose Selesan
69275c37b4 chore: update comments and documentation for clarity and consistency across various files
- 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.
2026-10-01 16:06:54 -03:00
Jose Selesan
01b35691df feat: improve UI layout and accessibility for group components 2026-10-01 14:25:43 -03:00
a93450579a Merge pull request 'task/improve-ui' (#8) from task/improve-ui into development
Reviewed-on: #8
2026-10-01 15:36:44 +00:00
Jose Selesan
ef38f98747 feat: enhance UI spacing and layout for attendee detail sections 2026-10-01 12:35:57 -03:00
Jose Selesan
ea722a42f1 feat: enhance group management features with improved attendance tracking and UI components 2026-10-01 12:12:14 -03:00
Jose Selesan
416c6f12e1 feat: enhance AttendanceCapacityIndicator and GroupCard for improved UI and accessibility 2026-10-01 10:22:41 -03:00
Jose Selesan
b5a00b309d feat: add attendance risk management features
- Export attendance risk related schemas and types from shared package.
- Introduce new schemas for attendance risk levels and urgent member summaries.
- Implement attendance risk calculation logic in the shared library.
- Create tests for attendance risk calculations and group attendance summaries.
- Add a new component for visualizing attendance capacity indicators in the web app.
2026-10-01 10:01:38 -03:00
Jose Selesan
454f20ed25 feat(api): add timezone support for group fetching and increase page size
feat(attendance): refactor attendance summary logic and update tests

feat(analytics): extend GroupRiskSummary schema with absence and attendance counts

feat(groups): enhance group schema with attendee and waitlist counts

chore(skills): add frontend design skill with guidelines and license

feat(attendee-detail): implement AttendeePhoneLine component for phone display

feat(groups): create AttendanceBadge and CapacityIndicator components for group cards

feat(groups): add card utility functions for attendance alerts and capacity summaries

test(groups): implement tests for attendance alert and capacity summary logic
2026-09-30 17:39:13 -03:00
Jose Selesan
4e86096653 refactor: remove unused attendee detail components and provider 2026-09-30 13:37:42 -03:00
Jose Selesan
27bff32e76 feat: enhance UI components for better accessibility and consistency 2026-09-30 10:33:06 -03:00
Jose Selesan
13c1446977 Improve group detail UI 2026-09-30 10:07:05 -03:00
e9b44caf54 Merge pull request 'feat/pre-registration' (#7) from feat/pre-registration into development
Reviewed-on: #7
2026-09-30 00:24:31 +00:00
Jose Selesan
581cf2f2b2 feat: implement immersive routes with Large Title component
- Added Large Title component to manage immersive screen headers.
- Created ImmersiveBarProvider to handle the sticky bar for immersive routes.
- Updated RootLayout to conditionally render Header based on immersive routes.
- Modified Sidebar to adjust its position and height in immersive mode.
- Integrated Large Title in ClassAttendanceView and AnalyticsView for consistent header display.
- Updated GroupHeader to use Large Title for better layout management.
- Implemented isImmersiveRoute function to determine immersive routes.
- Added tests for immersive route detection.
2026-09-29 21:23:56 -03:00
Jose Selesan
81ed5747f3 feat: add region handling for currency and locale formatting, including comprehensive tests 2026-09-29 21:01:24 -03:00
Jose Selesan
8ccff20473 feat: add accessible Tooltip component with hover, focus, and tap support 2026-09-29 20:12:06 -03:00
Jose Selesan
9520763ec3 feat: refactor group detail components for improved member and pending views 2026-09-29 16:29:38 -03:00
Jose Selesan
5ef393fa64 feat: add SectionChips component for improved navigation between members, pre-registrations, and waitlist 2026-09-29 15:41:13 -03:00
Jose Selesan
45a1f50231 feat: implement group pre-registration feature with approval and rejection workflows
- 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`.
2026-09-29 15:25:24 -03:00
Jose Selesan
0f02331dfc Improved group detail look and feel 2026-09-29 09:19:29 -03:00
Jose Selesan
df510cfe45 fix(web): evitar el zoom residual de iOS al cerrar el teclado
iOS (Safari y standalone) auto-zoomea al enfocar un control de formulario
con font-size < 16px y, al cerrar el teclado, no restaura el scale: la app
quedaba con zoom hasta que el usuario hacía pinch-out o recargaba.

- Input sube a 16px en mobile (text-base sm:text-sm), manteniendo los
  14px de escritorio. iPad queda fuera porque el zoom-on-focus es
  exclusivo de iPhone.
- El prefijo $ de GroupForm sigue el mismo tamaño para no desalinearse.
- Guard en @layer base para textareas/selects/inputs crudos futuros.
2026-09-28 22:57:22 -03:00
Jose Selesan
9f2e770509 New page for Add group member 2026-09-28 22:51:09 -03:00
Jose Selesan
2be59f99dd fix(web): make PWA build work in Docker and serve manifest with correct MIME
El build de Docker fallaba con "Rollup failed to resolve import
workbox-window from virtual:pwa-register". Localmente no pasaba: bun
hoisteaba la dependencia transitiva de vite-plugin-pwa a la raíz, pero
en la imagen usa el layout aislado y la deja solo en node_modules/.bun/,
sin symlink alcanzable desde apps/web. Se declara como devDependency
directa de apps/web para que resuelva desde apps/web/node_modules.

De paso, nginx servía el manifest como application/octet-stream porque
mime.types de alpine no conoce webmanifest; se mueve a su propia location
con el tipo correcto. Sigue en no-cache y con =404.
2026-09-28 22:34:35 -03:00
Jose Selesan
56096b1e35 Added installation notification 2026-09-28 22:20:11 -03:00
Jose Selesan
2fd1826014 feat(pwa): implement PWA installation banner and context provider
- Add `generate-icons.ts` script to generate PWA icons from SVG.
- Create `InstallBanner` component for prompting users to install the app.
- Implement `PwaProvider` to manage PWA installation state and events.
- Export `PwaProvider` and `InstallBanner` from the PWA feature index.
2026-09-28 20:55:48 -03:00
Jose Selesan
05da085e36 feat: update onboarding route to include OnboardingProvider and clarify Docker port mapping in compose file 2026-09-28 20:23:06 -03:00
Jose Selesan
2e027408e6 feat: update environment configuration and Docker networking for database connectivity 2026-09-28 19:48:47 -03:00
Jose Selesan
54f1c7ab34 feat: implement entrypoint script for backend to handle migrations and server startup 2026-09-28 19:41:50 -03:00
Jose Selesan
88c8b2ec90 feat: implement retry logic for database migrations and enable tty for better logging 2026-09-28 19:32:42 -03:00
Jose Selesan
0cd74194e3 feat: update environment variable handling and add .env.example template 2026-09-28 19:25:54 -03:00
Jose Selesan
f05fbf9e30 feat: enhance Docker setup and deployment configuration 2026-09-28 16:41:28 -03:00
2370895710 Merge pull request 'feat/attendance' (#5) from feat/attendance into development
Reviewed-on: #5
2026-09-28 19:19:23 +00:00
Jose Selesan
02af5e3c11 feat: add attendee detail and stats features
- Implemented API endpoints to fetch attendee details and statistics.
- Created new route for fetching attendee by ID and their attendance stats.
- Added schemas for attendee statistics.
- Developed frontend components to display attendee details and attendance statistics.
- Integrated attendee detail provider to manage state and data fetching.
- Added tests for attendee retrieval and statistics calculation.
2026-09-28 16:16:21 -03:00
Jose Selesan
e736ed3547 Updated spanish routes to english 2026-09-25 10:10:28 -03:00
Jose Selesan
94c353f4f2 Added routes 2026-09-25 10:05:56 -03:00
Jose Selesan
336e1af523 Migrate to file based routing on frontendf 2026-09-25 10:05:47 -03:00