Set the calendar's daily capacity in the company details
The task calendar's daily maximum moves from the hidden setting jobs.daily_capacity_hours to shared.daily_capacity_hours, edited by the admin on the company details page. An empty field means 7.5 hours. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
@@ -23,6 +23,7 @@ use App\Modules\Jobs\Domain\Exceptions\TaskHasTimeEntries;
|
||||
use App\Modules\Jobs\Domain\Exceptions\TaskNotFound;
|
||||
use App\Modules\Jobs\Domain\Exceptions\TasksNotAllowedYet;
|
||||
use App\Modules\Jobs\Domain\ValueObjects\TaskTitle;
|
||||
use App\Modules\Shared\Application\UseCases\DailyCapacity;
|
||||
use App\Modules\Shared\Application\UseCases\HolidayCalendar;
|
||||
use Tests\Fakes\FakeCatalogQueries;
|
||||
use Tests\Fakes\FakeClock;
|
||||
@@ -64,7 +65,7 @@ beforeEach(function () {
|
||||
|
||||
$checker = new TaskReferenceChecker($this->catalog, $this->users);
|
||||
$this->bookings = new InMemoryTaskBookingRepository($this->tasks);
|
||||
$this->planner = new TaskPlanner($this->bookings, new HolidayCalendar(new InMemoryHolidayOverrides), new FakeSettings);
|
||||
$this->planner = new TaskPlanner($this->bookings, new HolidayCalendar(new InMemoryHolidayOverrides), new DailyCapacity(tap(new FakeSettings, fn (FakeSettings $settings) => $settings->put(DailyCapacity::KEY, '8'))));
|
||||
$this->addTask = new AddTask($this->jobs, $this->tasks, $checker, $this->planner, $transactions, $this->events);
|
||||
$this->updateTask = new UpdateTask($this->jobs, $this->tasks, $checker, $this->planner, $transactions, $this->events);
|
||||
$this->scheduleTask = new ScheduleTask($this->jobs, $this->tasks, $checker, $this->planner, $transactions, $this->events);
|
||||
|
||||
@@ -13,6 +13,7 @@ use App\Modules\Jobs\Domain\Exceptions\InvalidEstimatedHours;
|
||||
use App\Modules\Jobs\Domain\Exceptions\InvalidTaskReference;
|
||||
use App\Modules\Jobs\Domain\Exceptions\TasksNotAllowedYet;
|
||||
use App\Modules\Jobs\Domain\Exceptions\WorkflowTemplateNotAvailable;
|
||||
use App\Modules\Shared\Application\UseCases\DailyCapacity;
|
||||
use App\Modules\Shared\Application\UseCases\HolidayCalendar;
|
||||
use Tests\Fakes\FakeCatalogQueries;
|
||||
use Tests\Fakes\FakeClock;
|
||||
@@ -59,7 +60,7 @@ beforeEach(function () {
|
||||
$this->templates->addTemplate(4, 'Rikki', 11, 1, [['Painatus', 21]]);
|
||||
|
||||
$this->bookings = new InMemoryTaskBookingRepository($this->tasks);
|
||||
$planner = new TaskPlanner($this->bookings, new HolidayCalendar(new InMemoryHolidayOverrides), new FakeSettings);
|
||||
$planner = new TaskPlanner($this->bookings, new HolidayCalendar(new InMemoryHolidayOverrides), new DailyCapacity(tap(new FakeSettings, fn (FakeSettings $settings) => $settings->put(DailyCapacity::KEY, '8'))));
|
||||
$this->addTasks = new AddTasksFromWorkflowTemplate($this->jobs, $this->tasks, $this->templates, new TaskReferenceChecker($catalog, $users), $planner, new FakeClock(new DateTimeImmutable('2026-05-01')), $transactions, $this->events);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user