Fixes for CI/CD
This commit is contained in:
parent
b9b4416737
commit
d1a7e399dc
@ -316,7 +316,7 @@ class Product extends Model implements IDs
|
|||||||
static $default = NULL;
|
static $default = NULL;
|
||||||
if (! $go) {
|
if (! $go) {
|
||||||
if (is_null($default))
|
if (is_null($default))
|
||||||
$default = Group::findOrFail(0); // All public users
|
$default = Group::whereNull('parent_id')->firstOrFail(); // All public users
|
||||||
|
|
||||||
$go = $default;
|
$go = $default;
|
||||||
}
|
}
|
||||||
|
@ -24,8 +24,6 @@ class AccountFactory extends Factory
|
|||||||
{
|
{
|
||||||
// Create Dependencies - should be loaded by seeding.
|
// Create Dependencies - should be loaded by seeding.
|
||||||
$co = Country::findOrFail(61);
|
$co = Country::findOrFail(61);
|
||||||
$lo = Language::findOrFail(1);
|
|
||||||
$cyo = Currency::findOrFail(6);
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'id' => $this->faker->numberBetween(2048,65535),
|
'id' => $this->faker->numberBetween(2048,65535),
|
||||||
@ -33,10 +31,8 @@ class AccountFactory extends Factory
|
|||||||
// 'date_last',
|
// 'date_last',
|
||||||
//* 'site_id', // Needs to be passed in
|
//* 'site_id', // Needs to be passed in
|
||||||
// 'date_expire',
|
// 'date_expire',
|
||||||
'language_id' => $lo->id,
|
|
||||||
'country_id' => $co->id,
|
'country_id' => $co->id,
|
||||||
// 'rtm_id',
|
// 'rtm_id',
|
||||||
'currency_id' => $cyo->id,
|
|
||||||
'active' => TRUE,
|
'active' => TRUE,
|
||||||
// 'company',
|
// 'company',
|
||||||
// 'address1',
|
// 'address1',
|
||||||
|
@ -36,11 +36,12 @@ class ProductFactory extends Factory
|
|||||||
// 'group_avail'
|
// 'group_avail'
|
||||||
// 'avail_category'
|
// 'avail_category'
|
||||||
// 'price_type'
|
// 'price_type'
|
||||||
'price_group'=>serialize([
|
'pricing'=>json_encode([
|
||||||
1=>[
|
[
|
||||||
0=>[
|
'show'=>true,
|
||||||
'price_setup'=>50,
|
[
|
||||||
'price_base'=>100,
|
'setup'=>50,
|
||||||
|
'base'=>100,
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]),
|
]),
|
||||||
|
@ -65,7 +65,7 @@ class ServiceFactory extends Factory
|
|||||||
// 'orderedby_id',
|
// 'orderedby_id',
|
||||||
// 'order_status',
|
// 'order_status',
|
||||||
// 'order_info',
|
// 'order_info',
|
||||||
'model' => 'App\Models\Service\Adsl',
|
'model' => 'App\Models\Service\Broadband',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,8 @@ class OptimizeProduct extends Migration
|
|||||||
*/
|
*/
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
|
$site = \App\Models\Site::where('site_id',1)->firstOrNew();
|
||||||
|
|
||||||
Schema::table('ab_product', function (Blueprint $table) {
|
Schema::table('ab_product', function (Blueprint $table) {
|
||||||
$table->dropForeign(['site_id']);
|
$table->dropForeign(['site_id']);
|
||||||
$table->dropIndex(['id','site_id']);
|
$table->dropIndex(['id','site_id']);
|
||||||
@ -490,6 +492,10 @@ class OptimizeProduct extends Migration
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// No need to update tables, if we dont have a site setup yet.
|
||||||
|
if (! $site->exists)
|
||||||
|
return;
|
||||||
|
|
||||||
// SSL
|
// SSL
|
||||||
$so = \App\Models\Supplier::where('name','Graytech Hosting Pty Ltd')->firstOrNew();
|
$so = \App\Models\Supplier::where('name','Graytech Hosting Pty Ltd')->firstOrNew();
|
||||||
$so->name = 'Graytech Hosting Pty Ltd';
|
$so->name = 'Graytech Hosting Pty Ltd';
|
||||||
@ -500,7 +506,7 @@ class OptimizeProduct extends Migration
|
|||||||
->where('site_id','1')
|
->where('site_id','1')
|
||||||
->where('supplier_id',$so->id)
|
->where('supplier_id',$so->id)
|
||||||
->firstOrNew();
|
->firstOrNew();
|
||||||
$sdo->site_id = 1;
|
$sdo->site_id = $site->site_id;
|
||||||
$so->detail()->save($sdo);
|
$so->detail()->save($sdo);
|
||||||
|
|
||||||
$o = new \App\Models\Supplier\SSL;
|
$o = new \App\Models\Supplier\SSL;
|
||||||
@ -538,7 +544,7 @@ class OptimizeProduct extends Migration
|
|||||||
->where('site_id','1')
|
->where('site_id','1')
|
||||||
->where('supplier_id',$so->id)
|
->where('supplier_id',$so->id)
|
||||||
->firstOrNew();
|
->firstOrNew();
|
||||||
$sdo->site_id = 1;
|
$sdo->site_id = $site->site_id;
|
||||||
$so->detail()->save($sdo);
|
$so->detail()->save($sdo);
|
||||||
|
|
||||||
$o = new \App\Models\Supplier\Host;
|
$o = new \App\Models\Supplier\Host;
|
||||||
@ -561,7 +567,7 @@ class OptimizeProduct extends Migration
|
|||||||
->where('site_id','1')
|
->where('site_id','1')
|
||||||
->where('supplier_id',$so->id)
|
->where('supplier_id',$so->id)
|
||||||
->firstOrNew();
|
->firstOrNew();
|
||||||
$sdo->site_id = 1;
|
$sdo->site_id = $site->site_id;
|
||||||
$so->detail()->save($sdo);
|
$so->detail()->save($sdo);
|
||||||
|
|
||||||
$o = new \App\Models\Supplier\Voip;
|
$o = new \App\Models\Supplier\Voip;
|
||||||
|
@ -22,7 +22,7 @@ class CountryTableSeeder extends Seeder
|
|||||||
$o->three_code = 'AUS';
|
$o->three_code = 'AUS';
|
||||||
$o->active = TRUE;
|
$o->active = TRUE;
|
||||||
|
|
||||||
$oo = Currency::where('iso_code','AUD')->firstOrFail();
|
$oo = Currency::where('iso','AUD')->firstOrFail();
|
||||||
|
|
||||||
$oo->country()->save($o);
|
$oo->country()->save($o);
|
||||||
}
|
}
|
||||||
|
@ -18,10 +18,10 @@ class CurrencyTableSeeder extends Seeder
|
|||||||
$o = new Currency;
|
$o = new Currency;
|
||||||
$o->id = 6;
|
$o->id = 6;
|
||||||
$o->name = 'Australian Dollars';
|
$o->name = 'Australian Dollars';
|
||||||
$o->symbol = '$';
|
|
||||||
$o->iso_code = 'AUD';
|
|
||||||
$o->rounding = 2;
|
|
||||||
$o->active = TRUE;
|
$o->active = TRUE;
|
||||||
|
$o->symbol = '$';
|
||||||
|
$o->iso = 'AUD';
|
||||||
|
$o->rounding = 2;
|
||||||
$o->save();
|
$o->save();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -18,7 +18,6 @@ class SiteTableSeeder extends Seeder
|
|||||||
// Test Sites 254 & 255
|
// Test Sites 254 & 255
|
||||||
$o = new Site;
|
$o = new Site;
|
||||||
$o->id = 254;
|
$o->id = 254;
|
||||||
// $o->date_orig
|
|
||||||
$o->active = TRUE;
|
$o->active = TRUE;
|
||||||
$o->site_id = 254;
|
$o->site_id = 254;
|
||||||
$o->country_id = 61;
|
$o->country_id = 61;
|
||||||
@ -32,7 +31,6 @@ class SiteTableSeeder extends Seeder
|
|||||||
// Test Sites 254 & 255
|
// Test Sites 254 & 255
|
||||||
$o = new Site;
|
$o = new Site;
|
||||||
$o->id = 255;
|
$o->id = 255;
|
||||||
// $o->date_orig
|
|
||||||
$o->site_id = 255;
|
$o->site_id = 255;
|
||||||
$o->active = TRUE;
|
$o->active = TRUE;
|
||||||
$o->country_id = 61;
|
$o->country_id = 61;
|
||||||
|
@ -17,10 +17,9 @@ class UserTableSeeder extends Seeder
|
|||||||
{
|
{
|
||||||
$o = new User;
|
$o = new User;
|
||||||
$o->id = 1;
|
$o->id = 1;
|
||||||
$o->site_id = 1;
|
$o->site_id = 254;
|
||||||
$o->language_id = 1;
|
$o->language_id = 1;
|
||||||
$o->country_id = 61;
|
$o->country_id = 61;
|
||||||
$o->currency_id = 6;
|
|
||||||
$o->active = 1;
|
$o->active = 1;
|
||||||
$o->firstname = 'Wholesaler';
|
$o->firstname = 'Wholesaler';
|
||||||
$o->lastname = 'User';
|
$o->lastname = 'User';
|
||||||
@ -29,10 +28,9 @@ class UserTableSeeder extends Seeder
|
|||||||
|
|
||||||
$o = new User;
|
$o = new User;
|
||||||
$o->id = 10;
|
$o->id = 10;
|
||||||
$o->site_id = 1;
|
$o->site_id = 254;
|
||||||
$o->language_id = 1;
|
$o->language_id = 1;
|
||||||
$o->country_id = 61;
|
$o->country_id = 61;
|
||||||
$o->currency_id = 6;
|
|
||||||
$o->active = 1;
|
$o->active = 1;
|
||||||
$o->firstname = 'reseller1-0';
|
$o->firstname = 'reseller1-0';
|
||||||
$o->lastname = 'User';
|
$o->lastname = 'User';
|
||||||
@ -41,10 +39,9 @@ class UserTableSeeder extends Seeder
|
|||||||
|
|
||||||
$o = new User;
|
$o = new User;
|
||||||
$o->id = 11;
|
$o->id = 11;
|
||||||
$o->site_id = 1;
|
$o->site_id = 254;
|
||||||
$o->language_id = 1;
|
$o->language_id = 1;
|
||||||
$o->country_id = 61;
|
$o->country_id = 61;
|
||||||
$o->currency_id = 6;
|
|
||||||
$o->active = 1;
|
$o->active = 1;
|
||||||
$o->firstname = 'reseller2-0';
|
$o->firstname = 'reseller2-0';
|
||||||
$o->lastname = 'User';
|
$o->lastname = 'User';
|
||||||
@ -53,10 +50,9 @@ class UserTableSeeder extends Seeder
|
|||||||
|
|
||||||
$o = new User;
|
$o = new User;
|
||||||
$o->id = 110;
|
$o->id = 110;
|
||||||
$o->site_id = 1;
|
$o->site_id = 254;
|
||||||
$o->language_id = 1;
|
$o->language_id = 1;
|
||||||
$o->country_id = 61;
|
$o->country_id = 61;
|
||||||
$o->currency_id = 6;
|
|
||||||
$o->active = 1;
|
$o->active = 1;
|
||||||
$o->firstname = 'reseller2-1';
|
$o->firstname = 'reseller2-1';
|
||||||
$o->lastname = 'User';
|
$o->lastname = 'User';
|
||||||
@ -65,10 +61,9 @@ class UserTableSeeder extends Seeder
|
|||||||
|
|
||||||
$o = new User;
|
$o = new User;
|
||||||
$o->id = 1010;
|
$o->id = 1010;
|
||||||
$o->site_id = 1;
|
$o->site_id = 254;
|
||||||
$o->language_id = 1;
|
$o->language_id = 1;
|
||||||
$o->country_id = 61;
|
$o->country_id = 61;
|
||||||
$o->currency_id = 6;
|
|
||||||
$o->active = 1;
|
$o->active = 1;
|
||||||
$o->firstname = 'user1-0-1';
|
$o->firstname = 'user1-0-1';
|
||||||
$o->lastname = 'User';
|
$o->lastname = 'User';
|
||||||
@ -77,10 +72,9 @@ class UserTableSeeder extends Seeder
|
|||||||
|
|
||||||
$o = new User;
|
$o = new User;
|
||||||
$o->id = 1110;
|
$o->id = 1110;
|
||||||
$o->site_id = 1;
|
$o->site_id = 254;
|
||||||
$o->language_id = 1;
|
$o->language_id = 1;
|
||||||
$o->country_id = 61;
|
$o->country_id = 61;
|
||||||
$o->currency_id = 6;
|
|
||||||
$o->active = 1;
|
$o->active = 1;
|
||||||
$o->firstname = 'user2-1-1';
|
$o->firstname = 'user2-1-1';
|
||||||
$o->lastname = 'User';
|
$o->lastname = 'User';
|
||||||
|
Loading…
Reference in New Issue
Block a user