Add Departure Time Slot and Catalog read API (T2.4, T2.5)
Adds the shared DepartureTimeSlot catalog entity with its Filament resource, and public GET /api/v1/companies + /api/v1/destinations endpoints (auth:sanctum + throttled) for the mini app/mobile/agent clients to consume.
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Catalog\Database\Factories;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Modules\Catalog\Models\DepartureTimeSlot;
|
||||
|
||||
/**
|
||||
* @extends Factory<DepartureTimeSlot>
|
||||
*/
|
||||
class DepartureTimeSlotFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
$time = Carbon::createFromTime(fake()->numberBetween(0, 23), fake()->randomElement([0, 15, 30, 45]));
|
||||
|
||||
return [
|
||||
'label' => $time->format('h:i A'),
|
||||
'time' => $time->format('H:i'),
|
||||
'is_active' => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user