Here are the two different sets of data:
"statusCode": 200,
"data": [
{
"color": {
"id": "1111",
"name": null,
"hex": null,
"image": "\/img\/.jpg",
"subColors": [
{
"id": null,
"name": "White",
"hex": "#F5F4F8",
"image": null,
"subColors": []
},
{
"id": null,
"name": "Grey",
"hex": "#6c6f70",
"image": null,
"subColors": []
}
]
},
"articleVariants": [
{
"id": "941282",
"articleNumber": "1000204445",
"size": "68\/74"
}
]
}
]
and
{
"statusCode": 200,
"data": [
{
"article": 1000204445,
"ownStock": 3,
"supplierStock": 18,
"notice": null,
"nextAvailability": null,
"hasMoreOwnStock": false,
"ownStockText": "3"
}
]
}
The goal is to merge these responses based on the matching article numbers from "articleVariants.articleNumber" and the value of "article" from the second response.
This process aims to simplify the arrays for article numbers, where stock services can subscribe to these values, compare them with the requested article numbers, and return matching values mapped to the request.
If you have any tips on how to effectively merge these requests with the same values and map the new response accordingly, please share your insights as I am currently struggling with this task.