From 93c66a87f44e940d5f181fcd1d80a5f56291178c Mon Sep 17 00:00:00 2001 From: Victoria Mihell-Hale Date: Thu, 29 Aug 2024 16:17:40 +0100 Subject: [PATCH] [Northumberland] Fetch extra_details from Alloy --- perllib/Open311/Endpoint/Integration/AlloyV2.pm | 4 ++++ .../northumberland/customer_requests_query_response.json | 4 ++++ .../northumberland/reconstruct_123456_20231113110500.json | 4 ++++ t/open311/endpoint/northumberland_alloy.t | 7 +++++-- t/open311/endpoint/northumberland_alloy.yml | 1 + 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/perllib/Open311/Endpoint/Integration/AlloyV2.pm b/perllib/Open311/Endpoint/Integration/AlloyV2.pm index a495e8e51..6450da8e6 100644 --- a/perllib/Open311/Endpoint/Integration/AlloyV2.pm +++ b/perllib/Open311/Endpoint/Integration/AlloyV2.pm @@ -651,6 +651,10 @@ sub _get_inspection_updates { $args{extras} = $assigned_to_user if $assigned_to_user; } + my $detailed_information + = $attributes->{ $mapping->{extra_details} } // ''; + $args{extras}{detailed_information} = $detailed_information; + push @updates, Open311::Endpoint::Service::Request::Update::mySociety->new( %args ); } } 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 b3a7d53e8..329ba4c30 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 @@ -74,6 +74,10 @@ "attributeCode": "attributes_customerRequestEmail_63868f209e005f0396e519ca", "value": "person@email.com" }, + { + "attributeCode": "attributes_customerRequestFMSExtraDetails_646e07533726d8036a7a4022", + "value": "Goodbye here" + }, { "attributeCode": "attributes_customerRequestAssignedTo_653664b0557119eef53a97e1", "value": [ diff --git a/t/open311/endpoint/json/alloyv2/northumberland/reconstruct_123456_20231113110500.json b/t/open311/endpoint/json/alloyv2/northumberland/reconstruct_123456_20231113110500.json index 833493d30..a244b0a04 100644 --- a/t/open311/endpoint/json/alloyv2/northumberland/reconstruct_123456_20231113110500.json +++ b/t/open311/endpoint/json/alloyv2/northumberland/reconstruct_123456_20231113110500.json @@ -33,6 +33,10 @@ "attributeCode": "attributes_customerRequestEmail_63868f209e005f0396e519ca", "value": "person@email.com" }, + { + "attributeCode": "attributes_customerRequestFMSExtraDetails_646e07533726d8036a7a4022", + "value": "Hello there" + }, { "attributeCode": "attributes_customerRequestAssignedTo_653664b0557119eef53a97e1", "value": [ diff --git a/t/open311/endpoint/northumberland_alloy.t b/t/open311/endpoint/northumberland_alloy.t index 4853ff131..9b0933dec 100644 --- a/t/open311/endpoint/northumberland_alloy.t +++ b/t/open311/endpoint/northumberland_alloy.t @@ -403,8 +403,9 @@ subtest "check fetch updates" => sub { update_id => '100001', updated_datetime => '2023-11-13T11:05:00Z', extras => { - assigned_user_name => 'FMS User 123', - assigned_user_email => '123@email.com', + assigned_user_name => 'FMS User 123', + assigned_user_email => '123@email.com', + detailed_information => 'Hello there', }, }, { description => '', @@ -416,6 +417,7 @@ subtest "check fetch updates" => sub { extras => { assigned_user_name => 'FMS User 234', assigned_user_email => '234@email.com', + detailed_information => '', }, }, { description => '', @@ -427,6 +429,7 @@ subtest "check fetch updates" => sub { extras => { assigned_user_name => 'FMS User 345', assigned_user_email => '345@email.com', + detailed_information => '', }, }, ], 'correct json returned'; diff --git a/t/open311/endpoint/northumberland_alloy.yml b/t/open311/endpoint/northumberland_alloy.yml index fd0f01752..55fc44659 100644 --- a/t/open311/endpoint/northumberland_alloy.yml +++ b/t/open311/endpoint/northumberland_alloy.yml @@ -168,6 +168,7 @@ "updates": "attributes_customerRequestFMSUpdates_6387cc9805cb250393e00e2f", "status": "attributes_customerRequestMainFMSStatus_63fcb297c9ec9c036ec35dfb", "inspector_comments": "attributes_customerRequestInspectorsComments_638629fcfb3d97038c4e5d5a", + "extra_details": "attributes_customerRequestFMSExtraDetails_646e07533726d8036a7a4022", "assigned_to_user": "attributes_customerRequestAssignedTo_653664b0557119eef53a97e1", },