implement uuid and make sample data factory

This commit is contained in:
TimmensOne
2023-03-30 15:16:38 +02:00
parent 656056a3b3
commit 6894c2c3c5
25 changed files with 202 additions and 81 deletions

View File

@@ -25,12 +25,15 @@ class DatabaseSeeder extends Seeder
// 'email' => 'test@example.com',
// ]);
Device::factory(1)->create([
'device_id' => '1'
]);
//Device::factory()->has(PurchasingInformation::factory()->count(1))->create();
Device::factory()->count(10)
->has(PurchasingInformation::factory()->count(1), 'purchasing')
->has(LocationTransaction::factory()->count(3), 'locations')
->has(OwnerTransaction::factory()->count(3), 'owners')
->create();
User::create([
'rz_username' => 'admin',
'full_name' => 'Admin',
'organisation_unit' => '11111111',
@@ -45,29 +48,5 @@ class DatabaseSeeder extends Seeder
'has_admin_privileges' => false,
'hashed_password' => bcrypt('test123')
]);
PurchasingInformation::create([
'purchasing_information_id' => '1',
'price' => '1',
'timestamp_warranty_end' => '1',
'timestamp_purchase' => '1',
'cost_centre' => '1',
'seller' => '1',
'device_id' => '1',
]);
LocationTransaction::create([
'location_transaction_id' => '1',
'room_code' => '1',
'timestamp_located_since' => '1',
'device_id' => '1',
]);
OwnerTransaction::create([
'owner_transaction_id' => '1',
'rz_username' => '1',
'timestamp_owner_since' => '1',
'device_id' => '1',
]);
}
}