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

use BookiFlex\Core\Exception\InvalidArgumentException;

defined( 'ABSPATH' ) || exit;

class SessionRequiredException extends InvalidArgumentException
{
    public function __construct(
        string $message = 'Session ID is required',
        int $code = 400,
        ?\Exception $previous = null,
        array $context = []
    ) {
        $context['errorCode'] = $context['errorCode'] ?? 'session_required';
        $context['field'] = $context['field'] ?? 'sessionId';
        parent::__construct($message, $code, $previous, $context);
    }
}
