Files
Nyan Lin Paing 4da9ecfe7d Add Routing module: EvRoute, pricing, time slots, read API, caching (T3.1-T3.7)
Implements Phase 3 in full: EvRoute model with company/destination relations
and a from/to-must-differ guard; the ev_route_time_slots pivot; RoutePricing
with a per-route is_blocked flag (every route auto-manages exactly one price
row per vehicle option via a fixed-row Filament repeater on both create and
edit); PricingService::quote() with a shared VehicleOption enum; RoutingPlugin
with the EvRouteResource admin UI (activation gated on non-blocked options
being priced); the /api/v1/routes read API (list/show/pricing/time-slots,
AI-agent-friendly nested shape); and Redis-tag-based response caching
invalidated via EvRoute/RoutePricing observers.
2026-08-06 23:49:42 +07:00

31 lines
723 B
PHP

<?php
namespace Modules\Routing\Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Modules\Catalog\Models\Destination;
use Modules\Catalog\Models\EvCompany;
use Modules\Routing\Models\EvRoute;
/**
* @extends Factory<EvRoute>
*/
class EvRouteFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'ev_company_id' => EvCompany::factory(),
'from_destination_id' => Destination::factory(),
'to_destination_id' => Destination::factory(),
'is_round_trip' => false,
'is_active' => true,
];
}
}