From a2d331a51c70a2f25292838f8c96ff76bc68bcf0 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Tue, 24 Oct 2023 17:19:02 +0100 Subject: [PATCH] [Brent] Include small items service name in report As it's not a service with any collections, it isn't included in the standard lookup. --- perllib/FixMyStreet/Cobrand/Brent.pm | 7 +++++++ t/app/controller/waste_brent_small_items.t | 1 + 2 files changed, 8 insertions(+) diff --git a/perllib/FixMyStreet/Cobrand/Brent.pm b/perllib/FixMyStreet/Cobrand/Brent.pm index 57cfe1319ca..5f9ef309367 100644 --- a/perllib/FixMyStreet/Cobrand/Brent.pm +++ b/perllib/FixMyStreet/Cobrand/Brent.pm @@ -1013,6 +1013,13 @@ sub waste_munge_report_data { my $address = $c->stash->{property}->{address}; my $service = $c->stash->{services}{$id}{service_name}; + + my $cfg = $self->feature('echo'); + my $service_id_missed = $cfg->{bulky_service_id_missed}; + if (!$service && $id == $service_id_missed) { + $service = 'small items / clinical'; + } + $data->{title} = "Report missed $service"; $data->{detail} = "$data->{title}\n\n$address"; $c->set_param('service_id', $id); diff --git a/t/app/controller/waste_brent_small_items.t b/t/app/controller/waste_brent_small_items.t index eb6bd241e25..01c3ad4e5b8 100644 --- a/t/app/controller/waste_brent_small_items.t +++ b/t/app/controller/waste_brent_small_items.t @@ -470,6 +470,7 @@ FixMyStreet::override_config { my $report = FixMyStreet::DB->resultset("Problem")->search(undef, { order_by => { -desc => 'id' } })->first; is $report->category, 'Report missed collection'; is $report->get_extra_field_value('service_id'), 787; + is $report->title, 'Report missed small items / clinical'; $echo->mock( 'GetEventsForObject', sub { [ { EventTypeId => 2964,