<?php

declare(strict_types=1);

/*
 * This file is part of the Ferienpass package.
 *
 * (c) Richard Henkenjohann <richard@ferienpass.online>
 *
 * For more information visit the project website <https://ferienpass.online>
 * or the documentation under <https://docs.ferienpass.online>.
 */

namespace Ferienpass\CoreBundle\Notification;

use Ferienpass\CoreBundle\Enum\AttendanceStatus;

class AttendanceNotificationChecker
{
    public function shouldNotify(string $status, bool $isNew): bool
    {
        if ($isNew) {
            return AttendanceStatus::CONFIRMED === $status;
        }

        return \in_array($status, [AttendanceStatus::CONFIRMED, AttendanceStatus::REJECTED, AttendanceStatus::WITHDRAWN], true);
    }
}
