From a1d679e6763e2120c9fc3ec54643c8633d67f8df Mon Sep 17 00:00:00 2001 From: Victoria Mihell-Hale Date: Wed, 13 Nov 2024 10:48:07 +0000 Subject: [PATCH] [Bexley][WW] Include location_of_letterbox in Whitespace worksheets --- perllib/Integrations/Whitespace.pm | 6 ++++++ .../Endpoint/Integration/UK/Bexley/Whitespace.pm | 10 ++++++++-- perllib/Open311/Endpoint/Integration/Whitespace.pm | 2 ++ .../Open311/Endpoint/Service/UKCouncil/Whitespace.pm | 7 +++++++ 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/perllib/Integrations/Whitespace.pm b/perllib/Integrations/Whitespace.pm index 817521313..f3df94a07 100644 --- a/perllib/Integrations/Whitespace.pm +++ b/perllib/Integrations/Whitespace.pm @@ -133,6 +133,12 @@ sub CreateWorksheet { 'wsap:ServicePropertyValue' => $params->{location_of_containers}, ), }, + { + 'wsap:Input.CreateWorksheetInput.ServicePropertyInput' => ixhash( + 'wsap:ServicePropertyId' => 82, + 'wsap:ServicePropertyValue' => $params->{location_of_letterbox}, + ), + }, ], ); diff --git a/perllib/Open311/Endpoint/Integration/UK/Bexley/Whitespace.pm b/perllib/Open311/Endpoint/Integration/UK/Bexley/Whitespace.pm index 20a7b785d..ad587de5f 100644 --- a/perllib/Open311/Endpoint/Integration/UK/Bexley/Whitespace.pm +++ b/perllib/Open311/Endpoint/Integration/UK/Bexley/Whitespace.pm @@ -12,8 +12,14 @@ around BUILDARGS => sub { sub _worksheet_message { my ($self, $args) = @_; - return "Assisted collection? $args->{attributes}->{assisted_yn}\n\n" . - "Location of containers: $args->{attributes}->{location_of_containers}\n"; + my $msg = "Assisted collection? $args->{attributes}->{assisted_yn}\n\n" + . "Location of containers: $args->{attributes}->{location_of_containers}\n"; + + $msg + .= "\nLocation of letterbox: $args->{attributes}->{location_of_letterbox}\n" + if $args->{attributes}->{location_of_letterbox}; + + return $msg; } __PACKAGE__->run_if_script; diff --git a/perllib/Open311/Endpoint/Integration/Whitespace.pm b/perllib/Open311/Endpoint/Integration/Whitespace.pm index 54db69acb..7eb2864f8 100644 --- a/perllib/Open311/Endpoint/Integration/Whitespace.pm +++ b/perllib/Open311/Endpoint/Integration/Whitespace.pm @@ -79,6 +79,7 @@ sub post_service_request { my $integration = $self->get_integration; $args->{attributes}{location_of_containers} //= ''; + $args->{attributes}{location_of_letterbox} //= ''; $args->{attributes}{quantity} ||= 1; my $worksheet_id = $integration->CreateWorksheet({ @@ -89,6 +90,7 @@ sub post_service_request { worksheet_message => $self->_worksheet_message($args), assisted_yn => $args->{attributes}->{assisted_yn}, location_of_containers => $args->{attributes}->{location_of_containers}, + location_of_letterbox => $args->{attributes}->{location_of_letterbox}, quantity => $args->{attributes}->{quantity}, }); diff --git a/perllib/Open311/Endpoint/Service/UKCouncil/Whitespace.pm b/perllib/Open311/Endpoint/Service/UKCouncil/Whitespace.pm index 3ebf1e5fc..fe1f10833 100644 --- a/perllib/Open311/Endpoint/Service/UKCouncil/Whitespace.pm +++ b/perllib/Open311/Endpoint/Service/UKCouncil/Whitespace.pm @@ -46,6 +46,13 @@ sub _build_attributes { required => 0, automated => 'hidden_field', ), + Open311::Endpoint::Service::Attribute->new( + code => 'location_of_letterbox', + description => 'Location of letterbox', + datatype => 'string', + required => 0, + automated => 'hidden_field', + ), Open311::Endpoint::Service::Attribute->new( code => 'quantity', description => 'Number of containers',