Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map product_id for a Product #761

Merged
merged 2 commits into from
Apr 7, 2021
Merged

Map product_id for a Product #761

merged 2 commits into from
Apr 7, 2021

Conversation

niallzato
Copy link
Contributor

As per below we do not check to see if a product_id is present and only map for id
#746

@@ -422,7 +423,7 @@ public String name() {
}

public String id() {
return getString(ID_KEY);
return getString(ID_KEY) != null ? getString(ID_KEY) : getString(PRODUCT_ID_KEY);
Copy link
Contributor

Choose a reason for hiding this comment

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

question: do u think we should give first preference to product_id and then fall back to id or vice versa?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My thinking was to give preference to id over product_id. This should not introduce any changes if a customer is sending both id and product_id. If a customer is sending both values you'd expect those values to be the same but you never know!

Copy link
Contributor

Choose a reason for hiding this comment

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

sounds good

@@ -197,5 +197,9 @@ class PropertiesTest {
assertThat(product.name()).isNull()
product.putName("name")
assertThat(product.name()).isEqualTo("name")

product.remove("id")
Copy link
Contributor

Choose a reason for hiding this comment

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

🔥

@niallzato niallzato merged commit b089df7 into master Apr 7, 2021
@prayansh prayansh deleted the niall/map_product_id branch April 9, 2021 00:32
@prayansh prayansh mentioned this pull request May 3, 2021
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