diff options
author | M Somerville <matthew-github@dracos.co.uk> | 2020-11-12 11:48:24 +0000 |
---|---|---|
committer | M Somerville <matthew-github@dracos.co.uk> | 2020-11-12 12:09:45 +0000 |
commit | 0b97468330ab7146f16dfe4060a63d28ce445fa6 (patch) | |
tree | 752104e2da254c10006a7093f2011b2e031c96d6 /perllib/Integrations/Echo.pm | |
parent | f5dc489e9ad85a7cf3e7c937a926228cd8178432 (diff) |
[Bromley] Use property ID, rather than UPRN.
Diffstat (limited to 'perllib/Integrations/Echo.pm')
-rw-r--r-- | perllib/Integrations/Echo.pm | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/perllib/Integrations/Echo.pm b/perllib/Integrations/Echo.pm index bf4b453e6..d6783677c 100644 --- a/perllib/Integrations/Echo.pm +++ b/perllib/Integrations/Echo.pm @@ -129,14 +129,14 @@ sub GetTasks { return force_arrayref($res, 'Task'); } -sub _uprn_ref { +sub _id_ref { require SOAP::Lite; - my $uprn = shift; + my $id = shift; tie(my %obj, 'Tie::IxHash', - Key => 'Uprn', + Key => 'Id', Type => 'PointAddress', Value => [ - { 'msArray:anyType' => SOAP::Data->value($uprn)->type('string') }, + { 'msArray:anyType' => SOAP::Data->value($id) }, ], ); return \%obj; @@ -144,10 +144,11 @@ sub _uprn_ref { sub GetPointAddress { my $self = shift; - my $uprn = shift; - my $obj = _uprn_ref($uprn); + my $id = shift; + my $obj = _id_ref($id); return { Id => '12345', + SharedRef => { Value => { anyType => '1000000002' } }, PointType => 'PointAddress', PointAddressType => { Name => 'House' }, Coordinates => { GeoPoint => { Latitude => 51.401546, Longitude => 0.015415 } }, @@ -165,11 +166,11 @@ sub FindPoints { Postcode => $pc, ); return [ - { Description => '1 Example Street, Bromley, BR1 1AA', SharedRef => { Value => { anyType => 1000000001 } } }, - { Description => '2 Example Street, Bromley, BR1 1AA', SharedRef => { Value => { anyType => 1000000002 } } }, - { Description => '3 Example Street, Bromley, BR1 1AA', SharedRef => { Value => { anyType => 1000000003 } } }, - { Description => '4 Example Street, Bromley, BR1 1AA', SharedRef => { Value => { anyType => 1000000004 } } }, - { Description => '5 Example Street, Bromley, BR1 1AA', SharedRef => { Value => { anyType => 1000000005 } } }, + { Description => '1 Example Street, Bromley, BR1 1AA', Id => '11345', SharedRef => { Value => { anyType => 1000000001 } } }, + { Description => '2 Example Street, Bromley, BR1 1AA', Id => '12345', SharedRef => { Value => { anyType => 1000000002 } } }, + { Description => '3 Example Street, Bromley, BR1 1AA', Id => '13345', SharedRef => { Value => { anyType => 1000000003 } } }, + { Description => '4 Example Street, Bromley, BR1 1AA', Id => '14345', SharedRef => { Value => { anyType => 1000000004 } } }, + { Description => '5 Example Street, Bromley, BR1 1AA', Id => '15345', SharedRef => { Value => { anyType => 1000000005 } } }, ] if $self->sample_data; my $res = $self->call('FindPoints', query => \%obj); return force_arrayref($res, 'PointInfo'); @@ -177,8 +178,8 @@ sub FindPoints { sub GetServiceUnitsForObject { my $self = shift; - my $uprn = shift; - my $obj = _uprn_ref($uprn); + my $id = shift; + my $obj = _id_ref($id); my $from = DateTime->now->set_time_zone(FixMyStreet->local_time_zone); return [ { Id => 1001, |