openactive / customer-accounts-api

Repository for discussions broadly related to Customer Accounts
MIT License
0 stars 0 forks source link

`eligibleEntitlementType` within the `Offer` in the open feed, and associated controlled vocabulary #1

Open nickevansuk opened 3 years ago

nickevansuk commented 3 years ago

Proposal

In order to indicate which Offer is appropriate for a particular Entitlement Type, the eligibleEntitlementType property is used.

The Offer is applicable to the Customer if at least one of the Concepts in the eligibleEntitlementType array within the Offer matches that which a Broker has associated with the Customer.

The Entitlement SKOS vocabulary itself is maintained by the owner of the Membership Scheme.

Example

"offers": [
  {
    "@type": "Offer",
    "@id": "https://example.com/api/identifiers/facility-uses/1489/slots/14882#/offers/0",
    "identifier": "OX-AD",
    "name": "Adult",
    "price": 3.3,
    "priceCurrency": "GBP",
    "eligibleEntitlementType": [
      {
        "id": "https://data.mcractive.com/openactive/entitlement-list#12345",
        "type": "Concept",
        "prefLabel": "MCRactive Adult Non-resident",
        "inScheme": "https://data.mcractive.com/openactive/entitlement-list"
      }
    ]
  },
  {
    "@type": "Offer",
    "@id": "https://example.com/api/identifiers/facility-uses/1489/slots/14882#/offers/1",
    "identifier": "MCR2",
    "name": "MCRactive Junior Resident",
    "price": 2.1,
    "priceCurrency": "GBP",
    "ageRestriction": {
      "@type": "QuantitativeValue",
      "minValue": 50
    },
    "eligibleEntitlementType": [
      {
        "id": "https://data.mcractive.com/openactive/entitlement-list#5678",
        "type": "Concept",
        "prefLabel": "MCRactive Junior Resident",
        "inScheme": "https://data.mcractive.com/openactive/entitlement-list"
      }
    ]
  }
],
lukehesluke commented 2 years ago

@nickevansuk is there still the most recent proposal for offer entitlements?

I've seen Offers with Entitlements have this shape recently, and I'm wondering if this is a mistake on the part of this particular data source or just a consequence of changes that have been made outside of this issue.

{
  "@type": "Offer",
  /* Other Offer Fields... */
  "entitlement": [
    {
      "@id" : "https://mcractive.github.io/entitlements#41730e9d-e07b-4737-a0b8-5bd12fe6be79",
      "inScheme" : "https://mcractive.github.io/entitlements",
      "prefLabel" : "Adult Pay & Play MCR Non-Resident",
      "@type" : "Concept"
    },
    /* ...etc */
  ]
}

The difference is the field name from eligibleEntitlementType -> entitlement.

Thanks