<?php

declare(strict_types=1);

namespace MauticPlugin\DealFlowBundle\Event;

use MauticPlugin\DealFlowBundle\Entity\Deal;
use Symfony\Contracts\EventDispatcher\Event;

class DealEvent extends Event
{
    /**
     * @param array<string, mixed> $payload
     */
    public function __construct(
        private Deal $deal,
        private string $origin = 'ui',
        private ?string $actorType = 'user',
        private ?int $actorId = null,
        private array $payload = [],
    ) {
    }

    public function getDeal(): Deal
    {
        return $this->deal;
    }

    public function getOrigin(): string
    {
        return $this->origin;
    }

    public function getActorType(): ?string
    {
        return $this->actorType;
    }

    public function getActorId(): ?int
    {
        return $this->actorId;
    }

    /**
     * @return array<string, mixed>
     */
    public function getPayload(): array
    {
        return $this->payload;
    }
}
