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 { HasDisplayOrderEntity } from './types'; export function withDisplayOrderEntity(Base: TBase) { @Feature([EntityFeature.HasDisplayOrder]) @Entity({ abstract: true }) abstract class HasDisplayOrderMixinEntity extends Base implements HasDisplayOrderEntity { @Property({ type: types.double, nullable: false, default: 0 }) displayOrder!: number & Opt; } return HasDisplayOrderMixinEntity; }