Skip to content

Commit

Permalink
Merge branch 'bexley-ww-remove-clinical-waste' into commercial-staging
Browse files Browse the repository at this point in the history
  • Loading branch information
nephila-nacrea committed May 14, 2024
2 parents ce7d2de + 3bd3565 commit c210879
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
15 changes: 5 additions & 10 deletions perllib/FixMyStreet/Cobrand/Bexley/Waste.pm
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ sub bin_services_for_address {
for my $service (@$site_services) {
next if !$service->{NextCollectionDate};

my $container = $containers->{ $service->{ServiceItemName} };
next unless $container;

my $next_dt = eval {
DateTime::Format::W3CDTF->parse_datetime(
$service->{NextCollectionDate} );
Expand Down Expand Up @@ -158,16 +161,12 @@ sub bin_services_for_address {
next if $now_dt > $to_dt;
}

my $containers = $self->_containers($property);

my ($round) = split / /, $service->{RoundSchedule};
my $filtered_service = {
id => $service->{SiteServiceID},
service_id => $service->{ServiceItemName},
service_name =>
$containers->{ $service->{ServiceItemName} }{name},
service_description =>
$containers->{ $service->{ServiceItemName} }{description},
service_name => $container->{name},
service_description => $container->{description},
round_schedule => $service->{RoundSchedule},
round => $round,
next => {
Expand Down Expand Up @@ -657,10 +656,6 @@ For:
HTML

return {
'CW-SACK' => {
name => 'Clinical Waste Sack(s)',
description => 'Clinical waste',
},
'FO-140' => {
name => 'Communal Food Bin',
description => 'Food waste',
Expand Down
8 changes: 8 additions & 0 deletions t/app/controller/waste_bexley.t
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,14 @@ sub _site_collections {

RoundSchedule => 'RND-8-9 Mon, RND-8-9 Wed',
},
# CW-SACK (Clinical waste) is not in container list so won't be shown
{
SiteServiceID => 99,
ServiceItemDescription => 'Clinical Waste Sack',
ServiceItemName => 'CW-SACK',

NextCollectionDate => '2024-04-01T00:00:00',
},
],
10003 => [
{ SiteServiceID => 1000,
Expand Down

0 comments on commit c210879

Please sign in to comment.