import { BaseRepository } from "@edr/api-common"; import { Injectable } from "@nestjs/common"; import { InjectRepository } from "@nestjs/typeorm"; import { Repository } from "typeorm"; import { Customer } from "./entities/customer.entity"; @Injectable() export class CustomersRepository extends BaseRepository { constructor( @InjectRepository(Customer) repository: Repository, ) { super(repository); } /** Find a customer by their unique email. */ findByEmail(email: string): Promise { return this.repository.findOne({ where: { email } }); } }