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

@ -17,7 +17,7 @@ class DeviceFactory extends Factory
public function definition(): array
{
return [
'device_id' => $this->faker->randomDigitNotNull(),
'device_id' => $this->faker->uuid(),
'title' => $this->faker->word(),
'device_type' => $this->faker->domainWord(),
'description' => $this->faker->sentence(),

View File

@ -0,0 +1,24 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\LocationTransaction>
*/
class LocationTransactionFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'room_code' => $this->faker->buildingNumber(),
'timestamp_located_since' => $this->faker->unixTime()
];
}
}

View File

@ -0,0 +1,24 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\OwnerTransaction>
*/
class OwnerTransactionFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'rz_username' => $this->faker->name(),
'timestamp_owner_since' => $this->faker->unixTime()
];
}
}

View File

@ -0,0 +1,26 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\PurchasingInformation>
*/
class PurchasingInformationFactory extends Factory
{
/**
* Define the model's default state.
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'price' => $this->faker->word(),
'timestamp_warranty_end' => $this->faker->unixTime(),
'timestamp_purchase' => $this->faker->unixTime(),
'cost_centre' => $this->faker->numberBetween(1000000000, 9999999999),
'seller' => $this->faker->company()
];
}
}