Skip to content

feat(grpc): include UseOneMinuteIntervals on Site in GetRegistrationSites response#1573

Merged
renemadsen merged 1 commit into
stablefrom
feat/kiosk-use-one-minute-intervals-site-proto
May 13, 2026
Merged

feat(grpc): include UseOneMinuteIntervals on Site in GetRegistrationSites response#1573
renemadsen merged 1 commit into
stablefrom
feat/kiosk-use-one-minute-intervals-site-proto

Conversation

@renemadsen
Copy link
Copy Markdown
Member

Summary

  • Adds bool use_one_minute_intervals = 23; to the Site message in settings.proto and the matching UseOneMinuteIntervals property on the C# Infrastructure.Models.Settings.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.
  • 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.

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 after GetAssignedSite, which produces a brief window where the kiosk pause/start displays use the legacy 5-minute formula even for UseOneMinuteIntervals=true sites — the same class of bug closed for the admin web UI in #1566 / #1568 / #1572. Surfacing the flag on the Site list message removes that window. The companion flutter-time PR consumes this field directly.

Backwards compatibility

  • proto3 default-false: clients built against the old proto continue to deserialize the message and simply ignore the new field. Tablets that haven't been updated degrade gracefully to today's behavior (flag effectively false at the list stage, then corrected once GetAssignedSite returns).
  • Pure addition — no field renumbering, no removed fields, no changed types.
  • C# Site DTO gains one nullable-free bool UseOneMinuteIntervals { get; set; } (default false); no schema migration.
  • No change to the JSON/REST path, no change to web admin behavior.

Test plan

  • CI green (.NET build + Angular build + all Playwright shards)
  • Existing TimePlanningSettingsGrpcServiceTests.GetRegistrationSitesByCurrentUser_Success_MapsSitesToGrpcResponse extended to cover both UseOneMinuteIntervals=true and =false sites and assert the field round-trips through the gRPC mapper.
  • New test (or extension of the existing one) covering the token-based GetRegistrationSites handler, which currently has zero coverage — mocks ISettingService.GetAvailableSites and asserts the new field on the response.
  • Manual: kiosk-mode flutter-time against a host with one UseOneMinuteIntervals=true site and one =false site — confirm the list response carries use_one_minute_intervals for the right site (e.g. via grpcurl or the flutter-time debug log).
  • Manual: old (pre-proto-update) tablet builds still parse the response and display the site list (default-false fall-through).

…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>
Copilot AI review requested due to automatic review settings May 13, 2026 16:13
Copy link
Copy Markdown

Copilot AI left a comment

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 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_intervals to the Site message in settings.proto and UseOneMinuteIntervals to the C# Infrastructure.Models.Settings.Site DTO.
  • Populated Site.UseOneMinuteIntervals from AssignedSite.UseOneMinuteIntervals in TimeSettingService so 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);
@renemadsen renemadsen merged commit 6d4f6b8 into stable May 13, 2026
42 checks passed
@renemadsen renemadsen deleted the feat/kiosk-use-one-minute-intervals-site-proto branch May 13, 2026 16:49
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.

2 participants