20 lines
618 B
TypeScript
20 lines
618 B
TypeScript
import { Contacts, Customers } from "@prisma/client";
|
|
import BaseService from "@Services/BaseService";
|
|
import { Service } from "typedi";
|
|
import ContactRepository from "@Repositories/ContactRepository";
|
|
|
|
@Service()
|
|
export default class DocumentsService extends BaseService {
|
|
constructor(private contactRepository: ContactRepository) {
|
|
super();
|
|
}
|
|
|
|
/**
|
|
* @description : Get a contact by email
|
|
* @throws {Error} If contact cannot be get by email
|
|
*/
|
|
public async getByEmail(email: string): Promise<(Contacts & {customers: Customers | null}) | null> {
|
|
return this.contactRepository.findOneByEmail(email);
|
|
}
|
|
}
|