Skip to content

Commit

Permalink
[Brent] Option for other bulky missed service ID.
Browse files Browse the repository at this point in the history
We may want to do this to signify to open311-adapter
this is a different service.
  • Loading branch information
dracos committed Oct 25, 2023
1 parent 39a3a3f commit 02c996f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion perllib/FixMyStreet/Roles/CobrandEcho.pm
Original file line number Diff line number Diff line change
Expand Up @@ -614,12 +614,13 @@ sub bulky_check_missed_collection {

my $cfg = $self->feature('echo');
my $service_id = $cfg->{bulky_service_id} or return;
my $service_id_missed = $cfg->{bulky_service_id_missed};
my $event_type_id = $cfg->{bulky_event_type_id} or return;
my $event = $events->{enquiry}{$event_type_id};
return unless $event;
my $row = {
service_name => 'Bulky waste',
service_id => $service_id,
service_id => $service_id_missed || $service_id,
};
my $in_time = $self->within_working_days($event->{date}, 2);
foreach my $state_id (keys %$blocked_codes) {
Expand Down
12 changes: 12 additions & 0 deletions t/app/controller/waste_brent_small_items.t
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ create_contact(
{ code => 'GUID' },
{ code => 'reservation' },
);
create_contact(
{ category => 'Report missed collection', email => '[email protected]' },
);

FixMyStreet::override_config {
MAPIT_URL => 'http://mapit.uk/',
Expand All @@ -76,6 +79,7 @@ FixMyStreet::override_config {
echo => {
brent => {
bulky_service_id => 274,
bulky_service_id_missed => 787,
bulky_event_type_id => 2964,
url => 'http://example.org',
},
Expand Down Expand Up @@ -459,6 +463,14 @@ FixMyStreet::override_config {
$mech->content_contains('Report a small items collection as missed', 'In time, normal completion');
$mech->get_ok('/waste/12345/report');
$mech->content_contains('Small items collection');
$mech->submit_form_ok({ with_fields => { 'service-787' => 1 } });
$mech->submit_form_ok({ with_fields => { name => 'Bob Marge', email => $user->email }});
$mech->submit_form_ok({ with_fields => { process => 'summary' } });
$mech->content_contains('Your missed collection has been reported');
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;

$echo->mock( 'GetEventsForObject', sub { [ {
EventTypeId => 2964,
ResolvedDate => { DateTime => '2023-06-25T00:00:00Z' },
Expand Down

0 comments on commit 02c996f

Please sign in to comment.