feat(grpc): include UseOneMinuteIntervals on Site in GetRegistrationSites response#1573
Merged
renemadsen merged 1 commit intoMay 13, 2026
Merged
Conversation
…ites response Adds bool use_one_minute_intervals = 23 to the Site message in settings.proto and the matching UseOneMinuteIntervals property on the C# Site DTO. Populates the new field from AssignedSite.UseOneMinuteIntervals in both GetAvailableSites (token path) and GetAllRegistrationSitesByCurrentUser (personal/JWT path) inside TimeSettingService, so the gRPC handler maps it through automatically. Also fills the field in GetResignedSites for symmetry across the three site-builders. Mobile clients (flutter-time kiosk mode) can now select the correct site-level minute-precision behavior at the registration step, before any GetAssignedSite call is made. Extends TimePlanningSettingsGrpcServiceTests GetRegistrationSitesByCurrentUser_Success_MapsSitesToGrpcResponse to cover both UseOneMinuteIntervals=true and =false sites and assert the field round-trips through the gRPC mapper. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR extends the TimePlanning settings gRPC contract so site lists returned by GetRegistrationSites and GetRegistrationSitesByCurrentUser include the site-level UseOneMinuteIntervals flag, enabling kiosk/mobile clients to render minute-precision behavior correctly before fetching AssignedSite.
Changes:
- Added
use_one_minute_intervalsto theSitemessage insettings.protoandUseOneMinuteIntervalsto the C#Infrastructure.Models.Settings.SiteDTO. - Populated
Site.UseOneMinuteIntervalsfromAssignedSite.UseOneMinuteIntervalsinTimeSettingServiceso both token-based and JWT-based flows carry the value through. - Updated gRPC mapping and extended the existing gRPC service test to assert the field is mapped for the “current user” path.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Services/TimePlanningSettingService/TimeSettingService.cs | Sets Site.UseOneMinuteIntervals from AssignedSite.UseOneMinuteIntervals when building site lists. |
| eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Services/GrpcServices/TimePlanningSettingsGrpcService.cs | Maps UseOneMinuteIntervals into the gRPC Site response for both registration-site endpoints. |
| eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Protos/settings.proto | Adds bool use_one_minute_intervals = 23; to the Site message. |
| eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Infrastructure/Models/Settings/Site.cs | Adds bool UseOneMinuteIntervals to the server-side Site DTO. |
| eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn.Test/GrpcServices/TimePlanningSettingsGrpcServiceTests.cs | Extends existing test assertions to cover UseOneMinuteIntervals for the JWT/current-user gRPC path. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
264
to
271
| SnapshotEnabled = site.SnapshotEnabled, | ||
| Resigned = site.Resigned, | ||
| ResignedAtDate = Timestamp.FromDateTime( | ||
| DateTime.SpecifyKind(site.ResignedAtDate, DateTimeKind.Utc)), | ||
| PhoneNumber = site.PhoneNumber ?? "", | ||
| UseOneMinuteIntervals = site.UseOneMinuteIntervals, | ||
| }; | ||
| response.Model.Add(grpcSite); |
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.
Summary
bool use_one_minute_intervals = 23;to theSitemessage insettings.protoand the matchingUseOneMinuteIntervalsproperty on the C#Infrastructure.Models.Settings.SiteDTO.AssignedSite.UseOneMinuteIntervalsin bothGetAvailableSites(token path) andGetAllRegistrationSitesByCurrentUser(personal/JWT path) insideTimeSettingService, so the gRPC handler maps it through automatically.GetAssignedSitecall is made.Why now
In kiosk mode the flutter-time app lists registration sites and only later fetches per-site
AssignedSite. While that list is displayed (and when the worker taps to start/stop), the UI needs to know whether to render exact-minute or 5-minute-quantized values for that site's pause and actual start/stop. Today the flag is only available afterGetAssignedSite, which produces a brief window where the kiosk pause/start displays use the legacy 5-minute formula even forUseOneMinuteIntervals=truesites — the same class of bug closed for the admin web UI in #1566 / #1568 / #1572. Surfacing the flag on theSitelist message removes that window. The companion flutter-time PR consumes this field directly.Backwards compatibility
falseat the list stage, then corrected onceGetAssignedSitereturns).SiteDTO gains one nullable-freebool UseOneMinuteIntervals { get; set; }(defaultfalse); no schema migration.Test plan
TimePlanningSettingsGrpcServiceTests.GetRegistrationSitesByCurrentUser_Success_MapsSitesToGrpcResponseextended to cover bothUseOneMinuteIntervals=trueand=falsesites and assert the field round-trips through the gRPC mapper.GetRegistrationSiteshandler, which currently has zero coverage — mocksISettingService.GetAvailableSitesand asserts the new field on the response.UseOneMinuteIntervals=truesite and one=falsesite — confirm the list response carriesuse_one_minute_intervalsfor the right site (e.g. viagrpcurlor the flutter-time debug log).