Skip to content

Commit

Permalink
fixup! fixup! fixup! [Merton][WW] Allow transfer of ggw subscription
Browse files Browse the repository at this point in the history
  • Loading branch information
MorayMySoc committed Oct 31, 2024
1 parent 8492c7d commit 34fd44f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions perllib/FixMyStreet/Cobrand/Merton/Waste.pm
Original file line number Diff line number Diff line change
Expand Up @@ -398,18 +398,18 @@ sub check_ggw_transfer_applicable {
return { error => 'due_soon' } if ($subscription_enddate && $self->waste_sub_due($subscription_enddate));

my $old_subscription_bin_data = Integrations::Echo::force_arrayref($servicetask->{Data}, 'ExtensibleDatum');

Check warning on line 400 in perllib/FixMyStreet/Cobrand/Merton/Waste.pm

View check run for this annotation

Codecov / codecov/patch

perllib/FixMyStreet/Cobrand/Merton/Waste.pm#L400

Added line #L400 was not covered by tests
my $bin_number;
my $bin_type;
for my $extensible_data (@$old_subscription_bin_data) {
if ($extensible_data->{DatatypeName} eq 'SLWP - Containers') {
($bin_number) = grep { $_->{DatatypeName} eq 'Quantity'} @{$extensible_data->{ChildData}->{ExtensibleDatum}};
($bin_type) = grep { $_->{DatatypeName} eq 'Container Type'} @{$extensible_data->{ChildData}->{ExtensibleDatum}};

foreach (@$old_subscription_bin_data) {
my $moredata = Integrations::Echo::force_arrayref($_->{ChildData}, 'ExtensibleDatum');
foreach (@$moredata) {

Check warning on line 404 in perllib/FixMyStreet/Cobrand/Merton/Waste.pm

View check run for this annotation

Codecov / codecov/patch

perllib/FixMyStreet/Cobrand/Merton/Waste.pm#L402-L404

Added lines #L402 - L404 were not covered by tests
if ($_->{DatatypeName} eq 'Quantity') {
$old_garden->{transfer_bin_number} = $_->{Value};

Check warning on line 406 in perllib/FixMyStreet/Cobrand/Merton/Waste.pm

View check run for this annotation

Codecov / codecov/patch

perllib/FixMyStreet/Cobrand/Merton/Waste.pm#L406

Added line #L406 was not covered by tests
} elsif ($_->{DatatypeName} eq 'Container Type') {
$old_garden->{transfer_bin_type} = $_->{Value};

Check warning on line 408 in perllib/FixMyStreet/Cobrand/Merton/Waste.pm

View check run for this annotation

Codecov / codecov/patch

perllib/FixMyStreet/Cobrand/Merton/Waste.pm#L408

Added line #L408 was not covered by tests
}
}
};
$old_garden->{subscription_enddate} = $subscription_enddate;
$old_garden->{transfer_bin_number} = $bin_number->{Value};
$old_garden->{transfer_bin_type} = $bin_type->{Value};

return $old_garden;

Check warning on line 413 in perllib/FixMyStreet/Cobrand/Merton/Waste.pm

View check run for this annotation

Codecov / codecov/patch

perllib/FixMyStreet/Cobrand/Merton/Waste.pm#L412-L413

Added lines #L412 - L413 were not covered by tests
}

Expand Down

0 comments on commit 34fd44f

Please sign in to comment.