public async Task <IActionResult> UpdateStoreAsync([FromRoute] string storeName, [FromBody] StoreInputModel store)
        {
            if (string.IsNullOrWhiteSpace(store.StoreName) || string.IsNullOrWhiteSpace(store.Country) ||
                string.IsNullOrWhiteSpace(store.City))
            {
                var errorMessage = "Invalid input.";
                _logger.LogError(errorMessage);
                return(BadRequest(errorMessage));
            }

            if (storeName.ToLower() != store.StoreName.ToLower())
            {
                return(BadRequest("Failed to update store details. Store name does not match with the name in the updated details."));
            }

            var storeDetails = await _storesRepository.GetStoreAsync(store.StoreName);

            if (storeDetails == null)
            {
                var errorMessage = $"Store with name '{storeName}' doesn't exist.";
                _logger.LogError(errorMessage);
                return(BadRequest(errorMessage));
            }

            var storeDal = store.ToDalEntity();

            storeDal.Id = storeDetails.Id;
            await _storesRepository.UpdateStoreAsync(storeDal);

            _logger.LogInformation($"Details of store with name '{store.StoreName}' updated successfully.");
            return(NoContent());
        }
        public async Task <IActionResult> RegisterStoreAsync([FromBody] StoreInputModel storeInput)
        {
            if (string.IsNullOrWhiteSpace(storeInput.StoreName) || string.IsNullOrWhiteSpace(storeInput.Country) ||
                string.IsNullOrWhiteSpace(storeInput.City))
            {
                var errorMessage = "Invalid input.";
                _logger.LogError(errorMessage);
                return(BadRequest(errorMessage));
            }

            var exists = await _storesRepository.StoreExistsAsync(storeInput.StoreName);

            if (exists)
            {
                var errorMessage = $"Store with name '{storeInput.StoreName}' already registered. Register with a different store name.";
                _logger.LogInformation(errorMessage);
                return(BadRequest(errorMessage));
            }

            var storeDal = storeInput.ToDalEntity();
            await _storesRepository.RegisterStoreAsync(storeDal);

            _logger.LogInformation($"Store with name '{storeInput.StoreName}' registered successfully.");
            return(Ok($"Store '{storeInput.StoreName}' registered Successfully."));
        }