Skip to content

Commit

Permalink
[Surrey][Boomi] Change source of external reference
Browse files Browse the repository at this point in the history
Use the externalId of the FMS report object instead of the
the 'externalSystemReference' or 'jobNumber' from the log
of enquiries or jobs.

mysociety/societyworks#4535
  • Loading branch information
MorayMySoc committed Oct 4, 2024
1 parent 50ecad7 commit f275f92
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
8 changes: 3 additions & 5 deletions perllib/Open311/Endpoint/Integration/Boomi.pm
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,10 @@ sub _get_service_request_updates_for_integration_id {
my $log = $enquiry_update ? $update->{confirmEnquiryStatusLog} : $update->{confirmJobStatusLog};
my $fms = $update->{fmsReport};

my $id = $enquiry_update
? $log->{enquiry}->{externalSystemReference} . "_" . $log->{logNumber}
: $log->{job}->{jobNumber} . "_" . $log->{logNumber};
my $id = $fms->{externalId} . "_" . $log->{logNumber};
my $service_request_id = $enquiry_update
? "Zendesk_" . $log->{enquiry}->{externalSystemReference}
: "Zendesk_JOB_" . $log->{job}->{jobNumber};
? "Zendesk_" . $fms->{externalId}
: "Zendesk_JOB_" . $fms->{externalId};
my $status = lc $fms->{status}->{state};
$status =~ s/ /_/g;
# fixup invalid status from Boomi
Expand Down
7 changes: 3 additions & 4 deletions t/open311/endpoint/surrey_boomi.t
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,10 @@ $lwp->mock(request => sub {
"statusCode" => "5800",
"enquiry" => {
"enquiryNumber" => 129293,
"externalSystemReference" => "2929177"
}
},
"fmsReport" => {
"externalId" => 2929177,
"status" => {
"state" => "Closed",
"label" => "Enquiry closed"
Expand All @@ -172,10 +172,10 @@ $lwp->mock(request => sub {
"statusCode" => "3200",
"enquiry" => {
"enquiryNumber" => 132361,
"externalSystemReference" => "2939061"
}
},
"fmsReport" => {
"externalId" => 2939061,
"status" => {
"state" => "Action scheduled",
"label" => "Assessed - scheduling a repair within 5 Working Days"
Expand All @@ -189,10 +189,10 @@ $lwp->mock(request => sub {
"statusCode" => "3201",
"enquiry" => {
"enquiryNumber" => 132361,
"externalSystemReference" => "2939061"
}
},
"fmsReport" => {
"externalId" => 2939061,
"status" => {
"state" => "Not responsible",
"label" => "Not Surrey CC's responsibility"
Expand All @@ -211,7 +211,6 @@ $lwp->mock(request => sub {
"logNumber" => 2,
"statusCode" => "2000",
"job" => {
"jobNumber" => 569276
}
},
"fmsReport" => {
Expand Down

0 comments on commit f275f92

Please sign in to comment.