Commit Graph
15 Commits
Author SHA1 Message Date
Lizandro GuarnizoandClaude Sonnet 4.6 b0e3467565 Fix resetRejected: always reset pro_state even without professional record
Previous code deleted the professional record; if pro_state=3 but no record
exists, the 404 blocked the retry. Now we unconditionally reset pro_state=0.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-29 10:03:31 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 5f02c45759 Fix retry flow: reset pro_state without deleting professional record
- resetRejected: only set pro_state=0, no DELETE (avoids FK constraint errors
  from services/reputations with onDelete: NoAction)
- upsert: detect re-submission after rejection (pro_state=0) and set pro_state=1
  so the request appears in admin pending list

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-29 10:00:38 -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 d551739d0c Fix upsert: create professional record if none exists
PATCH /professionals/me now works for first-time submissions.
Creates the record with pro_state=1 if user has no professional entry.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 17:20:35 -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 8a1f9687cd feat: filtrar profesionales por ciudad con query param ?city=
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 19:26:33 -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 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 130e52ddcd fix: align Flutter API repositories with backend routes (Fase 3 prep)
- api_service_repository: use correct endpoints (services/me, services/professional,
  professional/requests, professional/history, professional/calendar, etc.)
  instead of generic /services?userId= query params
- api_service_repository: fix status conversion string↔enum, createService DTO fields,
  handle paginated {data,meta} response, stub setProfessionalScored/setUserScored
  (backend sets these automatically on POST /comments)
- api_score_repository: fix comment endpoints to /comments/user/:id and
  /comments/professional/:id; handle paginated response
- api_professional_repository + api_user_repository: handle paginated {data,meta}
  response from GET /professionals

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 18:23:14 -05:00
Lizandro Guarnizo afc096d552 full project: admin panel, backend modules, docs 2026-06-03 22:11:01 -05:00
Lizandro Guarnizo 3c5d81603a feat: backend API NestJS + Prisma + JWT auth + todos los módulos 2026-06-01 21:23:04 -05:00