Exemple #1
0
        public async Task CompleteAsync(Guid id, string firstName, string lastName,
                                        string address, string country)
        {
            var customer = await _customerRepository.GetAsync(id);

            if (customer.Completed)
            {
                throw new ServiceException("customer_already_completed",
                                           $"Customer account was already completed for user: '******'.");
            }
            customer.Complete(firstName, lastName, address, country);
            await _customerRepository.UpdateAsync(customer);

            var cart = new Cart(id);
            await _cartsRepository.CreateAsync(cart);
        }