Skip to content

Commit

Permalink
[Bexley] Garden subscription.
Browse files Browse the repository at this point in the history
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
dracos committed Dec 19, 2024
1 parent 21d32b3 commit 6a2ae66
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions perllib/FixMyStreet/Cobrand/Bexley.pm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use Time::Piece;
use DateTime;
use Moo;
with 'FixMyStreet::Roles::Open311Multi';
with 'FixMyStreet::Cobrand::Bexley::Garden';
with 'FixMyStreet::Cobrand::Bexley::Waste';

sub council_area_id { 2494 }
Expand Down
39 changes: 39 additions & 0 deletions perllib/FixMyStreet/Cobrand/Bexley/Garden.pm
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;

0 comments on commit 6a2ae66

Please sign in to comment.