Skip to content

feat: Adicionar base de relatorios EM#18

Merged
sthevan027 merged 1 commit into
mainfrom
cursor/relatorios-eletromecanico-4643
Apr 27, 2026
Merged

feat: Adicionar base de relatorios EM#18
sthevan027 merged 1 commit into
mainfrom
cursor/relatorios-eletromecanico-4643

Conversation

@sthevan027
Copy link
Copy Markdown
Owner

O que foi feito

  • Introduzido o modelo unificado EletroMecanicoReport (meta padronizada + módulo).
  • Criada camada de adapters em src/em/ para converter relatórios atuais para o formato EM.
  • Persistência: adicionada tabela emReports no Dexie com migração version(5) e helpers em dbUtils.
  • Exportação corporativa (infra): criado src/utils/export-template/ com overlay por coordenadas via pdf-lib (depende do PDF base ser fornecido).
  • UI: adicionada página Relatórios EM (/em/reports) e item no menu.
  • Integração: ao salvar um Megger em GenerateReport, também salva a versão EM (não bloqueante).

Como testar

  • pnpm dev
  • Gerar um Megger e clicar em Salvar
  • Abrir Relatórios EM e validar que o relatório aparece

Próximo passo

  • Enviar o PDF base corporativo para eu implementar o preenchimento (AcroForm ou overlay com mapping).

Co-authored-by: L00W1 <L00W1@users.noreply.github.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 057ac3d7c1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/components/Layout.tsx
const otherItems = [
{ path: '/multiphase', label: 'Multi-Fase', icon: ChartBarIcon, color: 'text-gray-400' },
{ path: '/panel', label: 'Painel', icon: Squares2X2Icon, color: 'text-gray-400' },
{ path: '/em-reports', label: 'Eletromecânico', icon: DocumentTextIcon, color: 'text-gray-400' },
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Point EM nav item to an existing route

The new sidebar entry navigates to /em-reports, but the router only registers the EM list at /em in src/App.tsx (no /em-reports route exists). In practice, clicking "Eletromecânico" from the menu sends users to an unmatched URL instead of the page introduced in this commit, making the feature inaccessible through normal navigation.

Useful? React with 👍 / 👎.

Comment thread src/pages/EMReports.tsx
</div>
<div className="flex items-center gap-1 flex-shrink-0 ml-3">
<Link
to={`/em/report/${r.id}`}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid linking EM rows to an undefined detail page

Each row's "Ver" action links to /em/report/${r.id}, but there is no matching <Route> for that path (only /em and /report/:type/:id are defined). This means every click on the eye icon leads to a missing route, so users cannot view report details from the new EM list.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ver

@sthevan027 sthevan027 merged commit 8695645 into main Apr 27, 2026
8 checks passed
@sthevan027 sthevan027 deleted the cursor/relatorios-eletromecanico-4643 branch April 27, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants