Files
Toiminnanohjaus/tests/Fakes/FakeQuickSaleHours.php
T
2026-11-26 17:11:54 +02:00

31 lines
849 B
PHP

<?php
namespace Tests\Fakes;
use App\Modules\Sales\Application\Contracts\QuickSaleHours;
use DateTimeImmutable;
class FakeQuickSaleHours implements QuickSaleHours
{
/** @var list<array{int, string, int, int, int}> seller, day, work type, quarters, sale */
public array $booked = [];
public bool $fails = false;
public function bookForOrder(int $userId, DateTimeImmutable $day, int $workTypeId, int $quarters, int $pickupNumber): bool
{
return $this->book($userId, $day, $workTypeId, $quarters, 0);
}
public function book(int $sellerId, DateTimeImmutable $day, int $workTypeId, int $quarters, int $saleId): bool
{
if ($this->fails) {
return false;
}
$this->booked[] = [$sellerId, $day->format('Y-m-d'), $workTypeId, $quarters, $saleId];
return true;
}
}