-
-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TODO lots. Code will need rejigging to cope with looking up first bin cost differently from subsequent (and also it does not know until you have picked DD/CC? Perhaps can be implemented as 5GBP discount when you click the DD option?) Perhaps default can have first/subsequents (but normally those two are the same).
- Loading branch information
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
=head1 NAME | ||
FixMyStreet::Cobrand::Bexley::Garden - code specific to Bexley WasteWorks GGW | ||
=cut | ||
|
||
package FixMyStreet::Cobrand::Bexley::Garden; | ||
|
||
use Moo::Role; | ||
|
||
sub garden_service_name { 'garden waste collection service' } | ||
|
||
# TODO No current subscription look up here | ||
# | ||
sub garden_current_subscription { } | ||
|
||
=item * You can order a maximum of five bins | ||
=cut | ||
|
||
sub waste_garden_maximum { 5 } | ||
|
||
=item * Garden waste has different price for the first bin | ||
=cut | ||
|
||
sub garden_waste_cost_pa { | ||
my ($self, $bin_count) = @_; | ||
$bin_count ||= 1; | ||
my $per_bin_cost = $self->garden_waste_subsequent_cost_pa; | ||
my $first_cost = $self->garden_waste_first_cost_pa; | ||
my $cost = $per_bin_cost * ($bin_count-1) + $first_cost; | ||
return $cost; | ||
} | ||
|
||
sub garden_waste_first_cost_pa { $_[0]->_get_cost('ggw_cost_first_cc') } # XXX DD | ||
sub garden_waste_subsequent_cost_pa { $_[0]->_get_cost('ggw_cost_other') } | ||
|
||
1; |