<?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\ValueObject;

defined( 'ABSPATH' ) || exit;

class GuestConfiguration
{
    public function __construct(
        private readonly int $adults,
        private readonly array $children = []
    ) {
        if ($adults < 1 || $adults > 20) {
            throw new \InvalidArgumentException('Adults count must be between 1 and 20');
        }
    }

    public function getAdults(): int { return $this->adults; }
    public function getChildren(): array { return $this->children; }
    public function getTotalGuests(): int { return $this->adults + count($this->children); }
}
