- Add CalendarSlotService methods for slot order calculation - Update PlannedItemController to create slots from datetime - Update CalendarSlotController with proper eager loading - Create timeline UI components (TripTimeline, DaySection, HourRow, ScheduleItemModal) - Add comprehensive PHPUnit tests (PlannedItemTest, CalendarSlotServiceTest) - Add comprehensive Selenium E2E tests (timeline-scheduling.test.js) - Update PlannablesList to support onItemsChange callback
22 lines
507 B
PHP
22 lines
507 B
PHP
<?php
|
|
|
|
namespace App\Domain\PlannedItem\Actions;
|
|
|
|
use App\Models\PlannedItem;
|
|
|
|
class UpdatePlannedItemAction
|
|
{
|
|
/**
|
|
* Update a planned item's properties
|
|
*
|
|
* @param PlannedItem $plannedItem
|
|
* @param array $data ['calendar_slot_id'?, 'sort_order'?]
|
|
* @return PlannedItem
|
|
*/
|
|
public function execute(PlannedItem $plannedItem, array $data): PlannedItem
|
|
{
|
|
$plannedItem->update($data);
|
|
|
|
return $plannedItem->load(['plannableItem', 'calendarSlot']);
|
|
}
|
|
}
|