Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix republicservices holliday collection #1431

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

5ila5
Copy link
Collaborator

@5ila5 5ila5 commented Nov 19, 2023

fix for #1430

Not sure why it was implemented the other way in the first place but the old holiday check implementation seems to behave wrongly.

@dt215git did I miss something? I think there must be a reason you checked for a holliday in the past 5 days

@5ila5 5ila5 linked an issue Nov 19, 2023 that may be closed by this pull request
7 tasks
@dt215git
Copy link
Contributor

@5ila5
If I remember correctly, looking into the past 5 days was intentional.
The query initially returns a collection date that doesn't take into consideration delays due to public holidays.
It then looks for any public holiday dates and tries to work out if any of the original collection dates would be impacted.
If the original collection was due on a Thursday, you need to check whether any of the preceeding days in that week were public holidays. If there were, then the actual collection would move by 1 day per public holiday.
I think the 5 day limit was because I couldn't find any examples on the website where collections were shifted into different weeks, so 5 days would cover the number of weekdays.
To be honest, it's not obvious what rules Republic Service apply (it could be different for different States), so there may be better ways of trying to deal with this.

@5ila5
Copy link
Collaborator Author

5ila5 commented Nov 20, 2023

What about keeping the old implementation but check if a collection date is already moved and then do not apply the second holiday delay?
Is there a reason you used the holiday incorporated check? it looks like you Cycle thorough all holidays and then set incorporated to True (or not) so the check will never return false. or do i miss something?

@dt215git
Copy link
Contributor

When looking at it previously, I came across a case where the original collection date was delayed by a public holiday, but the shifted collection date then fell on a second public holiday in that same week. That new date was then also delayed for a second time so the actual collection date was 2 days after the original date.

I was keeping track of the public holidays that had already impacted schedules so that when original/revised dates were checked against the list of public holidays, they wouldn't be affected by one that had already been accounted for.

@carefulcomputer
Copy link

Do we know when this will be merged ?

@5ila5
Copy link
Collaborator Author

5ila5 commented Dec 22, 2023

I do not think this is a good fix (as this probably adds new issues). There needs to be some deeper investigation what their website java script actually does and it does not seems to be that easy (as it is some "compiled" Typescript and it does not look like they provide the original source)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Republic Service incorrect date when delay due to holidays
3 participants