<?php

namespace Signteer\Core\Event\Signup;

use Signteer\Core\Event\StorableEventInterface;

final class SignupDeleted implements StorableEventInterface
{
    private int $id;
    private int $taskId;
    private int $volunteerId;

    public function __construct(int $id, int $taskId, int $volunteerId)
    {
        $this->id = $id;
        $this->taskId = $taskId;
        $this->volunteerId = $volunteerId;
    }

    public function getId(): int
    {
        return $this->id;
    }

    public function getTaskId(): int
    {
        return $this->taskId;
    }

    public function getVolunteerId(): int
    {
        return $this->volunteerId;
    }

    public static function alias(): string
    {
        return 'signup-deleted';
    }

    public function toArray(): array
    {
        return ['id' => $this->id, 'taskId' => $this->taskId, 'volunteerId' => $this->volunteerId];
    }

    public static function fromArray(array $a)
    {
        return new self($a['id'], $a['taskId'], $a['volunteerId']);
    }
}
