File size: 719 Bytes
cf14c12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php

declare(strict_types=1);

namespace Affiliate\Application\Commands;

use Affiliate\Application\CommandHandlers\CountPayoutsCommandHandler;
use Affiliate\Domain\ValueObjects\Status;
use Shared\Infrastructure\CommandBus\Attributes\Handler;
use User\Domain\Entities\UserEntity;

#[Handler(CountPayoutsCommandHandler::class)]
class CountPayoutsCommand
{
    public ?Status $status = null;
    public ?UserEntity $user = null;

    public function setStatus(string|Status $status): self
    {
        $this->status = is_string($status) ? Status::from($status) : $status;
        return $this;
    }

    public function setUser(UserEntity $user): self
    {
        $this->user = $user;
        return $this;
    }
}