import { ReferenceKind } from '@mikro-orm/core';
import { getMetadataFromDecorator } from '../utils.js';
/** Defines a computed SQL formula property on an entity (legacy TypeScript decorator). */
export function Formula(formula, options = {}) {
  return function (target, propertyName) {
    const meta = getMetadataFromDecorator(target.constructor);
    meta.properties[propertyName] = {
      name: propertyName,
      kind: ReferenceKind.SCALAR,
      formula,
      ...options,
    };
  };
}
