import { ProvideSingleton , inject } from '../../ioc' ; import { BaseRepository } from './BaseRepository' ; import { IUserModel , UserFormatter } from '../../models' ; import { UserEntity } from './entities' ; @ ProvideSingleton ( UserRepository ) export class UserRepository extends BaseRepository < IUserModel > { protected formatter : any = UserFormatter ; constructor ( @ inject ( UserEntity ) protected entityModel ) { super ( ) ; } /** for aditional logic (maybe nested entities) */ public async create ( model , include = this . saveInclude ) { return super . create ( model , include ) ; } /** for aditional logic (maybe nested entities) */ public async update ( _id , model ) { return super . update ( _id , model ) ; } }