Как отфильтровать массив обьектов по нескольким значениям, включающие в себя и дочерние значения

Есть вот такой json, мне нужно отфильтровать обьекты по:

  1. по статусу (active),
  2. по items[0].deliveryAddress.countryCode, если countryCode и дата одинаковые в разных обьектах нужна вернуть только первый То есть исходя из прилоденного json, мне нужно получить три обьекта с id: 21, id: 22 и с id: 54 Обьект с id: 2323 нужно убрать так как у него дата и countryCode одинаковые а так же убрать обьект со статусом "unsuccessful"
"awards": [
        {
          "id": "21",
          "status": "active",
          "statusDetails": "",
          "description": "",
          "date": "2020",
          "items": [
            {
              "id": "1",
              "unit": {
                "value": {
                  "amount": 12.2,
                  "currency": "USD"
                }
              },
              "deliveryAddress": {
                "countryCode": "ua",
                "region": ""
              }
            }
          ]
        },
        {
          "id": "2323",
          "status": "active",
          "statusDetails": "",
          "description": "",
          "date": "2020",
          "items": [
            {
              "id": "1",
              "unit": {
                "value": {
                  "amount": 12.2,
                  "currency": "USD"
                }
              },
              "deliveryAddress": {
                "countryCode": "ua",
                "region": ""
              }
            }
          ]
        },
        {
          "id": "22",
          "status": "active",
          "statusDetails": "",
          "description": "",
          "date": "2019",
          "items": [
            {
              "id": "2",
              "unit": {
                "value": {
                  "amount": 12.2,
                  "currency": "USD"
                }
              },
              "deliveryAddress": {
                "countryCode": "ua",
                "region": ""
              }
            }
          ]
        },
        {
          "id": "54",
          "status": "active",
          "statusDetails": "",
          "description": "",
          "date": "2020",
          "items": [
            {
              "id": "1",
              "unit": {
                "value": {
                  "amount": 12.9,
                  "currency": "USD"
                }
              },
              "deliveryAddress": {
                "countryCode": "kz",
                "region": ""
              }
            }
          ]
        },
        {
          "id": "7654",
          "date": "",
          "status": "unsuccessful",
          "statusDetails": "",
          "description": "",
          "items": [
            {
              "id": "",
              "unit": {
                "value": {
                  "amount": 12.2,
                  "currency": "USD"
                }
              },
              "deliveryAddress": {
                "countryCode": "kz",
                "region": ""
              }
            }
          ]
        }
      ],

Ответы (0 шт):