update logic

This commit is contained in:
baodev0
2026-06-15 09:11:57 +07:00
parent 9c68273b4a
commit 3243473843
30 changed files with 2502 additions and 24 deletions
+30
View File
@@ -0,0 +1,30 @@
<?php
declare(strict_types=1);
namespace App\DTOs\Order;
class ClientOrderFilters
{
public function __construct(
public readonly ?string $totalPrice = null,
public readonly bool $pending = false,
) {
}
public static function fromArray(array $data): self
{
return new self(
totalPrice: $data['total_price'] ?? null,
pending: filter_var($data['pending'] ?? false, FILTER_VALIDATE_BOOLEAN),
);
}
public function toArray(): array
{
return [
'total_price' => $this->totalPrice,
'pending' => $this->pending,
];
}
}