Skip to content

Commit

Permalink
[Bexley][WW] Allow modification of subscriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
davea committed Feb 18, 2025
1 parent c1683af commit 5733da7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
5 changes: 5 additions & 0 deletions perllib/FixMyStreet/Cobrand/Bexley.pm
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,11 @@ sub open311_extra_data_include {
{ name => 'description', description => 'Detail',
value => $row->detail };
}
if ($contact->email =~ /^Agile/) {
push @$open311_only,

Check warning on line 252 in perllib/FixMyStreet/Cobrand/Bexley.pm

View check run for this annotation

Codecov / codecov/patch

perllib/FixMyStreet/Cobrand/Bexley.pm#L252

Added line #L252 was not covered by tests
{ name => 'title', description => 'Title',
value => $row->title },
}

# Add private comments field
push @$open311_only,
Expand Down
16 changes: 13 additions & 3 deletions perllib/FixMyStreet/Cobrand/Bexley/Garden.pm
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,18 @@ sub waste_garden_sub_params {

my $c = $self->{c};

if ( $data->{category} eq 'Cancel Garden Subscription' ) {
my $srv = $self->garden_current_subscription;
if (my $srv = $self->garden_current_subscription) {
$c->set_param( 'customer_external_ref', $srv->{customer_external_ref} );

Check warning on line 165 in perllib/FixMyStreet/Cobrand/Bexley/Garden.pm

View check run for this annotation

Codecov / codecov/patch

perllib/FixMyStreet/Cobrand/Bexley/Garden.pm#L165

Added line #L165 was not covered by tests
}

if ( $data->{category} eq 'Cancel Garden Subscription' ) {
my $parser = DateTime::Format::Strptime->new( pattern => '%d/%m/%Y' );
my $due_date_str = $parser->format_datetime( DateTime->now->add(days => 1) );

my $reason = $data->{reason};
$reason .= ': ' . $data->{reason_further_details}
if $data->{reason_further_details};

$c->set_param( 'customer_external_ref', $srv->{customer_external_ref} );
$c->set_param( 'due_date', $due_date_str );
$c->set_param( 'reason', $reason );
}
Expand All @@ -198,4 +199,13 @@ sub waste_cc_payment_line_item_ref {
return $p->id;
}

=item * Anyone can modify garden subs XXX Is that right?
XXX TODO can't modify in renewal period
=cut

sub waste_show_garden_modify { 1 }

Check warning on line 208 in perllib/FixMyStreet/Cobrand/Bexley/Garden.pm

View check run for this annotation

Codecov / codecov/patch

perllib/FixMyStreet/Cobrand/Bexley/Garden.pm#L208

Added line #L208 was not covered by tests


1;

0 comments on commit 5733da7

Please sign in to comment.