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 { HasTitleDescriptionEntity } from './types'; export function withTitleDescriptionEntity(Base: TBase) { @Feature([EntityFeature.HasTitleDescription]) @Entity({ abstract: true }) class HasTitleDescriptionMixinEntity extends Base implements HasTitleDescriptionEntity { @Property({ type: types.string, nullable: false }) title!: string; @Property({ type: types.string, nullable: true }) description?: string; } return HasTitleDescriptionMixinEntity; }