import { Collection, Entity, ManyToMany, Property } from '@mikro-orm/core'; import { SoftDeletable } from 'mikro-orm-soft-delete'; import { CommonEntity } from './common-entity.entity'; import Role from './role.entity'; @SoftDeletable(() => User, 'deletedAt', () => new Date()) @Entity() export default class User extends CommonEntity { @Property({ name: 'first_name', }) firstName: string; @Property({ name: 'last_name', }) lastName: string; @Property({ name: 'profile_picture', }) profilePicture: string; @Property() email: string; @Property() password: string; @ManyToMany(() => Role, (role) => role.users) roles = new Collection(this); }