import { IUsersRepository } from "../IUsersRepository" ; import { User } from "../../entities/User" ; export class PostgresUsersRepository implements IUsersRepository { private users : User [ ] = [ ] ; async findByEmail ( email ) { const user = this . users . find ( user => user . email === email ) ; return user ; } async save ( user ) { this . users . push ( user ) ; } }