openactive / modelling-opportunity-data

OpenActive Modelling Opportunity Data specification
https://www.openactive.io/modelling-opportunity-data/
Other
6 stars 6 forks source link

Primary Offer #116

Open nickevansuk opened 6 years ago

nickevansuk commented 6 years ago

Proposer

EMD

Use Case

Where multiple Offers are available for an Event, which price should be used to advertise the activity in a summary view (e.g. when only one price can be displayed)

Why is this not covered by existing properties?

Offers do not make it clear which offer is the primary offer, so the primary price to use for display is non-trivial to select.

Please provide a link to example data

"offers": [
  {
    "type": "Offer",
    "identifier": "OX-AD",
    "name": "Oxygen - Adult",
    "description": "Fitness Ride",
    "price": 5.2,
    "priceCurrency": "GBP",
    "genderRestriction": "http://openactive.io/ns#None"
  },
  {
    "type": "Offer",
    "identifier": "OX-JNR",
    "name": "Oxygen - Junior",
    "description": "Fitness Ride",
    "price": 4.2,
    "priceCurrency": "GBP",
    "ageRange": {
      "type": "QuantitativeValue",
      "minValue": 50
    },
    "genderRestriction": "http://openactive.io/ns#None"
  }
]

Investigation

Although there is an AggregateOffer type available, it does not provide additional information about a "primary" offer, unless it included in a repurposed price property, as below.

"offers": {
  "type": "AggregateOffer",
  "highPrice": 5.2,
  "price": 5.2, /* display price is here, based on the target age group of the activity */
  "lowPrice": 4.2,
  "priceCurrency": "GBP",
  "offerCount": 2,
  "offers": [
    {
      "type": "Offer",
      "identifier": "OX-AD",
      "name": "Oxygen - Adult",
      "description": "Fitness Ride",
      "price": 5.2,
      "priceCurrency": "GBP"
    },
    {
      "type": "Offer",
      "identifier": "OX-JNR",
      "name": "Oxygen - Junior",
      "description": "Fitness Ride",
      "price": 4.2,
      "priceCurrency": "GBP",
      "ageRange": {
        "type": "QuantitativeValue",
        "minValue": 50
      }
    }
  ]
}

Further investigation is required

nickevansuk commented 6 years ago

Given that an adult price and junior price will need to be present for consistent searching, filtering, and display across data feeds, the AggregateOffer could actually be used to represent this, especially if a large number of offers are available.

Suggest using ext:publicAdultPrice and ext:publicJuniorPrice consistent with publicAccess.

Also ext:membershipRequired if all .offer.eligibleCustomerType = "http://openactive.io/ns#Member" (see https://github.com/openactive/modelling-opportunity-data/issues/80)

"offers": {
  "type": "AggregateOffer",
  "ext:publicAdultPrice": 5.2,
  "ext:publicJuniorPrice": 4.2,
  "ext:membershipRequired": true,
  "priceCurrency": "GBP",
  "offers": [
    {
      "type": "Offer",
      "identifier": "OX-AD",
      "name": "Oxygen - Adult",
      "description": "Fitness Ride",
      "price": 5.2,
      "priceCurrency": "GBP"
    },
    {
      "type": "Offer",
      "identifier": "OX-JNR",
      "name": "Oxygen - Junior",
      "description": "Fitness Ride",
      "price": 4.2,
      "priceCurrency": "GBP",
      "ageRange": {
        "type": "QuantitativeValue",
        "minValue": 50
      }
    }
  ]
}
petewalker commented 6 years ago

This seems a little confusing? You’ve used ext:publicJuniorPrice to refer to a price available to over 50s in the example. Is it not better to use something like ext:publicConcessionPrice or similar?

Although, some activities could have multiple types of concession - but in that circumstance I guess you could just omit that property, or provide an array?

e.g. Students may get 10% off, over-50s get 20%

nickevansuk commented 6 years ago

Great spot, sorry my example was inconsistent, have edited. Should have been "Junior" instead of "Senior". As you say, concessions are complex, so probably worth ignoring for the first iteration.

The idea here is to provide the most common demographics (adults and kids), with simplified and relevant pricing, in a consistent location, for activity finders focussed on those audiences. Perhaps "senior" pricing could come later e.g. for Age UK.

What do you think?

civsiv commented 5 years ago

It would also be good if the primary adult and junior offers could have consistent identifiers. Currently we have this enumeration in code:

const PROVIDER_ADULT_PRICE_ID_MAP = {
  [PROVIDERS.ACTIVELIFE]: 'NMADT',
  [PROVIDERS.ACTIVENEWHAM]: 'Adult non-member',
  [PROVIDERS.BRITISHCYCLING]: 'Offer', // British Cycling weirdness because they only have one offer
  [PROVIDERS.CLASSFINDER]: 'Single session',
  [PROVIDERS.CLASSFINDERPRIVATE]: 'Single session',
  [PROVIDERS.ENGLANDATHLETICS]: 'SINGLE',
  [PROVIDERS.ENGLANDNETBALL]: 'Full price cost',
  [PROVIDERS.EVERYONEACTIVE]: 'OX-AD',
  [PROVIDERS.FUSION]: 'STAND',
  [PROVIDERS.GOODGYM]: 'Offer', // Goodgym weirdness because they only have one offer
  [PROVIDERS.LEISUREWORLD]: 'CASADULT',
  [PROVIDERS.LTA]: 'SINGLE',
  [PROVIDERS.MILLERTECH]: 'Single session',
  [PROVIDERS.MILLERTECHPRIVATE]: 'Single session',
  [PROVIDERS.NCC]: 'STAND',
  [PROVIDERS.OPENSESSIONS]: 'Adult',
  [PROVIDERS.OURPARKS]: 'Offer', // we assign only one offer to Our Parks sessions
  [PROVIDERS.SALFORDLEISURE]: 'Adult non-member',
  [PROVIDERS.SIXTEENTEN]: 'STAND',
  [PROVIDERS.VISIONRCL]: 'NONADULT',
};

const PROVIDER_JUNIOR_PRICE_ID_MAP = {
  [PROVIDERS.ACTIVELIFE]: 'NMJNR',
  [PROVIDERS.BRITISHCYCLING]: 'Offer', // British Cycling weirdness because they only have one offer
  [PROVIDERS.CLASSFINDER]: 'Single session',
  [PROVIDERS.CLASSFINDERPRIVATE]: 'Single session',
  [PROVIDERS.ENGLANDNETBALL]: 'Full price cost',
  [PROVIDERS.EVERYONEACTIVE]: 'OX-JNR',
  [PROVIDERS.FUSION]: 'NONJNR',
  [PROVIDERS.LEISUREWORLD]: 'CASJUNIOR',
  [PROVIDERS.MILLERTECH]: 'Single session',
  [PROVIDERS.MILLERTECHPRIVATE]: 'Single session',
  [PROVIDERS.OPENSESSIONS]: 'Child',
  [PROVIDERS.OURPARKS]: 'Offer', // we assign only one offer to Our Parks sessions
  [PROVIDERS.VISIONRCL]: 'NONJUNIOR',
};
civsiv commented 5 years ago

Hi all, is there any update on this?