import { SetMetadata } from '@nestjs/common';
import { PlanFeature } from '@domain/value-objects/plan-feature.vo';

export const REQUIRED_FEATURES_KEY = 'requiredFeatures';

/**
 * Decorator to require specific plan features for a route.
 * Works with FeatureFlagGuard to enforce access control.
 *
 * Usage:
 * @RequiresFeature('dashboard')
 * @RequiresFeature('csv_export', 'api_access')
 */
export const RequiresFeature = (...features: PlanFeature[]) =>
  SetMetadata(REQUIRED_FEATURES_KEY, features);
