Add project hours, hours overview page, and default current-year selector #20

Merged
rygos merged 2 commits from codex/add-hours-field-and-navigation-for-projects-xrtmjv into master 2026-01-13 16:46:46 +00:00
rygos commented 2026-01-13 16:42:31 +00:00 (Migrated from github.com)

Motivation

  • Persist an estimated/allocated number of hours per project and display them in a finished-projects hours overview.
  • Provide a navigable hours overview page showing finished projects grouped by year with Short/SAP/City and Hours.
  • Allow selecting the year to view and default the selector to the current year when that year has finished projects.
  • Expose the hours overview via a route and navigation link for quick access.

Description

  • Added a migration 2024_10_15_000001_add_hours_to_projects_table.php to add a nullable unsigned hours column to the projects table.
  • Updated app/Models/Base/Project.php and app/Models/Project.php to cast hours and include hours in the $fillable metadata.
  • Persisted hours from the create form in ProjectsController::store and added a numeric hours input to resources/views/projects/add.blade.php.
  • Implemented HoursController::index (with default-year logic in app/Http/Controllers/HoursController.php), registered the hours.index route, added a navigation link, and created resources/views/hours/index.blade.php with a year selector and project hours table.

Testing

  • A Playwright script opened /hours and saved an initial screenshot which completed successfully.
  • The Playwright screenshot was re-run after updating the hours table columns and completed successfully.
  • The Playwright script was run again after adding default-current-year selection and produced artifacts/hours-page-current-year.png successfully.
  • No unit or feature tests were added or executed as part of these changes.

Codex Task

### Motivation - Persist an estimated/allocated number of hours per project and display them in a finished-projects hours overview. - Provide a navigable hours overview page showing finished projects grouped by year with `Short`/`SAP`/`City` and `Hours`. - Allow selecting the year to view and default the selector to the current year when that year has finished projects. - Expose the hours overview via a route and navigation link for quick access. ### Description - Added a migration `2024_10_15_000001_add_hours_to_projects_table.php` to add a nullable unsigned `hours` column to the `projects` table. - Updated `app/Models/Base/Project.php` and `app/Models/Project.php` to cast `hours` and include `hours` in the `$fillable` metadata. - Persisted `hours` from the create form in `ProjectsController::store` and added a numeric `hours` input to `resources/views/projects/add.blade.php`. - Implemented `HoursController::index` (with default-year logic in `app/Http/Controllers/HoursController.php`), registered the `hours.index` route, added a navigation link, and created `resources/views/hours/index.blade.php` with a year selector and project hours table. ### Testing - A Playwright script opened `/hours` and saved an initial screenshot which completed successfully. - The Playwright screenshot was re-run after updating the hours table columns and completed successfully. - The Playwright script was run again after adding default-current-year selection and produced `artifacts/hours-page-current-year.png` successfully. - No unit or feature tests were added or executed as part of these changes. ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_6966655adbdc83288ecfa1060ecfac46)
Sign in to join this conversation.
No description provided.