gladstonemrm / FusionLifestyle

Issues relating to open data from Fusion Lifestyle
0 stars 0 forks source link

Clarification on cost selection rules when a single cost must be displayed #13

Closed alza-bitz closed 5 years ago

alza-bitz commented 7 years ago

When viewed in the Fusion Android app, the instance of activity B16CLST0800915 with RPDE id 610057561 is displayed with the single cost £6.60.

When implementing rules to process the RPDE data, it would be desirable to implement the same rules as the Fusion Android app for deriving which cost to display, in cases where a single cost must be displayed.

The RPDE data associated with the above is:

    {
      "state": "updated",
      "kind": "session",
      "id": 610057561,
      "modified": 52396,
      "data": {
        "activityGroup": "Yoga And Pilates Classes",
        "siteName": "Braintree Swimming and Fitness",
        "address": "Charter Way",
        "postcode": "CM77 8YJ",
        "telephone": "01376 333 833",
        "website": "www.fusion-lifestyle.com/centres/Braintree_Swimming_Centre/Contact#formTop",
        "title": "Beginners Yoga Sat 08.00",
        "startDateTime": "2017-03-18T08:00:00Z",
        "endDateTime": "2017-03-18T08:59:59Z",
        "gender": "mixed",
        "adultAllowed": true,
        "juniorAllowed": false,
        "seniorAllowed": true,
        "adultCost": "£0.00",
        "juniorCost": "£6.60",
        "seniorCost": "£6.60",
        "availability": "available",
        "onSiteLocation": [
          "Studio"
        ],
        "description": "",
        "imageURL": "",
        "richTitle": "",
        "level": "",
        "activityID": "B16CLST0800915",
        "activityDuration": 60,
        "bookingID": 610057561
      }

My question is, what rules are employed to determine that the juniorCost or seniorCost be displayed for this item, in preference to the adultCost, even though adultAllowed is true in this instance?

MeganHennessy commented 7 years ago

Looking back at the data history we've sent for this record I can't see where the adult cost was set to zero. Are there any other examples? The prices and flags are set if the standard, non-member prices have been set as bookable per activity. So adult bookable/price will be the standard non-member price level. Non-member concession is the senior price; and non-member junior will be the junior price/flag. I have noticed there are some bookable juniors coming though (for example activity id B11CLP110300916) where it is bookable for juniors but no price is set. This would be a data entry issue. I've now restricted the flags to where the price is >0 so you should not see this behaviour going forward. There is one exception, id 850087391, which I've flagged with the system administrator.

alza-bitz commented 7 years ago

Hi @MeganHennessy,

Thanks for the response. To check the effect of the changes you've made, I just walked the entire Fusion dataset (at 2017-03-20T15:42:00Z approx), and I'm still getting lots of £0.00 for adultCost where adultAllowed is true (475 out of 1529 total to be precise).

Unless I've misunderstood something, I am expecting the count for this combination to be zero?

Thanks,

Alex.

MeganHennessy commented 7 years ago

Hi Alex,

That doesn't sound right to me. I'm attaching the full data set that is currently available in the underlying database. I can't see any adult flags without prices? Can you please check on your end - if it's still not right we might need to check the web function with Thanos. The code I can see looks ok but that was from a week or so ago. imin-opendata20mar2017.xlsx

alza-bitz commented 7 years ago

Hi @MeganHennessy

Here's a summary of the differences between your attached spreadsheet and the RPDE

Item RPDE XLSX
Snapshot Datetime 2017-03-20T15:42:00Z 2017-03-20T???
Total 1529 1528
adultAllowed = true 1056 1058
adultAllowed = false 467 470
adultAllowed = true and adultCost = £0.00 475 0
adultAllowed = false and adultCost = £0.00 311 470

As you can see there is a discrepancy with adultAllowed counts where adultCost is £0.00.

Please could you check the Azure function with Thanos and/or @nickevansuk ?

Thanks,

Alex.

FusionLifestyle commented 7 years ago

The data that we publish contains this records:

image

FusionLifestyle commented 7 years ago

I corrected an code error.

alza-bitz commented 7 years ago

Hi @MeganHennessy @FusionLIfestyle thanks for the fix.

To verify the fix, I walked the entire Fusion dataset again (at 2017-03-21T12:40:00Z approx), and I got zero instances of £0.00 for adultCost where adultAllowed is true.

So this is verified as fixed from our side.

Thanks,

Alex.