aboutsummaryrefslogtreecommitdiffstats
path: root/bin/fixmystreet.com/fixture
diff options
context:
space:
mode:
Diffstat (limited to 'bin/fixmystreet.com/fixture')
-rwxr-xr-xbin/fixmystreet.com/fixture24
1 files changed, 23 insertions, 1 deletions
diff --git a/bin/fixmystreet.com/fixture b/bin/fixmystreet.com/fixture
index 1062eb16b..59de8e222 100755
--- a/bin/fixmystreet.com/fixture
+++ b/bin/fixmystreet.com/fixture
@@ -99,15 +99,35 @@ if ($opt->test_fixtures) {
{ area_id => 2257, categories => ['Flytipping', 'Graffiti'], name => 'Chiltern District Council' },
{ area_id => 2397, categories => [ 'Graffiti' ], name => 'Northampton Borough Council' },
{ area_id => 2483, categories => [ 'Potholes', 'Other' ], name => 'Hounslow Borough Council' },
+ { area_id => 2508, categories => [ 'Potholes', 'Other' ], name => 'Hackney Council' },
{ area_id => 2636, categories => [ 'Potholes', 'Private', 'Extra' ], name => 'Isle of Wight Council' },
- { area_id => 2566, categories => [ 'Fallen branch' ], name => 'Peterborough City Council' },
+ { area_id => 2566, categories => [ 'Fallen branch', 'Light Out', 'Light Dim', 'Fallen Tree', 'Damaged Tree' ], name => 'Peterborough City Council' },
{ area_id => 2498, categories => [ 'Incorrect timetable', 'Glass broken', 'Mobile Crane Operation' ], name => 'TfL' },
+ { area_id => 2237, categories => [ 'Flytipping', 'Roads', 'Parks' ], name => 'Oxfordshire County Council' },
) {
$bodies->{$_->{area_id}} = FixMyStreet::DB::Factory::Body->find_or_create($_);
my $cats = join(', ', @{$_->{categories}});
say "Created body $_->{name} for MapIt area ID $_->{area_id}, categories $cats";
}
+ for my $cat_name ('Fallen Tree', 'Damaged Tree') {
+ my $cat = FixMyStreet::DB->resultset('Contact')->find({
+ body => $bodies->{2566},
+ category => $cat_name,
+ });
+ $cat->set_extra_metadata( group => 'Trees' );
+ $cat->update;
+ }
+
+ for my $cat_name ('Light Out', 'Light Dim') {
+ my $cat = FixMyStreet::DB->resultset('Contact')->find({
+ body => $bodies->{2566},
+ category => $cat_name,
+ });
+ $cat->set_extra_metadata( group => 'Street lighting' );
+ $cat->update;
+ }
+
my $child_cat = FixMyStreet::DB->resultset("Contact")->find({
body => $bodies->{2234},
category => 'Very Urgent',
@@ -260,6 +280,7 @@ $priority->add_to_contacts($body->contacts->first);
say "Created users, all with password 'password':";
my %users;
my $perms_inspector = ['report_inspect', 'planned_reports'];
+my $perms_inspector_with_instruct = [@$perms_inspector, 'report_instruct'];
my $perms_cs = [
'contribute_as_body', 'contribute_as_another_user',
'moderate', 'view_body_contribute_details',
@@ -271,6 +292,7 @@ my $perms_cs_full = [
];
foreach (
{ name => 'Inspector Gadget', email => 'inspector@example.org', email_verified => 1, body => $body, permissions => $perms_inspector },
+ { name => 'Inspector Instructor', email => 'inspector-instructor@example.org', email_verified => 1, body => $body, permissions => $perms_inspector_with_instruct },
{ name => 'Harriet Helpful', email_verified => 1, email => 'cs@example.org', body => $body, permissions => $perms_cs },
{ name => 'Andrew Agreeable', email_verified => 1, email => 'cs_full@example.org', body => $body, permissions => $perms_cs_full },
{ name => 'Super User', email_verified => 1, email => 'super@example.org', body => $body, permissions => [