aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/Open311
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/Open311')
-rw-r--r--perllib/Open311/GetServiceRequestUpdates.pm15
-rw-r--r--perllib/Open311/PopulateServiceList.pm6
2 files changed, 21 insertions, 0 deletions
diff --git a/perllib/Open311/GetServiceRequestUpdates.pm b/perllib/Open311/GetServiceRequestUpdates.pm
index 6e6e3b905..656fa9d68 100644
--- a/perllib/Open311/GetServiceRequestUpdates.pm
+++ b/perllib/Open311/GetServiceRequestUpdates.pm
@@ -32,6 +32,13 @@ sub fetch {
jurisdiction => $council->jurisdiction,
);
+ if ( $council->area_id =~ /2482/ ) {
+ my $endpoints = $o->endpoints;
+ $endpoints->{update} = 'update.xml';
+ $endpoints->{service_requests_updates} = 'update.xml';
+ $o->endpoints( $endpoints );
+ }
+
$self->suppress_alerts( $council->suppress_alerts );
$self->system_user( $council->comment_user );
$self->update_comments( $o, { areaid => $council->area_id }, );
@@ -48,6 +55,14 @@ sub update_comments {
push @args, $self->start_date;
push @args, $self->end_date;
+ # default to asking for last 2 hours worth if not Bromley
+ } elsif ( $council_details->{areaid} != 2482 ) {
+ my $end_dt = DateTime->now();
+ my $start_dt = $end_dt->clone;
+ $start_dt->add( hours => -2 );
+
+ push @args, DateTime::Format::W3CDTF->format_datetime( $start_dt );
+ push @args, DateTime::Format::W3CDTF->format_datetime( $end_dt );
}
my $requests = $open311->get_service_request_updates( @args );
diff --git a/perllib/Open311/PopulateServiceList.pm b/perllib/Open311/PopulateServiceList.pm
index 788024c89..d8730a703 100644
--- a/perllib/Open311/PopulateServiceList.pm
+++ b/perllib/Open311/PopulateServiceList.pm
@@ -149,6 +149,12 @@ sub _handle_existing_contact {
}
}
+ if ( $contact and lc( $self->_current_service->{metadata} ) eq 'true' ) {
+ $self->_add_meta_to_contact( $contact );
+ } elsif ( $contact and $contact->extra and lc( $self->_current_service->{metadata} ) eq 'false' ) {
+ $contact->update( { extra => undef } );
+ }
+
push @{ $self->found_contacts }, $self->_current_service->{service_code};
}