Skip to content

Commit

Permalink
[Bromley] Cope with updates on now-Echo categories
Browse files Browse the repository at this point in the history
  • Loading branch information
dracos committed Oct 17, 2024
1 parent 8789d51 commit b8aaed4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion perllib/FixMyStreet/Cobrand/Bromley.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use FixMyStreet::DB;
use Moo;
with 'FixMyStreet::Roles::Cobrand::Echo';
with 'FixMyStreet::Roles::Cobrand::Pay360';
with 'FixMyStreet::Roles::Open311Multi';
with 'FixMyStreet::Roles::Cobrand::SCP';
with 'FixMyStreet::Roles::Cobrand::Waste';
with 'FixMyStreet::Roles::Cobrand::BulkyWaste';
Expand Down Expand Up @@ -350,6 +349,17 @@ sub open311_post_send_updates {
sub open311_munge_update_params {
my ($self, $params, $comment, $body) = @_;

# Inline the Open311Multi code here, as we need to adjust it
my $contact = $comment->problem->contact;
$params->{service_code} = $contact->email;

# If the report was sent to Bromley (external ID is digits), but now is
# Echo (contact starts with digits), use a dummy code so open311-adapter
# thinks it is a Passthrough service and the update goes to Bromley.
if ($comment->problem->external_id =~ /^\d+$/ && $contact->email =~ /^\d+/) {
$params->{service_code} = 'DUMMY';

Check warning on line 360 in perllib/FixMyStreet/Cobrand/Bromley.pm

View check run for this annotation

Codecov / codecov/patch

perllib/FixMyStreet/Cobrand/Bromley.pm#L360

Added line #L360 was not covered by tests
}

my $private_comments = $comment->get_extra_metadata('private_comments');
if ($private_comments) {
my $text = $params->{description} . "\n\nPrivate comments: $private_comments";
Expand Down

0 comments on commit b8aaed4

Please sign in to comment.