playfinder / openactive

A place to submit issues with the Bookteq Openactive feeds
0 stars 0 forks source link

Fix expansion of acceptedOffer and orderedItem, and Seller, for cases where OrderItem fails #2

Closed nickevansuk closed 6 days ago

nickevansuk commented 9 months ago

Currently when there's an error with an OrderItem, the following invalid response is returned.

acceptedOffer, orderedItem, and seller should be fully expanded for cases where there is an OrderItem error.

  "orderedItem": [
    {
      "@type": "OrderItem",
      "orderedItem": {
        "@type": "Slot",
        "@id": "/api/open-active/a63e6a0f-f10f-4ea7-ad18-848a4e551834/slots/213a06b1-43fd-5035-b45e-7e200faa2e4a",
        "identifier": "213a06b1-43fd-5035-b45e-7e200faa2e4a"
      },
      "acceptedOffer": {
        "@type": "Offer",
        "@id": "/api/open-active/offers/1707582600-616643d5-56f9-439a-9c6d-a73175d37b80",
        "identifier": "1707582600-616643d5-56f9-439a-9c6d-a73175d37b80"
      },
      "error": [
        {
          "@type": "OpportunityIsFullError",
          "description": "There are no spaces remaining in this opportunity"
        }
      ],
      "position": 0
    }
  ],

Failing test result below: availability-check_opportunity-full_OpenBookingSimpleFlow_IndividualFacilityUseSlot.md

Additionally, when multiple OrderItems are included in the booking, the first slot will return invalid data as above (but without the error), and one of the other slots appears to contain the error, as below:

nathansalter commented 7 months ago

This is improved now, but doesn't always return the correct information when it's not detectable

lukehesluke commented 6 days ago

The primary issue has been resolved here. The secondary problem is now in a separate issue: https://github.com/playfinder/openactive/issues/8, so I think this can be closed

nickevansuk commented 6 days ago

Great thanks @lukehesluke