Skip to content

Commit

Permalink
[Bexley][WW] Include location_of_letterbox in Whitespace worksheets
Browse files Browse the repository at this point in the history
  • Loading branch information
nephila-nacrea committed Nov 13, 2024
1 parent 95e0f8a commit a1d679e
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
6 changes: 6 additions & 0 deletions perllib/Integrations/Whitespace.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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},
),
},
],
);

Expand Down
10 changes: 8 additions & 2 deletions perllib/Open311/Endpoint/Integration/UK/Bexley/Whitespace.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
2 changes: 2 additions & 0 deletions perllib/Open311/Endpoint/Integration/Whitespace.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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},
});

Expand Down
7 changes: 7 additions & 0 deletions perllib/Open311/Endpoint/Service/UKCouncil/Whitespace.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit a1d679e

Please sign in to comment.