Skip to content

feat(plano-setorial): adicionar campo de fechamento automático do orçamento#593

Open
Eduruiz wants to merge 1 commit intohomolfrom
feature/SEPLAN/S04.09-PdM-e-PS-Configurador-fechamento-automático-do-preenchimento-do-orcamento-pelos-pontos-focais

Hidden character warning

The head ref may contain hidden characters: "feature/SEPLAN/S04.09-PdM-e-PS-Configurador-fechamento-autom\u00e1tico-do-preenchimento-do-orcamento-pelos-pontos-focais"
Open

feat(plano-setorial): adicionar campo de fechamento automático do orçamento#593
Eduruiz wants to merge 1 commit intohomolfrom
feature/SEPLAN/S04.09-PdM-e-PS-Configurador-fechamento-automático-do-preenchimento-do-orcamento-pelos-pontos-focais

Conversation

@Eduruiz
Copy link
Collaborator

@Eduruiz Eduruiz commented Feb 26, 2026

Adiciona select de dia de fechamento (1 a 28) ao formulário de PDM e Plano Setorial, visível apenas quando monitoramento de orçamento está habilitado. Corrige layout de checkboxes removendo class block.

Summary by CodeRabbit

  • New Features

    • Added automatic budget closure date configuration for sectoral plans. When budget monitoring is enabled, users can now specify a closure day (1-28) that will automatically close the budget period.
  • Style

    • Refined label layout spacing in the sectoral plans editor form.

…amento

Adiciona select de dia de fechamento (1 a 28) ao formulário de PDM e
Plano Setorial, visível apenas quando monitoramento de orçamento está
habilitado. Corrige layout de checkboxes removendo class block.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 26, 2026

📝 Walkthrough

Walkthrough

The changes introduce a new orcamento_dia_fechamento field to the planoSetorial form across three layers: schema definition, state management store, and UI view. The field represents an automatic budget closing day, accepts numeric values 1-28, and displays conditionally when budget monitoring is enabled. Label styling was also adjusted by removing the "block" class.

Changes

Cohort / File(s) Summary
Form Schema Definition
frontend/src/consts/formSchemas.js
Added orcamento_dia_fechamento field to planoSetorial schema: a required numeric field (range 1-28) with conditional display when monitoramento_orcamento is true. Includes transform to map empty inputs to null.
Store Data Getter
frontend/src/stores/planosSetoriais.store.ts
Extended itemParaEdicao getter to include orcamento_dia_fechamento derived from emFoco?.orcamento_dia_fechamento with null default.
Form UI Component
frontend/src/views/planosSetoriais/PlanosSetoriaisCriarEditar.vue
Added conditional rendering block for orcamento_dia_fechamento when monitoramento_orcamento is true; includes select field with options 1-28 and error messaging. Removed "block" class from label wrappers across form groups for spacing adjustments.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • GustavoFSoares
  • robsonsobral

Poem

🐰 A budget day arrives, oh what delight!
With fields that close from one to twenty-eight bright,
The schema learns, the store now knows,
The UI shows when monitoring grows,
A rabbit's code hop, clean and right! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 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 an automatic budget closing day field to the plano-setorial (sectoral plan) form, which is the primary feature introduced across all modified files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/SEPLAN/S04.09-PdM-e-PS-Configurador-fechamento-automático-do-preenchimento-do-orcamento-pelos-pontos-focais

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

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

@cloudflare-workers-and-pages
Copy link

Deploying smae with  Cloudflare Pages  Cloudflare Pages

Latest commit: cf0a1be
Status: ✅  Deploy successful!
Preview URL: https://2d516abb.smae.pages.dev
Branch Preview URL: https://feature-seplan-s04-09-pdm-e.smae.pages.dev

View logs

@sonarqubecloud
Copy link

Copy link
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.

🧹 Nitpick comments (1)
frontend/src/views/planosSetoriais/PlanosSetoriaisCriarEditar.vue (1)

658-681: Consider adding a placeholder option to the select.

The select field lacks a placeholder/empty option, which means day 1 will be pre-selected by default when the field becomes visible. This could lead to unintentional submissions if users don't actively select a value.

For consistency with other selects in this form (like nivel_orcamento which has explicit options), consider adding a placeholder:

♻️ Proposed fix to add placeholder option
           <Field
             name="orcamento_dia_fechamento"
             as="select"
             class="inputtext light mb1"
             :class="{ 'error': errors.orcamento_dia_fechamento }"
           >
+            <option value="">
+              Selecionar
+            </option>
             <option
               v-for="dia in 28"
               :key="dia"
               :value="dia"
             >
               {{ dia }}
             </option>
           </Field>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/src/views/planosSetoriais/PlanosSetoriaisCriarEditar.vue` around
lines 658 - 681, The select for "orcamento_dia_fechamento" currently renders
days 1–28 with no empty option so day 1 becomes selected by default; add a
placeholder/empty <option> (e.g., value="" disabled selected or value="" hidden)
as the first option in the Field with name "orcamento_dia_fechamento" so users
must actively choose a day, and ensure the form validation (schema referenced by
LabelFromYup and ErrorMessage tied to errors.orcamento_dia_fechamento) treats
empty string as invalid so submissions without a selection are rejected.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@frontend/src/views/planosSetoriais/PlanosSetoriaisCriarEditar.vue`:
- Around line 658-681: The select for "orcamento_dia_fechamento" currently
renders days 1–28 with no empty option so day 1 becomes selected by default; add
a placeholder/empty <option> (e.g., value="" disabled selected or value=""
hidden) as the first option in the Field with name "orcamento_dia_fechamento" so
users must actively choose a day, and ensure the form validation (schema
referenced by LabelFromYup and ErrorMessage tied to
errors.orcamento_dia_fechamento) treats empty string as invalid so submissions
without a selection are rejected.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 00d3df9 and cf0a1be.

📒 Files selected for processing (3)
  • frontend/src/consts/formSchemas.js
  • frontend/src/stores/planosSetoriais.store.ts
  • frontend/src/views/planosSetoriais/PlanosSetoriaisCriarEditar.vue

:schema="schema"
/>
<Field
name="orcamento_dia_fechamento"
Copy link
Collaborator

Choose a reason for hiding this comment

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

A gente devia começar a botar id nessas coisas.

class="inputtext light mb1"
:class="{ 'error': errors.orcamento_dia_fechamento }"
>
<option
Copy link
Collaborator

Choose a reason for hiding this comment

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

Não devia ter um item para o valor vazio, mesmo que desabilitado, @Eduruiz ?

Copy link
Collaborator

@robsonsobral robsonsobral left a comment

Choose a reason for hiding this comment

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

Um comentário a mais.

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