From 1bc56016e7543a436d220dffe8e79d7e285d0c68 Mon Sep 17 00:00:00 2001 From: Tom Bloor Date: Thu, 23 Nov 2017 16:52:52 +0000 Subject: [PATCH] Fix dev_data Command for testing --- lib/Pear/LocalLoop/Command/dev_data.pm | 54 ++++++++++++++++---------- 1 file changed, 33 insertions(+), 21 deletions(-) diff --git a/lib/Pear/LocalLoop/Command/dev_data.pm b/lib/Pear/LocalLoop/Command/dev_data.pm index 70a5673..5cf079b 100644 --- a/lib/Pear/LocalLoop/Command/dev_data.pm +++ b/lib/Pear/LocalLoop/Command/dev_data.pm @@ -28,45 +28,57 @@ sub run { $schema->resultset('User')->create({ email => 'test@example.com', password => 'abc123', - customer => { - full_name => 'Test User', - display_name => 'Test User', - year_of_birth => 2006, - postcode => 'LA1 1AA', + entity => { + type => 'customer', + customer => { + full_name => 'Test User', + display_name => 'Test User', + year_of_birth => 2006, + postcode => 'LA1 1AA', + } }, - administrator => {}, + is_admin => 1, }); $schema->resultset('User')->create({ email => 'test2@example.com', password => 'abc123', - customer => { - full_name => 'Test User 2', - display_name => 'Test User 2', - year_of_birth => 2006, - postcode => 'LA1 1AA', + entity => { + type => 'customer', + customer => { + full_name => 'Test User 2', + display_name => 'Test User 2', + year_of_birth => 2006, + postcode => 'LA1 1AA', + }, }, }); $schema->resultset('User')->create({ email => 'test3@example.com', password => 'abc123', - customer => { - full_name => 'Test User 3', - display_name => 'Test User 3', - year_of_birth => 2006, - postcode => 'LA1 1AA', + entity => { + type => 'customer', + customer => { + full_name => 'Test User 3', + display_name => 'Test User 3', + year_of_birth => 2006, + postcode => 'LA1 1AA', + }, }, }); $schema->resultset('User')->create({ email => 'testorg@example.com', password => 'abc123', - organisation => { - name => 'Test Org', - street_name => 'Test Street', - town => 'Lancaster', - postcode => 'LA1 1AA', + entity => { + type => 'organisation', + organisation => { + name => 'Test Org', + street_name => 'Test Street', + town => 'Lancaster', + postcode => 'LA1 1AA', + }, }, }); }