playfinder / openactive

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

The FacilityUse feed should contain FacilityUses #11

Open lukehesluke opened 6 days ago

lukehesluke commented 6 days ago

At present, the FacilityUses feed (https://imin.strmln.uk/api/open-active/facility-uses) only shows IndividualFacilityUses.

Screenshot 2024-10-17 at 11 21 40

nickevansuk commented 5 days ago

Just to note that for the LTA the feed needs to be structured FacilityUse -> IndividualFacilityUse, rather than IndividualFacilityUse -> FacilityUse. The slots are all related to the IndividualFacilityUse already, so this change should only impact this feed, as it's a case of using the FacilityUse as the principle item type of the feed and including IndividualFacilityUse within it, as per the OpenActive Validator sample.

nathansalter commented 2 days ago

Just need to change the top-level to FacilityUse instead of IndividualFacilityUse

nickevansuk commented 1 day ago

And embed a simple IndividualFacilityUse inside it, which is identical, but with a different @id format. The IndividualFacilityUse @id must match the slots feed.

For example note the individualFacilityUse property inside FacilityUse below:

{
  "next": "https://imin.strmln.uk/api/open-active/facility-uses?afterTimestamp=1729066848677385&afterId=083a951d-b409-4e5b-be55-a07ce019b63a",
  "items": [
    {
      "state": "updated",
      "kind": "FacilityUse",
      "id": "68206132-9ea4-472b-90e5-3b3968c45f12",
      "modified": 1728404887538436,
      "data": {
        "@type": "FacilityUse",
        "@context": [
          "https://openactive.io/",
          "https://openactive.io/ns-beta"
        ],
        "@id": "https://imin.strmln.uk/api/open-active/a7533eed-b15c-469f-a05f-604737b9acd5/facility-uses/68206132-9ea4-472b-90e5-3b3968c45f12",
        "identifier": "68206132-9ea4-472b-90e5-3b3968c45f12",
        "name": "Badminton A",
        "url": "https://imin.strmln.uk/api/open-active/place/a7533eed-b15c-469f-a05f-604737b9acd5",
        "facilityType": [
          {
            "@type": "Concept",
            "@id": "https://openactive.io/facility-types#da364f9b-8bb2-490e-9e2f-1068790b9e35",
            "inScheme": "https://openactive.io/facility-type",
            "prefLabel": "Sports Hall"
          }
        ],
        "individualFacilityUse": [
          {
            "@type": "IndividualFacilityUse",
            "@id": "https://imin.strmln.uk/api/open-active/a7533eed-b15c-469f-a05f-604737b9acd5/individual-facility-uses/68206132-9ea4-472b-90e5-3b3968c45f12",
            "name": "Badminton A"
          }
        ],
        "location": {
          "@type": "Place",
          "@id": "https://imin.strmln.uk/api/open-active/place/a7533eed-b15c-469f-a05f-604737b9acd5",
          "name": "Test Venue",
          "address": {
            "@type": "PostalAddress",
            "addressCountry": "GB",
            "addressRegion": "Lincoln",
            "addressLocality": "North East Lincolnshire",
            "postalCode": "IM11 1NN",
            "streetAddress": "Immingham"
          },
          "geo": {
            "@type": "GeoCoordinates",
            "latitude": 53.614012,
            "longitude": -0.215913
          }
        },
        "provider": {
          "@type": "Organization",
          "@id": "https://imin.strmln.uk/api/open-active/place/a7533eed-b15c-469f-a05f-604737b9acd5",
          "name": "Test Venue",
          "isOpenBookingAllowed": true,
          "taxMode": "https://openactive.io/TaxGross"
        }
      }
    }