Commit Graph
18 Commits
Author SHA1 Message Date
Lizandro GuarnizoandClaude Sonnet 4.6 735d8c2ba0 fix: corregir flujo completo de servicio y geocodificación
- Service.fromJson: lat/lng con Decimal de Prisma llegaban como string y
  el cast 'as num?' lanzaba TypeError silencioso → lista de servicios vacía.
  Mismo patrón que average_score, fix: double.tryParse(?.toString())
- service_status: agregar enumToStringService que mapea el enum de Flutter
  al string que espera el DTO del backend ('pending','accepted', etc.).
  changeServiceStatus enviaba el índice entero → @IsEnum rechazaba → el
  profesional no podía aceptar ni rechazar solicitudes
- maps_service: agregar MapsService.reverseGeocode que usa el Geocoder del
  Maps JS SDK ya cargado, sin requerir la Geocoding API habilitada por separado
- dashboard_view: _reverseGeocode usa el JS Geocoder en vez del endpoint HTTP

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-22 09:15:59 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 c0fce73d41 fix: average_score Decimal string cast crash silently empties professionals list
Prisma serializa Decimal como string JSON ("0"), no como número.
'(doc['average_score'] as num?)' lanzaba TypeError en Dart cuando el valor
era "0" (string), el catch lo tragaba y professionals quedaba vacío.
Cambiado a double.tryParse que maneja null, string y número.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-21 20:57:26 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 920ae7144d configurable slot duration: UI picker + genRanges stepMinutes
- Fix TimeOfDayExtension.add() to handle minute overflow via total-minutes math
- genRanges() now takes stepMinutes param (default 30, clamp 5-480)
- Profesional model: slotDurationMinutes field (parsed from slot_duration_minutes)
- ProfessionalFormProvider: saves slot duration alongside schedules on Guardar
- schedule_view: _SlotDurationPicker chip selector (15/20/30/45/60/90/120 min)
- ProfessionalCalendarView + CalendarView: pass slotDurationMinutes to genRanges

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-12 19:25:08 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 46acad0b55 fix blocked/occupied slot detection always returning false
Service.fromJson stored day as the raw Prisma JSON string
"2024-01-15T00:00:00.000Z", but _isSelfBooked/_isOccupied/_isBlocked
compared it against "2024-01-15" (toIso8601String().split('T').first),
so the match always failed and every slot appeared as Disponible.

Normalize day to the date-only portion in fromJson so all comparisons
work correctly across ProfessionalCalendarView and CalendarView.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-12 19:14:42 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 498481cab0 fix(scheduling): fix schedule save endpoint, time format, and calendar load
Critical fixes for the scheduling flow:

- ScheduleEntity: add toScheduleDto() with snake_case keys, day_of_week,
  and HH:MM zero-padded format required by the backend DTO @Matches validator
- Schedules: add toSchedulesArray() converting the day-keyed object to the
  array format expected by PATCH /professionals/me/schedules
- ProfessionalFormProvider: updateProfesionalProfileScheduleInfo now calls
  the correct endpoint (/professionals/me/schedules) instead of /professionals/me
  which was stripping the schedules field via ValidationPipe whitelist
- Service.formatTimeOfDay: zero-pad hours and minutes so POST /services passes
  the @Matches(/^\d{2}:\d{2}$/) DTO validation
- ProfessionalProvider: add getProfessionalById() calling /professionals/:id
  (public endpoint) to load any professional's data, not the viewer's own
- CalendarServicesProvider: add getPublicServicesForProfessional() calling
  /services/public-calendar/:id so the user calendar shows the target
  professional's booked slots, not the viewer's own services
- CalendarView: use getProfessionalById + getPublicServicesForProfessional
  so the calendar correctly reflects the selected professional's schedule

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-12 17:52:02 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 706b78b737 fix: safe parsing of Prisma Decimal fields to prevent data loss on save
Prisma serializes Decimal fields (rate, latitude, longitude) as JSON
strings, causing 'as num?' casts to throw in fromDocument(). The catch
block in getProfessional() then returned an empty Profesional, so saving
overwrote all existing data with empty strings.

Also added try-catch in all patch API calls to surface errors to user
instead of silently failing with a stuck loading button.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-06 22:00:29 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 b31ff13657 fix: professional profile not loading or saving correctly
- Fix typo aditional_address -> additional_address in toDocument() and fromDocument()
- Clear ProfessionalFormProvider before fetch in initState() so TextFormField initialValue always applies to fresh data
- Add clear() to ProfessionalFormProvider; call it on logout to avoid leaking data between users

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-02 21:44:16 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 391c32f765 Rejection retry flow with configurable wait days
- Usuario model: proRejectedAt parsed from professionals.updated_at
- _StatusCard: shows countdown or retry button based on rejection_wait_days setting
- Retry clears the rejected record via DELETE /professionals/me

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 18:03:20 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 eb63a3e415 Fix request professional flow for new users
- Add Profesional.empty() factory for users with no professional record
- initState: catch error from getProfessional and show empty form instead of infinite spinner
- Backend upsert: create professional record if none exists (no longer throws 404)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 17:20:28 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 0711d30f07 feat: 6 mejoras simultáneas en prosappweb
- web/index.html: lang=es (evita traductor) + cache busting con timestamp en flutter_bootstrap.js
- profesional.dart: rate → número, location_preferences → string para coincidir con backend DTO
- location_preferences.dart: funciones locationPrefsToString/locationPrefsFromValue
- auth_provider.dart: _navigateAfterAuth redirige a setup-city si user.city vacío, método updateCity y linkEmailWithOtp
- setup_city_view.dart: nueva vista con GPS + Nominatim para detectar ciudad, campo editable, omitir
- email_view.dart: rediseño completo con flujo OTP (paso 1: email+contraseña → paso 2: código recibido en correo)
- router + dashboard_handlers: ruta /dashboard/setup-city

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 11:34:51 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 7434bc8644 fix: hover navbar, soporte sin spinner, RETHUS en formulario profesional
- Navbar: hoverColor tenue por tema (azul/blanco) en vez del gris por defecto de Flutter web
- SettingsProvider: lazy:false + timeout 10s para evitar spinner gris permanente en soporte
- SupportView: muestra contenido con defaults inmediatamente sin bloquear en isLoading
- Modelo Profesional: campos rethus_code y rethus_validated
- ProfessionalFormProvider: soporte para rethus_code en copyProfesionalWith
- RequestProfessionalView: campo RETHUS opcional en formulario + fix color dropdown profesión

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 18:23:30 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 aeeeeb47fb fix: soporte siempre visible + perfil mejorado
- Setting: lee support_title/description/days/hours/email/phone
- SettingsProvider: fallback a Setting vacio si no hay datos en DB
- SupportView: guard para settings null
- Avatar: ui-avatars.com como imagen por defecto (con nombre)
- Perfil: seccion correo como ExpansionTile (acordeon)
  paso 1: email+contrasena+confirmar → Enviar codigo
  paso 2: ingresar codigo de 6 digitos → Verificar (verde)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 09:53:38 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 8372e19d9f fix: soporte visible + perfil con vinculacion de correo
- Setting.fromDocument con valores por defecto (null-safe)
- SettingsProvider crea Setting vacio si el backend falla
- support_view: guard para settings null
- profile_view: seccion 'Acceso con correo' con toggle,
  campos email/password/confirmar, envia OTP, verifica codigo

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 09:34:39 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 cc18246e1f feat: SMS OTP auth + phone verification gate + improved login UI
- Usuario model: add isPhoneVerified field from is_phone_verified
- auth_provider.dart: fix access_token key, add _navigateAfterAuth gate
  (redirects to phoneLoginRoute if phone not verified), add verifyPhoneNumber,
  signInWithOTP, verifyPhoneNumberForLink, linkPhoneWithOTP methods
- phone_login_view.dart: full rewrite with logo, +57 prefix, two-step OTP flow
  (phone input → code input), 60s resend timer, email login fallback

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 15:54:15 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 a4a6099722 fix: runtime fixes for service model and paginated responses
- Service.fromJson: string status/location enums, ISO8601 time parsing, additional_address field name
- _loadServices: unwrap {data:[...]} paginated response; extract embedded user from response instead of extra API calls
- calendar_services_provider: same response unwrap; fallback user when not embedded
- Add ProState import where needed

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-18 16:20:12 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 0ecca498ad fix: align Flutter endpoints and model parsing with actual NestJS backend
- Auth: phone login → POST /auth/phone (direct, no OTP); link phone → POST /auth/verify-phone; add email → POST /auth/link-email
- Services: replace query-param paths with dedicated role endpoints (/services/me, /services/professional/requests, /services/professional, etc.)
- Services: PATCH /services/:id → PATCH /services/:id/status
- Calendar: → GET /services/professional/calendar
- Professionals: /users/professionals → /professionals (handles {data:[...]} response)
- Professional info: /professional-info/:id → /professionals/:id; PATCH → /professionals/me
- Comments: /comments?... → /comments/user/:id and /comments/professional/:id
- Chat: /chats → /chat; start chat → POST /chat/start/:professionalId; poll GET /chat/:chatId/messages; send → POST /chat/:chatId/message
- Cities: /cities → GET /locations/countries (parse nested countries→regions→cities)
- Profesional.fromDocument: null-safe fields; convert schedules array→Schedules, specializations array→name/picture lists, payment_methods object/array
- Usuario.fromDocument: null-safe professional_state and id
- UsuarioProfesional.fromDocument: handle backend format (users nested, professional at top level)
- ScheduleEntity.parseTime: handle ISO8601 time strings from backend
- MessageEntity.fromDocument: accept sender_id (backend) or owner_id (legacy)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-18 16:07:44 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 60216fd0e3 feat: migrate Firebase → NestJS REST API backend
Replace all Firebase SDK (Auth, Firestore, Storage) with HTTP calls
to backend.prosapp.co/api/v1:

- New ApiService singleton (JWT token, GET/POST/PATCH/DELETE/upload)
- auth_provider: Firebase Auth → /auth/login, /auth/register, /auth/phone/*
- services_provider + calendar_services_provider → /services endpoints
- professional_provider + professionals_provider → /professional-info, /users/professionals
- profile_form_provider + professional_form_provider → /users/me, /storage/upload
- cities/professions/settings providers → /cities, /professions, /settings
- firebase_chat_repository → polling via /chats endpoints (3s interval)
- firebase_score_repository → polling via /comments endpoints (10s interval)
- professional_detail_provider → /users/:id + /professional-info/:id
- dashboard_view: Firestore.add → POST /services
- chat_view + rating_view: FirebaseAuth.uid → AuthProvider.user.id
- Models: Timestamp → String for createdAt fields
- google_fonts upgraded to ^8.1.0 (Dart 3.12 compat)
- Remove firebase_core, firebase_auth, cloud_firestore, firebase_storage from pubspec

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-18 15:53:39 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 15175c1b91 replace: swap prosappweb content for prosapp_web_app (more complete version)
prosapp_web_app has chat, dashboard, calendar, support, 13 providers and
Fluro URL routing. Keep Dockerfile + nginx.conf from previous prosappweb.
Upgrade google_fonts 6.2.1 → 8.1.0 (Dart 3.12 compat fix).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-18 15:26:32 -05:00