43 Commits
Author SHA1 Message Date
Lizandro GuarnizoandClaude Sonnet 4.6 afbf4d537e show gender on admin professional detail page
Add gender: true to users select in findById() (both lookup paths)
and render it in the personal data card in the admin frontend.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-12 19:03:02 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 2180e0480c add admin services-by-professional endpoint + calendar view in admin panel
Backend:
- GET /services/admin/professional/:id (JWT-guarded) returns paginated
  services for any professional with embedded user (client) info

Admin professional detail page:
- Replace broken all-services-then-filter with new endpoint
- Add month calendar with colored dots per day (click to filter table)
- Services table shows client name/phone, time, colored status badges
- Fix DAY_NAMES array (was 0=Domingo, now 0=Lunes per DB convention)
- Schedule row shows both ranges + continuous_day flag

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-12 18:58:42 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 72777df52c fix: save and display professional profile address, payment methods, and docs
- DTO: add payment_methods field so whitelist pipe no longer strips it
- Service upsert(): extract payment_methods and write as Prisma nested upsert instead of passing flat object
- Admin detail page: fix image regex to handle Firebase URLs with query params; fix payment_methods display for 1:1 Prisma relation (object, not array)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-02 21:42:37 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 1e0de51ec5 feat(settings): add domicilios and tarifas toggles in admin panel
Both flags are read by prosappweb from /settings to enable/disable
delivery service and rate display. Saves via the existing PATCH /settings.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-02 20:48:10 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 a8842a2728 feat(users): add block/unblock and delete from admin panel
- Migration 0004: adds is_active column to users table
- Backend: DELETE /users/:id endpoint + is_active field in UpdateUserDto
- Admin UI: block/unblock toggle and delete with confirmation on user detail
- Users list: shows "Bloqueado" badge for inactive users

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-02 14:55:16 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 1f3efb50da Add SMTP test email endpoint and mail logs in admin settings
- POST /settings/test-email: send test email to diagnose SMTP config
- Admin settings: test email form + last 20 email logs with status/error

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-29 11:20:56 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 b0ca6804fa Fix JSON parse error on empty responses: handle empty body in API client and return message from saveSmtpConfig
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-29 11:12:13 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 0a67f5d80a Add Verifik RETHUS integration: backend module, settings auth flow, admin query button
- verifik.service.ts: email OTP auth, token storage/refresh, RETHUS query by professional
- verifik.controller.ts: send-otp, confirm, refresh, rethus/professional/:id endpoints
- settings/page.tsx: Verifik connection section (email→OTP→token)
- professionals/[id]/page.tsx: Consultar RETHUS button with inline result display

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-29 10:50:35 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 aa35f4b661 Always show documents section in professional detail, with No subido fallback
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-29 10:31:40 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 0899105a52 Add rejection retry flow with configurable wait days
- Backend: DELETE /professionals/me resets rejected state so user can retry
- Backend: findRejected/findPending now filter by pro_state
- Admin settings: rejection_wait_days field (default 7)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 18:03:13 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 3fd7a33fc1 Add rejected professionals tab and fix deny to keep record
- deny() now marks is_active:false instead of deleting the record
- New GET /professionals/rejected endpoint (pro_state:3)
- findPendingApprovals now filters only pro_state:1
- Admin list: third tab 'No aprobados' with approve/review actions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 18:00:03 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 7935e48fae Add status management and documents view to pro detail page
- Backend: deactivate and set-pending endpoints for status control
- Admin detail: Aprobar/Rechazar/Desactivar/En revisión buttons based on current state
- Admin detail: Documentos section showing ID photo and certificate
- Admin detail: deny now confirms before deleting

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 17:49:28 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 efb48e017f Show email/phone in pro detail and improve RETHUS section
- Backend: include email and phone in users select for professionals
- Admin detail page: RETHUS section shows cedula+code with copy buttons

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 17:47:01 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 f845350911 Fix Decimal.toFixed crash and new professionals default is_active
- Detail page: use Number() before toFixed() since Prisma returns Decimal objects
- Service upsert: create professionals with is_active:false so they appear as pending

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 17:39:56 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 5380a894b1 Fix useParams null crash on detail pages
useParams() can return null during SSR — destructuring null throws TypeError.
Use optional chaining params?.id to prevent the crash.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 17:35:42 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 d1f93d6d13 Add Ver button to active professionals in admin list
Active professionals now have a link to the detail page where
they can be edited, RETHUS validated, etc.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 17:27:59 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 ce769dfe8d Fix professional 500 error, add SMTP config UI and message history page
- Fix route ordering in professionals.controller: PATCH me was captured by PATCH :id causing 500
- Admin settings: add SMTP email config section (host, port, user, pass, sender)
- Admin sidebar: add Mensajes link
- Admin: new /mensajes page with SMS/email history, channel filter and pagination

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 17:08:59 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 a9b5e413e3 feat: página admin /admin-sugerencias + enlace en sidebar
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 19:46:30 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 c919bb737f fix: reemplazar Textarea (no existe) con textarea nativo en página sugerencias
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 19:19:52 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 42d41eb199 feat: módulo de sugerencias (backend) + página pública /sugerencias (admin)
- Backend: POST /suggestions (público) + GET /suggestions (JWT admin)
- Admin: página pública /sugerencias con formulario de sugerencias
- schema.prisma: modelo suggestions
- AuthGuard + Sidebar: /sugerencias como ruta pública

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 19:05:58 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 c1e9dba2d1 feat: campo RETHUS con validación manual desde el admin
- Prisma schema: rethus_code y rethus_validated en tabla professionals
- Migración 0001: ALTER TABLE agrega ambas columnas
- DTO: rethus_code y rethus_validated en CreateProfessionalDto y UpdateProfessionalDto
- Service: nuevo método validateRethus, rethus_code incluido en requestProfessional
- Controller: endpoint POST /professionals/:id/validate-rethus (JWT protegido)
- Admin listado pendientes: columna RETHUS con ícono verde/amarillo y enlace al detalle
- Admin detalle profesional: card de validación RETHUS con botón consultar Minsalud y marcar como validado

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 18:23:55 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 46fcb57edf fix: settings siempre retorna objeto, autocomplete Colombia con bias de ubicacion
- GET /settings retorna {} en lugar de undefined cuando no hay configuracion
  (evita error jsonDecode en Flutter que dejaba soporte en gris)
- Autocomplete: agrega components=country:co, radius 20km, remove types=address
  para mostrar mas resultados cercanos al usuario

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 10:11:13 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 f66b1a9bc1 fix: agregar campos soporte faltantes en admin settings
- support_title, support_description, support_days, support_hours
  (los que lee la app Flutter para la pantalla de soporte)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 09:54:16 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 d3ca99fa1b feat: agregar endpoint /autocomplete en admin Next.js
Proxy a Google Places Autocomplete API:
- Lee la API key de /settings/maps-key del backend
- Acepta params: input, location
- Devuelve { results: [{ formatted_address, place_id }] }
- Headers CORS para permitir acceso desde app.prosapp.co

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 08:51:51 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 abc19505ae feat: edicion de usuarios y profesionales desde el admin
Backend: agrega PATCH /users/:id y PATCH /professionals/:id (protegidos).
Admin: pagina de usuario con edicion de nombre/telefono/ciudad/genero;
pagina de profesional con dos secciones editables independientes
(datos personales y perfil profesional).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 08:22:40 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 e7afbf6d7b feat: restore global settings with proper fields in settings page
Restores: version Android/iOS, horario soporte, email/telefono soporte,
modo mantenimiento. Organizado en secciones: Ajustes generales,
Integraciones (Maps), Documentos legales.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 08:02:29 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 3e1632e776 feat: Google Maps API key management in admin settings
- Backend: GET /settings/maps-key (public) + PATCH /settings/maps (protected)
- Admin: sección para guardar/ver estado de la Maps API key
- Flutter web carga la key dinámicamente desde el backend

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 07:59:19 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 39c4301d1b feat: full locations CRUD + legal policies in settings
Backend:
- CRUD completo para countries, regions y cities
- GET /settings/policy/:key — página HTML pública para políticas
- GET/PATCH /settings/policies/:key — admin endpoints protegidos

Admin:
- /locations: árbol interactivo País → Región → Ciudad con add/edit/delete
- /settings: editor de Política de Privacidad y Términos con enlace público copiable
- Sidebar: Ciudades → Ubicaciones

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 07:45:53 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 5c3e3c4bc8 fix: handle null in service status select onValueChange
TypeScript error: Select onValueChange passes string | null, not string.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 16:44:49 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 a81a01a06d feat: use real ProsApp logo in admin login and sidebar
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 16:15:05 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 a5c1dd7c33 feat: improve admin login UI and sidebar branding
- Login page: split layout with gradient panel (desktop) + form,
  ProsApp logo mark, feature list, consistent blue brand colors
- Sidebar: replace plain text with logo mark + brand name

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 16:12:56 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 7783cac3fe feat: SMS OTP auth, phone verification gate, admin comments/edit/status pages
Backend:
- Add SmsService + SmsModule: send OTP via u-site.app provider, 5-min TTL
- Auth endpoints: POST /auth/send-otp, POST /auth/phone (login by phone+code),
  POST /auth/verify-phone (link), PATCH /auth/change-password
- is_phone_verified included in JWT token response
- GET /comments (admin, JWT-protected) with author/destination names

Admin:
- Users list: link to detail page per row
- User detail: inline edit form (name, city, phone) with PATCH /users/:id
- Services list: link to detail page per row
- Service detail: status change dropdown (PATCH /services/:id/status)
- New Comments page: summary stats + full table with star ratings
- New SMS settings page: configure API key + send test SMS
- Sidebar: added Comments and SMS entries

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 15:53:32 -05:00
Lizandro Guarnizo ac7fe193cd hola 2026-06-17 07:47:29 -05:00
Lizandro GuarnizoandClaude Haiku 4.5 3fa0f5bd5f fix: add Tailwind CSS config to enable style compilation
Tailwind CSS 4 requires explicit content paths configuration. Without this,
the @tailwindcss/postcss plugin cannot find files to process, preventing
styles from being generated for the admin interface.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-16 22:28:40 -05:00
Lizandro Guarnizo e4799a8bf7 style: apply ProsApp brand color #26b5f0 to admin theme 2026-06-04 08:58:16 -05:00
Lizandro Guarnizo 86a14713e0 fix: make root layout a server component with globals.css import and html/body tags 2026-06-04 08:27:27 -05:00
Lizandro Guarnizo 86d5ea9704 fix: allow /login route to bypass AuthGuard so login page renders instead of blank 2026-06-04 08:24:28 -05:00
Lizandro Guarnizo 558647414d fix admin Dockerfile: pass NEXT_PUBLIC_API_URL as build arg 2026-06-03 23:46:57 -05:00
Lizandro Guarnizo 8fe15f0528 switch npm ci to npm install for Docker compat 2026-06-03 22:43:48 -05:00
Lizandro Guarnizo 47ad790f79 fix Dockerfiles: remove deprecated flags, add .dockerignore 2026-06-03 22:42:29 -05:00
Lizandro Guarnizo ae6bd1f53a fix Dockerfiles: update npm to latest before ci 2026-06-03 22:40:10 -05:00
Lizandro Guarnizo afc096d552 full project: admin panel, backend modules, docs 2026-06-03 22:11:01 -05:00
Lizandro Guarnizo 1635723035 add Dockerfiles and docker-compose for Coolify deploy 2026-06-03 22:10:28 -05:00