Add account entity token support (balance_amount); factories + feature test

This commit is contained in:
Simon Pocrnjič
2025-10-06 19:20:05 +02:00
parent 80b3c7230b
commit 84d15ac715
4 changed files with 106 additions and 1 deletions
+6 -1
View File
@@ -17,7 +17,12 @@ class AccountFactory extends Factory
public function definition(): array
{
return [
//
'reference' => $this->faker->uuid(),
'description' => $this->faker->sentence(4),
'type_id' => \App\Models\AccountType::factory(),
'active' => 1,
'initial_amount' => 0,
'balance_amount' => 0,
];
}
}
+22
View File
@@ -0,0 +1,22 @@
<?php
namespace Database\Factories;
use App\Models\AccountType;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends Factory<AccountType>
*/
class AccountTypeFactory extends Factory
{
protected $model = AccountType::class;
public function definition(): array
{
return [
'name' => $this->faker->unique()->word(),
'description' => $this->faker->sentence(3),
];
}
}