import { injectable } from 'inversify' ; import { getMongoManager } from 'typeorm' ; import { User } from '../../entities/user' ; export interface UserRepositoryInterface { getAllByWalletAddresses ( walletAddresses ) : Promise < User [ ] > ; save ( u ) : Promise < User > ; } /**
 *
 */ @ injectable ( ) export class UserRepository { getAllByWalletAddresses ( walletAddresses ) { return getMongoManager ( ) . createEntityCursor ( User , { 'wallets.address' : { $in : walletAddresses } } ) . project ( { 'wallets.address' : 1 , 'wallets.ticker' : 1 } ) . toArray ( ) ; } param u save ( u ) { return getMongoManager ( ) . getMongoRepository ( User ) . save ( u ) ; } } const UserRepositoryType = Symbol ( 'UserRepositoryInterface' ) ; export { UserRepositoryType } ;