- Use explicit has() checks for timeout and enabled fields to properly handle falsy values - Add validation to prevent empty update requests - Optimize delete endpoint to use direct query deletion instead of fetch-then-delete - Update factory to use Team::factory() for proper test isolation
21 lines
459 B
PHP
21 lines
459 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Team;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
class ScheduledTaskFactory extends Factory
|
|
{
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'name' => fake()->word(),
|
|
'command' => 'echo hello',
|
|
'frequency' => '* * * * *',
|
|
'timeout' => 300,
|
|
'enabled' => true,
|
|
'team_id' => Team::factory(),
|
|
];
|
|
}
|
|
}
|