Build & Deploy / build (push) Successful in 18s
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
40 lines
1.2 KiB
PHP
40 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace Technical\Integrations\Database\Factories;
|
|
|
|
use Functional\Users\Models\User;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
use Technical\Integrations\Models\ExternalActivity;
|
|
use Technical\Integrations\Models\Integration;
|
|
|
|
/**
|
|
* @extends Factory<ExternalActivity>
|
|
*/
|
|
class ExternalActivityFactory extends Factory
|
|
{
|
|
protected $model = ExternalActivity::class;
|
|
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
$integration = Integration::factory()->create();
|
|
|
|
return [
|
|
'integration_id' => $integration,
|
|
'user_id' => $integration->user_id,
|
|
'provider' => $integration->provider,
|
|
'external_id' => (string) fake()->unique()->numberBetween(1000000, 9999999),
|
|
'type' => fake()->randomElement(['run', 'ride', 'swim', 'walk', 'workout']),
|
|
'started_at' => fake()->dateTimeBetween('-3 months', 'now'),
|
|
'duration_seconds' => fake()->numberBetween(600, 7200),
|
|
'distance_meters' => fake()->optional(0.8)->randomFloat(2, 500, 42000),
|
|
'calories' => fake()->optional(0.8)->numberBetween(100, 2000),
|
|
'raw' => null,
|
|
];
|
|
}
|
|
}
|