import { IEntity } from './IEntity' ; export abstract class BaseEntity < TId > implements IEntity < TId > { protected constructor ( public id ) { if ( typeof id !== 'number' && ! id ) { throw new Error ( 'Id cannot be null or empty' ) ; } } public equals ( otherId ) { return this . id === otherId ; } }