import { ExecutionContext, createParamDecorator } from '@nestjs/common'

// Tiny escape hatch for handlers that need to read request-level metadata
// the JWT doesn't carry — primarily the client IP for audit-log entries.
// Use `clientIp(req)` from ./client-ip.ts to extract the originating address.
export const CurrentRequest = createParamDecorator(
  (_data: unknown, ctx: ExecutionContext) => ctx.switchToHttp().getRequest(),
)
