You are tasked with writing a function to process an array of orders. Each order contains information about the customer, the items in the order, and its status. Your goal is to extract and restructure this data to create a summary for each order.
Your function should extract the orderId
, customer's name (customerName
), and status
for each order. For each item in the order, rename productName
to itemName
and quantity
to itemQuantity
. Then create a summary object for each order containing the orderId
, customerName
, status
, and a list of items with their itemName
and itemQuantity
and finally log the summary of each order.