Skip to content

Add relevant_text fields to Beacons struct with validation - #173

Merged
njausteve merged 1 commit into
mainfrom
63-add-relevanttext-field-for-beacons
Oct 6, 2024
Merged

njausteve merged 1 commit into
mainfrom
63-add-relevanttext-field-for-beacons

Conversation

@njausteve

Copy link
Copy Markdown
Owner

Type of Change

  • New feature

Description

This PR introduces the following changes:

  • Adds new fields minor, proximity_UUID (required), and relevant_text (optional) to the ExPass.Structs.Beacons module.
  • Updates validation logic to ensure minor is a 16-bit unsigned integer and proximity_UUID is a valid UUID.
  • Updates JSON encoding for the new fields, ensuring camel-cased field names are used.
  • Updates and adds new tests to cover the validation and struct creation process.

Testing

  • Unit tests have been added to ensure proper validation and encoding of the minor, proximity_UUID, and relevant_text fields.
  • Edge cases such as invalid UUID strings, negative integers, and exceeding integer limits are covered.
  • JSON encoding tests ensure correct camel-casing and handling of optional fields when they are nil.

Impact

  • These changes enhance the flexibility and safety of creating Beacons structs. By introducing the proximity_UUID field, beacon uniqueness is now enforced, allowing for better tracking and validation.
  • The validation logic in the ExPass.Utils.Validators module has been expanded to support field-specific error messages, improving debugging and error reporting.

Additional Information

No new dependencies were introduced. The changes remain backward-compatible with existing structures and should not affect existing behavior unless the newly added fields are used.

Checklist

  • My code adheres to the coding and style guidelines of the project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.

@njausteve njausteve linked an issue Oct 6, 2024 that may be closed by this pull request
@njausteve njausteve changed the title feat: Update proximity_UUID validation error message in ExPass.Utils.Validators module Add relevant_text fields to Beacons struct with validation Oct 6, 2024
@njausteve njausteve added this to the Add support for beacons milestone Oct 6, 2024
@njausteve
njausteve merged commit 823c35e into main Oct 6, 2024
@njausteve
njausteve deleted the 63-add-relevanttext-field-for-beacons branch October 6, 2024 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Add relevantText field for Beacons

1 participant