Skip to content

Conversation

@lanej
Copy link
Member

@lanej lanej commented Dec 5, 2025

Summary

Adds an optional details field to the Rate model to support dynamic metadata in API responses. This field enables flexible, feature-flag-driven data for specific carriers and shipment options, starting with Amazon's USPS Ship API integration.

Fixes SHPE-727

Changes

  • Add details field of type Map<String, String> to Rate class
  • Field is optional and null when not present in API responses
  • Fully backward compatible with existing code

API Example

{
  "id": "rate_...",
  "carrier": "USPS",
  "service": "Priority",
  "rate": "7.33",
  "details": {
    "some_string_key": "value",
    "another_key": "value"
  }
}

Access in Java:

Rate rate = shipment.getLowestRate();
Map<String, String> details = rate.getDetails(); // null if not present

Testing

  • All existing RateTest tests pass
  • Gson automatically handles serialization/deserialization
  • Lombok @Getter generates accessor method

Notes

Release constraint: Cannot be released before 2025-12-09 per Amazon integration timeline.

@lanej lanej requested review from a team as code owners December 5, 2025 20:15
@lanej lanej merged commit 3850550 into master Dec 5, 2025
24 checks passed
@lanej lanej deleted the feature/SHPE-727-add-details-to-rate branch December 5, 2025 20:24
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