Skip to content

Share default meter reading gap validation constant between client and server #1687

Description

@GoodKimchi

Summary

The Admin Preferences page still has an inconsistency between the frontend and backend validation for the Default Meter Reading Gap setting.

The frontend currently allows values beyond the backend limit, which can result in users submitting values that are only rejected after the request reaches the server.

Current behavior

  • The frontend effectively treats the maximum Reading Gap as unlimited.
  • The backend enforces a maximum value of 86400.
  • This creates inconsistent validation between the client and server.

Expected behavior

The frontend and backend should share the same validation constant so both enforce the same maximum Reading Gap value.

Proposed solution

Following the same pattern used for the file-size validation:

  • Add a shared Reading Gap validation constant to src/common/preferencesValidationConstants.
  • Replace the backend hardcoded value (86400) with the shared constant.
  • Update the frontend validation, input limits, and validation messages to use the same shared constant.

This keeps the validation logic consistent and prevents the frontend from accepting values that the backend will reject.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions