Move the reports under the Hallinto menu
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
@@ -25,7 +25,7 @@ Read `docs/architecture.md` (Finnish) before adding or changing domain code. `ap
|
||||
- Modules talk only through another module's Application contracts or events, never its Infrastructure or Eloquent models. Exceptions: `App\Models\User` (Laravel's auth model, owned by `Users`) is used through `auth()`/Gate, and `Users\Domain\Enums\Role` may be used in any module's Gate rules.
|
||||
- **Authorization:** define abilities with `Gate::define` in the owning module's provider (`users.manage`, `customers.use`, `catalog.manage`, `jobs.view`, `jobs.view-job`, `jobs.manage`, `jobs.archive`, `jobs.set-billing-status`, `jobs.manage-tasks`, `jobs.update-task-status`, `jobs.remove-any-task-comment`, `jobs.remove-any-task-image`, `time.use`, `time.book`, `time.approve`, `time.approve-others`, `time.cancel-approval`, `jobs.unlock`, `catalog.view-prices`, `expenses.use`, `expenses.record`, `expenses.record-for-others`, `expenses.change`, `expenses.see-amount`, `sales.use`, `sales.view-all`, `sales.view-sale`, `sales.credit`, `sales.close-day`, `sales.reopen-day`, `billing.manage`, `reports.view`, and in `Users` `money.prices`, `money.expenses`, `money.quotes`, `money.billing` for the personal money permissions of specification 2.3). Protect routes with `can:` and also call `$this->authorize()` in each Livewire page's `mount()` and in every action. Mark record ids on Livewire pages `#[Locked]`.
|
||||
- **Login** is the `Users` module: `Auth::attemptWhen` with `CheckLoginAllowed` (active, intern's last day not passed), and the `EnsureAccountIsUsable` web middleware ends sessions of users who are no longer allowed in. Nobody handles passwords: new users and "forgot password" get the same emailed set-password link, and when an admin creates a user or asks for a new link, the link is also shown to the admin to copy. Admin links use the `admin_links` broker (own table, valid 72 h); forgot-password links use the default broker (60 min); the reset page accepts both, and using or issuing a link ends the user's earlier links. `AuthenticateSession` ends a user's other sessions when the password changes. Passwords need 12+ characters with mixed case, a number and a symbol (`Password::defaults` in `UsersServiceProvider`). Login allows 5 failed attempts a minute per email + IP and 20 per IP; the forgot-password page 5 requests a minute per IP.
|
||||
- **Main menu**: the layout renders the groups of `App\View\MainMenu` (Työt, Oma kirjaus, Asiakkaat ja myynti, Hallinto, Raportit, Ylläpito) as disclosure popovers (`resources/views/components/nav-group.blade.php`). A new page is added to `MainMenu::definition()` with the Gate ability of its route; groups with no allowed links disappear.
|
||||
- **Main menu**: the layout renders the groups of `App\View\MainMenu` (Työt, Oma kirjaus, Asiakkaat ja myynti, Hallinto (incl. the reports), Ylläpito) as disclosure popovers (`resources/views/components/nav-group.blade.php`). A new page is added to `MainMenu::definition()` with the Gate ability of its route; groups with no allowed links disappear.
|
||||
- **Notifications** are their own module (`Notifications`): the header's bell `notifications::bell` (beside the profile menu) shows the unseen count and the last 7 days of `user_notifications`, and opening it marks them seen. Texts are made at display time from `NotificationType` and its `params` (`lang/*/notifications.php`). `NotifyTasksStartingSoon` (`notifications:task-starts`, scheduled daily at 14.00 business time in `routes/console.php`) notifies the assignee and members of tasks starting by the next working day through Jobs' `UpcomingTasks` port; `dedupe_key` keeps reruns from notifying twice. Jobs' use cases publish `PeopleAddedToTask` and `PeopleAddedToJob` (Domain events, after commit) when someone else is made a task's assignee or member or gets a role on a job; `NotifyAddedPeople` turns them into notifications at once, never for the actor's own changes. The scheduler needs `php artisan schedule:run` every minute (cron / Windows Task Scheduler; locally `php artisan schedule:work`).
|
||||
- **Holidays** are Shared: `Shared\Application\UseCases\HolidayCalendar` gives the Finnish public holidays (`FinnishHolidays`, calculated) minus those the admin took out of use plus company days off (`holiday_overrides`), edited on `shared::holidays` (`/settings/holidays`, gate `settings.manage`).
|
||||
- **Company details** (name, business ID, address, phone, email) are kept by `Shared\Application\UseCases\CompanyDetailsStore` in the settings (`shared.company_*`) and edited by the admin on `shared::company` (`/settings/company`, gate `settings.manage`). `BusinessId` (Y-tunnus with check digit) is a Shared value object. The name at the left of the main menu is the optional "Valikon nimi" (`shared.company_menu_name`), read with `CompanyDetailsStore::menuName()` (falls back to `config('app.name')`).
|
||||
|
||||
Reference in New Issue
Block a user