aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
Diffstat (limited to 'perllib')
-rw-r--r--perllib/FixMyStreet/DB/Result/Problem.pm2
-rw-r--r--perllib/Open311.pm2
-rw-r--r--perllib/Open311/GetServiceRequestUpdates.pm12
3 files changed, 7 insertions, 9 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm
index 376190aff..83939bfab 100644
--- a/perllib/FixMyStreet/DB/Result/Problem.pm
+++ b/perllib/FixMyStreet/DB/Result/Problem.pm
@@ -309,7 +309,7 @@ HASHREF.
=cut
sub council_states {
my $states = {
- 'confirmed' => 1,
+ 'confirmed' => 1,
'investigating' => 1,
'action scheduled' => 1,
'in progress' => 1,
diff --git a/perllib/Open311.pm b/perllib/Open311.pm
index b508a2bcc..34a9b1bfb 100644
--- a/perllib/Open311.pm
+++ b/perllib/Open311.pm
@@ -291,7 +291,7 @@ sub _populate_service_request_update_params {
} elsif ( $comment->problem->state eq 'not responsible' ) {
$status = 'NOT_COUNCILS_RESPONSIBILITY';
} elsif ( $comment->problem->state eq 'unable to fix' ) {
- $status = 'UNABLE_TO_FIX';
+ $status = 'NO_FURTHER_ACTION';
}
} else {
$status = $comment->problem->is_open ? 'OPEN' : 'CLOSED',;
diff --git a/perllib/Open311/GetServiceRequestUpdates.pm b/perllib/Open311/GetServiceRequestUpdates.pm
index c0b9dcac0..99e1d5758 100644
--- a/perllib/Open311/GetServiceRequestUpdates.pm
+++ b/perllib/Open311/GetServiceRequestUpdates.pm
@@ -98,15 +98,12 @@ sub update_comments {
if ( $comment->created_local > $p->lastupdate_local ) {
my $state = $self->map_state( $request->{status} );
- # do not change a fixed problem to a closed one
- if ( $p->is_fixed && FixMyStreet::DB::Result::Problem->open_states()->{$state} ) {
+ # don't update state unless it's an allowed state and it's
+ # actually changing the state of the problem
+ if ( FixMyStreet::DB::Result::Problem->council_states()->{$state} && $p->state ne $state &&
+ !( $p->is_fixed && FixMyStreet::DB::Result::Problem->fixed_states()->{$state} ) ) {
$p->state($state);
$comment->problem_state($state);
- } elsif ( ( $p->is_open || $p->is_closed ) && $p->state ne $state ) {
- if ( FixMyStreet::DB::Result::Problem->council_states() ->{$state} ) {
- $p->state($state);
- $comment->problem_state($state);
- }
}
}
@@ -144,6 +141,7 @@ sub map_state {
my %state_map = (
fixed => 'fixed - council',
'not councils responsibility' => 'not responsible',
+ 'no further action' => 'unable to fix',
open => 'confirmed',
closed => 'fixed - council'
);