<?php

namespace ShopManagerPro\Jobs;

class JobUtil {
	private const finishedStatuses = [DTO\Generated\JobStatus::finishedsuccessfully, DTO\Generated\JobStatus::finishedwitherrors, DTO\Generated\JobStatus::stopped];

	public static function isFinished(DTO\Generated\Job $job) {
		return self::isFinishedStatus($job->getStatus());
	}

	public static function isFinishedStatus(DTO\Generated\JobStatus $status) {
		return in_array($status, self::finishedStatuses, true);
	}
}
