%dw 2.0
output application/json
var priorityMap = {
	LOW : "NOT_IMPORTANT",
	MEDIUM : "IMPORTANT",
	HIGH : "VERY_IMPORTANT"
}
---
in0 map {
	customerName: $.header.customerName,
	customerId: $.header.customerNumber as String,
	priority: priorityMap[($.header.priority)],
	lineItems: $.orderItems map {
		unitQuantity: $.quantity,
		productCode: $.productId as String,
		unitPrice: $.price
	}
}