robbrad / UKBinCollectionData

UK Council Bin Collection Data Parser Outputting Bin Data as a JSON
MIT License
127 stars 82 forks source link

Gedling Borough Council: Use alternative name for cleaner values #764

Closed jamesmacwhite closed 2 months ago

jamesmacwhite commented 3 months ago

Following #763. I noticed you are having to do some replace calls on the original name generated from the iCal. There's also a bug whereby certain values that are changed collections become Black Bin (Changed ) after the replace calls.

All JSON endpoints now provide an alternativeName value for any collection, which provides a modified name value which removes the "Day" or "(Changed Collection)" values, which is cleaner for this use case. This is automatically generated at build, allowing you to simplify your codebase.

Here's the new values of name vs alternativeName:

Name Alternative name
Black Bin Day (Changed Collection) Black Bin
Green Bin Day Green Bin
Green Bin + Glass Box Day Green Bin + Glass Box
Garden Waste Collection Garden Bin
{
      "name": "Black Bin Day",
      "alternativeName": "Black Bin",
      "weekday": "Friday",
      "isOccurrence": true,
      "type": "black-bin",
      "collectionDate": "2023-12-08",
      "isChangedCollection": false
}

Happy to adjust the tweak the format if needed. This PR updates the column being used to the new alternativeName key

I have also documented the JSON endpoints in full.

Hope it's useful!

codecov-commenter commented 2 months ago

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 87.98%. Comparing base (599f617) to head (f623bf0). Report is 670 commits behind head on master.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

:exclamation: There is a different number of reports uploaded between BASE (599f617) and HEAD (f623bf0). Click for more details.

HEAD has 4 uploads less than BASE | Flag | BASE (599f617) | HEAD (f623bf0) | |------|------|------| ||6|2|
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #764 +/- ## =========================================== - Coverage 98.61% 87.98% -10.64% =========================================== Files 2 3 +1 Lines 144 208 +64 =========================================== + Hits 142 183 +41 - Misses 2 25 +23 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

jamesmacwhite commented 2 months ago

I have fixed the commit message to clear the lint error.