diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-12-06 15:59:05 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-12-08 09:29:58 +0000 |
commit | 0e84e1a8f51af275b1b0e8400d23b6dffeb4303c (patch) | |
tree | 1694917f7d0515324d81ae44ac97e709b1054e56 /bin | |
parent | fda50e07fc671eefa68257fbc9d9bdea63dd4b0f (diff) |
[fixmystreet.com] More categories in fixture.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/fixmystreet.com/fixture | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/bin/fixmystreet.com/fixture b/bin/fixmystreet.com/fixture index 1ca840c71..52e38e2aa 100755 --- a/bin/fixmystreet.com/fixture +++ b/bin/fixmystreet.com/fixture @@ -38,7 +38,28 @@ print($usage->text), exit if $opt->help; FixMyStreet::DB::Factories->setup($opt); # Body + categories -my $categories = ['Potholes', 'Street lighting', 'Graffiti', 'Other']; +my $categories = [ + 'Abandoned vehicles', + 'Bus stops', + 'Dog fouling', + 'Flyposting', + 'Flytipping', + 'Footpath/bridleway away from road', + 'Graffiti', + 'Parks/landscapes', + 'Pavements', + 'Potholes', + 'Public toilets', + 'Roads/highways', + 'Road traffic signs', + 'Rubbish (refuse and recycling)', + 'Street cleaning', + 'Street lighting', + 'Street nameplates', + 'Traffic lights', + 'Trees', + 'Other', +]; my $body = FixMyStreet::DB::Factory::Body->find_or_create({ area_id => $opt->area_id, categories => $categories, @@ -131,7 +152,7 @@ foreach (FixMyStreet::Cobrand->available_cobrand_classes) { FixMyStreet::PhotoStorage::backend->init(); my $user = $users{'user@example.org'}; -my $num = $opt->nonrandom ? 21 : 20; +my $num = $opt->nonrandom ? 21 : 50; say "Created $num problems around '$location' in cobrand '$cobrand'"; my $confirmed = DateTime->today->subtract(days => 1)->add(hours => 8); @@ -182,7 +203,7 @@ for (0..$num-1) { }); } -for (1..3) { +for (1..5) { my $p = $problems->[int(rand(@$problems))]; $users{'inspector@example.org'}->add_to_planned_reports($p); } @@ -201,7 +222,7 @@ my @fixed_user = ( my @problems = $opt->nonrandom ? @$problems : shuffle(@$problems); -my @range = $opt->nonrandom ? (1, 7, 12) : (1..3); +my @range = $opt->nonrandom ? (1, 7, 12) : (1..10); for (@range) { my $problem = $problems[$_]; $confirmed->add(seconds => rand(10000)); @@ -259,11 +280,11 @@ my @open_user = ( 'Ongoing issue.', 'Council rang to say they’re aware and it’s on their list.', 'Still awaiting news on this one.', - 'Council let me know it’s not a top priority, which TBH I do understand now they’ve talked it through.', + 'Council let me know it’s not a top priority, which TBH I do understand now they’ve talked it through.', ); my $updates = []; -@range = $opt->nonrandom ? (13, 8, 2) : (5..9); +@range = $opt->nonrandom ? (13, 8, 2) : (11..20); for my $i (@range) { $confirmed->add(seconds => rand(10000)); my @range_u = $opt->nonrandom ? (1..$i) : (1); @@ -277,7 +298,7 @@ for my $i (@range) { } # Some not responsible updates -@range = $opt->nonrandom ? (3, 9, 20) : (11..13); +@range = $opt->nonrandom ? (3, 9, 20) : (21..25); for (@range) { my $problem = $problems[$_]; $confirmed->add(seconds => rand(10000)); |