Skip to content

Commit

Permalink
[Bromley] Store Bromley to Echo notes differently.
Browse files Browse the repository at this point in the history
Using the same handover_notes as Echo to Bromley means that they will be
automatically added to the detail when sent, and included in the Notes,
as well as the report details.
  • Loading branch information
dracos committed Oct 11, 2024
1 parent 01eec2d commit f57791c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion perllib/FixMyStreet/Cobrand/Bromley.pm
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ sub open311_get_update_munging {
$problem->state('in progress');
$comment->problem_state('in progress');
$problem->set_extra_metadata( original_bromley_external_id => $problem->external_id );
$problem->update_extra_field({ name => 'Notes', value => $comment->text });
$problem->set_extra_metadata(handover_notes => $comment->text);
# Resending report, don't need comment to be public
$comment->state('hidden');
$problem->resend;
Expand Down
11 changes: 9 additions & 2 deletions t/cobrand/bromley.t
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,7 @@ subtest 'redirecting of reports between backends' => sub {
});

my $in = $mech->echo_notify_xml('guid', 2104, 15004, 1252);
my $detail = $report->detail;

subtest 'A report sent to Confirm, then redirected to Echo' => sub {
$report->update({ external_id => 12345 });
Expand Down Expand Up @@ -799,8 +800,14 @@ subtest 'redirecting of reports between backends' => sub {
$report->discard_changes;
is $report->comments->count, 1;
is $report->whensent, undef;
is $report->get_extra_field_value('Notes'), 'This is a handover note';
is $report->get_extra_metadata('handover_notes'), 'This is a handover note';
is $report->category, 'Street Services';

FixMyStreet::Script::Reports::send();
my $req = Open311->test_req_used;
my $c = CGI::Simple->new($req->content);
is $c->param('service_code'), 3045;
is $c->param('description'), "$detail | Handover notes - This is a handover note";
};
subtest '...then redirected back to Confirm' => sub {
$report->update({ external_id => 'guid', whensent => DateTime->now, send_method_used => 'Open311' });
Expand Down Expand Up @@ -839,7 +846,7 @@ subtest 'redirecting of reports between backends' => sub {
my $req = Open311->test_req_used;
my $c = CGI::Simple->new($req->content);
is $c->param('service_code'), 'LBB_RRE_FROM_VEOLIA_STREETS';
like $c->param('description'), qr/Handover notes - Outgoing notes from Echo/;
is $c->param('description'), "$detail | Handover notes - Outgoing notes from Echo";
};

subtest "comment on a closed echo report result in a resend under 'Street Services'" => sub {
Expand Down

0 comments on commit f57791c

Please sign in to comment.