import { createParamDecorator, ExecutionContext } from '@nestjs/common';
import { UserEntity } from '../../modules/user/entities/user.entity';

/** Set by MobileOptionalSessionGuard when a valid seeker session is present. */
export const OptionalMobileUser = createParamDecorator(
  (_data: unknown, ctx: ExecutionContext): UserEntity | null => {
    return ctx.switchToHttp().getRequest().mobileUser ?? null;
  },
);
