<?php

namespace App\Domain\Shared\Infrastructure\Persistence\Entity;

use Doctrine\ORM\Mapping as ORM;

#[ORM\Entity]
#[ORM\Table(name: 'failed_job')]
class FailedJobEntity
{
    #[ORM\Id]
    #[ORM\Column]
    private string $id;

    #[ORM\Column(type: 'string')]
    private string $type;

    #[ORM\Column(type: 'text')]
    private string $failureReason;

    #[ORM\Column]
    private \DateTimeImmutable $failedAt;

    #[ORM\Column(type: 'json')]
    private array $context = [];

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

    public function setId(string $id): self
    {
        $this->id = $id;
        return $this;
    }

    public function getType(): string
    {
        return $this->type;
    }

    public function setType(string $type): self
    {
        $this->type = $type;
        return $this;
    }

    public function getFailureReason(): string
    {
        return $this->failureReason;
    }

    public function setFailureReason(string $failureReason): self
    {
        $this->failureReason = $failureReason;
        return $this;
    }

    public function getFailedAt(): \DateTimeImmutable
    {
        return $this->failedAt;
    }

    public function setFailedAt(\DateTimeImmutable $failedAt): self
    {
        $this->failedAt = $failedAt;
        return $this;
    }

    public function getContext(): array
    {
        return $this->context;
    }

    public function setContext(array $context): self
    {
        $this->context = $context;
        return $this;
    }
}
