Skip to content

Commit

Permalink
[Northumberland] Fetch extra_details from Alloy
Browse files Browse the repository at this point in the history
  • Loading branch information
nephila-nacrea committed Sep 4, 2024
1 parent 838bdae commit 93c66a8
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
4 changes: 4 additions & 0 deletions perllib/Open311/Endpoint/Integration/AlloyV2.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@
"attributeCode": "attributes_customerRequestEmail_63868f209e005f0396e519ca",
"value": "[email protected]"
},
{
"attributeCode": "attributes_customerRequestFMSExtraDetails_646e07533726d8036a7a4022",
"value": "Goodbye here"
},
{
"attributeCode": "attributes_customerRequestAssignedTo_653664b0557119eef53a97e1",
"value": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
"attributeCode": "attributes_customerRequestEmail_63868f209e005f0396e519ca",
"value": "[email protected]"
},
{
"attributeCode": "attributes_customerRequestFMSExtraDetails_646e07533726d8036a7a4022",
"value": "Hello there"
},
{
"attributeCode": "attributes_customerRequestAssignedTo_653664b0557119eef53a97e1",
"value": [
Expand Down
7 changes: 5 additions & 2 deletions t/open311/endpoint/northumberland_alloy.t
Original file line number Diff line number Diff line change
Expand Up @@ -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 => '[email protected]',
assigned_user_name => 'FMS User 123',
assigned_user_email => '[email protected]',
detailed_information => 'Hello there',
},
},
{ description => '',
Expand All @@ -416,6 +417,7 @@ subtest "check fetch updates" => sub {
extras => {
assigned_user_name => 'FMS User 234',
assigned_user_email => '[email protected]',
detailed_information => '',
},
},
{ description => '',
Expand All @@ -427,6 +429,7 @@ subtest "check fetch updates" => sub {
extras => {
assigned_user_name => 'FMS User 345',
assigned_user_email => '[email protected]',
detailed_information => '',
},
},
], 'correct json returned';
Expand Down
1 change: 1 addition & 0 deletions t/open311/endpoint/northumberland_alloy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},

Expand Down

0 comments on commit 93c66a8

Please sign in to comment.