-
-
Notifications
You must be signed in to change notification settings - Fork 242
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
[Brent] Add payment for some containers. #5274
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,14 +54,21 @@ sub council_area { return 'Brent'; } | |
sub council_name { return 'Brent Council'; } | ||
sub council_url { return 'brent'; } | ||
|
||
Readonly::Scalar my $CONTAINER_GREY_BIN => 16; | ||
Readonly::Scalar my $CONTAINER_BLUE_BIN => 6; | ||
Readonly::Scalar my $CONTAINER_CLEAR_SACK => 8; | ||
Readonly::Scalar my $CONTAINER_FOOD_CADDY => 11; | ||
Readonly::Scalar my $CONTAINER_GREEN_BIN => 13; | ||
Readonly::Scalar my $CONTAINER_BLUE_SACK => 46; | ||
|
||
my $BRENT_CONTAINERS = { | ||
1 => 'Blue rubbish sack', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Has 1 been left alone because it's not currently used anywhere else? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I wasn't sure if it should actually be removed, but this halfway house seemed easiest :) |
||
16 => 'General rubbish bin (grey bin)', | ||
8 => 'Clear recycling sack', | ||
6 => 'Recycling bin (blue bin)', | ||
11 => 'Food waste caddy', | ||
13 => 'Garden waste (green bin)', | ||
46 => 'Paper and cardboard blue sack', | ||
$CONTAINER_GREY_BIN => 'General rubbish bin (grey bin)', | ||
$CONTAINER_CLEAR_SACK => 'Clear recycling sack', | ||
$CONTAINER_BLUE_BIN => 'Recycling bin (blue bin)', | ||
$CONTAINER_FOOD_CADDY => 'Food waste caddy', | ||
$CONTAINER_GREEN_BIN => 'Garden waste (green bin)', | ||
$CONTAINER_BLUE_SACK => 'Paper and cardboard blue sack', | ||
}; | ||
|
||
=head1 DESCRIPTION | ||
|
@@ -1092,12 +1099,12 @@ sub waste_containers { $BRENT_CONTAINERS } | |
|
||
sub waste_service_to_containers { | ||
return ( | ||
262 => [ 16 ], | ||
265 => [ 6 ], | ||
269 => [ 8 ], | ||
316 => [ 11 ], | ||
317 => [ 13 ], | ||
807 => [ 46 ], | ||
262 => [ $CONTAINER_GREY_BIN ], | ||
265 => [ $CONTAINER_BLUE_BIN ], | ||
269 => [ $CONTAINER_CLEAR_SACK ], | ||
316 => [ $CONTAINER_FOOD_CADDY ], | ||
317 => [ $CONTAINER_GREEN_BIN ], | ||
807 => [ $CONTAINER_BLUE_SACK ], | ||
); | ||
} | ||
|
||
|
@@ -1394,12 +1401,12 @@ sub waste_munge_request_data { | |
|
||
# XXX Share somewhere with reverse? | ||
my %service_id = ( | ||
16 => 262, | ||
6 => 265, | ||
8 => 269, | ||
11 => 316, | ||
13 => 317, | ||
46 => 807, | ||
$CONTAINER_GREY_BIN => 262, | ||
$CONTAINER_BLUE_BIN => 265, | ||
$CONTAINER_CLEAR_SACK => 269, | ||
$CONTAINER_FOOD_CADDY => 316, | ||
$CONTAINER_GREEN_BIN => 317, | ||
$CONTAINER_BLUE_SACK => 807, | ||
); | ||
$c->set_param('service_id', $service_id{$id}); | ||
} | ||
|
@@ -1419,7 +1426,7 @@ sub waste_request_form_first_next { | |
return sub { | ||
my $data = shift; | ||
my $choice = $data->{"container-choice"}; | ||
return 'request_refuse_call_us' if $choice == 16; | ||
return 'request_refuse_call_us' if $choice == $CONTAINER_GREY_BIN; | ||
return 'replacement'; | ||
}; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the upside to using Readonly::Scalar versus 'use constant'? I haven't come across Readonly often.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the main advantage here is that
use constant
constants can't be used as keys in hashes, see https://metacpan.org/pod/Readonly#Comparison-with-%22use-constant%22