import { SetMetadata } from '@nestjs/common';
import type { PermissionScopeOptions } from '../auth/permission.decorator';

export const AUDIT_MUTATION_METADATA_KEY = 'ftb:audit-mutation';

export interface AuditMutationMetadata extends PermissionScopeOptions {
  action: string;
  entityType: string;
  entityIdParam?: string;
}

export function AuditMutation(metadata: AuditMutationMetadata) {
  return SetMetadata(AUDIT_MUTATION_METADATA_KEY, metadata);
}
