import { ReferenceKind } from '@mikro-orm/core';
import { getMetadataFromDecorator } from '../utils.js';
/** Defines an enum property on an entity (legacy TypeScript decorator). */
export function Enum(options = {}) {
  return function (target, propertyName) {
    const meta = getMetadataFromDecorator(target.constructor);
    options = options instanceof Function ? { items: options } : options;
    meta.properties[propertyName] = {
      name: propertyName,
      kind: ReferenceKind.SCALAR,
      enum: true,
      ...options,
    };
  };
}
