Skip to content

feat(envio-de-emails): add customizar assunto e corpo antes de enviar#627

Open
Eduruiz wants to merge 2 commits intohomolfrom
feature/SERI/S03.08-Customizacao-do-e-mail-de-comunicado-das-demandas
Open

feat(envio-de-emails): add customizar assunto e corpo antes de enviar#627
Eduruiz wants to merge 2 commits intohomolfrom
feature/SERI/S03.08-Customizacao-do-e-mail-de-comunicado-das-demandas

Conversation

@Eduruiz
Copy link
Copy Markdown
Collaborator

@Eduruiz Eduruiz commented Apr 30, 2026

Adiciona página de detalhes do e-mail onde o usuário edita assunto e conteúdo pré-preenchidos com o último envio antes de confirmar o disparo.

Summary by CodeRabbit

  • New Features
    • Introduced a dedicated email composition interface allowing users to enter a subject line and message body before sending emails with a confirmation step.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 30, 2026

Warning

Rate limit exceeded

@Eduruiz has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 39 minutes and 27 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ab87e96c-7bc7-49db-b658-2e6a2f1bd5e8

📥 Commits

Reviewing files that changed from the base of the PR and between 6577496 and 751edee.

📒 Files selected for processing (4)
  • frontend/src/router/configuracoes.js
  • frontend/src/stores/envioDeEmails.store.ts
  • frontend/src/views/envioDeEmails/EnvioDeEmailsDetalhes.vue
  • frontend/src/views/envioDeEmails/EnvioDeEmailsLista.vue
📝 Walkthrough

Walkthrough

This pull request adds a new email composition workflow by introducing a dedicated route and view for users to compose emails with subject and body fields before sending, alongside store updates to accept and transmit these parameters to the backend API.

Changes

Cohort / File(s) Summary
Router Configuration
frontend/src/router/configuracoes.js
Adds lazy-loaded nested route envioDeEmails.detalhes to navigate to new email composition view with back-navigation metadata.
Email Store Updates
frontend/src/stores/envioDeEmails.store.ts
Updates EmailItem model fields, adds assuntoUltimoEmail and corpoUltimoEmail state, and modifies dispararEmail() signature to accept optional assunto and corpo parameters.
Email Composition View
frontend/src/views/envioDeEmails/EnvioDeEmailsDetalhes.vue
New view component with form for composing email subject and body; initializes from store state, displays confirmation dialog, sends email via store action, and redirects on success.
Email List View Refactor
frontend/src/views/envioDeEmails/EnvioDeEmailsLista.vue
Replaces inline email-sending handler with navigation link routing to composition view.

Sequence Diagram

sequenceDiagram
    participant User
    participant ListaView as EnvioDeEmailsLista.vue
    participant Router
    participant DetalhesView as EnvioDeEmailsDetalhes.vue
    participant Store as envioDeEmails.store
    participant API

    User->>ListaView: Click "Enviar e-mail"
    ListaView->>Router: Navigate to envioDeEmails.detalhes
    Router->>DetalhesView: Mount view
    DetalhesView->>Store: Get assuntoUltimoEmail & corpoUltimoEmail
    Store-->>DetalhesView: Return stored subject & body
    DetalhesView->>DetalhesView: Populate form fields
    User->>DetalhesView: Fill/modify subject and body
    User->>DetalhesView: Click submit
    DetalhesView->>User: Show confirmation dialog
    User->>DetalhesView: Confirm action
    DetalhesView->>Store: dispararEmail(assunto, corpo)
    Store->>API: POST with subject & body
    API-->>Store: Response
    Store-->>DetalhesView: Return ok status
    DetalhesView->>Router: Navigate to envioDeEmails.listar
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • robsonsobral
  • GustavoFSoares

Poem

🐰 Whiskers twitch with delight,
An email form takes flight—
Subject, body, all so right,
Confirmation shines so bright!
Send with care, compose with might! ✉️

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding the ability to customize subject and body before sending emails in the envio-de-emails feature.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/SERI/S03.08-Customizacao-do-e-mail-de-comunicado-das-demandas

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 39 minutes and 27 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@frontend/src/stores/envioDeEmails.store.ts`:
- Around line 75-78: The code assigns this.corpoUltimoEmail from a non-existent
corpo field on DemandaEmailParlamentarDto so it always falls back to ''. Replace
the assignment of this.corpoUltimoEmail (in the same block where this.lista and
this.assuntoUltimoEmail are set) to source the email body from a real response
that contains the body (e.g., call the API or service that returns the full
email/detail DTO and use its body field), or remove the UI binding for
corpoUltimoEmail and related usage if bodies are not provided; ensure references
to DemandaEmailParlamentarDto are updated accordingly so the UI gets the actual
body field name returned by the backend (or remove the field from the contract).

In `@frontend/src/views/envioDeEmails/EnvioDeEmailsDetalhes.vue`:
- Around line 18-34: The page must always reload its seed email instead of
relying on the store cache: remove the conditional cache check and call
envioDeEmailsStore.buscarTudo({ pagina: 1 }) unconditionally when the component
mounts (replace the if (!envioDeEmailsStore.lista.length) { ... } block). This
ensures envioDeEmailsStore.buscarTudo is invoked every time the component loads
so the form preloads the freshest row rather than stale data from
envioDeEmailsStore.lista.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 10dba606-97b5-41f3-92b4-4ecf84e893f5

📥 Commits

Reviewing files that changed from the base of the PR and between 3a6581f and 6577496.

📒 Files selected for processing (4)
  • frontend/src/router/configuracoes.js
  • frontend/src/stores/envioDeEmails.store.ts
  • frontend/src/views/envioDeEmails/EnvioDeEmailsDetalhes.vue
  • frontend/src/views/envioDeEmails/EnvioDeEmailsLista.vue

Comment thread frontend/src/stores/envioDeEmails.store.ts Outdated
Comment thread frontend/src/views/envioDeEmails/EnvioDeEmailsDetalhes.vue Outdated
…viar

Adiciona página de detalhes do e-mail onde o usuário edita assunto e
conteúdo pré-preenchidos com o último envio antes de confirmar o disparo.
@Eduruiz Eduruiz force-pushed the feature/SERI/S03.08-Customizacao-do-e-mail-de-comunicado-das-demandas branch from 6577496 to f02f372 Compare April 30, 2026 17:34
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 30, 2026

Deploying smae with  Cloudflare Pages  Cloudflare Pages

Latest commit: 751edee
Status: ✅  Deploy successful!
Preview URL: https://a3e58aa3.smae.pages.dev
Branch Preview URL: https://feature-seri-s03-08-customiz.smae.pages.dev

View logs

Adiciona campo `corpo` à interface EmailItem refletindo retorno do backend.
Remove cast `any` e busca dados sempre ao montar a página de detalhes.
@sonarqubecloud
Copy link
Copy Markdown

❌ The last analysis has failed.

See analysis details on SonarQube Cloud

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.

1 participant