I have an array of objects. In each object there is an id property and an array property called rates. I would to reduce this object such t