Task calendar (/jobs/calendar) replaces per-unit task Kanban columns (K34): a two-week Gantt of tasks per person. Bars move, resize and change person by dragging or through a keyboard dialog. Each task's estimate is booked evenly over working days into task_bookings, and what exceeds the daily maximum (jobs.daily_capacity_hours, 8 h) moves to the next working day. Tasks get planned_from/planned_to on the form. Holidays (/settings/holidays): Finnish public holidays calculated per year, which the admin can take out of use, plus company days off. Also includes the earlier uncommitted work: workflow templates with adding tasks from a template, and removing customers no module refers to. Co-Authored-By: Claude Opus 5.5 <[email protected]>
49 lines
1.8 KiB
PHP
49 lines
1.8 KiB
PHP
<?php
|
|
|
|
namespace App\Modules\Shared\Infrastructure\Providers;
|
|
|
|
use App\Models\User;
|
|
use App\Modules\Shared\Application\Contracts\EventDispatcher;
|
|
use App\Modules\Shared\Application\Contracts\HolidayOverrides;
|
|
use App\Modules\Shared\Application\Contracts\Settings;
|
|
use App\Modules\Shared\Application\Contracts\TransactionManager;
|
|
use App\Modules\Shared\Infrastructure\Events\LaravelEventDispatcher;
|
|
use App\Modules\Shared\Infrastructure\Persistence\DatabaseHolidayOverrides;
|
|
use App\Modules\Shared\Infrastructure\Persistence\DatabaseSettings;
|
|
use App\Modules\Shared\Infrastructure\Persistence\LaravelTransactionManager;
|
|
use App\Modules\Shared\Presentation\Http\Middleware\SetSecurityHeaders;
|
|
use App\Modules\Users\Domain\Enums\Role;
|
|
use Illuminate\Contracts\Http\Kernel;
|
|
use Illuminate\Support\Facades\Gate;
|
|
use Illuminate\Support\ServiceProvider;
|
|
use Livewire\Livewire;
|
|
|
|
class SharedServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* @var array<class-string, class-string>
|
|
*/
|
|
public array $bindings = [
|
|
TransactionManager::class => LaravelTransactionManager::class,
|
|
EventDispatcher::class => LaravelEventDispatcher::class,
|
|
Settings::class => DatabaseSettings::class,
|
|
HolidayOverrides::class => DatabaseHolidayOverrides::class,
|
|
];
|
|
|
|
public function boot(): void
|
|
{
|
|
$this->app->make(Kernel::class)->pushMiddleware(SetSecurityHeaders::class);
|
|
|
|
$presentationPath = dirname(__DIR__, 2).'/Presentation';
|
|
|
|
Livewire::addNamespace('shared', viewPath: $presentationPath.'/Livewire');
|
|
|
|
if (! $this->app->routesAreCached()) {
|
|
$this->loadRoutesFrom($presentationPath.'/Routes/web.php');
|
|
}
|
|
|
|
// Settings, such as the company's details, are the admin's (spec 2).
|
|
Gate::define('settings.manage', fn (User $user): bool => $user->role === Role::Admin);
|
|
}
|
|
}
|