Transform Data

by Ravindra Athreya

JavaScript

const testObject = {
    "status": "SUCCESS",
    "responseCode": "0000",
    "responseText": "Request processed successfully.",
    "totRecCnt": 2,
    "pricingBundleId": 7034,
    "pricingBundleName": "NewPricingModelBundle",
    "pricingModel": [
    {
    
        "modelType":"LICENSOR",
        "entityId": 20,
        "entityName": "WCM",
         "serviceTypeId": 1,
         "serviceTypeName": "iTunes Downloads",
         "contentGroupId": 3,
         "contentGroupName": "Music",
         "subscription": "PBS Living 1",
         "periodFrom": "201903",
         "periodTo": "201906",
         "currencyCode": "GBP",
         "pricing":{
            "rate":15.00,
            "perSubscriptionMinima":{
                "value":12.3750,
                "discount":33.3,
                "multiplier":"2x",
              },
         "ppr":0.0022,
         "mv":true,
        },
        "modelState": {
            "current":"ACTIVE",
            "future":"ACTIVE",
            "Change":"No"
        },
        "errorMessage":null
    },
    {
        "modelType":"LICENSOR",
        "entityId": 20,
        "entityName": "WCM",
         "serviceTypeId": 1,
         "serviceTypeName": "iTunes Downloads",
         "contentGroupId": 3,
         "contentGroupName": "Music",
         "subscription": "PBS Living 1",
         "periodFrom": "201906",
         "periodTo": "201909",
         "currencyCode": "GBP",
         "pricing":{
            "rate":15.00,
            "perSubscriptionMinima":{
                "value":12.3750,
                "discount":33.3,
                "multiplier":"2x",
              },
            "ppr":0.0022,
            "mv":true,
         },
        "modelState": {
            "current":"ACTIVE",
            "future":"ACTIVE",
            "Change":"No"
        },
         "errorMessage":null
      }],
      "comments": [{
        "comments": "Licensor Pricing Model",
        "createdBy":"999999000165712619",
        "createdDate":"20-03-2020"
       ...