Added new search data fixtures

This commit is contained in:
Tom Bloor 2017-08-31 16:58:23 +01:00
parent bf16077b10
commit 1ab2d0b71c
39 changed files with 414 additions and 0 deletions

View file

@ -0,0 +1,88 @@
#! /usr/bin/env perl
use strict;
use warnings;
use DBIx::Class::Fixtures;
use FindBin qw/ $Bin /;
use lib "$Bin/../../../../lib";
use Pear::LocalLoop::Schema;
use DateTime;
my $fixtures = DBIx::Class::Fixtures->new({
config_dir => "$Bin",
});
my $schema = Pear::LocalLoop::Schema->connect('dbi:SQLite::memory:');
$schema->deploy;
$fixtures->populate({
directory => "$Bin/../data/users",
no_deploy => 1,
schema => $schema,
});
my @orgs = (
{
organisation => {
name => 'Avanti Bar & Restaurant',
street_name => '57 Main St',
town => 'Kirkby Lonsdale',
postcode => 'LA6 2AH',
sector => 'I',
},
type => "organisation",
},
{
organisation => {
name => 'Full House Noodle Bar',
street_name => '21 Common Garden St',
town => 'Lancaster',
postcode => 'LA1 1XD',
sector => 'I',
},
type => "organisation",
},
{
organisation => {
name => 'The Quay\'s Fishbar',
street_name => '1 Adcliffe Rd',
town => 'Lancaster',
postcode => 'LA1 1SS',
sector => 'I',
},
type => "organisation",
},
{
organisation => {
name => 'Dan\'s Fishop',
street_name => '56 North Rd',
town => 'Lancaster',
postcode => 'LA1 1LT',
sector => 'I',
},
type => "organisation",
},
{
organisation => {
name => 'Hodgeson\'s Chippy',
street_name => '96 Prospect St',
town => 'Lancaster',
postcode => 'LA1 3BH',
sector => 'I',
},
type => "organisation",
},
);
$schema->resultset('Entity')->create( $_ ) for @orgs;
my $data_set = 'search';
$fixtures->dump({
all => 1,
schema => $schema,
directory => "$Bin/../data/" . $data_set,
});

View file

@ -0,0 +1,57 @@
$VAR1 = {
'has_many' => {
'fetch' => 0
},
'sets' => [
{
'class' => 'Feedback',
'quantity' => 'all'
},
{
'quantity' => 'all',
'class' => 'Transaction'
},
{
'quantity' => 'all',
'class' => 'User'
},
{
'quantity' => 'all',
'class' => 'LeaderboardSet'
},
{
'class' => 'Customer',
'quantity' => 'all'
},
{
'quantity' => 'all',
'class' => 'Organisation'
},
{
'quantity' => 'all',
'class' => 'LeaderboardValue'
},
{
'class' => 'Entity',
'quantity' => 'all'
},
{
'quantity' => 'all',
'class' => 'Leaderboard'
},
{
'class' => 'SessionToken',
'quantity' => 'all'
},
{
'quantity' => 'all',
'class' => 'AccountToken'
}
],
'might_have' => {
'fetch' => 0
},
'belongs_to' => {
'fetch' => 0
}
};

View file

@ -0,0 +1 @@
1.001036

View file

@ -0,0 +1,8 @@
$HASH1 = {
display_name => 'Test User1',
entity_id => 1,
full_name => 'Test User1',
id => 1,
postcode => 'LA1 1AA',
year_of_birth => 2006
};

View file

@ -0,0 +1,8 @@
$HASH1 = {
display_name => 'Test User2',
entity_id => 2,
full_name => 'Test User2',
id => 2,
postcode => 'LA1 1AA',
year_of_birth => 2006
};

View file

@ -0,0 +1,8 @@
$HASH1 = {
display_name => 'Test User3',
entity_id => 3,
full_name => 'Test User3',
id => 3,
postcode => 'LA1 1AA',
year_of_birth => 2006
};

View file

@ -0,0 +1,8 @@
$HASH1 = {
display_name => 'Test User4',
entity_id => 4,
full_name => 'Test User4',
id => 4,
postcode => 'LA1 1AA',
year_of_birth => 2006
};

View file

@ -0,0 +1,8 @@
$HASH1 = {
display_name => 'Test Admin',
entity_id => 6,
full_name => 'Test Admin',
id => 5,
postcode => 'LA1 1AA',
year_of_birth => 2006
};

View file

@ -0,0 +1,4 @@
$HASH1 = {
id => 1,
type => 'customer'
};

View file

@ -0,0 +1,4 @@
$HASH1 = {
id => 10,
type => 'organisation'
};

View file

@ -0,0 +1,4 @@
$HASH1 = {
id => 11,
type => 'organisation'
};

View file

@ -0,0 +1,4 @@
$HASH1 = {
id => 2,
type => 'customer'
};

View file

@ -0,0 +1,4 @@
$HASH1 = {
id => 3,
type => 'customer'
};

View file

@ -0,0 +1,4 @@
$HASH1 = {
id => 4,
type => 'customer'
};

View file

@ -0,0 +1,4 @@
$HASH1 = {
id => 5,
type => 'organisation'
};

View file

@ -0,0 +1,4 @@
$HASH1 = {
id => 6,
type => 'customer'
};

View file

@ -0,0 +1,4 @@
$HASH1 = {
id => 7,
type => 'organisation'
};

View file

@ -0,0 +1,4 @@
$HASH1 = {
id => 8,
type => 'organisation'
};

View file

@ -0,0 +1,4 @@
$HASH1 = {
id => 9,
type => 'organisation'
};

View file

@ -0,0 +1,5 @@
$HASH1 = {
id => 1,
name => 'Daily Total',
type => 'daily_total'
};

View file

@ -0,0 +1,5 @@
$HASH1 = {
id => 2,
name => 'Daily Count',
type => 'daily_count'
};

View file

@ -0,0 +1,5 @@
$HASH1 = {
id => 3,
name => 'Weekly Total',
type => 'weekly_total'
};

View file

@ -0,0 +1,5 @@
$HASH1 = {
id => 4,
name => 'Weekly Count',
type => 'weekly_count'
};

View file

@ -0,0 +1,5 @@
$HASH1 = {
id => 5,
name => 'Monthly Total',
type => 'monthly_total'
};

View file

@ -0,0 +1,5 @@
$HASH1 = {
id => 6,
name => 'Monthly Count',
type => 'monthly_count'
};

View file

@ -0,0 +1,5 @@
$HASH1 = {
id => 7,
name => 'All Time Total',
type => 'all_time_total'
};

View file

@ -0,0 +1,5 @@
$HASH1 = {
id => 8,
name => 'All Time Count',
type => 'all_time_count'
};

View file

@ -0,0 +1,16 @@
$HASH1 = {
country => undef,
entity_id
=> 5,
id => 1,
name => 'Test Org',
pending => 0,
postcode
=> 'LA1 1AA',
sector => undef,
street_name
=> 'Test Street',
submitted_by_id
=> undef,
town => 'Lancaster'
};

View file

@ -0,0 +1,16 @@
$HASH1 = {
country => undef,
entity_id
=> 7,
id => 2,
name => 'Avanti Bar & Restaurant',
pending => 0,
postcode
=> 'LA6 2AH',
sector => 'I',
street_name
=> '57 Main St',
submitted_by_id
=> undef,
town => 'Kirkby Lonsdale'
};

View file

@ -0,0 +1,16 @@
$HASH1 = {
country => undef,
entity_id
=> 8,
id => 3,
name => 'Full House Noodle Bar',
pending => 0,
postcode
=> 'LA1 1XD',
sector => 'I',
street_name
=> '21 Common Garden St',
submitted_by_id
=> undef,
town => 'Lancaster'
};

View file

@ -0,0 +1,16 @@
$HASH1 = {
country => undef,
entity_id
=> 9,
id => 4,
name => 'The Quay\'s Fishbar',
pending => 0,
postcode
=> 'LA1 1SS',
sector => 'I',
street_name
=> '1 Adcliffe Rd',
submitted_by_id
=> undef,
town => 'Lancaster'
};

View file

@ -0,0 +1,16 @@
$HASH1 = {
country => undef,
entity_id
=> 10,
id => 5,
name => 'Dan\'s Fishop',
pending => 0,
postcode
=> 'LA1 1LT',
sector => 'I',
street_name
=> '56 North Rd',
submitted_by_id
=> undef,
town => 'Lancaster'
};

View file

@ -0,0 +1,16 @@
$HASH1 = {
country => undef,
entity_id
=> 11,
id => 6,
name => 'Hodgeson\'s Chippy',
pending => 0,
postcode
=> 'LA1 3BH',
sector => 'I',
street_name
=> '96 Prospect St',
submitted_by_id
=> undef,
town => 'Lancaster'
};

View file

@ -0,0 +1,8 @@
$HASH1 = {
email => 'test1@example.com',
entity_id => 1,
id => 1,
is_admin => 0,
join_date => '2017-08-31 12:17:25',
password => '$2a$08$HSuznDeSU1fuONwKhp2/S.TX/X4p4g0dHtz20kVXxprm8hIg5QQma'
};

View file

@ -0,0 +1,8 @@
$HASH1 = {
email => 'test2@example.com',
entity_id => 2,
id => 2,
is_admin => 0,
join_date => '2017-08-31 12:17:25',
password => '$2a$08$5XYLWPJvVGuWUvfSWj9cIOg4/tyB4fZ3knzwgw5UnBSKFBFIKOiFC'
};

View file

@ -0,0 +1,8 @@
$HASH1 = {
email => 'test3@example.com',
entity_id => 3,
id => 3,
is_admin => 0,
join_date => '2017-08-31 12:17:25',
password => '$2a$08$p5VU4leHetEvuz2P3uMfYuuPTkDGg8wsM7QuSVKkXR.s3B9T2JaVW'
};

View file

@ -0,0 +1,8 @@
$HASH1 = {
email => 'test4@example.com',
entity_id => 4,
id => 4,
is_admin => 0,
join_date => '2017-08-31 12:17:25',
password => '$2a$08$fkkTUYA9zvt32iBbN7aOcOnmiHzOkbMEjN31PB9CsitGrE.KF7cAG'
};

View file

@ -0,0 +1,8 @@
$HASH1 = {
email => 'org@example.com',
entity_id => 5,
id => 5,
is_admin => 0,
join_date => '2017-08-31 12:17:25',
password => '$2a$08$MWC45.w1AnLPNNHiS96ICOHfNlTrIqB0.7OPzy5qB.z0pZB0theo.'
};

View file

@ -0,0 +1,8 @@
$HASH1 = {
email => 'admin@example.com',
entity_id => 6,
id => 6,
is_admin => 1,
join_date => '2017-08-31 12:17:25',
password => '$2a$08$1sPcPB9GnoNgzhBAk2bHSOqEmv6.Y6YLrAa2DJ6TR2WefzTYZQ92G'
};