import { type Opt, types } from '@mikro-orm/core'; import { Entity, Property } from '@mikro-orm/decorators/legacy'; import type { Constructor } from '@wener/utils'; import { Feature } from '../../Feature'; import { EntityFeature } from '../enum'; import type { HasTidEntity } from './types'; export function withTidEntity(Base: TBase) { @Feature([EntityFeature.HasTid]) @Entity({ abstract: true }) abstract class HasTidMixinEntity extends Base implements HasTidEntity { @Property({ type: types.string, nullable: false }) tid!: string & Opt; } return HasTidMixinEntity; }