assessment data entry improvements - #181
Merged
markdav-is merged 2 commits intoJul 23, 2026
Merged
Conversation
Assessments were hard-blocked based on DateTime.UtcNow and a hardcoded 14/30-day cohort-year rule, which broke bulk/historical data entry. Replace with a non-blocking inline warning comparing the entered Assessment Date against the grower's existing assessments, using a new per-cohort AssessmentFrequencyDays setting instead of the hardcoded split. Fixes #180 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Introduce non-blocking, per-cohort assessment frequency warning: - Add AssessmentFrequencyDays to Cohort model, DB, and migration - Update Cohort Edit form with validated frequency field - Show live warning on Assessment Edit for date proximity/duplicates - Server blocks only exited/inactive growers, not frequency - Preserve filter state via query string on assessment add - Move service interfaces to separate files; refactor for Blazor - Improve localization (en, ts) and accessibility for new UI - Remove Oqtane/system tables from SQL project file - Update test plan for migration, UI, and accessibility scenarios
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds per-cohort assessment-frequency configuration and shifts “too-soon” assessment checks from a server-side submission block to a non-blocking, live client-side proximity warning, while also refactoring shared service interfaces and cleaning up SQL project artifacts.
Changes:
- Added
AssessmentFrequencyDays(default 30) to Cohort model/schema plus an idempotent migration script. - Replaced server-side assessment-frequency hard stop with a client-side proximity warning on Assessment Edit (keeping the exited/inactive grower hard stop).
- Split Cohort/Village/TreeType service interfaces into
Shared/Servicesand updated controllers/DI/client services accordingly, plus related UX and localization updates.
Reviewed changes
Copilot reviewed 73 out of 73 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Sql/Sql.sqlproj | Remove many table script includes from the SQL project (project cleanup). |
| Sql/Scripts/Migration_AddAssessmentFrequencyDaysToCohort.sql | Add idempotent migration to introduce AssessmentFrequencyDays. |
| Sql/dbo/Tables/Visitor.sql | Remove redundant table DDL from repo. |
| Sql/dbo/Tables/UserRole.sql | Remove redundant table DDL from repo. |
| Sql/dbo/Tables/User.sql | Remove redundant table DDL from repo. |
| Sql/dbo/Tables/UrlMapping.sql | Remove redundant table DDL from repo. |
| Sql/dbo/Tables/Theme.sql | Remove redundant table DDL from repo. |
| Sql/dbo/Tables/Tenant.sql | Remove redundant table DDL from repo. |
| Sql/dbo/Tables/SiteTask.sql | Remove redundant table DDL from repo. |
| Sql/dbo/Tables/SiteGroupMember.sql | Remove redundant table DDL from repo. |
| Sql/dbo/Tables/SiteGroup.sql | Remove redundant table DDL from repo. |
| Sql/dbo/Tables/Site.sql | Remove redundant table DDL from repo. |
| Sql/dbo/Tables/Setting.sql | Remove redundant table DDL from repo. |
| Sql/dbo/Tables/SearchWord.sql | Remove redundant table DDL from repo. |
| Sql/dbo/Tables/SearchContentWord.sql | Remove redundant table DDL from repo. |
| Sql/dbo/Tables/SearchContentProperty.sql | Remove redundant table DDL from repo. |
| Sql/dbo/Tables/SearchContent.sql | Remove redundant table DDL from repo. |
| Sql/dbo/Tables/Role.sql | Remove redundant table DDL from repo. |
| Sql/dbo/Tables/Profile.sql | Remove redundant table DDL from repo. |
| Sql/dbo/Tables/Permission.sql | Remove redundant table DDL from repo. |
| Sql/dbo/Tables/PageModule.sql | Remove redundant table DDL from repo. |
| Sql/dbo/Tables/Page.sql | Remove redundant table DDL from repo. |
| Sql/dbo/Tables/Notification.sql | Remove redundant table DDL from repo. |
| Sql/dbo/Tables/ModuleDefinition.sql | Remove redundant table DDL from repo. |
| Sql/dbo/Tables/Module.sql | Remove redundant table DDL from repo. |
| Sql/dbo/Tables/Log.sql | Remove redundant table DDL from repo. |
| Sql/dbo/Tables/Language.sql | Remove redundant table DDL from repo. |
| Sql/dbo/Tables/JobLog.sql | Remove redundant table DDL from repo. |
| Sql/dbo/Tables/Job.sql | Remove redundant table DDL from repo. |
| Sql/dbo/Tables/HtmlText.sql | Remove redundant table DDL from repo. |
| Sql/dbo/Tables/Folder.sql | Remove redundant table DDL from repo. |
| Sql/dbo/Tables/File.sql | Remove redundant table DDL from repo. |
| Sql/dbo/Tables/Cohort.sql | Add AssessmentFrequencyDays column (default 30). |
| Sql/dbo/Tables/AspNetUserTokens.sql | Remove redundant table DDL from repo. |
| Sql/dbo/Tables/AspNetUsers.sql | Remove redundant table DDL from repo. |
| Sql/dbo/Tables/AspNetUserPasskeys.sql | Remove redundant table DDL from repo. |
| Sql/dbo/Tables/AspNetUserLogins.sql | Remove redundant table DDL from repo. |
| Sql/dbo/Tables/AspNetUserClaims.sql | Remove redundant table DDL from repo. |
| Sql/dbo/Tables/Alias.sql | Remove redundant table DDL from repo. |
| Sql/dbo/Tables/__EFMigrationsHistory.sql | Remove redundant table DDL from repo. |
| Specs/Plans/test-plan-issue-180-assessment-date-proximity-warning.md | Add manual browser test plan for Issue #180 behavior. |
| Specs/Features/GardenAssessment.feature | Update Gherkin documentation from hard stop to proximity warning scenarios. |
| Shared/Services/IVillageService.cs | Introduce shared Village service interface. |
| Shared/Services/ITreeTypeService.cs | Introduce shared TreeType service interface. |
| Shared/Services/ICohortService.cs | Introduce shared Cohort service interface + clearer method naming. |
| Shared/Models/Cohort.cs | Add AssessmentFrequencyDays property (default 30). |
| Server/Services/VillageService.cs | Remove embedded interface; rely on shared interface. |
| Server/Services/TreeTypeService.cs | Remove embedded interface; rely on shared interface. |
| Server/Services/CohortService.cs | Remove embedded interface; rename methods to match new shared interface. |
| Server/Services/AssessmentService.cs | Remove frequency hard-stop logic from CanSubmitAssessmentAsync. |
| Server/Controllers/VillageController.cs | Add hasassociateddata endpoint with controller-boundary error handling. |
| Server/Controllers/CohortController.cs | Update to new Cohort service method names/signatures. |
| Client/Startup/VillageClientStartup.cs | Guard DI against double-registration in Blazor Server hosting. |
| Client/Startup/TreeTypeClientStartup.cs | Guard DI against double-registration in Blazor Server hosting. |
| Client/Startup/TrainingClientStartup.cs | Guard DI against double-registration in Blazor Server hosting. |
| Client/Startup/OrchardClientStartup.cs | Guard DI against double-registration in Blazor Server hosting. |
| Client/Startup/MentorClientStartup.cs | Guard DI against double-registration in Blazor Server hosting. |
| Client/Startup/EnrollmentClientStartup.cs | Guard DI against double-registration (multiple services). |
| Client/Startup/CohortClientStartup.cs | Guard DI against double-registration in Blazor Server hosting. |
| Client/Startup/AssessmentClientStartup.cs | Guard DI against double-registration in Blazor Server hosting. |
| Client/Services/VillageService.cs | Remove embedded interface; add HasAssociatedDataAsync API call. |
| Client/Services/TreeTypeService.cs | Remove embedded interface; rely on shared interface. |
| Client/Services/CohortService.cs | Remove embedded interface; rely on shared interface. |
| Client/Resources/OpenEug.TenTrees.Module.Cohort/Edit.ts-ZA.resx | Add localization for new Cohort frequency field + ActivatedOn hint. |
| Client/Resources/OpenEug.TenTrees.Module.Cohort/Edit.resx | Add localization for new Cohort frequency field + ActivatedOn hint. |
| Client/Resources/OpenEug.TenTrees.Module.Assessment/Edit.ts-ZA.resx | Add new warning/error message keys and dropdown labels in ts-ZA. |
| Client/Resources/OpenEug.TenTrees.Module.Assessment/Edit.resx | Add new warning/error message keys and dropdown labels in English. |
| Client/Modules/Enrollment/Index.razor | Refactor row class and village loading logic for clarity. |
| Client/Modules/Cohort/ModuleInfo.cs | Bump Cohort module version and release list. |
| Client/Modules/Cohort/Edit.razor | Add required AssessmentFrequencyDays input and editable ActivatedOn with hint text. |
| Client/Modules/Assessment/ModuleInfo.cs | Bump Assessment module version and release list. |
| Client/Modules/Assessment/Index.razor | Preserve/add filters to Add flow via returnurl parameters. |
| Client/Modules/Assessment/Edit.razor | Add village/cohort selectors (Add), implement live proximity warning, keep hard-stop only for ineligible growers. |
Comment on lines
22
to
+24
| public DateTime? ActivatedOn { get; set; } | ||
|
|
||
| public int AssessmentFrequencyDays { get; set; } = 30; |
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.
PR Classification
New feature and code cleanup to support per-cohort assessment frequency configuration and improve assessment date validation UX.
PR Summary
Introduces a configurable Assessment Frequency field for cohorts, moves frequency validation to a client-side warning, and refactors service interfaces for clarity.
.resxfor new labels and warnings.