1345 timesheet codes and tasks adjustments#1378
Open
aharwood2 wants to merge 23 commits into
Open
Conversation
…witched some debug statements to logging statements
…timesheet entries
…at have bookings against them
This comment has been minimized.
This comment has been minimized.
…45-timesheet-codes-and-tasks-adjustments-2026-06-16-07-30-05 Add License and Copyright Headers
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a shared “bookable item” abstraction and extends timesheet activities/tasks with an active/inactive state, updating backend, migrations, and UI so users can’t book to inactive items and admins can’t delete codes/tasks that are already in use.
Changes:
- Added
BaseBookableItem(withIsActive) and refactoredInnateCode/InnateCodeTaskto inherit from it. - Added persistence + UI support for task-level active/inactive state, including deactivation cascades from code → tasks.
- Added booking-awareness to prevent deletion of codes/tasks that have existing timesheet entries, and added validation/styling for inactive items.
Reviewed changes
Copilot reviewed 33 out of 36 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| PPMTool/Services/UserService.cs | Updates service construction to pass logger into BaseEntityService. |
| PPMTool/Services/TimesheetService.cs | Adds booking lookup helpers + respects task active state in template setup. |
| PPMTool/Services/SubTaskService.cs | Adds logger-aware base constructor wiring. |
| PPMTool/Services/SkillTagService.cs | Adds logger-aware base constructor wiring. |
| PPMTool/Services/SettingsService.cs | Adds logger-aware base constructor wiring. |
| PPMTool/Services/SchoolService.cs | Adds logger-aware base constructor wiring. |
| PPMTool/Services/ProjectService.cs | Adds logger-aware base constructor wiring. |
| PPMTool/Services/PersonService.cs | Adds logger-aware base constructor wiring. |
| PPMTool/Services/PaymentService.cs | Adds logger-aware base constructor wiring. |
| PPMTool/Services/NoteService.cs | Adds logger-aware base constructor wiring. |
| PPMTool/Services/InvoiceService.cs | Adds logger-aware base constructor wiring. |
| PPMTool/Services/InnateCodeService.cs | Adds logger-aware base constructor wiring. |
| PPMTool/Services/FundingSourceService.cs | Adds logger-aware base constructor wiring. |
| PPMTool/Services/FinancialReferenceService.cs | Adds logger-aware base constructor wiring. |
| PPMTool/Services/FacultyService.cs | Adds logger-aware base constructor wiring. |
| PPMTool/Services/CompetencyService.cs | Adds logger-aware base constructor wiring. |
| PPMTool/Services/BaseEntityService.cs | Introduces shared logger plumbing for services. |
| PPMTool/Services/ApiKeyService.cs | Adds logger-aware base constructor wiring. |
| PPMTool/Pages/ManageInnateCodes.razor.cs | Loads booking-aware code IDs; deactivates tasks when code is deactivated. |
| PPMTool/Pages/ManageInnateCodes.razor | Disables delete UI for codes that are in use. |
| PPMTool/Pages/AddTimesheet.razor.cs | Prevents submitting bookings to inactive tasks/codes and updates inactive styling. |
| PPMTool/Pages/AddInnateCode.razor.cs | Loads booking-aware task IDs; deactivates tasks when activity is deactivated. |
| PPMTool/Pages/AddInnateCode.razor | Adds per-task active toggle and disables delete UI for tasks that are in use. |
| PPMTool/App.razor | Minor auth message CSS tweak. |
| PPMTool.Migrations.SqlServer/Migrations/PPMToolContextModelSnapshot.cs | Snapshot updated for InnateCodeTask.IsActive + EF version bump. |
| PPMTool.Migrations.SqlServer/Migrations/20260615153605_AddActiveFlagToTimesheetTask.Designer.cs | SQL Server migration designer for IsActive column. |
| PPMTool.Migrations.SqlServer/Migrations/20260615153605_AddActiveFlagToTimesheetTask.cs | SQL Server migration adding IsActive to InnateCodeTasks. |
| PPMTool.Migrations.Sqlite/Migrations/PPMToolContextModelSnapshot.cs | Snapshot updated for InnateCodeTask.IsActive + EF version bump. |
| PPMTool.Migrations.Sqlite/Migrations/20260615153309_AddActiveFlagToTimesheetTask.Designer.cs | SQLite migration designer for IsActive column. |
| PPMTool.Migrations.Sqlite/Migrations/20260615153309_AddActiveFlagToTimesheetTask.cs | SQLite migration adding IsActive to InnateCodeTasks. |
| PPMTool.Migrations.PostgreSql/Migrations/PPMToolContextModelSnapshot.cs | Snapshot updated for InnateCodeTask.IsActive + EF version bump. |
| PPMTool.Migrations.PostgreSql/Migrations/20260615153709_AddActiveFlagToTimesheetTask.Designer.cs | PostgreSQL migration designer for IsActive column. |
| PPMTool.Migrations.PostgreSql/Migrations/20260615153709_AddActiveFlagToTimesheetTask.cs | PostgreSQL migration adding IsActive to InnateCodeTasks. |
| PPMTool.Data/Entities/InnateCodeTask.cs | Refactors task entity to inherit from BaseBookableItem and expose FK. |
| PPMTool.Data/Entities/InnateCode.cs | Refactors code entity to inherit from BaseBookableItem; adds task deactivation helper. |
| PPMTool.Data/Entities/BaseBookableItem.cs | New shared base entity for “bookable” items with IsActive. |
Files not reviewed (3)
- PPMTool.Migrations.PostgreSql/Migrations/20260615153709_AddActiveFlagToTimesheetTask.Designer.cs: Generated file
- PPMTool.Migrations.SqlServer/Migrations/20260615153605_AddActiveFlagToTimesheetTask.Designer.cs: Generated file
- PPMTool.Migrations.Sqlite/Migrations/20260615153309_AddActiveFlagToTimesheetTask.Designer.cs: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
PhilBradbury
requested changes
Jun 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new abstraction for bookable items, adds an
IsActiveproperty to timesheet tasks, and updates both the backend and frontend to support managing and displaying active/inactive states for activities and tasks. It also ensures that timesheet submissions and UI interactions respect the new active status, preventing bookings to inactive items and disabling deletion for tasks in use.Core Data Model and Backend Changes:
BaseBookableItemto encapsulate common properties and methods for bookable entities, such asIsActiveandGetSensibleObjectName(), and refactoredInnateCodeandInnateCodeTaskto inherit from this base class. (PPMTool.Data/Entities/BaseBookableItem.cs,PPMTool.Data/Entities/InnateCode.cs,PPMTool.Data/Entities/InnateCodeTask.cs) [1] [2] [3] [4] [5] [6]IsActiveproperty to theInnateCodeTaskentity and created database migrations for PostgreSQL, SQL Server, and SQLite to support this new column. (PPMTool.Migrations.PostgreSql/Migrations/20260615153709_AddActiveFlagToTimesheetTask.cs,PPMTool.Migrations.SqlServer/Migrations/20260615153605_AddActiveFlagToTimesheetTask.cs,PPMTool.Migrations.Sqlite/Migrations/20260615153309_AddActiveFlagToTimesheetTask.cs, model snapshots) [1] [2] [3] [4] [5] [6]Frontend and UI Logic Updates:
PPMTool/Pages/AddInnateCode.razor,PPMTool/Pages/AddInnateCode.razor.cs) [1] [2] [3] [4] [5]Validation and Submission Enforcement:
PPMTool/Pages/AddTimesheet.razor.cs) [1] [2]Other Minor Changes:
PPMTool.Migrations.*) [1] [2] [3]PPMTool/App.razor)