<?php
/**
 * BookiFlex Core
 *
 * @package    BookiFlex
 * @subpackage Core
 * @author     BookiFlex
 * @copyright  Copyright (c) 2025 BookiFlex
 * @license    GPL-2.0-or-later
 *
 * @link       https://bookiflex.com
 */

declare(strict_types=1);

namespace BookiFlex\Core\Service\AvailabilityChecker;

defined( 'ABSPATH' ) || exit;

/**
 * Represents the result of the availability check.
 */
class AvailabilityCheckerResult
{
    public function __construct(
        private readonly bool   $available,
        private readonly int    $availableUnits = 1,
        private readonly array  $availableExtras = [],
        private readonly string $unavailableReason = ''
    ) {
    }

    public function isAvailable(): bool
    {
        return $this->available;
    }

    public function getAvailableUnits(): int
    {
        return $this->availableUnits;
    }

    /**
     * Returns the list of available extras
     *
     * @return array
     */
    public function getAvailableExtras(): array
    {
        return $this->availableExtras;
    }

    public function getUnavailableReason(): string
    {
        return $this->unavailableReason;
    }
}
