public ActionResult SetupOTP(Service service)
        {
            try
            {
                var userId = this.User.FindFirstValue(ClaimTypes.NameIdentifier);
                var user   = _repo.Customer.GetCustomer(userId);

                if (_repo.Service.GetService(user.ServiceId ?? default) is null)
                {
                    _repo.Service.CreateService(service);

                    user.ServiceId = service.Id;
                }
                else
                {
                    var serviceToChange = _repo.Service.GetService(user.ServiceId ?? default);
                    serviceToChange.OneTimePickup = service.OneTimePickup;

                    _repo.Service.Update(serviceToChange);
                }

                _repo.Save();

                return(RedirectToAction(nameof(Index)));
            }
        public ActionResult BeginService(Service service)
        {
            service.isActive = true;
            _repo.Service.CreateService(service);
            _repo.Save();

            var userId = this.User.FindFirstValue(ClaimTypes.NameIdentifier);
            var user   = _repo.Customer.GetCustomer(userId);

            user.ServiceId = service.Id;
            _repo.Customer.Update(user);

            _repo.Save();

            return(RedirectToAction(nameof(Index)));
        }
        public ActionResult EditPickupDay(Service service)
        {
            try
            {
                var userId = this.User.FindFirstValue(ClaimTypes.NameIdentifier);
                var user   = _repo.Customer.GetCustomer(userId);

                var serviceToChange = _repo.Service.GetService(user.ServiceId ?? default);
                serviceToChange.PickupDay = service.PickupDay;

                _repo.Service.Update(serviceToChange);
                _repo.Save();

                return(RedirectToAction(nameof(Index)));
            }
            catch
            {
                return(View());
            }
        }