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

[Bexley] Missed collection can't be reported until round confirmed #4932

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

MorayMySoc
Copy link
Contributor

@MorayMySoc MorayMySoc commented Apr 23, 2024

Need to check when the cab logs say the round was finished before allowing missed reports on services

Also add delayed message if round not complete after collection date

https://3.basecamp.com/4020879/buckets/35109031/todos/7283503961

[skip changelog]

Copy link

codecov bot commented Apr 23, 2024

Codecov Report

Attention: Patch coverage is 95.34884% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 83.45%. Comparing base (d182461) to head (46fe39d).
Report is 40 commits behind head on master.

Files Patch % Lines
perllib/FixMyStreet/Cobrand/Bexley/Waste.pm 95.34% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4932      +/-   ##
==========================================
+ Coverage   82.60%   83.45%   +0.85%     
==========================================
  Files         390      408      +18     
  Lines       30473    33898    +3425     
  Branches     4812     5485     +673     
==========================================
+ Hits        25171    28289    +3118     
- Misses       3864     4060     +196     
- Partials     1438     1549     +111     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Need to check when the cab logs say the round was finished
before allowing missed reports on services

https://3.basecamp.com/4020879/buckets/35109031/todos/7283503961
@nephila-nacrea nephila-nacrea force-pushed the bexley-end-of-round branch 2 times, most recently from 0828ee0 to 3faa5c6 Compare April 24, 2024 15:40
Copy link
Member

@chrismytton chrismytton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good! Couple of very minor comments, then I think this is good to go.

perllib/FixMyStreet/Cobrand/Bexley/Waste.pm Outdated Show resolved Hide resolved
t/app/controller/waste_bexley.t Outdated Show resolved Hide resolved
Was overriding the newer logic before it; was accidentally left in.
Copy link
Member

@chrismytton chrismytton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, clearly forgotten how to do code review! All looks good 👍

@chrismytton chrismytton changed the title [Bexley] Missed collection can't be repored until round confirmed [Bexley] Missed collection can't be reported until round confirmed May 2, 2024
Missed bins can be reported on the day of collection once the round has
been completed.

# Make cab logs unique by LogID
my %seen;
@$cab_logs = grep { !$seen{ $_->{LogID} }++ } @$cab_logs;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should remember this as a pithy way to get unique elements.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always takes my brain a moment to decode this construct when I see it, so I'm never sure if it's straying into code-thats-a-bit-too-clever territory! As you say, it's a fairly brief way of getting this done (though IMO not as nice as Ruby's cab_logs = cab_logs.uniq { |log| log[:LogID] }!)

@@ -373,7 +383,7 @@ sub _in_cab_logs {

my $logdate = DateTime::Format::Strptime->new( pattern => '%Y-%m-%dT%H:%M:%S' )->parse_datetime( $_->{LogDate} );

if ( $_->{Uprn} ) {
if ( $_->{Uprn} && $_->{Uprn} eq $property->{uprn} ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it is possible for the UPRN to not match because you are also now fetching the USRN logs above?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep exactly. The USRN logs contain both street-level logs (which have a blank UPRN field) and any property logs for that USRN (hence the need to filter out irrelevant ones here).

Update the logic which checks we're outside the reporting window to
check if the collection is happening today, and if it is then proceed
with the missed collection checks.
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.

None yet

3 participants