import { 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 { HasSidEntity } from './types'; export function withSidEntity(Base: TBase) { @Feature([EntityFeature.HasSid]) @Entity({ abstract: true }) abstract class HasSidMixinEntity extends Base implements HasSidEntity { @Property({ type: types.bigint, nullable: false }) sid!: number; } return HasSidMixinEntity; }