Skip to content

1345 timesheet codes and tasks adjustments#1378

Open
aharwood2 wants to merge 23 commits into
devfrom
1345-timesheet-codes-and-tasks-adjustments
Open

1345 timesheet codes and tasks adjustments#1378
aharwood2 wants to merge 23 commits into
devfrom
1345-timesheet-codes-and-tasks-adjustments

Conversation

@aharwood2

Copy link
Copy Markdown
Member

This pull request introduces a new abstraction for bookable items, adds an IsActive property 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:

  • Introduced a new abstract base class BaseBookableItem to encapsulate common properties and methods for bookable entities, such as IsActive and GetSensibleObjectName(), and refactored InnateCode and InnateCodeTask to 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]
  • Added the IsActive property to the InnateCodeTask entity 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:

  • Updated the Add/Edit Innate Code page to allow toggling the active status for both activities and tasks. When an activity is deactivated, all its tasks are automatically deactivated. The UI now disables editing of a task's active status if its parent activity is inactive, and disables deletion for tasks that have existing bookings. (PPMTool/Pages/AddInnateCode.razor, PPMTool/Pages/AddInnateCode.razor.cs) [1] [2] [3] [4] [5]

Validation and Submission Enforcement:

  • Enhanced timesheet submission validation to prevent users from submitting timesheets with entries linked to inactive activities or tasks, and updated the UI to visually indicate inactive items. (PPMTool/Pages/AddTimesheet.razor.cs) [1] [2]

Other Minor Changes:

  • Updated migration model snapshots and product version annotations to reflect the new schema and EF Core version. (PPMTool.Migrations.*) [1] [2] [3]
  • Minor CSS cleanup in the authentication message. (PPMTool/App.razor)

@aharwood2 aharwood2 added this to the v1.14.1 milestone Jun 16, 2026
@aharwood2 aharwood2 self-assigned this Jun 16, 2026
@aharwood2 aharwood2 linked an issue Jun 16, 2026 that may be closed by this pull request
@github-actions

This comment has been minimized.

…45-timesheet-codes-and-tasks-adjustments-2026-06-16-07-30-05

Add License and Copyright Headers

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 (with IsActive) and refactored InnateCode / InnateCodeTask to 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.

Comment thread PPMTool/Services/TimesheetService.cs
Comment thread PPMTool/Pages/ManageInnateCodes.razor.cs Outdated
Comment thread PPMTool/Pages/AddTimesheet.razor.cs Outdated
Comment thread PPMTool/Pages/AddTimesheet.razor.cs Outdated
Comment thread PPMTool/Pages/ManageInnateCodes.razor Outdated
Comment thread PPMTool/Pages/AddInnateCode.razor Outdated
Comment thread PPMTool/Pages/AddInnateCode.razor.cs Outdated
Comment thread PPMTool/Services/BaseEntityService.cs Outdated
aharwood2 and others added 7 commits June 17, 2026 08:48
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>
@aharwood2 aharwood2 marked this pull request as ready for review June 17, 2026 08:19
Comment thread PPMTool/Pages/AddTimesheet.razor.cs Outdated
@aharwood2 aharwood2 requested a review from PhilBradbury June 17, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Timesheet codes and tasks adjustments

3 participants