Skip to content

Commit 3588198

Browse files
[Bexley][WW] Use total_containers rather than new_containers for garden sub
new_containers already has current_containers subtracted from it; we want to pass the original total to Bexley.
1 parent 9ca9d42 commit 3588198

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

perllib/Open311/Endpoint/Integration/Agile.pm

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ sub _garden_subscription {
120120
TitleCode => 'Default',
121121
CustomerExternalReference => '',
122122
ServiceContractUPRN => $args->{attributes}{uprn},
123-
WasteContainerQuantity => int( $args->{attributes}{new_containers} ) || 1,
123+
WasteContainerQuantity => int( $args->{attributes}{total_containers} ) || 1,
124124
AlreadyHasBinQuantity => int( $args->{attributes}{current_containers} ) || 0,
125125
PaymentReference => $args->{attributes}{PaymentCode},
126126
PaymentMethodCode =>

t/open311/endpoint/agile.t

+3-3
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ subtest 'successfully subscribe to garden waste' => sub {
188188
'attribute[fixmystreet_id]' => 2000001,
189189
'attribute[uprn]' => '123_no_sub',
190190
'attribute[current_containers]' => 1,
191-
'attribute[new_containers]' => 2,
191+
'attribute[total_containers]' => 2,
192192
'attribute[payment_method]' => 'credit_card',
193193
'attribute[PaymentCode]' => 'payment_123',
194194
);
@@ -214,7 +214,7 @@ subtest 'try to subscribe to garden waste when already subscribed' => sub {
214214
'attribute[fixmystreet_id]' => 2000001,
215215
'attribute[uprn]' => '234_has_sub',
216216
'attribute[current_containers]' => 1,
217-
'attribute[new_containers]' => 2,
217+
'attribute[total_containers]' => 2,
218218
'attribute[payment_method]' => 'credit_card',
219219
'attribute[PaymentCode]' => 'payment_123',
220220
);
@@ -238,7 +238,7 @@ subtest 'handle unknown error' => sub {
238238
'attribute[fixmystreet_id]' => 'bad_data',
239239
'attribute[uprn]' => '123_no_sub',
240240
'attribute[current_containers]' => 1,
241-
'attribute[new_containers]' => 2,
241+
'attribute[total_containers]' => 2,
242242
'attribute[payment_method]' => 'credit_card',
243243
'attribute[PaymentCode]' => 'payment_123',
244244
);

0 commit comments

Comments
 (0)