import { SetMetadata } from '@nestjs/common';

export const REQUIRE_AUTHENTICATED_USER_METADATA_KEY = 'gridpilot:requireAuthenticatedUser';

export type RequireAuthenticatedUserMetadata = {
  readonly required: true;
};

export function RequireAuthenticatedUser(): MethodDecorator & ClassDecorator {
  return SetMetadata(REQUIRE_AUTHENTICATED_USER_METADATA_KEY, {
    required: true,
  } satisfies RequireAuthenticatedUserMetadata);
}