Open APIs

 View Only
  • 1.  ProductRelationship

    TM Forum Member
    Posted Sep 11, 2019 02:19
    Edited by Shibin CK Sep 11, 2019 02:20
    Hi All,
    In the product inventory data model of Product, there's a productRelationship attribute. I'm confused about the type "bundled".
    Assume GSM is the parent product which has a SIM child product. Should it be modeled as
    1.
    {
    	"id": "P01",
    	"name": "GSM",
    	"productRelationship": [{
    		"type": "bundled",
    		"product": {
    			"id": "P02"
    		}
    	}]
    }
    
    {
    	"id": "P02",
    	"name": "SIM"
    }
    

    or
    2.

    {
    	"id": "P01",
    	"name": "GSM",
    
    }
    
    {
    	"id": "P02",
    	"name": "SIM"
    	"productRelationship": [{
    		"type": "bundled",
    		"product": {
    			"id": "P01"
    		}
    	}]
    }



    i.e. in type "bundled", does the parent point to child or child point to parent?


    ------------------------------
    Shibin CK
    Tecnotree
    ------------------------------


  • 2.  RE: ProductRelationship

    TM Forum Member
    Posted Sep 11, 2019 07:08
    Hi Shibin
    The parent product holds the relationship to the child.
    See the extract from TMF637 Product Inventory:

    ProductRelationship sub-resource
    Represents a relationship between products - which potentially holds an entire product object or a product reference (with partial content).
    Type of the product relationship. It can be : - "bundled" if the product is a bundle and you want to describe the "bundled" products inside this bundle

    Suggest you reach out to @Ludovic Robert (who leads this API) if you need more clarification.

    Hope it helps​

    ------------------------------
    Jonathan Goldberg
    Amdocs Management Limited
    ------------------------------



  • 3.  RE: ProductRelationship

    TM Forum Member
    Posted Sep 16, 2019 01:19

    Hi Jonathan,

    Thank you. I have a related question

     

    >> ProductRelationship sub-resource
    Represents a relationship between products - which potentially holds an entire product object or a product reference (with partial content).

     

    If we're holding the entire product object inside the parent like below

    {

    "id": "P01",

    "name": "GSM",

    "productRelationship": [{

    "type": "bundled",

    "product": {

    "id": "P02",

    "name": "SIM",

    "productOffering": {

      }

      ......

      // all the product attributes embedded

      ......

    }

    }]

    }

     

    Then

     

    GET /product/P01

    GET /product/P02

     

    1. Are both apis expected to return product objects especially P02?
    2. And in the first call to P01, should it return full embedded product or should it return with a reference to P02 or both are valid?  

     

     

    -shibin






  • 4.  RE: ProductRelationship

    TM Forum Member
    Posted Sep 18, 2019 03:42
    Hi Shibin

    I suggest to distinguish between the internal implementation of the product inventory and its external exposure in the API.
    • One can imagine that the inventory might be implemented in a relational database, in which case each Product would be a separate row in some Product SQL table, and the relationship would be implemented as a separate table with pointers (IDs) to the dependent and owning Product rows.
    • On the other hand, if the inventory was implemented in a NoSQL (e.g. Document) database, it is possible that each top-level Product would be implemented as a document, and containment relationships would be implemented as contained sub-resources withing the document. Non-containment relationships would be implemented by reference. But it is also possible that each Product could be done as a stand-alone document, with all relationships implemented by reference
    • And there could be additional implementation strategies 
    All of the above should be hidden from the API exposure - here it is perhaps up to the implementation to decide whether to expand relationships to full Product or only to ProductRef. But there can be a measure of control from the consumer, which can use expand directives to cause Ref entities to be expanded, please refer to the design guidelines for more on this.
    Hope it helps.

    ------------------------------
    Jonathan Goldberg
    Amdocs Management Limited
    ------------------------------