diff --git a/src/app/(dashboard)/pacientes/[id]/_documentos/page.tsx b/src/app/(dashboard)/pacientes/[id]/_documentos/page.tsx index 48439f7b..6012be10 100644 --- a/src/app/(dashboard)/pacientes/[id]/_documentos/page.tsx +++ b/src/app/(dashboard)/pacientes/[id]/_documentos/page.tsx @@ -7,14 +7,14 @@ const PATIENT_SECTIONS = [ { id: '1', name: 'Laudo_Cardiologico_2025.pdf', - created_at: '2025-10-05', + createdAt: '2025-10-05', size: '783.4 KB', url: '/documents/Laudo_Cardiologico_2025.pdf', }, { id: '2', name: 'Exame_de_Sangue_Completo.pdf', - created_at: '2025-09-28', + createdAt: '2025-09-28', size: '1.2 MB', url: '/documents/Exame_de_Sangue_Completo.pdf', }, @@ -26,14 +26,14 @@ const PATIENT_SECTIONS = [ { id: '3', name: 'RG_Frente_Verso.pdf', - created_at: '2025-01-15', + createdAt: '2025-01-15', size: '450.1 KB', url: '/documents/RG_Frente_Verso.pdf', }, { id: '4', name: 'Comprovante_Residencia.pdf', - created_at: '2025-08-01', + createdAt: '2025-08-01', size: '249.0 KB', url: '/documents/Comprovante_Residencia.pdf', }, diff --git a/src/app/(dashboard)/perfil/page.tsx b/src/app/(dashboard)/perfil/page.tsx index 25d6362d..5a64f133 100644 --- a/src/app/(dashboard)/perfil/page.tsx +++ b/src/app/(dashboard)/perfil/page.tsx @@ -12,12 +12,12 @@ export default async function Page() { return null } - const showUpdatedDate = new Date(user.updated_at) > new Date(user.created_at) + const showUpdatedDate = new Date(user.updatedAt) > new Date(user.createdAt) return ( <>
- +

{user.name}

{user.email} @@ -36,13 +36,13 @@ export default async function Page() { Conta registrada em{' '} - {formatDate(user.created_at, { + {formatDate(user.createdAt, { dateStyle: 'short', timeStyle: 'short', })} . {showUpdatedDate && - ` Última atualização realizada em ${formatDate(user.updated_at, { + ` Última atualização realizada em ${formatDate(user.updatedAt, { dateStyle: 'short', timeStyle: 'short', })}.`} diff --git a/src/app/_paciente/_header/user-dropdown.tsx b/src/app/_paciente/_header/user-dropdown.tsx index 83a236dd..21697dfa 100644 --- a/src/app/_paciente/_header/user-dropdown.tsx +++ b/src/app/_paciente/_header/user-dropdown.tsx @@ -56,7 +56,7 @@ export function PatientHeaderUserDropdown({ className='rounded-full pl-1' indicator > - + {firstName} diff --git a/src/app/_paciente/documentos/pendentes/page.tsx b/src/app/_paciente/documentos/pendentes/page.tsx index 4b4af455..1447728e 100644 --- a/src/app/_paciente/documentos/pendentes/page.tsx +++ b/src/app/_paciente/documentos/pendentes/page.tsx @@ -20,10 +20,10 @@ export default async function Page() { type: 'screening', status: 'pending', description: null, - created_at: '2024-10-20', - submitted_at: null, - approved_at: null, - patient: { id: '2', name: 'Paciente Exemplo', avatar_url: null }, + createdAt: '2024-10-20', + submittedAt: null, + approvedAt: null, + patient: { id: '2', name: 'Paciente Exemplo', avatarUrl: null }, } return ( diff --git a/src/app/_paciente/triagem/hooks.ts b/src/app/_paciente/triagem/hooks.ts index 00b4275d..f0c39a9d 100644 --- a/src/app/_paciente/triagem/hooks.ts +++ b/src/app/_paciente/triagem/hooks.ts @@ -76,12 +76,12 @@ export function useScreening({ storageKey }: Readonly) { ...patient.data, phone: removeNonNumbers(patient.data.phone), cpf: removeNonNumbers(patient.data.cpf), - has_disability: medicalReport.data.has_disability === 'yes', - disability_desc: medicalReport.data.disability_desc ?? null, - need_legal_assistance: medicalReport.data.need_legal_assistance === 'yes', - take_medication: medicalReport.data.take_medication === 'yes', - medication_desc: medicalReport.data.medication_desc ?? null, - has_nmo_diagnosis: medicalReport.data.has_nmo_diagnosis === 'yes', + hasDisability: medicalReport.data.hasDisability === 'yes', + disabilityDesc: medicalReport.data.disabilityDesc ?? null, + needLegalAssistance: medicalReport.data.needLegalAssistance === 'yes', + takeMedication: medicalReport.data.takeMedication === 'yes', + medicationDesc: medicalReport.data.medicationDesc ?? null, + hasNmoDiagnosis: medicalReport.data.hasNmoDiagnosis === 'yes', supports, } diff --git a/src/app/_paciente/triagem/laudo-medico/medical-report-form-schema.tsx b/src/app/_paciente/triagem/laudo-medico/medical-report-form-schema.tsx index 8003fead..7eba645f 100644 --- a/src/app/_paciente/triagem/laudo-medico/medical-report-form-schema.tsx +++ b/src/app/_paciente/triagem/laudo-medico/medical-report-form-schema.tsx @@ -4,46 +4,46 @@ import { yesOrNoSchema } from '@/schemas' export const screeningMedicalReportFormSchema = z .object({ - has_disability: yesOrNoSchema, - disability_desc: z + hasDisability: yesOrNoSchema, + disabilityDesc: z .string() .transform((data) => data?.trim()) .nullable(), - need_legal_assistance: yesOrNoSchema, - take_medication: yesOrNoSchema, - medication_desc: z + needLegalAssistance: yesOrNoSchema, + takeMedication: yesOrNoSchema, + medicationDesc: z .string() .transform((data) => data?.trim()) .nullable(), - has_nmo_diagnosis: yesOrNoSchema, + hasNmoDiagnosis: yesOrNoSchema, }) .refine( (data) => { - if (data.has_disability === 'yes' && !data.disability_desc) { + if (data.hasDisability === 'yes' && !data.disabilityDesc) { return false } - if (data.has_disability === 'no') { - data.disability_desc = null + if (data.hasDisability === 'no') { + data.disabilityDesc = null } return true }, { - path: ['disability_desc'], + path: ['disabilityDesc'], message: 'Descrição da deficiência é obrigatória', }, ) .refine( (data) => { - if (data.take_medication === 'yes' && !data.medication_desc) { + if (data.takeMedication === 'yes' && !data.medicationDesc) { return false } - if (data.take_medication === 'no') { - data.medication_desc = null + if (data.takeMedication === 'no') { + data.medicationDesc = null } return true }, { - path: ['medication_desc'], + path: ['medicationDesc'], message: 'Descrição do medicamento é obrigatória', }, ) @@ -53,9 +53,9 @@ export type ScreeningMedicalReportFormSchema = z.infer< > export const screeningMedicalReportFormDefaultValues = { - has_disability: '', - disability_desc: '', - take_medication: '', - medication_desc: '', - has_nmo_diagnosis: '', + hasDisability: '', + disabilityDesc: '', + takeMedication: '', + medicationDesc: '', + hasNmoDiagnosis: '', } as unknown as ScreeningMedicalReportFormSchema diff --git a/src/app/_paciente/triagem/laudo-medico/medical-report-form.tsx b/src/app/_paciente/triagem/laudo-medico/medical-report-form.tsx index bf89b75f..6a24a173 100644 --- a/src/app/_paciente/triagem/laudo-medico/medical-report-form.tsx +++ b/src/app/_paciente/triagem/laudo-medico/medical-report-form.tsx @@ -33,8 +33,8 @@ export function ScreeningMedicalReportForm() { mode: 'onBlur', }) const { setValue, watch } = formMethods - const hasDisability = watch('has_disability') === 'yes' - const takeMedication = watch('take_medication') === 'yes' + const hasDisability = watch('hasDisability') === 'yes' + const takeMedication = watch('takeMedication') === 'yes' useEffect(() => { const savedFormData = getStoredFormData(screeningMedicalReportFormSchema) @@ -60,21 +60,18 @@ export function ScreeningMedicalReportForm() { > {hasDisability && ( - + )} {takeMedication && ( - + )} ) { return (
- +
= { @@ -110,9 +110,9 @@ export function AppointmentModal({ } if (isCreateMode) { - payload.patient_id = patient_id + payload.patientId = patientId payload.category = isUserSpecialist ? undefined : category - payload.professional_name = professional_name + payload.professionalName = professionalName } const response = isCreateMode @@ -137,7 +137,7 @@ export function AppointmentModal({ QUERY_CACHE_KEYS.statistics.totalAppointments, ]) revalidateServerCache([ - NEXT_CACHE_TAGS.patient(patient_id), + NEXT_CACHE_TAGS.patient(patientId), NEXT_CACHE_TAGS.appointments.main, NEXT_CACHE_TAGS.statistics.totalAppointments.main, NEXT_CACHE_TAGS.statistics.totalPatientsWithAppointments.main, @@ -162,7 +162,7 @@ export function AppointmentModal({ onSubmit={formMethods.handleSubmit(submitForm)} > router.push( - ROUTES.dashboard.patients.details.info(appointment.patient_id), + ROUTES.dashboard.patients.details.info(appointment.patientId), ) } > @@ -66,7 +66,7 @@ export function AppointmentsTableActions({ onClick={() => router.push( ROUTES.dashboard.patients.details.history( - appointment.patient_id, + appointment.patientId, ), ) } diff --git a/src/modules/appointments/table/index.tsx b/src/modules/appointments/table/index.tsx index b349d121..4a4e3ee3 100644 --- a/src/modules/appointments/table/index.tsx +++ b/src/modules/appointments/table/index.tsx @@ -97,12 +97,12 @@ export function AppointmentsTable({ {appointment.patient.name} @@ -114,7 +114,7 @@ export function AppointmentsTable({ {SPECIALTIES[appointment.category]} - {appointment.professional_name ?? '-'} + {appointment.professionalName ?? '-'} diff --git a/src/modules/appointments/view-appointment-modal.tsx b/src/modules/appointments/view-appointment-modal.tsx index f6710850..41e4892e 100644 --- a/src/modules/appointments/view-appointment-modal.tsx +++ b/src/modules/appointments/view-appointment-modal.tsx @@ -30,7 +30,7 @@ export function ViewAppointmentModal({ const ConditionIcon = condition.icon const showUpdatedDate = - new Date(appointment.updated_at) > new Date(appointment.created_at) + new Date(appointment.updatedAt) > new Date(appointment.createdAt) return ( @@ -41,7 +41,7 @@ export function ViewAppointmentModal({
- + {appointment.patient.name} @@ -66,7 +66,7 @@ export function ViewAppointmentModal({ label='Profissional responsável' className='sm:col-span-5' > - {appointment.professional_name ?? '-'} + {appointment.professionalName ?? '-'} {appointment.annotation && ( @@ -82,12 +82,12 @@ export function ViewAppointmentModal({ - {formatDate(appointment.created_at)} + {formatDate(appointment.createdAt)} {showUpdatedDate && ( - {formatDate(appointment.updated_at)} + {formatDate(appointment.updatedAt)} )} diff --git a/src/modules/auth/reset-password-form.tsx b/src/modules/auth/reset-password-form.tsx index 939edcf7..c5f5033c 100644 --- a/src/modules/auth/reset-password-form.tsx +++ b/src/modules/auth/reset-password-form.tsx @@ -17,12 +17,12 @@ import { passwordSchema } from '@/schemas' export const resetPasswordFormSchema = z .object({ password: passwordSchema, - confirm_password: z.string(), - reset_token: z.string(), + confirmPassword: z.string(), + resetToken: z.string(), }) - .refine((data) => data.password === data.confirm_password, { + .refine((data) => data.password === data.confirmPassword, { message: 'Suas senhas não coincidem', - path: ['confirm_password'], + path: ['confirmPassword'], }) export type ResetPasswordFormSchema = z.infer @@ -35,17 +35,14 @@ export function ResetPasswordForm({ token }: Readonly) { const formMethods = useForm({ resolver: zodResolver(resetPasswordFormSchema), - defaultValues: { password: '', confirm_password: '', reset_token: token }, + defaultValues: { password: '', confirmPassword: '', resetToken: token }, mode: 'onBlur', }) - async function submitForm({ - password, - reset_token, - }: ResetPasswordFormSchema) { + async function submitForm({ password, resetToken }: ResetPasswordFormSchema) { const response = await api('/reset-password', { method: 'POST', - body: JSON.stringify({ password, reset_token }), + body: JSON.stringify({ password, resetToken }), }) if (!response.success) { @@ -69,7 +66,7 @@ export function ResetPasswordForm({ token }: Readonly) { isRequired /> { - const response = await api<{ account_type: 'user' | 'patient' }>( + const response = await api<{ accountType: 'user' | 'patient' }>( '/login', - { - method: 'POST', - body: JSON.stringify({ - email, - password, - keep_logged_in: keepLoggedIn, - }), - }, + { method: 'POST', body: JSON.stringify(data) }, ) if (!response.success) { @@ -60,7 +49,7 @@ export function SignInForm() { } router.push( - response.data?.account_type === 'user' + response.data?.accountType === 'user' ? ROUTES.dashboard.main : ROUTES.patient.main, ) diff --git a/src/modules/auth/sign-up-form.tsx b/src/modules/auth/sign-up-form.tsx index fdd73f2f..fb11054c 100644 --- a/src/modules/auth/sign-up-form.tsx +++ b/src/modules/auth/sign-up-form.tsx @@ -32,13 +32,13 @@ export const signUpFormSchema = z role: z.enum(USERS_ROLE_ENUM), name: nameSchema, specialty: z.union([specialtySchema, z.literal('')]), - registration_id: userRegistrationId.optional(), + registrationId: userRegistrationId.optional(), password: passwordSchema, - confirm_password: z.string(), + confirmPassword: z.string(), consent: z.boolean(), }) .superRefine((data, ctx) => { - if (data.password !== data.confirm_password) { + if (data.password !== data.confirmPassword) { ctx.addIssue({ code: z.ZodIssueCode.custom, path: ['confirm_password'], @@ -60,10 +60,10 @@ export const signUpFormSchema = z message: 'Especialidade é obrigatória', }) } - if (!data.registration_id) { + if (!data.registrationId) { ctx.addIssue({ code: z.ZodIssueCode.custom, - path: ['registration_id'], + path: ['registrationId'], message: 'Registro profissional é obrigatório', }) } @@ -75,9 +75,9 @@ type RegisterUserPayload = { role: UserRole name: string password: string - invite_token: string + inviteToken: string specialty?: Specialty - registration_id?: string + registrationId?: string } interface SignUpFormProps { @@ -96,9 +96,9 @@ export function SignUpForm({ token, role }: Readonly) { role, name: '', specialty: '', - registration_id: '', + registrationId: '', password: '', - confirm_password: '', + confirmPassword: '', consent: false, } as unknown as SignUpFormSchema, }) @@ -108,19 +108,19 @@ export function SignUpForm({ token, role }: Readonly) { name, password, specialty, - registration_id, + registrationId, }: SignUpFormSchema) { startTransition(async () => { const payload: RegisterUserPayload = { role, name, password, - invite_token: token, + inviteToken: token, } - if (specialty && registration_id) { + if (specialty && registrationId) { payload.specialty = specialty - payload.registration_id = registration_id + payload.registrationId = registrationId } const response = await api('/register/user', { @@ -161,7 +161,7 @@ export function SignUpForm({ token, role }: Readonly) { isRequired /> ) { isRequired /> = { name_asc: { orderBy: 'patient', order: 'ASC' }, name_desc: { orderBy: 'patient', order: 'DESC' }, - date_asc: { orderBy: 'approved_at', order: 'ASC' }, - date_desc: { orderBy: 'approved_at', order: 'DESC' }, + date_asc: { orderBy: 'approvedAt', order: 'ASC' }, + date_desc: { orderBy: 'approvedAt', order: 'DESC' }, type_asc: { orderBy: 'type', order: 'ASC' }, type_desc: { orderBy: 'type', order: 'DESC' }, } @@ -134,12 +134,12 @@ export function ApprovedPatientRequirementsListTable() { {requirement.patient.name} - {formatDate(requirement.approved_at ?? '-')} + {formatDate(requirement.approvedAt ?? '-')} {PATIENT_REQUIREMENT_TYPES[requirement.type]} diff --git a/src/modules/patient-requirements/pending-requirements.tsx b/src/modules/patient-requirements/pending-requirements.tsx index b54e06a5..fbd2ab74 100644 --- a/src/modules/patient-requirements/pending-requirements.tsx +++ b/src/modules/patient-requirements/pending-requirements.tsx @@ -123,7 +123,7 @@ export function PendingPatientRequirements() { requirements.map((requirement) => { const pendingDays = differenceInDays( new Date(), - new Date(requirement.created_at), + new Date(requirement.createdAt), ) const severityVariant = () => { @@ -151,9 +151,7 @@ export function PendingPatientRequirements() {
- - Solicitado em {formatDate(requirement.created_at)} - + Solicitado em {formatDate(requirement.createdAt)}
-

Pendente {getTimeDistanceToNow(requirement.created_at)}

+

Pendente {getTimeDistanceToNow(requirement.createdAt)}

) diff --git a/src/modules/patient-requirements/requirement-modal.tsx b/src/modules/patient-requirements/requirement-modal.tsx index dbf1efb8..feec0567 100644 --- a/src/modules/patient-requirements/requirement-modal.tsx +++ b/src/modules/patient-requirements/requirement-modal.tsx @@ -28,7 +28,7 @@ import { api } from '@/lib/api' import { queryClient } from '@/lib/tanstack-query' const patientRequirementFormSchema = z.object({ - patient_id: z.string().uuid('Paciente é obrigatório'), + patientId: z.string().uuid('Paciente é obrigatório'), type: z.enum(PATIENT_REQUIREMENT_TYPE_ENUM), description: z .string() @@ -50,7 +50,7 @@ export function PatientRequirementModal({ const formMethods = useForm({ resolver: zodResolver(patientRequirementFormSchema), defaultValues: { - patient_id: '', + patientId: '', type: '', description: '', } as unknown as PatientRequirementFormSchema, @@ -89,7 +89,7 @@ export function PatientRequirementModal({ = { name_asc: { orderBy: 'patient', order: 'ASC' }, name_desc: { orderBy: 'patient', order: 'DESC' }, - date_asc: { orderBy: 'submitted_at', order: 'ASC' }, - date_desc: { orderBy: 'submitted_at', order: 'DESC' }, + date_asc: { orderBy: 'submittedAt', order: 'ASC' }, + date_desc: { orderBy: 'submittedAt', order: 'DESC' }, type_asc: { orderBy: 'type', order: 'ASC' }, type_desc: { orderBy: 'type', order: 'DESC' }, } @@ -128,8 +128,7 @@ export function UnderReviewPatientRequirements() {
- Recebido{' '} - {getTimeDistanceToNow(requirement.submitted_at ?? '')} + Recebido {getTimeDistanceToNow(requirement.submittedAt ?? '')}
diff --git a/src/modules/patient-supports/delete-patient-support-modal.tsx b/src/modules/patient-supports/delete-patient-support-modal.tsx index de56fe8e..d12f7df9 100644 --- a/src/modules/patient-supports/delete-patient-support-modal.tsx +++ b/src/modules/patient-supports/delete-patient-support-modal.tsx @@ -41,7 +41,7 @@ export function DeletePatientSupportModal({ return } - revalidateServerCache(NEXT_CACHE_TAGS.patient(patientSupport.patient_id)) + revalidateServerCache(NEXT_CACHE_TAGS.patient(patientSupport.patientId)) toast.success(response.message) onClose() diff --git a/src/modules/patient-supports/patient-support-modal.tsx b/src/modules/patient-supports/patient-support-modal.tsx index 5a792e9b..a9b4c4f7 100644 --- a/src/modules/patient-supports/patient-support-modal.tsx +++ b/src/modules/patient-supports/patient-support-modal.tsx @@ -48,7 +48,7 @@ export function PatientSupportModal({ patientSupport, onClose, }: Readonly) { - const ensurePatientId = patientId || patientSupport?.patient_id || '' + const ensurePatientId = patientId || patientSupport?.patientId || '' const formMethods = useForm({ resolver: zodResolver(patientSupportFormSchema), diff --git a/src/modules/patients/cards/patient-requirement-card.tsx b/src/modules/patients/cards/patient-requirement-card.tsx index b2c190b5..4e22908f 100644 --- a/src/modules/patients/cards/patient-requirement-card.tsx +++ b/src/modules/patients/cards/patient-requirement-card.tsx @@ -17,7 +17,7 @@ export function PatientRequirementCard({

Laudo médico

- Solicitado em: {formatDate(requirement.created_at)} + Solicitado em: {formatDate(requirement.createdAt)}