fix product order creation with ref offering#96
fix product order creation with ref offering#96markendos wants to merge 6 commits intoFIWARE:mainfrom
Conversation
| "id" | ||
| ] | ||
| }, | ||
| "ProductOfferingRefValue": { |
There was a problem hiding this comment.
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.
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.
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.
Isn't that reverting the changes made here?
There was a problem hiding this comment.
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.
I think I managed to apply this in latest changes
| private URI href; | ||
|
|
||
| @Override | ||
| @JsonIgnore |
There was a problem hiding this comment.
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.
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.
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.