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