Commit Graph

140 Commits

Author SHA1 Message Date
VPS 4 Builder cabd2b9118 Merge claude/youthful-mendel-0c569f: grupo familiar + indicado por
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 07:32:30 +02:00
VPS 4 Builder 4c39a04654 feat(pacientes): grupo familiar + indicado por — DB migration, routes, autocomplete UI, family modal
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 07:32:27 +02:00
VPS 4 Builder 11b0c2d2bf Merge claude/youthful-mendel-0c569f: patient UI overhaul
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 07:19:14 +02:00
VPS 4 Builder b411ab3c01 feat(pacientes): compact cards (6/screen), sort pills, clean search bar, 20-default limit
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 07:19:11 +02:00
VPS 4 Builder 58d875b4fc Merge claude/youthful-mendel-0c569f: patient card redesign + dataNascimento fix
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 07:12:01 +02:00
VPS 4 Builder 51cbd07125 fix(pacientes): alias dataNascimento in query; show full name; add CopyField component per data field
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 07:11:58 +02:00
VPS 4 Builder ca584dca72 Merge claude/youthful-mendel-0c569f: import-legacy + server-side pacientes search
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 07:03:58 +02:00
VPS 4 Builder 162404f4e8 feat(sync): add import-legacy route for Apps Script patients; fix pacientes API to use server-side search
- POST /api/sync/import-legacy: reads PACIENTES-CONSULTT-CLINIC tab (1755 patients),
  maps Nome+SobreNome→nome, CPF, Credenciada→convenio, DataNasci, TefefonePrincipal→telefone
- GET /api/pacientes: now supports ?q= server-side search, returns {data, total} — avoids loading all 1755 rows in client
- PatientsView: uses {data, total} response, shows count of all patients in header
- SyncView: adds "Importar Planilha Legada" button (amber)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 07:03:51 +02:00
VPS 4 Builder 1d2d164a73 fix(docker): expand frontend build context to root so update-version.js is accessible
WORKDIR changed to /app/frontend so ../update-version.js resolves correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 06:52:58 +02:00
VPS 4 Builder 1b56d729bf Merge claude/youthful-mendel-0c569f: add update-version.js build bump
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 06:52:07 +02:00
VPS 4 Builder 084a8f46c5 feat(build): add update-version.js to auto-increment patch on every build
Script runs before vite build via package.json "build" script.
Reads/writes APP_VERSION in frontend/constants.ts (now at V1.0.3).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 06:52:03 +02:00
VPS 4 Builder c718e888d7 Merge claude/youthful-mendel-0c569f: add APP_VERSION to ConfiguracoesView
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 06:48:58 +02:00
VPS 4 Builder 8331e87d26 feat(frontend): centralize APP_VERSION in constants.ts, show in ConfiguracoesView header
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 06:48:55 +02:00
VPS 4 Builder 7d61550ae6 Merge branch 'claude/youthful-mendel-0c569f' 2026-05-14 05:56:03 +02:00
VPS 4 Builder 263c98d74f feat(settings): Google OAuth credentials UI in Configurações
Backend:
- Load GOOGLE_CLIENT_ID/SECRET from DB at startup (env vars take priority)
- GET /api/settings/google-credentials → masked status (secret never returned)
- POST /api/settings/google-credentials → save to DB, hot-reload in memory
- /api/auth/google/url returns 503 with clear message when unconfigured

Frontend (ConfiguracoesView):
- OAuth credential inputs (Client ID + Client Secret with show/hide toggle)
- Shows configured status badge (ENV vs DB) and masked clientIdHint
- Instructions with redirect URI shown inline

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 05:56:00 +02:00
VPS 4 Builder 96b0cd0172 Merge branch 'claude/youthful-mendel-0c569f' 2026-05-14 05:52:36 +02:00
VPS 4 Builder fc891ab878 fix(oauth): set GOOGLE_REDIRECT_URI in docker-compose; guard missing credentials
- Add APP_URL and GOOGLE_REDIRECT_URI=https://scoreodonto.com/api/oauth2callback
  to docker-compose backend environment
- /api/auth/google/url returns 503 with clear message when CLIENT_ID/SECRET unset
- GoogleConnectButton shows alert instead of silently breaking on API error

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 05:52:33 +02:00
VPS 4 Builder 3b6c7f43d6 Merge branch 'claude/youthful-mendel-0c569f' 2026-05-14 05:44:59 +02:00
VPS 4 Builder 63962d51c1 feat(sync): Google Sheets bidirectional backup (PG ↔ Sheets)
Backend:
- Add SYNC_TABLES config (pacientes, agendamentos, financeiro, leads, guias)
- Add getSheetsClient(), ensureSheetTab(), pushTableToSheet(), pullTableFromSheet()
- Add schedulePush() debounced 5s auto-push after every write to main tables
- Add GET /api/sync/status, POST /api/sync/push, POST /api/sync/pull
- Update OAuth scope to include spreadsheets

Frontend:
- Redesign SyncView: per-table status grid, two-button operation (Backup/Restore),
  terminal log with color-coded lines, auto-backup info notice

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 05:44:52 +02:00
VPS 4 Builder 8922354772 Merge branch 'claude/youthful-mendel-0c569f' 2026-05-14 05:02:53 +02:00
VPS 4 Builder c70b2cde66 fix(ui): replace all MySQL references with PostgreSQL
Update SyncView description, security note, mock progress logs,
dbConfig, loading text in PatientsView, UpdateDbView warning, and
metadata.json description. Rename syncGoogleSheetsToMysql →
syncGoogleSheetsToPg.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 05:02:49 +02:00
VPS 4 Builder 7abda1dc58 Merge branch 'claude/youthful-mendel-0c569f' 2026-05-14 04:54:25 +02:00
VPS 4 Builder 2a284f9e6e feat(ui): add Configurações page with profile/integration cards
Move user profile card and Google connect button from sidebar footer
to a dedicated Configurações view. Sidebar footer now shows a compact
user button that navigates to settings. All roles have access.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 04:54:22 +02:00
VPS 4 Builder 829489d216 Merge branch 'claude/youthful-mendel-0c569f' 2026-05-14 04:44:55 +02:00
VPS 4 Builder 2f3c0420e3 feat(routing): switch from hash routing to HTML5 History API
Remove all window.location.hash assignments and hashchange events.
Navigate with history.pushState; listen on popstate. Fix base href to
'/' so assets resolve correctly on deep paths. Update magic link URL.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 04:44:53 +02:00
VPS 4 Builder 7c41fa09ed chore(frontend): adiciona @types/react e @types/react-dom 2026-05-14 04:09:41 +02:00
VPS 4 Builder f0f24e8a68 chore: atualiza .gitignore e adiciona package-lock.json do frontend 2026-05-14 04:08:47 +02:00
VPS 4 Builder 3456d26cbc feat(frontend): restore 3s preloader initialization view in LoginView 2026-05-13 23:30:47 +02:00
VPS 4 Builder 26a10ac4f7 fix(nav): corrige sistema de navegação pós-login e sincronização de URL
Causa raiz do login não navegar: getCurrentRole() retornava null quando
vinculos.role era NULL no banco, fazendo isViewAllowed() retornar false
e handleNavigate() falhar silenciosamente sem nenhum feedback.

Fixes:
- backend.ts: getCurrentRole usa workspace?.role || 'paciente' para
  garantir que nunca retorne null/undefined
- App.tsx: onLoginSuccess usa setCurrentView+navigate diretamente,
  sem passar pela guarda de permissão (desnecessária pós-autenticação)
- App.tsx: mount effect sempre chama navigate(currentView) para sincronizar
  a URL com a view real — antes só executava com hash vazio, deixando
  /#/login na URL ao recarregar com usuário autenticado
- LoginView.tsx: remove spinner isInitializing de 3s que bloqueava o
  formulário em toda montagem do componente

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 22:56:30 +02:00
VPS 4 Builder 1330147eaf fix: corrige inconsistências críticas de backend e navegação
- Backend: substitui string literals com aspas duplas por aspas simples
  nas queries PostgreSQL (settings, GTO builder, google_tokens delete)
- Backend: corrige alias SQL 'dentistanome' para 'dentistaNome' (quoted)
  e ajusta frontend para usar 'pacientenome' (lowercase do PG)
- Backend: move app.listen() para após todas as rotas registradas
- Backend: ativa generateIntelligentNotifications no startup + intervalo 5min
- Backend: magic link usa process.env.APP_URL em vez de localhost:3000 hardcoded
- Frontend: adiciona 'relatorios' às permissões do role 'funcionario'
- Frontend: adiciona onClick ao botão Relatórios do Dashboard
- Frontend: adiciona Content-Type e JWT token em salvarAgendamento/atualizarAgendamento
- Frontend: MeusTratamentos passa JWT token nas chamadas a /api/guias
- Frontend: ClinicasView passa JWT token no endpoint de atualização de cor
- Frontend: corrige subtítulo 'MYSQL + GOOGLE' para 'POSTGRESQL + GOOGLE'

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 21:43:23 +02:00
VPS 4 Builder 8a138cefac feat(frontend): increase preloader duration to 3s and bump version to V1.0.2 2026-05-13 20:12:35 +02:00
VPS 4 Builder b9dd79d484 fix(frontend): remove node types from frontend tsconfig to clear IDE warning 2026-05-13 15:41:15 +02:00
VPS 4 Builder abd56fcc6f fix(frontend): remove duplicated keys in backend.ts 2026-05-13 15:32:57 +02:00
VPS 4 Builder c16ec80780 fix(frontend): remove syntax errors in backend.ts 2026-05-13 15:31:30 +02:00
VPS 4 Builder 3416845c28 feat(frontend): Add V1.0.1 preloader and version string to LoginView 2026-05-13 10:11:33 +02:00
VPS 4 Builder 526495db96 fix(frontend): Resolve login redirection and inject JWT token on requests 2026-05-13 10:04:49 +02:00
Antigravity AI Agent 9d10fed38e feat: complete relative api route integration and container build 2026-05-13 07:50:15 +02:00
Antigravity AI Agent 606da6de97 feat: migrate ScoreOdonto CRM to Docker, PostgreSQL, and DragonflyDB 2026-05-13 07:13:41 +02:00
Antigravity AI Agent 4917d03bdf chore: clean up codebase content, keeping only the environment and infrastructure configurations 2026-05-13 05:21:31 +02:00
Antigravity AI Agent 19dbbae8b8 chore: initial setup with PostgreSQL, DragonflyDB, and Nginx routing configs 2026-05-13 05:12:32 +02:00