-
Notifications
You must be signed in to change notification settings - Fork 93
Dev #588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dev #588
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -419,18 +419,30 @@ private function getExpandedControls() | |
| return $controls->flatMap(function ($control) { | ||
| $expanded = collect([$control]); | ||
|
|
||
| if ($control->realisation_date === null && $control->periodicity > 0 && $control->periodicity <= 12) { | ||
| for ($i = 1; $i <= 12 / $control->periodicity; $i++) { | ||
| $repeatedControl = clone $control; | ||
| $repeatedControl->id = null; | ||
| $repeatedControl->score = null; | ||
| $repeatedControl->observations = null; | ||
| $repeatedControl->realisation_date = null; | ||
| $repeatedControl->plan_date = Carbon::parse($control->plan_date)->addMonthsNoOverflow($i * $control->periodicity); | ||
| $expanded->push($repeatedControl); | ||
| if ($control->realisation_date === null) { | ||
| if ($control->periodicity === -1) { | ||
| for ($i = 1; $i <= 32; $i++) { | ||
| $repeatedControl = clone $control; | ||
| $repeatedControl->id = null; | ||
| $repeatedControl->score = null; | ||
| $repeatedControl->observations = null; | ||
| $repeatedControl->realisation_date = null; | ||
| $repeatedControl->plan_date = Carbon::parse($control->plan_date)->addDays($i * 7); | ||
| $expanded->push($repeatedControl); | ||
| } | ||
| } | ||
| else if ($control->periodicity > 0 && $control->periodicity <= 12) { | ||
| for ($i = 1; $i <= 12 / $control->periodicity; $i++) { | ||
| $repeatedControl = clone $control; | ||
| $repeatedControl->id = null; | ||
| $repeatedControl->score = null; | ||
| $repeatedControl->observations = null; | ||
| $repeatedControl->realisation_date = null; | ||
| $repeatedControl->plan_date = Carbon::parse($control->plan_date)->addMonthsNoOverflow($i * $control->periodicity); | ||
| $expanded->push($repeatedControl); | ||
| } | ||
| } | ||
|
Comment on lines
+422
to
444
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Description: Verify the weekly expansion iteration counts across both controllers
echo "=== HomeController weekly iterations ==="
rg -n "periodicity === -1" -A 5 app/Http/Controllers/HomeController.php
echo ""
echo "=== ControlController weekly iterations ==="
rg -n "periodicity === -1" -A 5 app/Http/Controllers/ControlController.phpRepository: dbarzin/deming Length of output: 1439 Inconsistency: Weekly expansion uses 32 iterations (HomeController) vs 52 (ControlController). Line 424 uses Either align both to the same iteration count, or add an inline comment in both locations documenting why the difference is intentional (e.g., dashboard needs shorter future projection than history view). 🤖 Prompt for AI Agents |
||
| } | ||
|
|
||
| return $expanded; | ||
| }); | ||
| } | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -76,7 +76,8 @@ | |
| </div> | ||
| <div class="cell-lg-2 cell-md-3"> | ||
| <select name="periodicity" data-role="select"> | ||
| <option value="1" {{ $control->periodicity==0 ? "selected" : ""}}>{{ trans('common.once') }}</option> | ||
| <option value="0" {{ $control->periodicity==0 ? "selected" : ""}}>{{ trans('common.once') }}</option> | ||
| <option value="-1" {{ $control->periodicity==-1 ? "selected" : ""}}>{{ trans('common.weekly') }}</option> | ||
|
Comment on lines
+79
to
+80
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changing “once” from With this UI remap, legacy rows using 📦 Suggested rollout safeguard+ // Add a one-time data migration/reconciliation step before enabling this mapping in production:
+ // 1) Identify legacy records that used `1` as "once"
+ // 2) Convert them to `0`
+ // 3) Keep true monthly records as `1`
+ // 4) Document the cutoff strategy in release notes🤖 Prompt for AI Agents |
||
| <option value="1" {{ $control->periodicity==1 ? "selected" : ""}}>{{ trans('common.monthly') }}</option> | ||
| <option value="3" {{ $control->periodicity==3 ? "selected" : ""}}>{{ trans('common.quarterly') }}</option> | ||
| <option value="6" {{ $control->periodicity==6 ? "selected" : ""}}>{{ trans('common.biannually') }}</option> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 2026.03.04 | ||
| 2026.03.16 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: dbarzin/deming
Length of output: 440
🏁 Script executed:
Repository: dbarzin/deming
Length of output: 2622
Use
addMonthsNoOverflow()here to maintain consistency with other scheduling paths.Line 1498 currently uses
addMonths(), while the same scheduling operation at line 1385 and line 815 usesaddMonthsNoOverflow(). This inconsistency can produce different next dates (particularly for end-of-month dates), causing schedule drift across different code paths.🐛 Proposed fix
🤖 Prompt for AI Agents