<?php

declare(strict_types=1);

namespace App\Framework\Worker;

final readonly class Every
{
    public function __construct(
        public int $days = 0,
        public int $hours = 0,
        public int $minutes = 0,
        public int $seconds = 0,
    ) {
    }

    public function toSeconds(): int
    {
        return $this->days * 86400 + $this->hours * 3600 + $this->minutes * 60 + $this->seconds;
    }
}
