aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/Open311/Endpoint/Service
diff options
context:
space:
mode:
authorHakim Cassimally <hakim@mysociety.org>2014-07-15 14:15:46 +0000
committerHakim Cassimally <hakim@mysociety.org>2014-10-16 16:56:27 +0000
commit56eab366fc60fe83024abb6819c146bc9bd47adc (patch)
treea12aa26e01855c297ebcaf6232319f3e41b1e669 /perllib/Open311/Endpoint/Service
parentf47e9d48a2d26e92723ae96d3d65a1ba005f426f (diff)
Open311 Warwick (Exor) Integration
::Integration::Warwick subclasses ::Integration::Exor refactor request_class and new_request Exor service Warwickshire updates retrieval, with datetimes stubbing out of Oracle constants, for local testing We also edit FMS's core PopulateServiceList routine to hide system fields from FMS: Bromley/Warwickshire send metadata in their services/FOO.xml advising that you can pass, e.g. attributes[easting]. FMS by default shows all of these to the user to fill in, however we don't *want* the user to supply these, rather they are added by the cobrand. Bromley had an exception for this (keyed by $body->areas->id). We write this more generally for Warwickshire too, keying instead by $body->name (as this is far less likely to be overridden for installs using global or custom Mapit's)
Diffstat (limited to 'perllib/Open311/Endpoint/Service')
-rw-r--r--perllib/Open311/Endpoint/Service/Exor.pm44
-rw-r--r--perllib/Open311/Endpoint/Service/Request.pm2
-rw-r--r--perllib/Open311/Endpoint/Service/Request/mySociety.pm1
3 files changed, 46 insertions, 1 deletions
diff --git a/perllib/Open311/Endpoint/Service/Exor.pm b/perllib/Open311/Endpoint/Service/Exor.pm
new file mode 100644
index 000000000..6261875c1
--- /dev/null
+++ b/perllib/Open311/Endpoint/Service/Exor.pm
@@ -0,0 +1,44 @@
+package Open311::Endpoint::Service::Exor;
+use Moo;
+extends 'Open311::Endpoint::Service';
+use Open311::Endpoint::Service::Attribute;
+
+has '+attributes' => (
+ is => 'ro',
+ default => sub { [
+ Open311::Endpoint::Service::Attribute->new(
+ code => 'easting',
+ variable => 0, # set by server
+ datatype => 'number',
+ required => 1,
+ datatype_description => 'a number',
+ description => 'easting',
+ ),
+ Open311::Endpoint::Service::Attribute->new(
+ code => 'northing',
+ variable => 0, # set by server
+ datatype => 'number',
+ required => 1,
+ datatype_description => 'a number',
+ description => 'northing',
+ ),
+ Open311::Endpoint::Service::Attribute->new(
+ code => 'closest_address',
+ variable => 0, # set by server
+ datatype => 'string',
+ required => 1,
+ datatype_description => 'an address',
+ description => 'closest address',
+ ),
+ Open311::Endpoint::Service::Attribute->new(
+ code => 'external_id',
+ variable => 0, # set by server
+ datatype => 'string',
+ required => 1,
+ datatype_description => 'an id',
+ description => 'external system ID',
+ ),
+ ] },
+);
+
+1;
diff --git a/perllib/Open311/Endpoint/Service/Request.pm b/perllib/Open311/Endpoint/Service/Request.pm
index 1d835f2d5..8dfa5df3a 100644
--- a/perllib/Open311/Endpoint/Service/Request.pm
+++ b/perllib/Open311/Endpoint/Service/Request.pm
@@ -55,11 +55,13 @@ has agency_responsible => (
has requested_datetime => (
is => 'ro',
isa => Maybe[ InstanceOf['DateTime'] ],
+ default => sub { DateTime->now() },
);
has updated_datetime => (
is => 'rw',
isa => Maybe[ InstanceOf['DateTime'] ],
+ default => sub { DateTime->now() },
);
has expected_datetime => (
diff --git a/perllib/Open311/Endpoint/Service/Request/mySociety.pm b/perllib/Open311/Endpoint/Service/Request/mySociety.pm
index 748065ad8..85e31b26f 100644
--- a/perllib/Open311/Endpoint/Service/Request/mySociety.pm
+++ b/perllib/Open311/Endpoint/Service/Request/mySociety.pm
@@ -31,7 +31,6 @@ sub add_update {
$self->_add_update($update);
}
-
sub last_update {
my $self = shift;
return $self->has_updates ? $self->get_update(-1) : undef;