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
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
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. |
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
0828ee0
to
3faa5c6
Compare
3faa5c6
to
5545e4e
Compare
There was a problem hiding this 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.
Was overriding the newer logic before it; was accidentally left in.
There was a problem hiding this 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 👍
Missed bins can be reported on the day of collection once the round has been completed.
45caae4
to
cc27d4f
Compare
|
||
# Make cab logs unique by LogID | ||
my %seen; | ||
@$cab_logs = grep { !$seen{ $_->{LogID} }++ } @$cab_logs; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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} ) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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).
1f471f5
to
1774f1f
Compare
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.
1774f1f
to
ff883b7
Compare
ff883b7
to
46fe39d
Compare
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]