Skip to content

Commit

Permalink
[Sutton] Report missed assisted in different category.
Browse files Browse the repository at this point in the history
  • Loading branch information
dracos committed Feb 20, 2025
1 parent 4cebf2f commit 76875d2
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
5 changes: 5 additions & 0 deletions perllib/FixMyStreet/Roles/Cobrand/SLWP2.pm
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ lock_hash(%SERVICE_IDS);

my %EVENT_TYPE_IDS = (
missed => 3145,
missed_assisted => 3146,
request => 3129,
garden_add => 3159,
garden_amend => 3163,
Expand Down Expand Up @@ -297,6 +298,7 @@ sub waste_service_containers {
sub missed_event_types { return {
$EVENT_TYPE_IDS{request} => 'request',
$EVENT_TYPE_IDS{missed} => 'missed',
$EVENT_TYPE_IDS{missed_assisted} => 'missed',
$EVENT_TYPE_IDS{bulky} => 'bulky',
} }

Expand All @@ -319,6 +321,9 @@ sub waste_munge_report_data {
$data->{category} = 'Request additional collection';
$data->{title} = "Request additional $service collection";

Check warning on line 322 in perllib/FixMyStreet/Roles/Cobrand/SLWP2.pm

View check run for this annotation

Codecov / codecov/patch

perllib/FixMyStreet/Roles/Cobrand/SLWP2.pm#L321-L322

Added lines #L321 - L322 were not covered by tests
} else {
if ($c->stash->{assisted_collection}) {
$data->{category} = 'Report missed assisted collection';
}
$data->{title} = "Report missed $service";
}
$data->{detail} = "$data->{title}\n\n$address";
Expand Down
13 changes: 13 additions & 0 deletions t/app/controller/waste_sutton_r.t
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ create_contact({ category => 'Report missed collection', email => 'missed' }, 'W
{ code => 'service_id', required => 1, automated => 'hidden_field' },
{ code => 'fixmystreet_id', required => 1, automated => 'hidden_field' },
);
create_contact({ category => 'Report missed assisted collection', email => '3146' }, 'Waste',
{ code => 'service_id', required => 1, automated => 'hidden_field' },
{ code => 'fixmystreet_id', required => 1, automated => 'hidden_field' },
);
create_contact({ category => 'Request new container', email => '3129' }, 'Waste',
{ code => 'uprn', required => 1, automated => 'hidden_field' },
{ code => 'service_id', required => 1, automated => 'hidden_field' },
Expand Down Expand Up @@ -415,6 +419,15 @@ FixMyStreet::override_config {
$e->mock('GetServiceUnitsForObject', sub { $dupe });
$mech->get_ok('/waste/12345');
$mech->content_contains('is set up for assisted collection');
subtest 'Different category for assisted' => sub {
$mech->submit_form_ok({ with_fields => { 'service-954' => 1 } });
$mech->submit_form_ok({ with_fields => { 'service-954' => 1 } });
$mech->submit_form_ok({ with_fields => { name => 'Bob Marge', email => $user->email }});
$mech->submit_form_ok({ with_fields => { process => 'summary' } });
$mech->content_contains('Thank you for reporting a missed collection');
my $report = FixMyStreet::DB->resultset("Problem")->order_by('-id')->first;
is $report->category, 'Report missed assisted collection';
};
$e->mock('GetServiceUnitsForObject', sub { $bin_data });
};

Expand Down
1 change: 0 additions & 1 deletion templates/email/default/waste/other-reported.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[% is_missed_collection = report.category == 'Report missed collection' %]
[%

email_summary = "Thanks for logging your report";
Expand Down
2 changes: 1 addition & 1 deletion templates/web/base/waste/confirmation.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
ELSE;
title = 'Your container request has been sent';
END;
ELSIF report.category == 'Report missed collection';
ELSIF report.category == 'Report missed collection' OR report.category == 'Report missed assisted collection';
title = 'Thank you for reporting a missed collection';
ELSIF report.category == 'Request additional collection';
title = 'Your additional collection has been requested';
Expand Down

0 comments on commit 76875d2

Please sign in to comment.