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

export const REQUIRED_PERMISSION_KEY = 'required_permission';

export type PermissionAction = 'view' | 'edit' | 'delete' | 'manage';

export function RequirePermission(module: string, action: PermissionAction) {
  return SetMetadata(REQUIRED_PERMISSION_KEY, { module, action });
}
