Skip to content

Commit 2eb4fe5

Browse files
committed
[Kingston] Update for new data IDs and location.
There is one service task per service unit; container information is now on the service unit, not the task; all the IDs have changed.
1 parent f2728bb commit 2eb4fe5

File tree

7 files changed

+452
-142
lines changed

7 files changed

+452
-142
lines changed

perllib/FixMyStreet/App/Form/Waste/Request/Kingston.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use utf8;
1818
use HTML::FormHandler::Moose;
1919
extends 'FixMyStreet::App::Form::Waste::Request';
2020

21-
use constant CONTAINER_REFUSE_240 => 2;
21+
use constant CONTAINER_REFUSE_240 => 3;
2222

2323
=head2 About you
2424

perllib/FixMyStreet/Cobrand/Kingston.pm

Lines changed: 39 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -18,39 +18,39 @@ sub council_url { return 'kingston'; }
1818
sub admin_user_domain { 'kingston.gov.uk' }
1919

2020
my %TASK_IDS = (
21-
domestic_refuse => 2238,
22-
domestic_food => 2239,
23-
domestic_paper => 2240,
24-
domestic_mixed => 2241,
25-
domestic_refuse_bag => 2242,
26-
communal_refuse => 2243,
27-
domestic_mixed_bag => 2246,
28-
garden => 2247,
29-
communal_food => 2248,
30-
communal_paper => 2249,
31-
communal_mixed => 2250,
32-
domestic_paper_bag => 2632,
33-
schedule2_mixed => 3571,
34-
schedule2_refuse => 3576,
35-
deliver_refuse_bags => 2256,
36-
deliver_recycling_bags => 2257,
21+
domestic_refuse => 4394,
22+
domestic_food => 4389,
23+
domestic_paper => 4388,
24+
domestic_mixed => 4390,
25+
domestic_refuse_bag => 4395,
26+
communal_refuse => 4407,
27+
domestic_mixed_bag => 4391,
28+
garden => 4410,
29+
communal_food => 4403,
30+
communal_paper => 4396,
31+
communal_mixed => 4397,
32+
domestic_paper_bag => 4402,
33+
schedule2_mixed => 4398,
34+
schedule2_refuse => 4409,
35+
deliver_refuse_bags => 4427,
36+
deliver_recycling_bags => 4432,
3737
);
3838
lock_hash(%TASK_IDS);
3939

4040
my %CONTAINERS = (
4141
refuse_140 => 1,
42-
refuse_180 => 35,
43-
refuse_240 => 2,
44-
refuse_360 => 3,
45-
recycling_box => 16,
46-
recycling_240 => 12,
47-
paper_240 => 19,
48-
paper_140 => 36,
49-
food_indoor => 23,
50-
food_outdoor => 24,
51-
garden_240 => 26,
52-
garden_140 => 27,
53-
garden_sack => 28,
42+
refuse_180 => 2,
43+
refuse_240 => 3,
44+
refuse_360 => 4,
45+
recycling_box => 12,
46+
recycling_240 => 15,
47+
paper_240 => 27,
48+
paper_140 => 26,
49+
food_indoor => 43,
50+
food_outdoor => 46,
51+
garden_240 => 39,
52+
garden_140 => 37,
53+
garden_sack => 36,
5454
);
5555
lock_hash(%CONTAINERS);
5656

@@ -141,33 +141,21 @@ sub waste_containers {
141141
};
142142
return {
143143
%$black_bins,
144-
4 => 'Refuse Blue Sack',
145-
5 => 'Refuse Black Sack',
146-
6 => 'Refuse Red Stripe Bag',
147-
18 => 'Mixed Recycling Blue Striped Bag',
148-
29 => 'Recycling Single Use Bag',
149-
21 => 'Paper & Card Reusable Bag',
150-
22 => 'Paper Sacks',
151-
30 => 'Paper & Card Recycling Clear Bag',
152-
7 => 'Communal Refuse bin (240L)',
153-
8 => 'Communal Refuse bin (360L)',
154-
9 => 'Communal Refuse bin (660L)',
155-
10 => 'Communal Refuse bin (1100L)',
156-
11 => 'Communal Refuse Chamberlain',
157-
33 => 'Communal Refuse bin (140L)',
158-
34 => 'Communal Refuse bin (1280L)',
159-
14 => 'Communal Recycling bin (660L)',
160-
15 => 'Communal Recycling bin (1100L)',
161-
25 => 'Communal Food bin (240L)',
144+
10 => 'Refuse Red Stripe Bag',
145+
22 => 'Mixed Recycling Blue Striped Bag',
146+
34 => 'Paper & Card Recycling Clear Bag',
147+
8 => 'Communal Refuse bin (1100L)',
148+
20 => 'Communal Recycling bin (1100L)',
149+
51 => 'Communal Food bin (240L)',
162150
$CONTAINERS{recycling_240} => 'Recycling bin (240L)',
163-
13 => 'Recycling bin (360L)',
164-
20 => 'Paper recycling bin (360L)',
165-
31 => 'Paper 55L Box',
151+
16 => 'Recycling bin (360L)',
152+
28 => 'Paper recycling bin (360L)',
153+
32 => 'Communal Paper bin (1100L)',
166154
$CONTAINERS{recycling_240} => 'Green recycling bin (240L)',
167-
13 => 'Green recycling bin (360L)',
155+
16 => 'Green recycling bin (360L)',
168156
$CONTAINERS{recycling_box} => 'Green recycling box (55L)',
169157
$CONTAINERS{paper_240} => 'Blue lid paper and cardboard bin (240L)',
170-
20 => 'Blue lid paper and cardboard bin (360L)',
158+
28 => 'Blue lid paper and cardboard bin (360L)',
171159
$CONTAINERS{food_indoor} => 'Food waste bin (kitchen)',
172160
$CONTAINERS{food_outdoor} => 'Food waste bin (outdoor)',
173161
$CONTAINERS{paper_140} => 'Blue lid paper and cardboard bin (180L)',

t/app/controller/waste_kands_bulky.t

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ FixMyStreet::override_config {
5656
echo => {
5757
kingston => {
5858
bulky_address_types => [ 1, 7 ],
59-
bulky_service_id => 413,
60-
bulky_event_type_id => 1636,
59+
bulky_service_id => 986,
60+
bulky_event_type_id => 3130,
6161
url => 'http://example.org',
6262
nlpg => 'https://example.com/%s',
6363
},
@@ -68,8 +68,6 @@ FixMyStreet::override_config {
6868
hmac_id => '1234',
6969
scpID => '1234',
7070
company_name => 'rbk',
71-
form_name => 'rbk_user_form',
72-
staff_form_name => 'rbk_staff_form',
7371
customer_ref => 'customer-ref',
7472
bulky_customer_ref => 'customer-ref-bulky',
7573
} },
@@ -95,8 +93,8 @@ FixMyStreet::override_config {
9593
);
9694
$echo->mock('ReserveAvailableSlotsForEvent', sub {
9795
my ($self, $service, $event_type, $property, $guid, $start, $end) = @_;
98-
is $service, 413;
99-
is $event_type, 1636;
96+
is $service, 986;
97+
is $event_type, 3130;
10098
is $property, 12345;
10199
return [
102100
{
@@ -651,7 +649,7 @@ FixMyStreet::override_config {
651649
$mech->content_lacks('Bulky waste collection');
652650
$echo->mock( 'GetEventsForObject', sub { [ {
653651
Guid => 'a-guid',
654-
EventTypeId => 1636,
652+
EventTypeId => 3130,
655653
ResolvedDate => { DateTime => '2023-07-02T00:00:00Z' },
656654
ResolutionCodeId => 232,
657655
EventStateId => 12400,
@@ -662,7 +660,7 @@ FixMyStreet::override_config {
662660
$mech->content_lacks('Bulky waste collection');
663661
$echo->mock( 'GetEventsForObject', sub { [ {
664662
Guid => 'a-guid',
665-
EventTypeId => 1636,
663+
EventTypeId => 3130,
666664
ResolvedDate => { DateTime => '2023-07-05T00:00:00Z' },
667665
ResolutionCodeId => 232,
668666
EventStateId => 12400,
@@ -686,7 +684,7 @@ FixMyStreet::override_config {
686684

687685
$echo->mock( 'GetEventsForObject', sub { [ {
688686
Guid => 'a-guid',
689-
EventTypeId => 1636,
687+
EventTypeId => 3130,
690688
ResolvedDate => { DateTime => '2023-07-05T00:00:00Z' },
691689
ResolutionCodeId => 379,
692690
EventStateId => 12401,
@@ -698,13 +696,13 @@ FixMyStreet::override_config {
698696
$mech->content_lacks('Bulky waste collection');
699697
$echo->mock( 'GetEventsForObject', sub { [ {
700698
Guid => 'a-guid',
701-
EventTypeId => 1636,
699+
EventTypeId => 3130,
702700
ResolvedDate => { DateTime => '2023-07-05T00:00:00Z' },
703701
ResolutionCodeId => 100,
704702
EventStateId => 12401,
705703
}, {
706-
EventTypeId => 1571,
707-
ServiceId => 413,
704+
EventTypeId => 3145,
705+
ServiceId => 986,
708706
Guid => 'guid',
709707
EventDate => { DateTime => '2023-07-05T00:00:00Z' },
710708
} ] } );
Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
[
2+
{
3+
"Data": {
4+
"ExtensibleDatum": {
5+
"Value": "Paper Recycling 240L ",
6+
"DatatypeName": "Recycling Containers",
7+
"ChildData": {
8+
"ExtensibleDatum": [
9+
{ "DatatypeName": "Container Type", "Value": "27" },
10+
{ "DatatypeName": "Container Quantity", "Value": "1" }
11+
]
12+
}
13+
}
14+
},
15+
"ServiceTasks": {
16+
"ServiceTask": [
17+
{
18+
"TaskTypeId": "4388",
19+
"ServiceTaskSchedules": {
20+
"ServiceTaskSchedule": {
21+
"ScheduleDescription": "Friday every other week",
22+
"NextInstance": {
23+
"CurrentScheduledDate": { "DateTime": "2022-09-15T23:00:00Z" },
24+
"OriginalScheduledDate": { "DateTime": "2022-09-15T23:00:00Z" }
25+
},
26+
"LastInstance": {
27+
"CurrentScheduledDate": { "DateTime": "2022-09-02T05:00:00Z" },
28+
"OriginalScheduledDate": { "DateTime": "2022-09-01T23:00:00Z" },
29+
"Ref": { "Value": { "anyType": [ "22239416", "8280" ] } },
30+
"CompletedDate": { "DateTime": "2022-09-02T06:17:01Z" }
31+
},
32+
"StartDate": { "DateTime": "2018-09-02T23:00:00Z" },
33+
"EndDate": { "DateTime": "2050-01-01T00:00:00Z" }
34+
}
35+
},
36+
"TaskIndicatorId": "33",
37+
"Id": "2001",
38+
"TaskTypeName": "Collect Domestic Paper",
39+
"ScheduleDescription": "Every Friday fortnightly"
40+
}
41+
]
42+
},
43+
"ServiceName": "Domestic Paper Collection",
44+
"ServiceId": "974",
45+
"Id": "1001"
46+
},
47+
{
48+
"Data": {
49+
"ExtensibleDatum": [ {
50+
"ChildData": {
51+
"ExtensibleDatum": [
52+
{ "Value": "46", "DatatypeName": "Container Type" },
53+
{ "Value": "1", "DatatypeName": "Container Quantity" }
54+
]
55+
},
56+
"DatatypeName": "Food Containers",
57+
"DatatypeId": "3955",
58+
"Value": "Food Caddy 23L"
59+
} ]
60+
},
61+
"ServiceTasks": {
62+
"ServiceTask": [
63+
{
64+
"TaskTypeId": "4389",
65+
"ServiceTaskSchedules": {
66+
"ServiceTaskSchedule": [
67+
{
68+
"LastInstance": {
69+
"Ref": { "Value": { "anyType": [ "22244305", "8287" ] } },
70+
"OriginalScheduledDate": { "DateTime": "2022-09-08T23:00:00Z" },
71+
"CurrentScheduledDate": { "DateTime": "2022-09-09T05:00:00Z" },
72+
"CompletedDate": { "DateTime": "2022-09-09T05:42:38.93Z" }
73+
},
74+
"StartDate": { "DateTime": "2018-09-02T23:00:00Z" },
75+
"NextInstance": null,
76+
"EndDate": { "DateTime": "2050-01-01T00:00:00Z" },
77+
"ScheduleDescription": null
78+
},
79+
{
80+
"EndDate": { "DateTime": "2050-01-01T00:00:00Z" },
81+
"StartDate": { "DateTime": "2018-09-02T23:00:00Z" },
82+
"LastInstance": null,
83+
"NextInstance": {
84+
"CurrentScheduledDate": { "DateTime": "2022-09-15T23:00:00Z" },
85+
"OriginalScheduledDate": { "DateTime": "2022-09-15T23:00:00Z" }
86+
},
87+
"ScheduleDescription": "Friday every other week"
88+
}
89+
]
90+
},
91+
"TaskIndicatorId": "33",
92+
"TaskTypeName": "Collect Domestic Food",
93+
"Id": "2002",
94+
"ScheduleDescription": "Every Friday"
95+
}
96+
]
97+
},
98+
"ServiceName": "Domestic Food Collection",
99+
"ServiceId": "980",
100+
"Id": "1002"
101+
},
102+
{
103+
"Data": {
104+
"ExtensibleDatum": {
105+
"DatatypeName": "Recycling Containers",
106+
"DatatypeId": "3964",
107+
"Value": "Recycling 55L Box",
108+
"ChildData": {
109+
"ExtensibleDatum": [
110+
{ "Value": "12", "DatatypeName": "Container Type" },
111+
{ "Value": "3", "DatatypeName": "Container Quantity" }
112+
]
113+
}
114+
}
115+
},
116+
"ServiceTasks": {
117+
"ServiceTask": [
118+
{
119+
"TaskIndicatorId": "33",
120+
"ServiceTaskSchedules": {
121+
"ServiceTaskSchedule": {
122+
"ScheduleDescription": "Friday every other week",
123+
"NextInstance": {
124+
"CurrentScheduledDate": { "DateTime": "2022-09-22T23:00:00Z" },
125+
"OriginalScheduledDate": { "DateTime": "2022-09-22T23:00:00Z" }
126+
},
127+
"StartDate": { "DateTime": "2017-01-01T00:00:00Z" },
128+
"LastInstance": {
129+
"CompletedDate": { "DateTime": "2022-09-09T05:52:03.367Z" },
130+
"Ref": { "Value": { "anyType": [ "17510905", "8287" ] } },
131+
"CurrentScheduledDate": { "DateTime": "2022-09-09T05:00:00Z" },
132+
"OriginalScheduledDate": { "DateTime": "2022-09-08T23:00:00Z" }
133+
},
134+
"EndDate": { "DateTime": "2050-01-01T00:00:00Z" }
135+
}
136+
},
137+
"TaskTypeId": "4390",
138+
"ScheduleDescription": "Every Friday fortnightly",
139+
"TaskTypeName": "Collect Domestic Recycling",
140+
"Id": "2003"
141+
}
142+
]
143+
},
144+
"ServiceName": "Domestic Recycling Collection",
145+
"ServiceId": "970",
146+
"Id": "1003"
147+
},
148+
{
149+
"ServiceId": "966",
150+
"ServiceName": "Domestic Refuse Collection",
151+
"Id": "1004",
152+
"Data": {
153+
"ExtensibleDatum": {
154+
"ChildData": {
155+
"ExtensibleDatum": [
156+
{ "Value": "3", "DatatypeName": "Container Type" },
157+
{ "Value": "1", "DatatypeName": "Container Quantity" }
158+
]
159+
},
160+
"DatatypeName": "Refuse Containers"
161+
}
162+
},
163+
"ServiceTasks": {
164+
"ServiceTask": {
165+
"ScheduleDescription": "Every Friday fortnightly",
166+
"Id": "2004",
167+
"TaskTypeName": "Collect Domestic Refuse Bin",
168+
"TaskIndicatorId": "33",
169+
"ServiceTaskSchedules": {
170+
"ServiceTaskSchedule": {
171+
"ScheduleDescription": "Friday every other week",
172+
"EndDate": { "DateTime": "2050-01-01T00:00:00Z" },
173+
"StartDate": { "DateTime": "2017-01-01T00:00:00Z" },
174+
"LastInstance": {
175+
"Ref": { "Value": { "anyType": [ "17430692", "8287" ] } },
176+
"CurrentScheduledDate": { "DateTime": "2022-09-09T05:00:00Z" },
177+
"OriginalScheduledDate": { "DateTime": "2022-09-08T23:00:00Z" },
178+
"CompletedDate": { "DateTime": "2022-09-09T08:19:22.76Z" }
179+
},
180+
"NextInstance": {
181+
"OriginalScheduledDate": { "DateTime": "2022-09-22T23:00:00Z" },
182+
"CurrentScheduledDate": { "DateTime": "2022-09-22T23:00:00Z" }
183+
}
184+
}
185+
},
186+
"TaskTypeId": "4394"
187+
}
188+
}
189+
}
190+
]

0 commit comments

Comments
 (0)