-
Notifications
You must be signed in to change notification settings - Fork 11
fix product order creation with ref offering #96
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
base: main
Are you sure you want to change the base?
Conversation
| "id" | ||
| ] | ||
| }, | ||
| "ProductOfferingRefValue": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not change the api.json files. They are the orginals from TMForum and only here for convinience.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could not find another way autogenrate VO classes for the ProductOfferingRefValue class so it matches this type (needed in order for testing to assert equality).
Can you provide an alternative approach?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think I know understand the issue. When being translated to NGSI-LD, the reference needs to be treated as a relationship, not as a plain entity. Therefor the domain objects needs to be handled differnetly. See ProductOfferingRef, you might be able to just reuse it. Essentially, the library needs to knwo that this is a relationship, not just an attribute to be embedded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't that reverting the changes made here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you are wanting to reference an entity here, it should. The change there might not be required at all anymore, due to the changes in translation to NGSI-LD since then. I need to have a deeper look into that, but for your case, we want that to behave as a relationship and a real entity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I managed to apply this in latest changes
| private URI href; | ||
|
|
||
| @Override | ||
| @JsonIgnore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think that its a good solution to ignore it. We most likely need to change that class to provide the actual referenced type. The List.of("") is not correct, it needs to provide the type of the actual referenced entity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure of a good approach here since ReferenceValue is used both as an extension class (RelatedPartyRefValue, ProductOfferingRefValue and directly for attribute typing here and here. Therefore, ReferenceValue cannot be, for instance, abstract.
Could you provide some insight?
| .productOfferingQualificationItem(null) | ||
| .quoteItem(null); | ||
|
|
||
| /** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have direct access to the broker, therefor can create anything in the context you want;) See for example https://github.com/FIWARE/tmforum-api/blob/main/customer-bill-management/src/test/java/org/fiware/tmforum/customerbillmanagement/CustomerBillApiIT.java#L80
51b1c1e to
84adee6
Compare
This PR fixes issue described here by correctly mapping the attributes in the
ReferenceValue.javaclass.