import { Injectable } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; import { FindOptionsWhere, Repository } from 'typeorm'; import { UpdateCustomerRequestDto } from '../dtos/request'; import { Customer } from '../entities'; @Injectable() export class CustomerRepository { constructor(@InjectRepository(Customer) private readonly customerRepository: Repository) {} updateCustomer(id: string, data: UpdateCustomerRequestDto) { return this.customerRepository.update(id, data); } findOne(where: FindOptionsWhere) { return this.customerRepository.findOne({ where }); } }