Make quick sale products on machines as orders paid when ready

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
2026-11-26 17:11:54 +02:00
co-authored by Claude Sonnet 5.5
parent 920fecdeb2
commit 38b8075a9c
58 changed files with 3435 additions and 26 deletions
@@ -0,0 +1,45 @@
<?php
declare(strict_types=1);
namespace App\Modules\Sales\Application\DTOs;
use App\Modules\Sales\Domain\Enums\OrderStatus;
/**
* A quick sale order as listed. $orderedAt is "Y-m-d H:i" in the company's
* time zone; $saleId is the sale that paid it.
*/
final readonly class OrderSummary
{
/**
* @param list<OrderLineSummary> $lines
*/
public function __construct(
public int $id,
public int $pickupNumber,
public string $orderedOn,
public string $orderedAt,
public string $sellerName,
public ?int $customerId,
public ?string $customerName,
public OrderStatus $status,
public ?int $saleId,
public int $totalCents,
public array $lines,
) {}
public function isPaid(): bool
{
return $this->saleId !== null;
}
/**
* Whether making has not started on any line, so the order can still be
* cancelled without anything recorded.
*/
public function isOpen(): bool
{
return $this->status === OrderStatus::InProduction || $this->status === OrderStatus::Ready;
}
}