public async Task <CustomerDto> Handle(UpdateCustomerCommand request, CancellationToken cancellationToken)
        {
            var customer = await _merchantCustomerRepository.GetAsync(request.CustomerCode);

            if (customer is null)
            {
                throw new CustomerNotFoundException();
            }
            customer = customer.Update(request.Email, request.Phone, request.FirstName, request.LastName, request.UpdatedBy, request.Addresses);
            var result = await _merchantCustomerRepository.UpdateAsync(customer);

            var customerDto = _mapper.Map <CustomerDto>(result);

            return(customerDto);
        }
        public async Task <CustomerDto> Handle(UpdateAddressCommand request, CancellationToken cancellationToken)
        {
            var customer = await _customerRepository.GetAsync(request.Code);

            if (customer is null)
            {
                throw new CustomerNotFoundException();
            }

            customer = customer.UpdateAddress(request.AddressCode, request.Name, request.City, request.Town, request.District, request.FullAddress, request.UpdateBy);
            var result = await _customerRepository.UpdateAsync(customer);

            var customerDto = _mapper.Map <CustomerDto>(result);

            return(customerDto);
        }