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

export const PUBLIC_ROUTE_METADATA_KEY = 'gridpilot:publicRoute';

export type PublicRouteMetadata = {
  readonly public: true;
};

export function Public(): MethodDecorator & ClassDecorator {
  return SetMetadata(PUBLIC_ROUTE_METADATA_KEY, {
    public: true,
  } satisfies PublicRouteMetadata);
}