I have two JSON objects (displayed here with JSON.stringify(array of objects)) GPRows data is
[
{
"shopName":"Testing One",
"state":"NSW",
"yearMonth":"20203",
"id":29,
"shopId":1,
"paintSale":80000,
"panelSale":80000,
"partsSale":80000,
"otherSale":80000,
"paintCost":80000,
"panelCost":80000,
"partsCost":80000,
"otherCost":80000,
"panelWages":80000,
"paintWages":80000,
"depreciation":80000,
"forecastedSales":80000,
"expenses":80001
},
{
"shopName":"Not yours",
"state":"SA",
"yearMonth":"20204",
"id":28,
"shopId":2,
"paintSale":85000,
"panelSale":80000,
"partsSale":80000,
"otherSale":80000,
"paintCost":80000,
"panelCost":80000,
"partsCost":80000,
"otherCost":80000,
"panelWages":80000,
"paintWages":80000,
"depreciation":80000,
"forecastedSales":80000,
"expenses":80000
},
{
"shopName":"Testing One",
"state":"NSW",
"yearMonth":"20201",
"id":31,
"shopId":1,
"paintSale":75000,
"panelSale":75000,
"partsSale":75000,
"otherSale":75000,
"paintCost":60000,
"panelCost":42000,
"partsCost":45000,
"otherCost":20000,
"panelWages":75000,
"paintWages":75000,
"depreciation":75000,
"forecastedSales":75000,
"expenses":75000
}
]
and
BudgetTargets data is
[
{
"shopName":"Testing One",
"state":"NSW",
"yearMonth":"20202",
"shopId":1,
"sales":487500,
"costs":80000,
"expenses":90000,
"netprofit":25000,
"arc":2100,
"numVehicles":232,
"ppv":108,
"wagesperc":10,
"gPperc":40
},
{
"shopName":"Not yours",
"state":"SA",
"yearMonth":"20204",
"shopId":2,
"sales":487500,
"costs":80000,
"expenses":90000,
"netprofit":25000,
"arc":2100,
"numVehicles":232,
"ppv":108,
"wagesperc":10,
"gPperc":40
}
]
I am considering mapping them based on yearMonth and shopId or creating a function to query BudgetTargets value for specific entries in my Angular *ngFor loop of the GPRows array