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

declare(strict_types=1);

namespace BookiFlex\Extensions\Cart\DTO;

defined( 'ABSPATH' ) || exit;

/**
 * Generic catalog snapshot of an extra service. Cart treats domain-specific
 * fields (type, chargingRate) as opaque string labels — the extras domain
 * owns their semantics. Used both for cart validation/pricing and for
 * archiving a frozen catalog snapshot inside reservation extra item details.
 */
final class CartExtraSnapshot
{
    public function __construct(
        public readonly int $id,
        public readonly string $name,
        public readonly int $maxPerUnit = 0,
        public readonly string $type = '',
        public readonly string $chargingRate = '',
        public readonly int $catalogPrice = 0,
    ) {
    }
}
