implement uuid and make sample data factory
This commit is contained in:
@ -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(),
|
||||
|
24
device-app/database/factories/LocationTransactionFactory.php
Normal file
24
device-app/database/factories/LocationTransactionFactory.php
Normal 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()
|
||||
];
|
||||
}
|
||||
}
|
24
device-app/database/factories/OwnerTransactionFactory.php
Normal file
24
device-app/database/factories/OwnerTransactionFactory.php
Normal 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()
|
||||
];
|
||||
}
|
||||
}
|
@ -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()
|
||||
];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user