Skip to content

Commit

Permalink
feat: create model wallets
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrelstan committed Jan 21, 2022
1 parent 9492aee commit eeff066
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions server/models/Wallets.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import WalletsRepository from '../infra/database/WalletsRepository';
import log from 'loglevel';
import { delegateRepository } from '../infra/database/delegateRepository';

export type Wallets = {
id: string;
name: string;
token_in_wallet: number;
photo_url: string;
};

function getWallets(
walletsRepository: WalletsRepository,
): (filter: any) => Promise<Wallets[]> {
return async function (filter: any) {
const wallets = await walletsRepository.getByFilter(filter);
return wallets;
};
}

export default {
getById: delegateRepository(WalletsRepository, 'getById'),
getWallets,
};

0 comments on commit eeff066

Please sign in to comment.