diff options
author | Struan Donald <struan@exo.org.uk> | 2018-08-08 16:12:58 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2018-10-01 07:57:22 +0100 |
commit | 1b46273ffd41876b95a96cdaa41ef5f99b04f643 (patch) | |
tree | f24dbfa1a274a154a7a5c7b6c5663a84a6e78870 /bin/send-comments | |
parent | 1abc3183acb95f83ddbb05fb80ba19b87b047657 (diff) |
[Open311] turn on comment sending for OCC
but only send if the problem as a customer reference and use that as the
external id reference
Diffstat (limited to 'bin/send-comments')
-rwxr-xr-x | bin/send-comments | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/bin/send-comments b/bin/send-comments index 7043df7b8..55c9da62b 100755 --- a/bin/send-comments +++ b/bin/send-comments @@ -48,9 +48,6 @@ while ( my $body = $bodies->next ) { # XXX Cobrand specific - see also list in Problem->updates_sent_to_body if ($site eq 'fixmystreet.com') { - # Oxfordshire (OCC) is special: - # we do *receive* service_request_updates (aka comments) for OCC, but we never *send* them, so skip this pass - next if $body->areas->{+COUNCIL_ID_OXFORDSHIRE}; # Lewisham does not yet accept updates next if $body->areas->{+COUNCIL_ID_LEWISHAM}; } @@ -83,6 +80,9 @@ while ( my $body = $bodies->next ) { use_extended_updates => $use_extended, ); + if ( $body->areas->{+COUNCIL_ID_OXFORDSHIRE} ) { + $open311_conf{use_customer_reference} = 1, + } if ( $body->send_extended_statuses ) { $open311_conf{extended_statuses} = 1; @@ -111,6 +111,13 @@ while ( my $body = $bodies->next ) { next; } + # Oxfordshire stores the external id of the problem as a customer reference + # in metadata + if ($body->areas->{+COUNCIL_ID_OXFORDSHIRE} && + !$comment->problem->get_extra_metadata('customer_reference') ) { + next; + } + # TODO actually this should be OK for any devolved endpoint if original Open311->can_be_devolved, presumably if ( 0 ) { # Check can_be_devolved and do this properly if set my $sender = $cobrand->get_body_sender( $body, $comment->problem->category ); |