Skip to content

adicionado enum e campo do prazo - #517

Open
CaffeineIssues wants to merge 1 commit into
developfrom
feature/add-monitoring-report-request-deadline-enum
Open

adicionado enum e campo do prazo#517
CaffeineIssues wants to merge 1 commit into
developfrom
feature/add-monitoring-report-request-deadline-enum

Conversation

@CaffeineIssues

@CaffeineIssues CaffeineIssues commented Aug 25, 2026

Copy link
Copy Markdown
Member

✅ Descrição do propósito desse Pull Request


🧭 Referência a Issue

[#466 ]

❓ O que foi feito para atingir isso?


🏃‍♀️ Tipo de mudança

Marque as opções relevantes:

  • Bug fix (correção de bug)
  • Nova feature (mudança não retrocompatível que adiciona funcionalidade)
  • Mudança de breaking (correção ou feature que faria com que a funcionalidade existente não funcionasse como esperado)
  • Documentação (somente mudanças ou atualizações na documentação)

🕵️ Como foi testado?

  • Critério de aceitação
  • Testes de software (TDD, BDD, UNITÁRIO, INTEGRAÇÃO, E2E)

Checklist: ✔️

  • Meu código segue as diretrizes do projeto
  • Eu fiz um code review com minha equipe
  • Eu comentei meu código, especialmente em áreas de difícil entendimento
  • Eu atualizei a documentação correspondente
  • Testes novos e existentes passaram localmente com minhas alterações

Observação:

Summary by CodeRabbit

  • New Features

    • Added configurable monitoring report request deadlines for notices and projects.
    • Supported deadline options now include PNAB, Lei Aldir Blanc, Lei Paulo Gustavo, Calendarized Cycles, and Mecenas.
    • Added deadline selection fields to notice and project editing screens.
    • Monitoring schedules now calculate dates using the selected deadline duration.
  • Bug Fixes

    • Added validation to prevent unsupported deadline values.
    • Exposed saved deadline details and calculated durations consistently across notice and project views.
  • Tests

    • Added coverage for deadline options, validation, storage, updates, and date calculations.

@CaffeineIssues CaffeineIssues self-assigned this Aug 25, 2026
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: beb05c1c-c7b7-494c-b654-d699765448a2

📥 Commits

Reviewing files that changed from the base of the PR and between 5e7b9bc and ea0984a.

📒 Files selected for processing (21)
  • app/Enums/MonitoringReportRequestDeadline.php
  • app/Http/Controllers/NoticeController.php
  • app/Http/Controllers/ProjectController.php
  • app/Http/Requests/Notice/NoticeStoreRequest.php
  • app/Http/Requests/Notice/NoticeUpdateRequest.php
  • app/Http/Resources/NoticeResource.php
  • app/Models/Notice.php
  • app/Services/NoticeService.php
  • database/factories/NoticeFactory.php
  • database/migrations/2026_08_25_000001_add_monitoring_report_request_deadline_to_notices_table.php
  • resources/js/Components/EditableField.vue
  • resources/js/Pages/Notices/Index.vue
  • resources/js/Pages/Notices/NoticesListPage.vue
  • resources/js/Pages/Notices/NupDialog.vue
  • resources/js/Pages/Projects/Index.vue
  • resources/js/Pages/Projects/Partials/ProjectNoticeEdit.vue
  • resources/js/Schemas/Monitoring/viewSections.js
  • tests/Feature/Notice/StoreValidationTest.php
  • tests/Feature/Notice/UpdateValidationTest.php
  • tests/Feature/ProjectControllerTest.php
  • tests/Unit/MonitoringReportRequestDeadlineTest.php

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Adds five monitoring report deadline categories with day mappings and labels. Notices store and validate the selected deadline, expose it to Inertia pages, and edit it in notice and project interfaces. Monitoring calculations now use the configured deadline duration.

Changes

Monitoring report request deadlines

Layer / File(s) Summary
Deadline contract and notice storage
app/Enums/..., app/Models/Notice.php, database/migrations/..., database/factories/..., app/Http/Resources/NoticeResource.php, app/Services/NoticeService.php, tests/Unit/...
Defines five deadline values, Portuguese labels, 90-, 120-, and 240-day mappings, database storage, model casting, serialized fields, dashboard output, factory defaults, and unit coverage.
Server validation and page props
app/Http/Requests/Notice/..., app/Http/Controllers/..., tests/Feature/Notice/..., tests/Feature/ProjectControllerTest.php
Validates supported deadline values, supplies options to Notices and Projects pages, and tests storage, updates, invalid values, and project response fields.
Frontend editing and monitoring calculation
resources/js/Components/EditableField.vue, resources/js/Pages/Notices/..., resources/js/Pages/Projects/..., resources/js/Schemas/Monitoring/viewSections.js
Configures select option keys, adds deadline selectors to notice and project editing flows, and uses stored deadline days in monitoring date calculations.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: ⚪ Minimal · up to ea098

This change adds a monitoring-report request deadline to notices and carries it through the related application screens and validations. No actionable merge-blocking risk remains in the supplied evidence after normal checks and review.

Suggested reviewers: junior-shyko

Sequence Diagram(s)

sequenceDiagram
  participant NoticeController
  participant NupDialog
  participant NoticeStoreRequest
  participant Notice
  NoticeController->>NupDialog: Provides deadline options
  NupDialog->>NoticeStoreRequest: Submits selected deadline
  NoticeStoreRequest->>Notice: Validates and stores enum value
  Notice-->>NupDialog: Returns deadline value and calculated days
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 23 functions across 15 files. (6 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main changes: adding the deadline enum and the related database field.
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 23 functions across 15 files. (6 skipped: 6 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/add-monitoring-report-request-deadline-enum

Warning

Some tools did not complete. Review the errors below.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

resources/js/Components/EditableField.vue

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

resources/js/Pages/Notices/Index.vue

ESLint skipped: the matched ESLint configuration already failed (missing-dependency).

resources/js/Pages/Notices/NoticesListPage.vue

ESLint skipped: the matched ESLint configuration already failed (missing-dependency).

  • 4 others

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

@Junior-Shyko

Copy link
Copy Markdown
Collaborator

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

if (!paymentDate || !signedAt) return null;

const daysBetweenSignedAndPayment = daysBetweenDates(signedAt, paymentDate);
const requestDeadlineDays = Number(project.notice?.monitoring_report_request_deadline_days ?? 120);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Remover o fallback ?? 120 e garantir que o backend nunca mande null, pois se um dia precisar mudar os dias, mudará somente no Enum do php.

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