From 35780e6f225a6ca5c9bc7df923cfa8bd1a66ef06 Mon Sep 17 00:00:00 2001 From: Moray Jones Date: Mon, 5 Aug 2024 18:15:31 +0100 Subject: [PATCH] [Surrey] Expect serviceId from integration serviceId will be received from new version of Boomi integration so is not hard-coded https://3.basecamp.com/4020879/buckets/36546415/todos/7648793252#__recording_7674131654 https://mysociety.slack.com/archives/C06SKSH5KQT/p1722624461300599?thread_ts=1722616474.424329&cid=C06SKSH5KQT --- perllib/Open311/Endpoint/Integration/Boomi.pm | 2 +- t/open311/endpoint/surrey_boomi.t | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/perllib/Open311/Endpoint/Integration/Boomi.pm b/perllib/Open311/Endpoint/Integration/Boomi.pm index d9fed98ba..1f204b26a 100644 --- a/perllib/Open311/Endpoint/Integration/Boomi.pm +++ b/perllib/Open311/Endpoint/Integration/Boomi.pm @@ -202,7 +202,7 @@ sub _get_service_requests_for_integration_id { updated_datetime => $loggedDate, service => Open311::Endpoint::Service->new( service_name => $result->{fmsReport}->{categorisation}->{subCategory}, - service_code => "foobar", + service_code => $result->{fmsReport}->{categorisation}->{serviceId}, ), service_notice => $result->{fmsReport}->{categorisation}->{category}, latlong => [ $n, $e ], diff --git a/t/open311/endpoint/surrey_boomi.t b/t/open311/endpoint/surrey_boomi.t index acdd82d59..e8e8ed91e 100644 --- a/t/open311/endpoint/surrey_boomi.t +++ b/t/open311/endpoint/surrey_boomi.t @@ -208,7 +208,8 @@ $lwp->mock(request => sub { }, "categorisation" => { "category" => "Trees and roots", - "subCategory" => "Other tree or roots issue" + "subCategory" => "Other tree or roots issue", + "serviceId" => 'foobar', } } }, @@ -238,7 +239,9 @@ $lwp->mock(request => sub { }, "categorisation" => { "category" => "Gritting and Grit Bins", - "subCategory" => "Damaged grit bin" + "subCategory" => "Damaged grit bin", + "serviceId" => 'foobar', + } } },