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:
@@ -68,7 +68,7 @@ it('continues a task on the next working day when the day is full', function ()
|
||||
Livewire::test('jobs::calendar')
|
||||
->call('reschedule', $task->id, $this->job->id, $this->employee->id, $this->employee->id, '2026-12-23', '2026-12-23')
|
||||
->assertSee('Päivät olivat täynnä, joten tehtävä jatkuu 28.12.2026 asti.')
|
||||
->assertSee('8 / 8 h');
|
||||
->assertSee('7,5 / 7,5 h');
|
||||
|
||||
expect($task->refresh()->planned_to?->format('Y-m-d'))->toBe('2026-12-28');
|
||||
});
|
||||
|
||||
@@ -9,6 +9,8 @@ use App\Modules\Catalog\Infrastructure\Persistence\Eloquent\ServiceUnitModel;
|
||||
use App\Modules\Catalog\Infrastructure\Persistence\Eloquent\WorkTypeModel;
|
||||
use App\Modules\Jobs\Infrastructure\Persistence\Eloquent\CustomerJobModel;
|
||||
use App\Modules\Jobs\Infrastructure\Persistence\Eloquent\TaskModel;
|
||||
use App\Modules\Shared\Application\Contracts\Settings;
|
||||
use App\Modules\Shared\Application\UseCases\DailyCapacity;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Livewire\Features\SupportLockedProperties\CannotUpdateLockedPropertyException;
|
||||
@@ -17,6 +19,7 @@ use Livewire\Livewire;
|
||||
uses(RefreshDatabase::class);
|
||||
|
||||
beforeEach(function () {
|
||||
app(Settings::class)->put(DailyCapacity::KEY, '8');
|
||||
$this->employee = User::factory()->create(['name' => 'Eero Työntekijä']);
|
||||
$this->actingAs($this->employee);
|
||||
$this->marketing = ServiceUnitModel::query()->where('name', 'Markkinointi')->sole();
|
||||
|
||||
Reference in New Issue
Block a user