Lots of changes
This commit is contained in:
@@ -2,14 +2,12 @@
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Contract;
|
||||
use App\Models\ContractType;
|
||||
use App\Models\Person\AddressType;
|
||||
use App\Models\Person\Person;
|
||||
use App\Models\Person\PersonGroup;
|
||||
use App\Models\Person\PersonType;
|
||||
use App\Models\Person\PhoneType;
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class PersonSeeder extends Seeder
|
||||
@@ -26,8 +24,8 @@ public function run(): void
|
||||
];
|
||||
|
||||
$personGroups = [
|
||||
[ 'name' => 'client', 'description' => ''],
|
||||
[ 'name' => 'debtor', 'description' => '']
|
||||
[ 'name' => 'client', 'description' => '', 'color_tag' => 'blue-400'],
|
||||
[ 'name' => 'client case', 'description' => '', 'color_tag' => 'red-400']
|
||||
];
|
||||
|
||||
$phoneTypes = [
|
||||
@@ -80,7 +78,7 @@ public function run(): void
|
||||
'group_id' => 1,
|
||||
'type_id' => 1,
|
||||
'user_id' => 1
|
||||
]);
|
||||
])->client()->create();
|
||||
|
||||
//debtors
|
||||
Person::create([
|
||||
@@ -96,6 +94,8 @@ public function run(): void
|
||||
'group_id' => 2,
|
||||
'type_id' => 2,
|
||||
'user_id' => 1
|
||||
])->clientCase()->create([
|
||||
'client_id' => 1
|
||||
]);
|
||||
|
||||
Person::create([
|
||||
@@ -111,6 +111,8 @@ public function run(): void
|
||||
'group_id' => 2,
|
||||
'type_id' => 2,
|
||||
'user_id' => 1
|
||||
])->clientCase()->create([
|
||||
'client_id' => 1
|
||||
]);
|
||||
|
||||
//client
|
||||
@@ -127,7 +129,7 @@ public function run(): void
|
||||
'group_id' => 1,
|
||||
'type_id' => 1,
|
||||
'user_id' => 1
|
||||
]);
|
||||
])->client()->create();
|
||||
|
||||
//debtors
|
||||
Person::create([
|
||||
@@ -143,7 +145,11 @@ public function run(): void
|
||||
'group_id' => 2,
|
||||
'type_id' => 2,
|
||||
'user_id' => 1
|
||||
]);
|
||||
])->clientCase()->create(
|
||||
[
|
||||
'client_id' => 4
|
||||
]
|
||||
);
|
||||
|
||||
Person::create([
|
||||
'nu' => rand(100000,200000),
|
||||
@@ -158,41 +164,11 @@ public function run(): void
|
||||
'group_id' => 2,
|
||||
'type_id' => 1,
|
||||
'user_id' => 1
|
||||
]);
|
||||
])->clientCase()->create(
|
||||
[
|
||||
'client_id' => 4
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
//contract
|
||||
Contract::create([
|
||||
'reference' => '111111222',
|
||||
'start_date' => date('Y-m-d'),
|
||||
'client_id' => 1,
|
||||
'debtor_id' => 2,
|
||||
'type_id' => 1
|
||||
]);
|
||||
|
||||
Contract::create([
|
||||
'reference' => '111111224',
|
||||
'start_date' => date('Y-m-d'),
|
||||
'client_id' => 1,
|
||||
'debtor_id' => 3,
|
||||
'type_id' => 1
|
||||
]);
|
||||
|
||||
Contract::create([
|
||||
'reference' => '211111222',
|
||||
'start_date' => date('Y-m-d'),
|
||||
'client_id' => 4,
|
||||
'debtor_id' => 5,
|
||||
'type_id' => 1
|
||||
]);
|
||||
|
||||
Contract::create([
|
||||
'reference' => '211111224',
|
||||
'start_date' => date('Y-m-d'),
|
||||
'client_id' => 4,
|
||||
'debtor_id' => 6,
|
||||
'type_id' => 1
|
||||
]);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user