Download src/Billing/Application/Commands/CountOrdersCommand.php from pnacorp/AIKEEDO: direct link, hf CLI and curl.
- Browser
- Download file 1.68 kB
-
https://huggingface.co/pnacorp/AIKEEDO/resolve/main/src/Billing/Application/Commands/CountOrdersCommand.php
- Command line
-
hf download hf://pnacorp/AIKEEDO/src/Billing/Application/Commands/CountOrdersCommand.php
-
curl -L -o CountOrdersCommand.php https://huggingface.co/pnacorp/AIKEEDO/resolve/main/src/Billing/Application/Commands/CountOrdersCommand.php
1.68 kB
| declare(strict_types=1); | |
| namespace Billing\Application\Commands; | |
| use Billing\Application\CommandHandlers\CountOrderCommandHandler; | |
| use Billing\Domain\Entities\PlanEntity; | |
| use Billing\Domain\Entities\PlanSnapshotEntity; | |
| use Billing\Domain\ValueObjects\BillingCycle; | |
| use Billing\Domain\ValueObjects\OrderStatus; | |
| use Shared\Domain\ValueObjects\Id; | |
| use Shared\Infrastructure\CommandBus\Attributes\Handler; | |
| use Workspace\Domain\Entities\WorkspaceEntity; | |
| (CountOrderCommandHandler::class) | |
| class CountOrdersCommand | |
| { | |
| public ?OrderStatus $status = null; | |
| public null|Id|WorkspaceEntity $workspace = null; | |
| public null|Id|PlanEntity $plan = null; | |
| public null|Id|PlanSnapshotEntity $planSnapshot = null; | |
| public ?BillingCycle $billingCycle = null; | |
| public function setStatus(string $status): self | |
| { | |
| $this->status = OrderStatus::from($status); | |
| return $this; | |
| } | |
| public function setWorkspace(string|Id|WorkspaceEntity $workspace): self | |
| { | |
| $this->workspace = is_string($workspace) ? new Id($workspace) : $workspace; | |
| return $this; | |
| } | |
| public function setPlan(string|Id|PlanEntity $plan): self | |
| { | |
| $this->plan = is_string($plan) ? new Id($plan) : $plan; | |
| return $this; | |
| } | |
| public function setPlanSnapshot( | |
| string|Id|PlanSnapshotEntity $planSnapshot | |
| ): self { | |
| $this->planSnapshot = is_string($planSnapshot) | |
| ? new Id($planSnapshot) : $planSnapshot; | |
| return $this; | |
| } | |
| public function setBillingCycle(string $billingCycle): self | |
| { | |
| $this->billingCycle = BillingCycle::from($billingCycle); | |
| return $this; | |
| } | |
| } | |