// file: has-feature.decorator.ts
import { SetMetadata } from '@nestjs/common';

export const HAS_FEATURE_KEY = 'hasFeature';

export enum FunctionPermission {
  CREATE = 'create',
  READ = 'read',
  UPDATE = 'update',
  DELETE = 'delete',
}

export const HasFeature = (feature: {
  name?: string;
  description?: string;
  function_permisstion?: FunctionPermission;
  group_key?: string;
  disabled?: boolean;
  public?: boolean;
}) =>
  SetMetadata(HAS_FEATURE_KEY, {
    ...{ disabled: false, public: false, ...feature },
  });
