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>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
f845350911
commit
efb48e017f
@@ -10,7 +10,7 @@ import { Badge } from '@/components/ui/badge';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table';
|
||||
import { toast } from 'sonner';
|
||||
import { ArrowLeft, Pencil, X, Check, ShieldCheck, ShieldAlert, ExternalLink } from 'lucide-react';
|
||||
import { ArrowLeft, Pencil, X, Check, ShieldCheck, ShieldAlert, ExternalLink, Copy } from 'lucide-react';
|
||||
|
||||
interface User { id: string; name: string; email?: string; phone?: string; city?: string; picture?: string; }
|
||||
interface Schedule { id: string; day_of_week: number; enabled: boolean; range1_hour1?: string; range1_hour2?: string; }
|
||||
@@ -293,21 +293,44 @@ export default function ProfessionalDetailPage() {
|
||||
<CardContent className="space-y-4">
|
||||
{professional.rethus_code ? (
|
||||
<>
|
||||
<div className="flex items-center gap-3 text-sm">
|
||||
<span className="text-muted-foreground">Código registrado:</span>
|
||||
<span className="font-mono font-semibold">{professional.rethus_code}</span>
|
||||
<div className="grid grid-cols-2 gap-3 text-sm">
|
||||
<div className="space-y-1">
|
||||
<span className="text-muted-foreground">Código RETHUS</span>
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="font-mono font-semibold">{professional.rethus_code}</span>
|
||||
<button
|
||||
onClick={() => { navigator.clipboard.writeText(professional.rethus_code!); toast.success('Código copiado'); }}
|
||||
className="text-muted-foreground hover:text-foreground"
|
||||
title="Copiar código"
|
||||
>
|
||||
<Copy className="h-3.5 w-3.5" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{professional.identification && (
|
||||
<div className="space-y-1">
|
||||
<span className="text-muted-foreground">Cédula</span>
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="font-mono font-semibold">{professional.identification}</span>
|
||||
<button
|
||||
onClick={() => { navigator.clipboard.writeText(professional.identification!); toast.success('Cédula copiada'); }}
|
||||
className="text-muted-foreground hover:text-foreground"
|
||||
title="Copiar cédula"
|
||||
>
|
||||
<Copy className="h-3.5 w-3.5" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="flex flex-wrap gap-3">
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
onClick={() => window.open(
|
||||
`https://www.minsalud.gov.co/salud/Paginas/rethus.aspx`,
|
||||
'_blank'
|
||||
)}
|
||||
onClick={() => window.open('https://www.minsalud.gov.co/salud/Paginas/rethus.aspx', '_blank')}
|
||||
>
|
||||
<ExternalLink className="mr-2 h-4 w-4" />
|
||||
Consultar en RETHUS (Minsalud)
|
||||
Abrir portal RETHUS (Minsalud)
|
||||
</Button>
|
||||
{!professional.rethus_validated && (
|
||||
<Button
|
||||
@@ -323,7 +346,7 @@ export default function ProfessionalDetailPage() {
|
||||
</div>
|
||||
{!professional.rethus_validated && (
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Consulta el código en el portal de Minsalud, verifica que coincida con el profesional y luego marca como validado.
|
||||
Copia el código o cédula, búscalo en el portal de Minsalud y una vez verificado haz clic en "Marcar como validado".
|
||||
</p>
|
||||
)}
|
||||
</>
|
||||
|
||||
@@ -15,7 +15,7 @@ export class ProfessionalsService {
|
||||
skip,
|
||||
take: limit,
|
||||
include: {
|
||||
users: { select: { id: true, name: true, picture: true, city: true } },
|
||||
users: { select: { id: true, name: true, email: true, phone: true, picture: true, city: true } },
|
||||
schedules: true,
|
||||
specializations: true,
|
||||
payment_methods: true,
|
||||
@@ -31,7 +31,7 @@ export class ProfessionalsService {
|
||||
let prof = await this.prisma.professionals.findUnique({
|
||||
where: { id },
|
||||
include: {
|
||||
users: { select: { id: true, name: true, picture: true, city: true } },
|
||||
users: { select: { id: true, name: true, email: true, phone: true, picture: true, city: true } },
|
||||
schedules: { orderBy: { day_of_week: 'asc' } },
|
||||
specializations: true,
|
||||
payment_methods: true,
|
||||
@@ -41,7 +41,7 @@ export class ProfessionalsService {
|
||||
prof = await this.prisma.professionals.findUnique({
|
||||
where: { user_id: id },
|
||||
include: {
|
||||
users: { select: { id: true, name: true, picture: true, city: true } },
|
||||
users: { select: { id: true, name: true, email: true, phone: true, picture: true, city: true } },
|
||||
schedules: { orderBy: { day_of_week: 'asc' } },
|
||||
specializations: true,
|
||||
payment_methods: true,
|
||||
|
||||
Reference in New Issue
Block a user