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

export const REQUIRE_ROLES_METADATA_KEY = 'gridpilot:requireRoles';

export type RequireRolesMetadata = {
  readonly anyOf: readonly string[];
};

export function RequireRoles(...anyOf: readonly string[]): MethodDecorator & ClassDecorator {
  return SetMetadata(REQUIRE_ROLES_METADATA_KEY, {
    anyOf,
  } satisfies RequireRolesMetadata);
}