Bug: saveThrottles validated and saved throttles in same loop.
Invalid entry mid-loop stopped processing but left already-saved
throttles committed, and omitted throttles could still get deleted
via notToDelete tracking — partial/inconsistent state on failure.
- app/Controllers/Jobs.php: split into two passes — validate all
throttleData entries first; on any invalid entry, roll back
transaction and return failure immediately before touching DB.
Only save/delete once full payload validated. Drop now-redundant
$success flag folded into invalid-entry early return.
- tests/Controllers/JobsControllerTest.php: add test asserting
existing throttles stay unchanged in DB when payload contains
invalid throttle data.
Signed-off-by: objecttothis <17935339+objecttothis@users.noreply.github.com>
Add PHPUnit tests for Jobs feature to lock in current
behavior before further changes.
- JobsControllerTest: covers /jobs index render, saveSettings
validation (invalid mode, non-natural max_seconds) and
success path, saveThrottles save/soft-delete-missing/invalid
period handling, throttles partial render, and stub
processAllJobs/processSelectedJobs endpoints
- JobThrottleModelTest: covers exists(), saveValue() insert vs
update, getAll() excluding soft-deleted rows, and delete()
soft-delete behavior
Signed-off-by: objecttothis <17935339+objecttothis@users.noreply.github.com>