feat: add Station, StationPrice, StationPriceCurrent, StationPriceArchive models and factories

This commit is contained in:
Ovidiu U
2026-04-03 18:46:53 +01:00
parent ec3a2bf848
commit 7f153fb08d
7 changed files with 258 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
<?php
namespace Database\Factories;
use App\Enums\FuelType;
use App\Models\Station;
use App\Models\StationPrice;
use Illuminate\Database\Eloquent\Factories\Factory;
/** @extends Factory<StationPrice> */
class StationPriceFactory extends Factory
{
public function definition(): array
{
return [
'station_id' => Station::factory(),
'fuel_type' => FuelType::E10,
'price_pence' => $this->faker->numberBetween(12000, 18000),
'price_effective_at' => now()->subDays($this->faker->numberBetween(1, 30)),
'price_reported_at' => now()->subDays($this->faker->numberBetween(1, 30)),
'recorded_at' => now(),
];
}
}