Skip to content

feat DF-527Add minimum precision validation for latitude and longitud…#235

Merged
mokhld merged 5 commits intomainfrom
feat-df-527-location-min-schema-changes
Nov 4, 2025
Merged

feat DF-527Add minimum precision validation for latitude and longitud…#235
mokhld merged 5 commits intomainfrom
feat-df-527-location-min-schema-changes

Conversation

@mokhld
Copy link
Contributor

@mokhld mokhld commented Nov 4, 2025

…e fields

  • Updated LatLongField to enforce a minimum decimal precision of 1 for latitude and longitude inputs.
  • Added corresponding test cases to ensure proper validation behavior for minimum precision in both LatLongField and NumberField components.

Proposed change

Jira ticket:

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Misc. (documentation, build updates, etc)

Checklist

  • You have executed this code locally and it performs as expected.
  • You have added tests to verify your code works.
  • You have added code comments and JSDoc, where appropriate.
  • There is no commented-out code.
  • You have added developer docs in README.md and docs/* (where appropriate, e.g. new features).
  • The tests are passing (npm run test).
  • The linting checks are passing (npm run lint).
  • The code has been formatted (npm run format).

…e fields

- Updated LatLongField to enforce a minimum decimal precision of 1 for latitude and longitude inputs.
- Added corresponding test cases to ensure proper validation behavior for minimum precision in both LatLongField and NumberField components.
…e fields

- Updated Easting and Northing fields to allow for increased digit lengths (6 for Easting and 7 for Northing).
- Added minLength and maxLength validations for Easting, Northing, Latitude, and Longitude fields.
- Introduced new test cases to validate the updated length requirements for these fields.
@mokhld mokhld force-pushed the feat-df-527-location-min-schema-changes branch from dea64e8 to 822043d Compare November 4, 2025 12:23
@mokhld mokhld marked this pull request as ready for review November 4, 2025 12:51
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 4, 2025

@mokhld mokhld merged commit 36c7edd into main Nov 4, 2025
11 checks passed
@mokhld mokhld deleted the feat-df-527-location-min-schema-changes branch November 4, 2025 13:10
'number.precision':
'{{#label}} must have no more than 7 decimal places',
'number.minPrecision':
'{{#label}} must have at least {{#minPrecision}} decimal place',
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo - 'place' -> 'places'

* @param maxLength - Maximum allowed string length
* @returns Object with validation result
*/
export function validateStringLength(
Copy link
Contributor

Choose a reason for hiding this comment

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

Will Joi not validate minLength/maxLength/precision/length through its own methods? Do we need these custom-written methods here?

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.

3 participants