diff --git a/perllib/Integrations/AlloyV2.pm b/perllib/Integrations/AlloyV2.pm index 05fb9fcec..c2afe11bd 100644 --- a/perllib/Integrations/AlloyV2.pm +++ b/perllib/Integrations/AlloyV2.pm @@ -184,7 +184,7 @@ sub search { return [] unless $result_count; my $maxPages = 100; - my $pageSize = $result_count <= 2000 ? 20 : ( ceil($result_count / $maxPages) + 1 ); + my $pageSize = $result_count <= 10000 ? 100 : ( ceil($result_count / $maxPages) + 1 ); my $pages = int( $result_count / $pageSize ) + 1; my $query_body = $body_base; diff --git a/perllib/Open311/Endpoint/Integration/AlloyV2.pm b/perllib/Open311/Endpoint/Integration/AlloyV2.pm index 46ed667d5..89d0aa0a8 100644 --- a/perllib/Open311/Endpoint/Integration/AlloyV2.pm +++ b/perllib/Open311/Endpoint/Integration/AlloyV2.pm @@ -121,7 +121,7 @@ has service_whitelist => ( =head2 update_store -Directory for storing reconstructions of Alloy items to save on API calls +Directory for storing some Alloy API calls to save on calls =cut @@ -562,8 +562,8 @@ sub get_service_request_updates { =head3 'Inspections' 'Inspection' updates fetch the C resources that have been updated -in the relevant time frame, fetching previous versions of each item. -It uses C for attribute mapping: +in the relevant time frame. It uses C for +attribute mapping: =over 4 @@ -582,7 +582,7 @@ closure that can be used to override these at the end. =item C -Used to find the attribute to look at to see if the comments have changed, for +Used to find the attribute to look at to see if there are any comments, for providing as the text update. =back @@ -603,76 +603,57 @@ sub _get_inspection_updates { my $assigned_to_users = $self->get_assigned_to_users(@$updates); - for my $update (@$updates) { - next unless $self->_accept_updated_resource($update); + for my $report (@$updates) { + next unless $self->_accept_updated_resource($report); - # We need to fetch all versions that changed in the time wanted - my @version_ids = $self->get_versions_of_resource($update->{itemId}); + # The main result doesn't actually include the last edit date + my $date = $self->get_latest_version_date($report->{itemId}); + my $update_dt = $self->date_to_truncated_dt($date); + next unless $update_dt >= $start_time && $update_dt <= $end_time; - my $last_description = ''; - foreach my $date (@version_ids) { - my $description_to_send = ''; - my $update_dt; + my $attributes = $self->alloy->attributes_to_hash($report); - # If we don't need to compare the comments field, we can - # consider updates only within the desired date range - if (!$mapping->{inspector_comments}) { - $update_dt = $self->date_to_truncated_dt( $date ); - next unless $update_dt >= $start_time && $update_dt <= $end_time; - } - - my $resource = $self->call_reconstruct($update->{itemId}, $date) or next; - my $attributes = $self->alloy->attributes_to_hash($resource); - - my ($status, $reason_for_closure) = $self->_get_inspection_status($attributes, $mapping); + my ($status, $reason_for_closure) = $self->_get_inspection_status($attributes, $mapping); - # If we are checking if the comments field has changed, we will - # have to fetch all the updates. Once we've fetched them we can - # throw away the ones that don't match the date range. - if ($mapping->{inspector_comments}) { - my $description = $attributes->{$mapping->{inspector_comments} || ''} || ''; - # only want to put a description in the update if it's - # changed, so compare it to the last one. - $description_to_send = $description ne $last_description ? $description : ''; - $last_description = $description; + my $description = ''; + if ($mapping->{inspector_comments}) { + $description = $attributes->{$mapping->{inspector_comments}} || ''; + } - $update_dt = $self->date_to_truncated_dt( $date ); - next unless $update_dt >= $start_time && $update_dt <= $end_time; - } + (my $id_date = $date) =~ s/\D//g; + my $id = $report->{itemId} . "_$id_date"; + + my %args = ( + status => $status, + external_status_code => $reason_for_closure, + update_id => $id, + service_request_id => $report->{itemId}, + description => $description, + updated_datetime => $update_dt, + extras => { latest_data_only => 1 }, + ); - (my $id_date = $date) =~ s/\D//g; - my $id = $update->{itemId} . "_$id_date"; + if ( my $assigned_to_user_id + = $attributes->{ $mapping->{assigned_to_user} // '' }[0] ) + { + my $assigned_to_user + = $assigned_to_users->{$assigned_to_user_id} ||= do { + # There is a possibility the assigned-to user is not + # already in the $assigned_to_users hash; do another + # lookup if so + $self->get_assigned_to_users($report) + ->{$assigned_to_user_id} + }; - my %args = ( - status => $status, - external_status_code => $reason_for_closure, - update_id => $resource->{signature}, - service_request_id => $update->{itemId}, - description => $description_to_send, - updated_datetime => $update_dt, - ); + $args{extras} = { %{$args{extras}}, %$assigned_to_user } if $assigned_to_user; - if ( my $assigned_to_user_id - = $attributes->{ $mapping->{assigned_to_user} // '' }[0] ) - { - my $assigned_to_user - = $assigned_to_users->{$assigned_to_user_id} ||= do { - # There is a possibility the assigned-to user is not - # already in the $assigned_to_users hash; do another - # lookup if so - $self->get_assigned_to_users($resource) - ->{$assigned_to_user_id} - }; - - $args{extras} = $assigned_to_user if $assigned_to_user; - } if ( my $extra_details_code = $mapping->{extra_details} ) { $args{extras}{detailed_information} = $attributes->{$extra_details_code} // ''; } - - push @updates, Open311::Endpoint::Service::Request::Update::mySociety->new( %args ); } + + push @updates, Open311::Endpoint::Service::Request::Update::mySociety->new( %args ); } return @updates; @@ -742,11 +723,6 @@ Alloy value to a status. If the status is open or investigating and there is a linked defect, the update is skipped. -Previous versions are fetched, as with 'inspections', their status worked out; -there are no text attributes checked here. It has some special code that I'm -not sure still applies, to prevent FMS adding phantom updates due to confusion -over external status codes. - =cut sub _get_defect_updates { @@ -768,59 +744,37 @@ sub _get_defect_updates_resource { my $end_time = $self->date_to_dt($args->{end_date}); my @updates; - my $closure_mapping = $self->config->{inspection_closure_mapping}; - my %reverse_closure_mapping = map { $closure_mapping->{$_} => $_ } keys %{$closure_mapping}; - my $updates = $self->fetch_updated_resources($resource_name, $args->{start_date}, $args->{end_date}); - for my $update (@$updates) { - next if $self->is_ignored_category( $update ); + for my $report (@$updates) { + next if $self->is_ignored_category( $report ); my $linked_defect; - my $attributes = $self->alloy->attributes_to_hash($update); + my $attributes = $self->alloy->attributes_to_hash($report); - my $service_request_id = $update->{itemId}; + my $service_request_id = $report->{itemId}; - my $fms_id = $self->_get_defect_fms_id( $attributes ); - - ($linked_defect, $service_request_id) = $self->_get_defect_inspection($update, $service_request_id); - $fms_id = undef if $linked_defect; + ($linked_defect, $service_request_id) = $self->_get_defect_inspection($report, $service_request_id); # we don't care about linked defects until they have been scheduled my $status = $self->defect_status($attributes); next if $self->_skip_job_update($linked_defect, $status); - my @version_ids = $self->get_versions_of_resource($update->{itemId}); - foreach my $date (@version_ids) { - my $update_dt = $self->date_to_truncated_dt($date); - next unless $update_dt >= $start_time && $update_dt <= $end_time; - - my $resource = $self->call_reconstruct($update->{itemId}, $date) or next; - my $attributes = $self->alloy->attributes_to_hash($resource); - my $status = $self->defect_status($attributes); - - my %args = ( - status => $status, - update_id => $resource->{signature}, - service_request_id => $service_request_id, - description => '', - updated_datetime => $update_dt, - ); - - # we need to set this to stop phantom updates being produced. This happens because - # when an inspection is closed it always sets an external_status_code which we never - # unset. Then when updates arrive from defects with no external_status_code the template - # fetching code at FixMyStreet sees that the external_status_code has changed and fetches - # the template. This means we always get an update even if nothing has changed. So, set - # this to the external_status_code used when an inspection is marked for raising as a - # defect. Only do this for 'action_scheduled' thouogh as otherwise the template lookup - # will fail as it will be looking for status + ext code which won't match. - if ( $status eq 'action_scheduled' && ( $fms_id || $linked_defect ) ) { - $args{external_status_code} = $reverse_closure_mapping{'action_scheduled'}; - } - $args{fixmystreet_id} = $fms_id if $fms_id; + my $date = $self->get_latest_version_date($report->{itemId}); + my $update_dt = $self->date_to_truncated_dt($date); + next unless $update_dt >= $start_time && $update_dt <= $end_time; + + (my $id_date = $date) =~ s/\D//g; + my $id = $report->{itemId} . "_$id_date"; + my %args = ( + status => $status, + update_id => $id, + service_request_id => $service_request_id, + description => '', + updated_datetime => $update_dt, + extras => { latest_data_only => 1 }, + ); - push @updates, Open311::Endpoint::Service::Request::Update::mySociety->new( %args ); - } + push @updates, Open311::Endpoint::Service::Request::Update::mySociety->new( %args ); } return @updates; @@ -1020,7 +974,7 @@ sub service_request_id_for_resource { return $resource->{item}->{itemId}; } -sub get_versions_of_resource { +sub get_latest_version_date { my ($self, $resource_id) = @_; my $versions = $self->alloy->api_call(call => "item-log/item/$resource_id")->{results}; @@ -1031,7 +985,7 @@ sub get_versions_of_resource { } @version_ids = sort(@version_ids); - return @version_ids; + return pop @version_ids; } sub date_to_dt { @@ -1168,8 +1122,6 @@ sub process_attributes { return \@remapped; } -sub _get_defect_fms_id { return undef; } - sub _get_defect_inspection { my ($self, $defect, $service_request_id) = @_; diff --git a/perllib/Open311/Endpoint/Integration/UK/Buckinghamshire/Alloy.pm b/perllib/Open311/Endpoint/Integration/UK/Buckinghamshire/Alloy.pm index cd80b0dae..ec8e4d805 100644 --- a/perllib/Open311/Endpoint/Integration/UK/Buckinghamshire/Alloy.pm +++ b/perllib/Open311/Endpoint/Integration/UK/Buckinghamshire/Alloy.pm @@ -10,6 +10,7 @@ package Open311::Endpoint::Integration::UK::Buckinghamshire::Alloy; use Moo; extends 'Open311::Endpoint::Integration::AlloyV2'; +with 'Role::Memcached'; around BUILDARGS => sub { my ($orig, $class, %args) = @_; @@ -97,10 +98,14 @@ sub _get_inspection_status { my $status_code = $attributes->{$mapping->{status}}->[0]; $status = $self->inspection_status($status_code); - my $status_obj = $self->alloy->api_call(call => "item/$status_code"); - $status_obj = $status_obj->{item}; - my $status_attributes = $self->alloy->attributes_to_hash($status_obj); - $ext_code = $status_attributes->{$mapping->{external_status_code}}; + $ext_code = $self->memcache->get("alloy-item-$status_code"); + unless ($ext_code) { + my $status_obj = $self->alloy->api_call(call => "item/$status_code"); + $status_obj = $status_obj->{item}; + my $status_attributes = $self->alloy->attributes_to_hash($status_obj); + $ext_code = $status_attributes->{$mapping->{external_status_code}}; + $self->memcache->set("alloy-item-$status_code", $ext_code, 86400); + } } return ($status, $ext_code); } diff --git a/t/open311/endpoint/alloyv2.t b/t/open311/endpoint/alloyv2.t index 057e0a49b..e3d7f192c 100644 --- a/t/open311/endpoint/alloyv2.t +++ b/t/open311/endpoint/alloyv2.t @@ -167,11 +167,6 @@ $integration->mock('api_call', sub { } else { $content = path(__FILE__)->sibling('json/alloyv2/inspect_search.json')->slurp; } - } elsif ( $call =~ 'item-log/item/([^/]*)/reconstruct' ) { - my $id = $1; - my $date = $body->{date}; - $date =~ s/\D//g; - $content = path(__FILE__)->sibling("json/alloyv2/reconstruct_${id}_$date.json")->slurp; } } else { if ( $call eq 'design/designs_enquiryInspectionRFS1001181_5d3245c5fe2ad806f8dfbaf6' ) { @@ -498,8 +493,6 @@ subtest "create problem with no resource_id" => sub { }; subtest "check fetch updates" => sub { - # Do it twice to check cache - for (1..2) { my $res = $endpoint->run_test_request( GET => '/servicerequestupdates.json?jurisdiction_id=dummy&start_date=2019-01-01T00:00:00Z&end_date=2019-03-01T02:00:00Z', ); @@ -510,64 +503,61 @@ subtest "check fetch updates" => sub { is_deeply decode_json($res->content), [ { - status => 'investigating', - service_request_id => '3027029', - description => '', - updated_datetime => '2019-01-01T00:22:40Z', - update_id => '5d32469bb4e1b90150014306', - media_url => '', - }, - { status => 'investigating', service_request_id => '3027029', description => 'This is an updated customer response', updated_datetime => '2019-01-01T00:32:40Z', - update_id => '5d32469bb4e1b90150014305', + update_id => '3027029_20190101003240', media_url => '', + extras => { latest_data_only => 1 }, }, { status => 'investigating', service_request_id => '3027030', description => '', updated_datetime => '2019-01-01T01:42:40Z', - update_id => '5d32469bb4e1b90150014307', + update_id => '3027030_20190101014240', media_url => '', + extras => { latest_data_only => 1 }, }, { status => 'not_councils_responsibility', service_request_id => '3027031', description => '', updated_datetime => '2019-01-01T01:43:40Z', - update_id => '6d32469bb4e1b90150014305', + update_id => '3027031_20190101014340', media_url => '', external_status_code => '01b51bb5c0de101a004154b5', + extras => { latest_data_only => 1 }, }, { status => 'action_scheduled', service_request_id => '3027032', description => '', updated_datetime => '2019-01-01T01:48:13Z', - update_id => '5d324086b4e1b90150f946a0', + update_id => '4947501_20190101014813', media_url => '', + extras => { latest_data_only => 1 }, }, { status => 'investigating', service_request_id => '3027034', description => '', updated_datetime => '2019-01-01T01:49:13Z', - update_id => '5d324086b4e1b90150f946a1', + update_id => '3027034_20190101014913', media_url => '', + extras => { latest_data_only => 1 }, }, { - status => 'fixed', + status => 'open', service_request_id => '4947502', description => '', updated_datetime => '2019-01-01T01:51:08Z', - update_id => '5d324049b4e1b90150f94191', + update_id => '4947502_20190101015108', media_url => '', + extras => { latest_data_only => 1 }, } ], 'correct json returned'; - } }; subtest "check fetch updates with cobrand skipping update where job has unchanged parent defect" => sub { @@ -581,45 +571,41 @@ subtest "check fetch updates with cobrand skipping update where job has unchange is_deeply decode_json($res->content), [ { - status => 'investigating', - service_request_id => '3027029', - description => '', - updated_datetime => '2019-01-01T00:22:40Z', - update_id => '5d32469bb4e1b90150014306', - media_url => '', - }, - { status => 'investigating', service_request_id => '3027029', description => 'This is an updated customer response', updated_datetime => '2019-01-01T00:32:40Z', - update_id => '5d32469bb4e1b90150014305', + update_id => '3027029_20190101003240', media_url => '', + extras => { latest_data_only => 1 }, }, { status => 'investigating', service_request_id => '3027030', description => '', updated_datetime => '2019-01-01T01:42:40Z', - update_id => '5d32469bb4e1b90150014307', + update_id => '3027030_20190101014240', media_url => '', + extras => { latest_data_only => 1 }, }, { status => 'not_councils_responsibility', service_request_id => '3027031', description => '', updated_datetime => '2019-01-01T01:43:40Z', - update_id => '6d32469bb4e1b90150014305', + update_id => '3027031_20190101014340', media_url => '', external_status_code => '01b51bb5c0de101a004154b5', + extras => { latest_data_only => 1 }, }, { status => 'investigating', service_request_id => '3027034', description => '', updated_datetime => '2019-01-01T01:49:13Z', - update_id => '5d324086b4e1b90150f946a1', + update_id => '3027034_20190101014913', media_url => '', + extras => { latest_data_only => 1 }, } ], 'correct json returned'; }; diff --git a/t/open311/endpoint/buckinghamshire_alloy.t b/t/open311/endpoint/buckinghamshire_alloy.t index ea6d6e585..1a622e784 100644 --- a/t/open311/endpoint/buckinghamshire_alloy.t +++ b/t/open311/endpoint/buckinghamshire_alloy.t @@ -62,11 +62,6 @@ $integration->mock('api_call', sub { } elsif ($type eq 'designs_customerReportDefect_62e43ee75039cb015e3287e9') { $content = path(__FILE__)->sibling('json/alloyv2/bucks_defects_search.json')->slurp; } - } elsif ( $call =~ 'item-log/item/([^/]*)/reconstruct' ) { - my $id = $1; - my $date = $body->{date}; - $date =~ s/\D//g; - $content = path(__FILE__)->sibling("json/alloyv2/bucks_reconstruct_${id}_$date.json")->slurp; } } elsif ( $call eq 'design/designs_streetLights' ) { $content = path(__FILE__)->sibling('json/alloyv2/occ_design_resource.json')->slurp; @@ -155,24 +150,16 @@ subtest "check fetch updates" => sub { is_deeply decode_json($res->content), [ - { - description => "", - media_url => "", - service_request_id => "63ee34826965f30390f01cda", - status => "open", - external_status_code => '060', - update_id => "63ee34826965f30390f01ce3", - updated_datetime => "2023-02-16T13:49:54Z" - }, { description => "", media_url => "", service_request_id => "63ee34826965f30390f01cda", status => "action_scheduled", external_status_code => '306', - update_id => "63ee3490b016c303ae032113", - updated_datetime => "2023-02-16T13:50:08Z" - } + update_id => "63ee34826965f30390f01cda_20230216135008792", + updated_datetime => "2023-02-16T13:50:08Z", + extras => { latest_data_only => 1 }, + }, ], 'correct json returned'; }; diff --git a/t/open311/endpoint/hackney_alloy.t b/t/open311/endpoint/hackney_alloy.t index c5021cad4..f2c3d2dbd 100644 --- a/t/open311/endpoint/hackney_alloy.t +++ b/t/open311/endpoint/hackney_alloy.t @@ -60,11 +60,6 @@ $integration->mock('api_call', sub { } elsif ($type eq 'designs_fixedMyStreetDefect') { $content = path(__FILE__)->sibling('json/hackney_environment/defects_search.json')->slurp; } - } elsif ( $call =~ 'item-log/item/([^/]*)/reconstruct' ) { - my $id = $1; - my $date = $body->{date}; - $date =~ s/\D//g; - $content = path(__FILE__)->sibling("json/hackney_environment/reconstruct_${id}_$date.json")->slurp; } } elsif ( $call =~ 'item-log/item/(.*)$' ) { $content = path(__FILE__)->sibling("json/hackney_environment/item_log_$1.json")->slurp; @@ -158,23 +153,16 @@ subtest "check fetch updates" => sub { is_deeply decode_json($res->content), [ - { - description => "", - media_url => "", - service_request_id => "625ffffffffae7015ac40c5b", - status => "open", - update_id => "625fffffff62a1016ce7f779", - updated_datetime => "2022-04-20T08:19:26Z" - }, { description => "", media_url => "", service_request_id => "625ffffffffae7015ac40c5b", # this is derived from the Hackney Environment-specific defect_status code status => "not_councils_responsibility", - update_id => "625fe4b24edcdb01584733b2", - updated_datetime => "2022-04-20T10:47:14Z" - } + update_id => "625ffffffffae7015ac40c5b_20220420104714612", + updated_datetime => "2022-04-20T10:47:14Z", + extras => { latest_data_only => 1 }, + }, ], 'correct json returned'; }; diff --git a/t/open311/endpoint/json/alloyv2/bucks_defects_search.json b/t/open311/endpoint/json/alloyv2/bucks_defects_search.json index 182ab919f..6a4663dd6 100644 --- a/t/open311/endpoint/json/alloyv2/bucks_defects_search.json +++ b/t/open311/endpoint/json/alloyv2/bucks_defects_search.json @@ -31,7 +31,7 @@ { "attributeCode": "attributes_customerReportDefectCustomerStatus_63690956d76320038c423af5", "value": [ - "638610d11de74303a7ce77df" + "638610d11de74303a7ce77f3" ] } ], diff --git a/t/open311/endpoint/json/alloyv2/bucks_reconstruct_63ee34826965f30390f01cda_20230216134954750.json b/t/open311/endpoint/json/alloyv2/bucks_reconstruct_63ee34826965f30390f01cda_20230216134954750.json deleted file mode 100644 index bd60219bb..000000000 --- a/t/open311/endpoint/json/alloyv2/bucks_reconstruct_63ee34826965f30390f01cda_20230216134954750.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "log": { - "itemId": "63ee34826965f30390f01cda", - "designCode": "designs_customerReportDefect_62e43ee75039cb015e3287e9", - "action": "Create", - "causes": [], - "date": "2023-02-16T13:49:54.750Z", - "username": "fixmystreetfixmystreet" - }, - "item": { - "itemId": "63ee34826965f30390f01cda", - "designCode": "designs_customerReportDefect_62e43ee75039cb015e3287e9", - "attributes": [ - { - "attributeCode": "attributes_customerReportDefectCRMReference_62e43eea0d2c1a0153b1c561", - "value": "123" - }, - { - "attributeCode": "attributes_defectsDescription", - "value": "Test" - }, - { - "attributeCode": "attributes_customerReportDefectReportedIssueText_636b830bd1026a0394a10de1", - "value": "Description" - }, - { - "attributeCode": "attributes_defectsReportedDate", - "value": "2023-02-16T13:49:00.000Z" - }, - { - "attributeCode": "attributes_customerReportDefectSubCategory_62e43eed0d2c1a0153b1c56e", - "value": [ - "63d157ad3919a703aea03dae" - ] - }, - { - "attributeCode": "attributes_customerReportDefectCustomerStatus_63690956d76320038c423af5", - "value": [ - "638610d11de74303a7ce77df" - ] - } - ], - "signature": "63ee34826965f30390f01ce3" - } -} diff --git a/t/open311/endpoint/json/alloyv2/bucks_reconstruct_63ee34826965f30390f01cda_20230216135008792.json b/t/open311/endpoint/json/alloyv2/bucks_reconstruct_63ee34826965f30390f01cda_20230216135008792.json deleted file mode 100644 index 8c29ed6d8..000000000 --- a/t/open311/endpoint/json/alloyv2/bucks_reconstruct_63ee34826965f30390f01cda_20230216135008792.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "log": { - "itemId": "63ee34826965f30390f01cda", - "designCode": "designs_customerReportDefect_62e43ee75039cb015e3287e9", - "action": "Edit", - "causes": [ - { - "workflowRunId": "63ee348be5b28203ae91632d", - "discriminator": "ItemChangeCauseWorkflowWebModel" - } - ], - "date": "2023-02-16T13:50:08.792Z", - "username": "alloybot" - }, - "item": { - "itemId": "63ee34826965f30390f01cda", - "designCode": "designs_customerReportDefect_62e43ee75039cb015e3287e9", - "attributes": [ - { - "attributeCode": "attributes_customerReportDefectCRMReference_62e43eea0d2c1a0153b1c561", - "value": "123" - }, - { - "attributeCode": "attributes_defectsDescription", - "value": "Test" - }, - { - "attributeCode": "attributes_customerReportDefectReportedIssueText_636b830bd1026a0394a10de1", - "value": "Description" - }, - { - "attributeCode": "attributes_defectsReportedDate", - "value": "2023-02-16T13:49:00.000Z" - }, - { - "attributeCode": "attributes_customerReportDefectSubCategory_62e43eed0d2c1a0153b1c56e", - "value": [ - "63d157ad3919a703aea03dae" - ] - }, - { - "attributeCode": "attributes_customerReportDefectCustomerStatus_63690956d76320038c423af5", - "value": [ - "638610d11de74303a7ce77f3" - ] - } - ], - "signature": "63ee3490b016c303ae032113" - }, - "previous": { - "attributes": [], - "signature": "63ee34826965f30390f01ce3" - } -} diff --git a/t/open311/endpoint/json/alloyv2/inspect_search.json b/t/open311/endpoint/json/alloyv2/inspect_search.json index 06d427926..2b72e86b3 100644 --- a/t/open311/endpoint/json/alloyv2/inspect_search.json +++ b/t/open311/endpoint/json/alloyv2/inspect_search.json @@ -17,12 +17,12 @@ "colour": "#99cf22", "attributes":[ { - "attributeCode": "attributes_tastStatus", - "value": [""] + "attributeCode": "attributes_taskStatus", + "value": ["5bc5bdd281d088d177342c73"] }, { "attributeCode": "attributes_enquiryInspectionRFS1001181ResponseToCustomer1011096_5d3245dafe2ad806f8dfbb2e", - "value": "" + "value": "This is an updated customer response" }, { "attributeCode": "attributes_enquiryInspectionRFS1001181ReasonForClosure1010926_5d3245d8fe2ad806f8dfbb24", @@ -47,8 +47,8 @@ "colour": "#99cf22", "attributes":[ { - "attributeCode": "attributes_tastStatus", - "value": [""] + "attributeCode": "attributes_taskStatus", + "value": ["5bc5bdd281d088d177342c74"] }, { "attributeCode": "attributes_enquiryInspectionRFS1001181ResponseToCustomer1011096_5d3245dafe2ad806f8dfbb2e", @@ -77,8 +77,8 @@ "colour": "#99cf22", "attributes":[ { - "attributeCode": "attributes_tastStatus", - "value": [""] + "attributeCode": "attributes_taskStatus", + "value": ["5bc5bdd281d088d177342c76"] }, { "attributeCode": "attributes_enquiryInspectionRFS1001181ResponseToCustomer1011096_5d3245dafe2ad806f8dfbb2e", @@ -86,7 +86,7 @@ }, { "attributeCode": "attributes_enquiryInspectionRFS1001181ReasonForClosure1010926_5d3245d8fe2ad806f8dfbb24", - "value": [""] + "value": ["01b51bb5c0de101a004154b5"] } ], "signature": "5d32469bb4e1b90150014305", @@ -107,8 +107,8 @@ "colour": "#99cf22", "attributes":[ { - "attributeCode": "attributes_tastStatus", - "value": [""] + "attributeCode": "attributes_taskStatus", + "value": ["5bc5bdd281d088d177342c73"] }, { "attributeCode": "attributes_enquiryInspectionRFS1001181ResponseToCustomer1011096_5d3245dafe2ad806f8dfbb2e", diff --git a/t/open311/endpoint/json/alloyv2/northumberland/customer_requests_query_response.json b/t/open311/endpoint/json/alloyv2/northumberland/customer_requests_query_response.json index 329ba4c30..ebf2f0b68 100644 --- a/t/open311/endpoint/json/alloyv2/northumberland/customer_requests_query_response.json +++ b/t/open311/endpoint/json/alloyv2/northumberland/customer_requests_query_response.json @@ -76,12 +76,12 @@ }, { "attributeCode": "attributes_customerRequestFMSExtraDetails_646e07533726d8036a7a4022", - "value": "Goodbye here" + "value": "Hello there" }, { "attributeCode": "attributes_customerRequestAssignedTo_653664b0557119eef53a97e1", "value": [ - "234" + "345" ] } ] diff --git a/t/open311/endpoint/json/alloyv2/northumberland/reconstruct_123456_20231113110500.json b/t/open311/endpoint/json/alloyv2/northumberland/reconstruct_123456_20231113110500.json deleted file mode 100644 index a244b0a04..000000000 --- a/t/open311/endpoint/json/alloyv2/northumberland/reconstruct_123456_20231113110500.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "item": { - "collection": "Live", - "designCode": "designs_customerRequest_6386279ffb3d97038c4e03a9", - "itemId": "123456", - "signature": "100001", - "attributes": [ - { - "attributeCode": "attributes_customerRequestFMSSummary_63862bd505cb250393c204d7", - "value": "Something is broken" - }, - { - "attributeCode": "attributes_customerRequestFMSDescription_63862bed05cb250393c2096d", - "value": "Please fix it" - }, - { - "attributeCode": "attributes_customerRequestFixMyStreetID_63862c38bafbd20397883f72", - "value": "5000063" - }, - { - "attributeCode": "attributes_customerRequestRequestCategory_63862851fb3d97038c4e1cfc", - "value": [ - "61fb016c4c5c56015448093f" - ] - }, - { - "attributeCode": "attributes_customerRequestFMSStatus_6391f99705cb2503934eb858", - "value": [ - "6391f9639e005f039665d65a" - ] - }, - { - "attributeCode": "attributes_customerRequestEmail_63868f209e005f0396e519ca", - "value": "person@email.com" - }, - { - "attributeCode": "attributes_customerRequestFMSExtraDetails_646e07533726d8036a7a4022", - "value": "Hello there" - }, - { - "attributeCode": "attributes_customerRequestAssignedTo_653664b0557119eef53a97e1", - "value": [ - "123" - ] - } - ] - } -} diff --git a/t/open311/endpoint/json/alloyv2/northumberland/reconstruct_234567_20231113110500.json b/t/open311/endpoint/json/alloyv2/northumberland/reconstruct_234567_20231113110500.json deleted file mode 100644 index f7d8f3d7c..000000000 --- a/t/open311/endpoint/json/alloyv2/northumberland/reconstruct_234567_20231113110500.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "item": { - "collection": "Live", - "designCode": "designs_customerRequest_6386279ffb3d97038c4e03a9", - "itemId": "234567", - "signature": "200002", - "attributes": [ - { - "attributeCode": "attributes_customerRequestFMSSummary_63862bd505cb250393c204d7", - "value": "Something is bothering me" - }, - { - "attributeCode": "attributes_customerRequestFMSDescription_63862bed05cb250393c2096d", - "value": "Please help me" - }, - { - "attributeCode": "attributes_customerRequestFixMyStreetID_63862c38bafbd20397883f72", - "value": "5000063" - }, - { - "attributeCode": "attributes_customerRequestRequestCategory_63862851fb3d97038c4e1cfc", - "value": [ - "61fb016c4c5c56015448093f" - ] - }, - { - "attributeCode": "attributes_customerRequestFMSStatus_6391f99705cb2503934eb858", - "value": [ - "6391f9639e005f039665d65a" - ] - }, - { - "attributeCode": "attributes_customerRequestEmail_63868f209e005f0396e519ca", - "value": "person@email.com" - }, - { - "attributeCode": "attributes_customerRequestAssignedTo_653664b0557119eef53a97e1", - "value": [ - "234" - ] - } - ] - } -} diff --git a/t/open311/endpoint/json/alloyv2/northumberland/reconstruct_234567_20231113111000.json b/t/open311/endpoint/json/alloyv2/northumberland/reconstruct_234567_20231113111000.json deleted file mode 100644 index e83364a63..000000000 --- a/t/open311/endpoint/json/alloyv2/northumberland/reconstruct_234567_20231113111000.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "item": { - "collection": "Live", - "designCode": "designs_customerRequest_6386279ffb3d97038c4e03a9", - "itemId": "234567", - "signature": "200002", - "attributes": [ - { - "attributeCode": "attributes_customerRequestFMSSummary_63862bd505cb250393c204d7", - "value": "Something is bothering me" - }, - { - "attributeCode": "attributes_customerRequestFMSDescription_63862bed05cb250393c2096d", - "value": "Please help me" - }, - { - "attributeCode": "attributes_customerRequestFixMyStreetID_63862c38bafbd20397883f72", - "value": "5000063" - }, - { - "attributeCode": "attributes_customerRequestRequestCategory_63862851fb3d97038c4e1cfc", - "value": [ - "61fb016c4c5c56015448093f" - ] - }, - { - "attributeCode": "attributes_customerRequestFMSStatus_6391f99705cb2503934eb858", - "value": [ - "6391f9639e005f039665d65a" - ] - }, - { - "attributeCode": "attributes_customerRequestEmail_63868f209e005f0396e519ca", - "value": "person@email.com" - }, - { - "attributeCode": "attributes_customerRequestAssignedTo_653664b0557119eef53a97e1", - "value": [ - "345" - ] - } - ] - } -} diff --git a/t/open311/endpoint/json/alloyv2/reconstruct_0203824fc0de101a008fbb4f_20190101014844.json b/t/open311/endpoint/json/alloyv2/reconstruct_0203824fc0de101a008fbb4f_20190101014844.json deleted file mode 100644 index 69ed05d49..000000000 --- a/t/open311/endpoint/json/alloyv2/reconstruct_0203824fc0de101a008fbb4f_20190101014844.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "item": - { - "itemId": "4947501", - "designCode": "designs_ancillaryItems1000793_5d324047fe2ad806f8dfb464", - "collection": "Live", - "start": "2019-01-01T00:00:00.723Z", - "end": "9999-12-31T23:59:59.999Z", - "geometry": { - "type": "Point", - "coordinates": [ - -0.5878147518991453, - 52.31519007307925 - ] - }, - "icon": "icon-defect-full", - "colour": "#AAC6Df", - "attributes": [ - { - "attributeCode": "attributes_defectsReportedDate", - "value": "2019-06-20T14:34:00.000Z" - }, - { - "attributeCode": "attributes_defectsStatus", - "value": [ - "5c8bdfc88ae862230019dc22" - ] - }, - { - "attributeCode": "attributes_defectsDefectNumber", - "value": 203262 - }, - { - "attributeCode": "attributes_ancillaryItems1000793OriginalDefectNumber1003788_5d324051fe2ad806f8dfb46c", - "value": "DEF-00203262" - }, - { - "attributeCode": "attributes_ancillaryItems1000793TeamMembers1005688_5d324052fe2ad806f8dfb471", - "value": [ - "0203a7d0c0de101a008fe0d0" - ] - }, - { - "attributeCode": "attributes_ancillaryItems1000793DefectType1005689_5d324052fe2ad806f8dfb476", - "value": [ - "018fae47c0de101a001be747" - ] - }, - { - "attributeCode": "attributes_ancillaryItems1000793TreatmentType1005690_5d324053fe2ad806f8dfb47b", - "value": [ - "018facffc0de101a001be5ff" - ] - }, - { - "attributeCode": "attributes_ancillaryItems1000793RepairType1005691_5d324054fe2ad806f8dfb480", - "value": [ - "01854946c0de101a00118246" - ] - }, - { - "attributeCode": "attributes_ancillaryItems1000793Priorities1005692_5d324055fe2ad806f8dfb485", - "value": [ - "01b51bbac0de101a004154ba" - ] - }, - { - "attributeCode": "attributes_ancillaryItems1000793LocationDescription1006369_5d324057fe2ad806f8dfb48f", - "value": "A6 Bypass Higham Ferrers - from Chowns Mill roundabout to Kimbolton Road" - }, - { - "attributeCode": "attributes_ancillaryItems1000793PermRepairDescription1006371_5d324059fe2ad806f8dfb499", - "value": "Repair VRS barrier - wire rope posts" - }, - { - "attributeCode": "attributes_defectsRemediedDate", - "value": "2019-06-26T13:23:00.000Z" - }, - { - "attributeCode": "attributes_ancillaryItems1000793ActivityCode1011097_5d32405afe2ad806f8dfb49e", - "value": "AI" - }, - { - "attributeCode": "attributes_ancillaryItems1000793TargetDate1011490_5d32405bfe2ad806f8dfb4a3", - "value": "2019-12-19T00:00:00.000Z" - } - ], - "signature": "5d324086b4e1b90150f946a0", - "title": "DEF-3401", - "subtitle": "Ancillary Items" - } -} diff --git a/t/open311/endpoint/json/alloyv2/reconstruct_3027029_20181231003240.json b/t/open311/endpoint/json/alloyv2/reconstruct_3027029_20181231003240.json deleted file mode 100644 index c4f3f14a0..000000000 --- a/t/open311/endpoint/json/alloyv2/reconstruct_3027029_20181231003240.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "item": - { - "itemId": "3027029", - "designCode": "designs_enquiryInspectionRFS1001181_5d3245c5fe2ad806f8dfbaf6", - "collection": "Live", - "start": "2019-01-01T00:32:40Z", - "end": "9999-12-31T23:59:59.999Z", - "geometry":{ - "type": "Point", - "coordinates":[-0.89868522337640622, 52.112591554183062] - }, - "icon": "icon-inspection-unknown", - "colour": "#99cf22", - "attributes":[ - { - "attributeCode": "attributes_taskStatus", - "value": ["5bc5bdd281d088d177342c73"] - }, - { - "attributeCode": "attributes_enquiryInspectionRFS1001181ResponseToCustomer1011096_5d3245dafe2ad806f8dfbb2e", - "value": "This is a customer response" - }, - { - "attributeCode": "attributes_enquiryInspectionRFS1001181ReasonForClosure1010926_5d3245d8fe2ad806f8dfbb24", - "value": [""] - } - ], - "signature": "5d32469bb4e1b90150014305", - "title": "INS-34032, 1584451", - "subtitle": "Enquiry Inspection RFS" - } -} diff --git a/t/open311/endpoint/json/alloyv2/reconstruct_3027029_20190101002240.json b/t/open311/endpoint/json/alloyv2/reconstruct_3027029_20190101002240.json deleted file mode 100644 index 1b44a5a2d..000000000 --- a/t/open311/endpoint/json/alloyv2/reconstruct_3027029_20190101002240.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "item": - { - "itemId": "3027029", - "designCode": "designs_enquiryInspectionRFS1001181_5d3245c5fe2ad806f8dfbaf6", - "collection": "Live", - "start": "2019-01-01T00:32:40Z", - "end": "9999-12-31T23:59:59.999Z", - "geometry":{ - "type": "Point", - "coordinates":[-0.89868522337640622, 52.112591554183062] - }, - "icon": "icon-inspection-unknown", - "colour": "#99cf22", - "attributes":[ - { - "attributeCode": "attributes_taskStatus", - "value": ["5bc5bdd281d088d177342c73"] - }, - { - "attributeCode": "attributes_enquiryInspectionRFS1001181ResponseToCustomer1011096_5d3245dafe2ad806f8dfbb2e", - "value": "This is a customer response" - }, - { - "attributeCode": "attributes_enquiryInspectionRFS1001181ReasonForClosure1010926_5d3245d8fe2ad806f8dfbb24", - "value": [""] - } - ], - "signature": "5d32469bb4e1b90150014306", - "title": "INS-34032, 1584451", - "subtitle": "Enquiry Inspection RFS" - } -} diff --git a/t/open311/endpoint/json/alloyv2/reconstruct_3027029_20190101003240.json b/t/open311/endpoint/json/alloyv2/reconstruct_3027029_20190101003240.json deleted file mode 100644 index b238bcc81..000000000 --- a/t/open311/endpoint/json/alloyv2/reconstruct_3027029_20190101003240.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "item": - { - "itemId": "3027029", - "designCode": "designs_enquiryInspectionRFS1001181_5d3245c5fe2ad806f8dfbaf6", - "collection": "Live", - "start": "2019-01-01T00:32:40Z", - "end": "9999-12-31T23:59:59.999Z", - "geometry":{ - "type": "Point", - "coordinates":[-0.89868522337640622, 52.112591554183062] - }, - "icon": "icon-inspection-unknown", - "colour": "#99cf22", - "attributes":[ - { - "attributeCode": "attributes_taskStatus", - "value": ["5bc5bdd281d088d177342c73"] - }, - { - "attributeCode": "attributes_enquiryInspectionRFS1001181ResponseToCustomer1011096_5d3245dafe2ad806f8dfbb2e", - "value": "This is an updated customer response" - }, - { - "attributeCode": "attributes_enquiryInspectionRFS1001181ReasonForClosure1010926_5d3245d8fe2ad806f8dfbb24", - "value": [""] - } - ], - "signature": "5d32469bb4e1b90150014305", - "title": "INS-34032, 1584451", - "subtitle": "Enquiry Inspection RFS" - } -} diff --git a/t/open311/endpoint/json/alloyv2/reconstruct_3027030_20190101014240.json b/t/open311/endpoint/json/alloyv2/reconstruct_3027030_20190101014240.json deleted file mode 100644 index f256e2315..000000000 --- a/t/open311/endpoint/json/alloyv2/reconstruct_3027030_20190101014240.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "item": - { - "itemId": "3027029", - "designCode": "designs_enquiryInspectionRFS1001181_5d3245c5fe2ad806f8dfbaf6", - "collection": "Live", - "start": "2019-01-01T01:42:40Z", - "end": "9999-12-31T23:59:59.999Z", - "geometry":{ - "type": "Point", - "coordinates":[-0.89868522337640622, 52.112591554183062] - }, - "icon": "icon-inspection-unknown", - "colour": "#99cf22", - "attributes":[ - { - "attributeCode": "attributes_taskStatus", - "value": ["5bc5bdd281d088d177342c74"] - }, - { - "attributeCode": "attributes_enquiryInspectionRFS1001181ResponseToCustomer1011096_5d3245dafe2ad806f8dfbb2e", - "value": "" - }, - { - "attributeCode": "attributes_enquiryInspectionRFS1001181ReasonForClosure1010926_5d3245d8fe2ad806f8dfbb24", - "value": [""] - } - ], - "signature": "5d32469bb4e1b90150014307", - "title": "INS-34032, 1584451", - "subtitle": "Enquiry Inspection RFS" - } -} diff --git a/t/open311/endpoint/json/alloyv2/reconstruct_3027031_20190101014340.json b/t/open311/endpoint/json/alloyv2/reconstruct_3027031_20190101014340.json deleted file mode 100644 index 9993d7186..000000000 --- a/t/open311/endpoint/json/alloyv2/reconstruct_3027031_20190101014340.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "item": - { - "itemId": "3027029", - "designCode": "designs_enquiryInspectionRFS1001181_5d3245c5fe2ad806f8dfbaf6", - "collection": "Live", - "start": "2019-01-01T01:43:40Z", - "end": "9999-12-31T23:59:59.999Z", - "geometry":{ - "type": "Point", - "coordinates":[-0.89868522337640622, 52.112591554183062] - }, - "icon": "icon-inspection-unknown", - "colour": "#99cf22", - "attributes":[ - { - "attributeCode": "attributes_taskStatus", - "value": ["5bc5bdd281d088d177342c76"] - }, - { - "attributeCode": "attributes_enquiryInspectionRFS1001181ResponseToCustomer1011096_5d3245dafe2ad806f8dfbb2e", - "value": "" - }, - { - "attributeCode": "attributes_enquiryInspectionRFS1001181ReasonForClosure1010926_5d3245d8fe2ad806f8dfbb24", - "value": ["01b51bb5c0de101a004154b5"] - } - ], - "signature": "6d32469bb4e1b90150014305", - "title": "INS-34032, 1584451", - "subtitle": "Enquiry Inspection RFS" - } -} diff --git a/t/open311/endpoint/json/alloyv2/reconstruct_3027032_20190101003240.json b/t/open311/endpoint/json/alloyv2/reconstruct_3027032_20190101003240.json deleted file mode 100644 index 6c37a30cf..000000000 --- a/t/open311/endpoint/json/alloyv2/reconstruct_3027032_20190101003240.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "item": - { - "itemId": "3027032", - "designCode": "designs_enquiryInspectionRFS1001181_5d3245c5fe2ad806f8dfbaf6", - "collection": "Live", - "start": "2019-01-01T00:32:40Z", - "end": "9999-12-31T23:59:59.999Z", - "geometry":{ - "type": "Point", - "coordinates":[-0.89868522337640622, 52.112591554183062] - }, - "icon": "icon-inspection-unknown", - "colour": "#99cf22", - "attributes":[ - { - "attributeCode": "attributes_taskStatus", - "value": ["01b51bb6c0de101a004154b7"] - }, - { - "attributeCode": "attributes_enquiryInspectionRFS1001181ResponseToCustomer1011096_5d3245dafe2ad806f8dfbb2e", - "value": "This is a customer response" - }, - { - "attributeCode": "attributes_enquiryInspectionRFS1001181ReasonForClosure1010926_5d3245d8fe2ad806f8dfbb24", - "value": [""] - } - ], - "signature": "5d32469bb4e1b90150014307", - "title": "INS-34032, 1584451", - "subtitle": "Enquiry Inspection RFS" - } -} diff --git a/t/open311/endpoint/json/alloyv2/reconstruct_3027034_20190101014913.json b/t/open311/endpoint/json/alloyv2/reconstruct_3027034_20190101014913.json deleted file mode 100644 index 2d35bf462..000000000 --- a/t/open311/endpoint/json/alloyv2/reconstruct_3027034_20190101014913.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "item": - { - "itemId": "3027034", - "designCode": "designs_enquiryInspectionRFS1001181_5d3245c5fe2ad806f8dfbaf6", - "collection": "Live", - "start": "2019-01-01T00:32:40Z", - "end": "9999-12-31T23:59:59.999Z", - "geometry":{ - "type": "Point", - "coordinates":[-0.89868522337640622, 52.112591554183062] - }, - "icon": "icon-inspection-unknown", - "colour": "#99cf22", - "attributes":[ - { - "attributeCode": "attributes_taskStatus", - "value": ["5bc5bdd281d088d177342c73"] - }, - { - "attributeCode": "attributes_enquiryInspectionRFS1001181ResponseToCustomer1011096_5d3245dafe2ad806f8dfbb2e", - "value": "" - }, - { - "attributeCode": "attributes_enquiryInspectionRFS1001181ReasonForClosure1010926_5d3245d8fe2ad806f8dfbb24", - "value": [""] - } - ], - "signature": "5d324086b4e1b90150f946a1", - "title": "INS-34032, 1584451", - "subtitle": "Enquiry Inspection RFS" - } -} diff --git a/t/open311/endpoint/json/alloyv2/reconstruct_3027052_20190106003240.json b/t/open311/endpoint/json/alloyv2/reconstruct_3027052_20190106003240.json deleted file mode 100644 index 482978d17..000000000 --- a/t/open311/endpoint/json/alloyv2/reconstruct_3027052_20190106003240.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "item": - { - "itemId": "3027052", - "designCode": "designs_enquiryInspectionRFS1001181_5d3245c5fe2ad806f8dfbaf6", - "collection": "Live", - "start": "2019-01-06T00:32:40Z", - "end": "9999-12-31T23:59:59.999Z", - "geometry":{ - "type": "Point", - "coordinates":[-0.89868522337640622, 52.112591554183062] - }, - "icon": "icon-inspection-unknown", - "colour": "#99cf22", - "attributes":[ - { - "attributeCode": "attributes_taskStatus", - "value": ["5bc5bdd281d088d177342c76"] - }, - { - "attributeCode": "attributes_enquiryInspectionRFS1001181ResponseToCustomer1011096_5d3245dafe2ad806f8dfbb2e", - "value": "This is a customer response" - }, - { - "attributeCode": "attributes_enquiryInspectionRFS1001181ReasonForClosure1010926_5d3245d8fe2ad806f8dfbb24", - "value": ["01b51bb6c0de101a004154b7"] - } - ], - "signature": "5d32469bb4e1b90150014308", - "title": "INS-34032, 1584451", - "subtitle": "Enquiry Inspection RFS" - } -} diff --git a/t/open311/endpoint/json/alloyv2/reconstruct_4947501_20190101014813.json b/t/open311/endpoint/json/alloyv2/reconstruct_4947501_20190101014813.json deleted file mode 100644 index 8823ca806..000000000 --- a/t/open311/endpoint/json/alloyv2/reconstruct_4947501_20190101014813.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "item": - { - "itemId": "4947501", - "designCode": "designs_ancillaryItems1000793_5d324047fe2ad806f8dfb464", - "collection": "Live", - "start": "2019-01-01T00:00:00.723Z", - "end": "9999-12-31T23:59:59.999Z", - "geometry": { - "type": "Point", - "coordinates": [ - -0.5878147518991453, - 52.31519007307925 - ] - }, - "icon": "icon-defect-full", - "colour": "#AAC6Df", - "attributes": [ - { - "attributeCode": "attributes_defectsReportedDate", - "value": "2019-06-20T14:34:00.000Z" - }, - { - "attributeCode": "attributes_defectsStatus", - "value": [ - "5c8bdfc18ae862230019dc21" - ] - }, - { - "attributeCode": "attributes_defectsDefectNumber", - "value": 203262 - }, - { - "attributeCode": "attributes_ancillaryItems1000793OriginalDefectNumber1003788_5d324051fe2ad806f8dfb46c", - "value": "DEF-00203262" - }, - { - "attributeCode": "attributes_ancillaryItems1000793TeamMembers1005688_5d324052fe2ad806f8dfb471", - "value": [ - "0203a7d0c0de101a008fe0d0" - ] - }, - { - "attributeCode": "attributes_ancillaryItems1000793DefectType1005689_5d324052fe2ad806f8dfb476", - "value": [ - "018fae47c0de101a001be747" - ] - }, - { - "attributeCode": "attributes_ancillaryItems1000793TreatmentType1005690_5d324053fe2ad806f8dfb47b", - "value": [ - "018facffc0de101a001be5ff" - ] - }, - { - "attributeCode": "attributes_ancillaryItems1000793RepairType1005691_5d324054fe2ad806f8dfb480", - "value": [ - "01854946c0de101a00118246" - ] - }, - { - "attributeCode": "attributes_ancillaryItems1000793Priorities1005692_5d324055fe2ad806f8dfb485", - "value": [ - "01b51bbac0de101a004154ba" - ] - }, - { - "attributeCode": "attributes_ancillaryItems1000793LocationDescription1006369_5d324057fe2ad806f8dfb48f", - "value": "A6 Bypass Higham Ferrers - from Chowns Mill roundabout to Kimbolton Road" - }, - { - "attributeCode": "attributes_ancillaryItems1000793PermRepairDescription1006371_5d324059fe2ad806f8dfb499", - "value": "Repair VRS barrier - wire rope posts" - }, - { - "attributeCode": "attributes_defectsRemediedDate", - "value": "2019-06-26T13:23:00.000Z" - }, - { - "attributeCode": "attributes_ancillaryItems1000793ActivityCode1011097_5d32405afe2ad806f8dfb49e", - "value": "AI" - }, - { - "attributeCode": "attributes_ancillaryItems1000793TargetDate1011490_5d32405bfe2ad806f8dfb4a3", - "value": "2019-12-19T00:00:00.000Z" - } - ], - "signature": "5d324086b4e1b90150f946a0", - "title": "DEF-3401", - "subtitle": "Ancillary Items" - } -} diff --git a/t/open311/endpoint/json/alloyv2/reconstruct_4947502_20190101015108.json b/t/open311/endpoint/json/alloyv2/reconstruct_4947502_20190101015108.json deleted file mode 100644 index 796f843e6..000000000 --- a/t/open311/endpoint/json/alloyv2/reconstruct_4947502_20190101015108.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "item": - { - "itemId": "4947502", - "designCode": "designs_benches1000794_5d32400ffe2ad80354bbdae6", - "collection": "Live", - "start": "2019-01-01T00:00:00.002Z", - "end": "9999-12-31T23:59:59.999Z", - "geometry": { - "type": "Point", - "coordinates": [ - -0.9050079189236898, - 52.236715671161356 - ] - }, - "icon": "icon-defect-full", - "colour": "#AAC6Df", - "attributes": [ - { - "attributeCode": "attributes_defectsDescription", - "value": "Broken Northampton Borough Council benches x 2" - }, - { - "attributeCode": "attributes_defectsReportedDate", - "value": "2019-04-26T06:35:00.000Z" - }, - { - "attributeCode": "attributes_defectsStatus", - "value": [ - "5c8bdfc88ae862230019dc22" - ] - }, - { - "attributeCode": "attributes_defectsDefectNumber", - "value": 200842 - }, - { - "attributeCode": "attributes_benches1000794OriginalDefectNumber1003788_5d324018fe2ad80354bbdaee", - "value": "DEF-00200842" - }, - { - "attributeCode": "attributes_benches1000794TeamMembers1005709_5d324018fe2ad80354bbdaf3", - "value": [ - "02037ebbc0de101a008fb7bb" - ] - }, - { - "attributeCode": "attributes_benches1000794DefectType1005710_5d32401afe2ad80354bbdaf8", - "value": [ - "018fae6ac0de101a001be76a" - ] - }, - { - "attributeCode": "attributes_benches1000794RepairType1005712_5d32401bfe2ad80354bbdafd", - "value": [ - "01854946c0de101a00118246" - ] - }, - { - "attributeCode": "attributes_benches1000794Priorities1005713_5d32401cfe2ad80354bbdb02", - "value": [ - "01b51bb8c0de101a004154b8" - ] - }, - { - "attributeCode": "attributes_benches1000794LocationDescription1006378_5d32401efe2ad80354bbdb0c", - "value": "On centre island, Black Lion Hill" - }, - { - "attributeCode": "attributes_benches1000794PermRepairDescription1006380_5d324020fe2ad80354bbdb16", - "value": "Emailed Hub to refer to Northampton Borough Council for renewal/repair" - }, - { - "attributeCode": "attributes_benches1000794TreatmentType1007311_5d324021fe2ad80354bbdb1b", - "value": [ - "018fad07c0de101a001be607" - ] - }, - { - "attributeCode": "attributes_benches1000794ActivityCode1011100_5d324022fe2ad80354bbdb20", - "value": "BE" - } - ], - "signature": "5d324049b4e1b90150f94191", - "title": "DEF-3400", - "subtitle": "Benches" - } -} diff --git a/t/open311/endpoint/json/alloyv2/reconstruct_5947505_20190104015108.json b/t/open311/endpoint/json/alloyv2/reconstruct_5947505_20190104015108.json deleted file mode 100644 index c6061b1e4..000000000 --- a/t/open311/endpoint/json/alloyv2/reconstruct_5947505_20190104015108.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "item": - { - "itemId": "5947505", - "designCode": "designs_shelterDamaged1000793_5d324047fe2ad806f8dfb464", - "collection": "Live", - "start": "2019-01-01T00:00:00.723Z", - "end": "9999-12-31T23:59:59.999Z", - "geometry": { - "type": "Point", - "coordinates": [ - -0.5878147518991453, - 52.31519007307925 - ] - }, - "icon": "icon-defect-full", - "colour": "#AAC6Df", - "attributes": [ - { - "attributeCode": "attributes_defectsReportedDate", - "value": "2019-06-20T14:34:00.000Z" - }, - { - "attributeCode": "attributes_defectsStatus", - "value": [ - "5c8bdfc18ae862230019dc21" - ] - }, - { - "attributeCode": "attributes_defectsDefectNumber", - "value": 203262 - }, - { - "attributeCode": "attributes_shelterDamaged1000793OriginalDefectNumber1003788_5d324051fe2ad806f8dfb46c", - "value": "DEF-00203262" - }, - { - "attributeCode": "attributes_shelterDamaged1000793TeamMembers1005688_5d324052fe2ad806f8dfb471", - "value": [ - "0203a7d0c0de101a008fe0d0" - ] - }, - { - "attributeCode": "attributes_shelterDamaged1000793DefectType1005689_5d324052fe2ad806f8dfb476", - "value": [ - "018fae47c0de101a001be747" - ] - }, - { - "attributeCode": "attributes_shelterDamaged1000793TreatmentType1005690_5d324053fe2ad806f8dfb47b", - "value": [ - "018facffc0de101a001be5ff" - ] - }, - { - "attributeCode": "attributes_shelterDamaged1000793RepairType1005691_5d324054fe2ad806f8dfb480", - "value": [ - "01854946c0de101a00118246" - ] - }, - { - "attributeCode": "attributes_shelterDamaged1000793Priorities1005692_5d324055fe2ad806f8dfb485", - "value": [ - "01b51bbac0de101a004154ba" - ] - }, - { - "attributeCode": "attributes_shelterDamaged1000793LocationDescription1006369_5d324057fe2ad806f8dfb48f", - "value": "A6 Bypass Higham Ferrers - from Chowns Mill roundabout to Kimbolton Road" - }, - { - "attributeCode": "attributes_shelterDamaged1000793PermRepairDescription1006371_5d324059fe2ad806f8dfb499", - "value": "Repair VRS barrier - wire rope posts" - }, - { - "attributeCode": "attributes_defectsRemediedDate", - "value": "2019-06-26T13:23:00.000Z" - }, - { - "attributeCode": "attributes_shelterDamaged1000793ActivityCode1011097_5d32405afe2ad806f8dfb49e", - "value": "AI" - }, - { - "attributeCode": "attributes_shelterDamaged1000793TargetDate1011490_5d32405bfe2ad806f8dfb4a3", - "value": "2019-12-19T00:00:00.000Z" - }, - { - "attributeCode": "attributes_shelterDamaged1001018StreetDoctorID1011599_5d324270fe2ad806f8dfb738", - "value": "10101010" - } - ], - "signature": "5d324086b4e1b90150f946a1", - "title": "DEF-3401", - "subtitle": "Ancillary Items" - } -} diff --git a/t/open311/endpoint/json/alloyv2/reconstruct_5947506_20190105013208.json b/t/open311/endpoint/json/alloyv2/reconstruct_5947506_20190105013208.json deleted file mode 100644 index 08ff4eff8..000000000 --- a/t/open311/endpoint/json/alloyv2/reconstruct_5947506_20190105013208.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "item": - { - "itemId": "5947506", - "designCode": "designs_shelterDamaged1000793_5d324047fe2ad806f8dfb464", - "collection": "Live", - "start": "2019-01-01T00:00:00.723Z", - "end": "9999-12-31T23:59:59.999Z", - "geometry": { - "type": "Point", - "coordinates": [ - -0.5878147518991453, - 52.31519007307925 - ] - }, - "icon": "icon-defect-full", - "colour": "#AAC6Df", - "attributes": [ - { - "attributeCode": "attributes_defectsReportedDate", - "value": "2019-06-20T14:34:00.000Z" - }, - { - "attributeCode": "attributes_defectsStatus", - "value": [ - "5c8bdfc18ae862230019dc21" - ] - }, - { - "attributeCode": "attributes_defectsDefectNumber", - "value": 203262 - }, - { - "attributeCode": "attributes_shelterDamaged1000793OriginalDefectNumber1003788_5d324051fe2ad806f8dfb46c", - "value": "DEF-00203262" - }, - { - "attributeCode": "attributes_shelterDamaged1000793TeamMembers1005688_5d324052fe2ad806f8dfb471", - "value": [ - "0203a7d0c0de101a008fe0d0" - ] - }, - { - "attributeCode": "attributes_shelterDamaged1000793DefectType1005689_5d324052fe2ad806f8dfb476", - "value": [ - "018fae47c0de101a001be747" - ] - }, - { - "attributeCode": "attributes_shelterDamaged1000793TreatmentType1005690_5d324053fe2ad806f8dfb47b", - "value": [ - "018facffc0de101a001be5ff" - ] - }, - { - "attributeCode": "attributes_shelterDamaged1000793RepairType1005691_5d324054fe2ad806f8dfb480", - "value": [ - "01854946c0de101a00118246" - ] - }, - { - "attributeCode": "attributes_shelterDamaged1000793Priorities1005692_5d324055fe2ad806f8dfb485", - "value": [ - "01b51bbac0de101a004154ba" - ] - }, - { - "attributeCode": "attributes_shelterDamaged1000793LocationDescription1006369_5d324057fe2ad806f8dfb48f", - "value": "A6 Bypass Higham Ferrers - from Chowns Mill roundabout to Kimbolton Road" - }, - { - "attributeCode": "attributes_shelterDamaged1000793PermRepairDescription1006371_5d324059fe2ad806f8dfb499", - "value": "Repair VRS barrier - wire rope posts" - }, - { - "attributeCode": "attributes_defectsRemediedDate", - "value": "2019-06-26T13:23:00.000Z" - }, - { - "attributeCode": "attributes_shelterDamaged1000793ActivityCode1011097_5d32405afe2ad806f8dfb49e", - "value": "AI" - }, - { - "attributeCode": "attributes_shelterDamaged1000793TargetDate1011490_5d32405bfe2ad806f8dfb4a3", - "value": "2019-12-19T00:00:00.000Z" - }, - { - "attributeCode": "attributes_shelterDamaged1001018StreetDoctorID1011599_5d324270fe2ad806f8dfb738", - "value": "10101010" - } - ], - "signature": "5d324086b4e1b90150f946b2", - "title": "DEF-3401", - "subtitle": "Ancillary Items" - } -} diff --git a/t/open311/endpoint/json/hackney_environment/defects_search.json b/t/open311/endpoint/json/hackney_environment/defects_search.json index f5f86cb46..6cd1e0c64 100644 --- a/t/open311/endpoint/json/hackney_environment/defects_search.json +++ b/t/open311/endpoint/json/hackney_environment/defects_search.json @@ -53,12 +53,24 @@ "abcdea5823d4d9016616c151" ] }, + { + "attributeCode": "attributes_fixedMyStreetDefectFixMyStreetCancellationReason", + "value": [ + "617807ffffffff015d18e75f" + ] + }, { "attributeCode": "attributes_defectsStatus", "value": [ "5c8bdfc88ae862230019dc22" ] }, + { + "attributeCode": "attributes_tasksStatus", + "value": [ + "5bc5bffffffff8d177342c79" + ] + }, { "attributeCode": "attributes_defectsDefectNumber", "value": 7379 @@ -83,4 +95,4 @@ "signature": "625fe4b24edcdb01584733b2" } ] -} \ No newline at end of file +} diff --git a/t/open311/endpoint/json/hackney_environment/reconstruct_625ffffffffae7015ac40c5b_20220420081926005.json b/t/open311/endpoint/json/hackney_environment/reconstruct_625ffffffffae7015ac40c5b_20220420081926005.json deleted file mode 100644 index f46ebf0bc..000000000 --- a/t/open311/endpoint/json/hackney_environment/reconstruct_625ffffffffae7015ac40c5b_20220420081926005.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "log": { - "itemId": "625ffffffffae7015ac40c5b", - "designCode": "designs_fixedMyStreetDefect", - "action": "Edit", - "causes": [], - "date": "2022-04-20T08:19:26.005Z", - "username": "fmsuser" - }, - "item": { - "itemId": "625ffffffffae7015ac40c5b", - "designCode": "designs_fixedMyStreetDefect", - "collection": "Live", - "locked": false, - "attributes": [ - { - "attributeCode": "attributes_defectsDescription", - "value": "This is just a test" - }, - { - "attributeCode": "attributes_fixedMyStreetDefectFMSReportTitle", - "value": "Test title" - }, - { - "attributeCode": "attributes_defectsReportedDate", - "value": "2022-04-19T19:17:00.000Z" - }, - { - "attributeCode": "attributes_fixedMyStreetDefectFMSID", - "value": "14482" - }, - { - "attributeCode": "attributes_fixedMyStreetDefectFMSNearestAddress", - "value": "2 Hillman Street, Hackney, E8 1EA" - }, - { - "attributeCode": "attributes_itemsGeometry", - "value": { - "type": "Point", - "coordinates": [ - -0.056875, - 51.544915 - ] - } - }, - { - "attributeCode": "attributes_fixedMyStreetDefectFMSCategory", - "value": [ - "613f20e5227cd101577025e2" - ] - }, - { - "attributeCode": "attributes_fixedMyStreetDefectContactDetails", - "value": [ - "6172aa5823d4d9016616c151" - ] - }, - { - "attributeCode": "attributes_defectsDefectNumber", - "value": 7379 - }, - { - "attributeCode": "attributes_itemsTitle", - "value": " 7379 - 14482 - 2 Hillman Street, Hackney, E8 1EA" - }, - { - "attributeCode": "attributes_itemsSubtitle", - "value": "Fly Tipping" - }, - { - "attributeCode": "attributes_fixedMyStreetDefectFixMyStreetNotes", - "value": "Customer update at 2022-04-19 20:17:17\nHi,\r\n\r\nThank you for your report related to Littering & Cleanliness. We aim to resolve reports like this by the end of the next working day (exc weekends and bank holidays).\r\n\r\nThank you\r\nHackney Council\r\n" - }, - { - "attributeCode": "attributes_defectsStatus", - "value": [ - "5c8bdfb28ae862230019dc1e" - ] - } - ], - "signature": "625fffffff62a1016ce7f779" - }, - "previous": { - "attributes": [ - { - "attributeCode": "attributes_fixedMyStreetDefectFixMyStreetNotes" - } - ], - "signature": "625f0ac061fae7015ac40c60" - } -} \ No newline at end of file diff --git a/t/open311/endpoint/json/hackney_environment/reconstruct_625ffffffffae7015ac40c5b_20220420104714612.json b/t/open311/endpoint/json/hackney_environment/reconstruct_625ffffffffae7015ac40c5b_20220420104714612.json deleted file mode 100644 index e6048e2d8..000000000 --- a/t/open311/endpoint/json/hackney_environment/reconstruct_625ffffffffae7015ac40c5b_20220420104714612.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "log": { - "itemId": "625ffffffffae7015ac40c5b", - "designCode": "designs_fixedMyStreetDefect", - "action": "Edit", - "causes": [], - "date": "2022-04-20T10:47:14.612Z", - "username": "staffuser" - }, - "item": { - "itemId": "625ffffffffae7015ac40c5b", - "designCode": "designs_fixedMyStreetDefect", - "collection": "Live", - "locked": false, - "attributes": [ - { - "attributeCode": "attributes_defectsDescription", - "value": "This is just a test" - }, - { - "attributeCode": "attributes_fixedMyStreetDefectFMSReportTitle", - "value": "Test title" - }, - { - "attributeCode": "attributes_defectsReportedDate", - "value": "2022-04-19T19:17:00.000Z" - }, - { - "attributeCode": "attributes_fixedMyStreetDefectFMSID", - "value": "14482" - }, - { - "attributeCode": "attributes_fixedMyStreetDefectFMSNearestAddress", - "value": "2 Hillman Street, Hackney, E8 1EA" - }, - { - "attributeCode": "attributes_itemsGeometry", - "value": { - "type": "Point", - "coordinates": [ - -0.056875, - 51.544915 - ] - } - }, - { - "attributeCode": "attributes_fixedMyStreetDefectFMSCategory", - "value": [ - "613f20e5227cd101577025e2" - ] - }, - { - "attributeCode": "attributes_fixedMyStreetDefectContactDetails", - "value": [ - "6172aa5823d4d9016616c151" - ] - }, - { - "attributeCode": "attributes_fixedMyStreetDefectFixMyStreetCancellationReason", - "value": [ - "617807ffffffff015d18e75f" - ] - }, - { - "attributeCode": "attributes_defectsStatus", - "value": [ - "5c8bdfc88ae862230019dc22" - ] - }, - { - "attributeCode": "attributes_tasksStatus", - "value": [ - "5bc5bffffffff8d177342c79" - ] - }, - { - "attributeCode": "attributes_defectsDefectNumber", - "value": 7379 - }, - { - "attributeCode": "attributes_itemsTitle", - "value": " 7379 - 14482 - 2 Hillman Street, Hackney, E8 1EA" - }, - { - "attributeCode": "attributes_itemsSubtitle", - "value": "Fly Tipping" - }, - { - "attributeCode": "attributes_fixedMyStreetDefectFixMyStreetNotes", - "value": "Customer update at 2022-04-19 20:17:17\nHi,\r\n\r\nThank you for your report related to Littering & Cleanliness. We aim to resolve reports like this by the end of the next working day (exc weekends and bank holidays).\r\n\r\nThank you\r\nHackney Council\r\n" - }, - { - "attributeCode": "attributes_defectsRemediedDate", - "value": "2022-04-20T09:30:00.000Z" - } - ], - "signature": "625fe4b24edcdb01584733b2" - }, - "previous": { - "attributes": [ - { - "attributeCode": "attributes_defectsStatus", - "value": [ - "5c8bdfb28ae862230019dc1e" - ] - }, - { - "attributeCode": "attributes_defectsRemediedDate" - } - ], - "signature": "625fffffff62a1016ce7f779" - } -} \ No newline at end of file diff --git a/t/open311/endpoint/northumberland_alloy.t b/t/open311/endpoint/northumberland_alloy.t index c352e5aa9..7697445fa 100644 --- a/t/open311/endpoint/northumberland_alloy.t +++ b/t/open311/endpoint/northumberland_alloy.t @@ -72,13 +72,6 @@ $integration->mock('api_call', sub { # Looking up asset. $content = path(__FILE__)->sibling("json/alloyv2/northumberland_asset_lookup_response.json")->slurp; - } elsif ($body && $call =~ 'item-log/item/([^/]*)/reconstruct') { - my $id = $1; - my $date = $body->{date}; - $date =~ s/\D//g; - $content - = path(__FILE__) - ->sibling("json/alloyv2/northumberland/reconstruct_${id}_$date.json")->slurp; } elsif ($call =~ 'item-log/item/([^/]*)') { my $id = $1; $content @@ -414,23 +407,12 @@ subtest "check fetch updates" => sub { media_url => '', service_request_id => '123456', status => 'open', - update_id => '100001', + update_id => '123456_20231113110500', updated_datetime => '2023-11-13T11:05:00Z', extras => { + latest_data_only => 1, assigned_user_name => 'FMS User 123', assigned_user_email => '123@email.com', - detailed_information => 'Hello there', - }, - }, - { description => '', - media_url => '', - service_request_id => '234567', - status => 'open', - update_id => '200002', - updated_datetime => '2023-11-13T11:05:00Z', - extras => { - assigned_user_name => 'FMS User 234', - assigned_user_email => '234@email.com', detailed_information => '', }, }, @@ -438,12 +420,13 @@ subtest "check fetch updates" => sub { media_url => '', service_request_id => '234567', status => 'open', - update_id => '200002', + update_id => '234567_20231113111000', updated_datetime => '2023-11-13T11:10:00Z', extras => { + latest_data_only => 1, assigned_user_name => 'FMS User 345', assigned_user_email => '345@email.com', - detailed_information => '', + detailed_information => 'Hello there', }, }, ], 'correct json returned';