Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kingston/Sutton Echo changes #5334

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
c591828
[Waste] Change garden end date format.
dracos Jan 23, 2025
0c48574
[SLWP] Copy all SLWP code to SLWP2.
dracos Jan 15, 2025
f27dd56
[SLWP] No need to check property location.
dracos Jan 22, 2025
26384c7
[SLWP] Remove Merton-only parts.
dracos Jan 15, 2025
c6f7319
[SLWP] Update for new data IDs and location.
dracos Jan 23, 2025
ba84cce
[SLWP] Switch to using service IDs.
dracos Jan 23, 2025
89f1f6b
[SLWP] Bulky field name changes.
dracos Jan 23, 2025
953c1ea
[SLWP] Garden changes.
dracos Jan 23, 2025
86dcbac
[Sutton] Remove EPDQ payment provider.
dracos Dec 19, 2024
000197b
[Sutton] Switch to new Echo.
dracos Jan 22, 2025
9137c05
[Sutton] Remove property location code.
dracos Jan 22, 2025
56c7139
[Sutton] Update for new data IDs and location.
dracos Jan 23, 2025
174a8b3
[Sutton] Switch to using service IDs.
dracos Jan 23, 2025
5c92c6e
[Sutton] Bulky field name changes.
dracos Jan 23, 2025
f8e5e30
[Sutton] Update bulky location label.
dracos Jan 20, 2025
e30cada
[Sutton] Container request changes.
dracos Jan 23, 2025
122c328
[Sutton] Rename communal recycling.
dracos Feb 13, 2025
7f0a799
[Sutton] Collect/deliver info on request summary.
dracos Feb 11, 2025
3356927
[Sutton] Garden changes.
dracos Jan 23, 2025
a62414a
[Kingston] Switch to new Echo.
dracos Jan 22, 2025
e3b6d26
[Kingston] Remove property location code.
dracos Jan 22, 2025
e8b335c
[Kingston] Update for new data IDs and location.
dracos Jan 23, 2025
8cc1bc7
[Kingston] Switch to using service IDs.
dracos Jan 23, 2025
f6f19e8
[Kingston] Bulky field name changes.
dracos Jan 23, 2025
12df93c
[Kingston] Container request changes.
dracos Jan 23, 2025
6319f33
[Kingston] Garden changes.
dracos Jan 23, 2025
4cebf2f
[SLWP] [Brent] Amend garden, allow increase only.
dracos Feb 14, 2025
76875d2
[Sutton] Report missed assisted in different category.
dracos Feb 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions perllib/FixMyStreet/App/Controller/Waste.pm
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ has index_template => (

my %GARDEN_IDS = (
merton => { bin240 => 26, bin140 => 27, sack => 28 },
kingston => { bin240 => 26, bin140 => 27, sack => 28 },
sutton => { bin240 => 26, bin140 => 27, sack => 28 },
kingston => { bin240 => 39, bin140 => 37, sack => 36 },
sutton => { bin240 => 39, bin140 => 37, sack => 36 },
);
lock_hash(%GARDEN_IDS);

Expand Down Expand Up @@ -1361,9 +1361,10 @@ sub process_garden_cancellation : Private {

my $now = DateTime->now->set_time_zone(FixMyStreet->local_time_zone);
my $end_date_field = $c->cobrand->call_hook(alternative_backend_field_names => 'Subscription_End_Date') || 'Subscription_End_Date';
$c->set_param($end_date_field, $now->ymd);
$c->set_param($end_date_field, $now->dmy('/'));

my $service = $c->cobrand->garden_current_subscription;
# Not actually used by Kingston/Sutton
if (!$c->stash->{slwp_garden_sacks} || $service->{garden_container} == $GARDEN_IDS{$c->cobrand->moniker}{bin240} || $service->{garden_container} == $GARDEN_IDS{$c->cobrand->moniker}{bin140}) {
my $bin_count = $c->cobrand->get_current_garden_bins;
$data->{new_bins} = $bin_count * -1;
Expand Down Expand Up @@ -1459,6 +1460,7 @@ sub process_garden_modification : Private {
my $service = $c->cobrand->garden_current_subscription;
my $costs = WasteWorks::Costs->new({ cobrand => $c->cobrand, discount => $data->{apply_discount} });
if ($c->stash->{slwp_garden_sacks} && $service->{garden_container} == $GARDEN_IDS{$c->cobrand->moniker}{sack}) { # SLWP Sack
# This must be Kingston
$data->{bins_wanted} = 1;
$data->{new_bins} = 1;
$payment = $costs->sacks($data->{bins_wanted});
Expand Down
1 change: 0 additions & 1 deletion perllib/FixMyStreet/App/Form/Waste/Bulky/Shared.pm
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ has_page location => (
$fields->{location} = { required => 1 };
}
if ($form->c->cobrand->moniker eq 'kingston' || $form->c->cobrand->moniker eq 'sutton') {
$fields->{location}{label} = 'Please tell us where you will place the items for collection (include any access codes the crew will need)';
$fields->{location}{tags}{hint} = 'For example, ‘On the driveway’';
}

Expand Down
33 changes: 29 additions & 4 deletions perllib/FixMyStreet/App/Form/Waste/Garden/Modify.pm
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,19 @@ has_field task => (
label => 'What do you want to do?',
required => 1,
widget => 'RadioGroup',
options => [
{ value => 'modify', label => 'Increase or reduce the number of bins in your subscription' },
{ value => 'cancel', label => 'Cancel your garden waste subscription' },
],
options_method => sub {
my $self = shift;
my $form = $self->form;
my $c = $form->c;
my @options;
if ($c->cobrand->moniker eq 'kingston' || $c->cobrand->moniker eq 'sutton' || $c->cobrand->moniker eq 'brent') {
push @options, { value => 'modify', label => 'Increase the number of bins in your subscription' };
} else {
push @options, { value => 'modify', label => 'Increase or reduce the number of bins in your subscription' };
}
push @options, { value => 'cancel', label => 'Cancel your garden waste subscription' };
return \@options;
},
);

has_field current_bins => (
Expand Down Expand Up @@ -181,4 +190,20 @@ has_field submit => (
order => 999,
);

sub validate {
my $self = shift;
my $cobrand = $self->{c}->cobrand->moniker;

if ($cobrand eq 'kingston' || $cobrand eq 'sutton' || $cobrand eq 'brent') {
unless ( $self->field('current_bins')->is_inactive ) {
my $total = $self->field('bins_wanted')->value;
my $current = $self->field('current_bins')->value;
$self->add_form_error('You can only increase the number of bins')
if $total <= $current;
}
}

$self->next::method();
}

1;
1 change: 1 addition & 0 deletions perllib/FixMyStreet/App/Form/Waste/Garden/Sacks/Choice.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package FixMyStreet::App::Form::Waste::Garden::Sacks::Choice;
use utf8;
use HTML::FormHandler::Moose::Role;

# Used by Merton only, below, to default the container choice
use constant CONTAINER_GARDEN_BIN => 26;
use constant CONTAINER_GARDEN_BIN_140 => 27;
use constant CONTAINER_GARDEN_SACK => 28;
Expand Down
16 changes: 11 additions & 5 deletions perllib/FixMyStreet/App/Form/Waste/Request/Kingston.pm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use utf8;
use HTML::FormHandler::Moose;
extends 'FixMyStreet::App::Form::Waste::Request';

use constant CONTAINER_REFUSE_240 => 2;
use constant CONTAINER_REFUSE_240 => 3;

=head2 About you

Expand All @@ -40,7 +40,7 @@ has_page about_you => (
my $total_paid_quantity = 0;
foreach (@services) {
my ($id) = /container-(.*)/;
my $quantity = $data->{"quantity-$id"};
my $quantity = $data->{"quantity-$id"} or next;
my $names = $c->stash->{containers};
if ($names->{$id} !~ /bag|sack|food/i) {
$total_paid_quantity += $quantity;
Expand Down Expand Up @@ -74,15 +74,21 @@ has_page how_many_exchange => (
fields => ['how_many_exchange', 'continue'],
title => 'Black bin size change request',
intro => 'request/intro.html',
post_process => sub {
my $form = shift;
my $data = $form->saved_data;
if ($data) {
my $how_many = $data->{"how_many_exchange"} || '';
return if $how_many eq 'less5' || $how_many eq '7more';
$form->c->cobrand->waste_exchange_bin_setup_data($data, CONTAINER_REFUSE_240);
}
},
next => sub {
my $data = shift;
my $how_many = $data->{"how_many_exchange"};
if ($how_many eq 'less5' || $how_many eq '7more') {
return 'biggest_bin_allowed';
}
$data->{'container-' . CONTAINER_REFUSE_240} = 1;
$data->{'quantity-' . CONTAINER_REFUSE_240} = 1;
$data->{'removal-' . CONTAINER_REFUSE_240} = 1;
return 'about_you';
},
);
Expand Down
Loading