Looking for assistance in restructuring this array to meet specific formatting requirements. Struggling to achieve the desired result on my own. The parent key should be named "type" and the subparent key should have a value of "category". Any suggestions or guidance would be greatly appreciated.
Suggesting beautifying the code for better visualization as it might not display properly here...
[{
"Labour": {
"Cleaners": {
"unitCost": 3409.5,
"markupValue": 18,
"totalCost": 3643.5
},
"Plumber": {
"unitCost": 309.0909,
"markupValue": 0,
"totalCost": 309.0909
}
}
},
{
"Material": {
"Cleaners": {
"unitCost": 450,
"markupValue": 5,
"totalCost": 475
},
"Plumber": {
"unitCost": 450,
"markupValue": 5,
"totalCost": 475
}
}
},
{
"Other": {
"Report Fee": {
"unitCost": 180,
"markupValue": 0,
"totalCost": 180
}
}
}
]
[{
"type": "Labour",
"category": "Cleaners",
"unitCost": 3409.5,
"markupValue": 18,
"totalCost": 3643.5
},
{
"type": "Labour",
"category": "Plumbers",
"unitCost": 3409.5,
"markupValue": 18,
"totalCost": 3643.5
},
{
"type": "Material",
"category": "Cleaners",
"unitCost": 450.5,
"markupValue": 0,
"totalCost": 5
},
{
"type": "Material",
"category": "Plumbers",
"unitCost": 450.5,
"markupValue": 0,
"totalCost": 5
}
]