Exemple #1
0
        public ActionResult UpdateSyncEnables(SyncEnablesUpdateModel input)
        {
            var data = _settingsRepository.RetrieveSettings();

            data.PullFromShopifyEnabled   = input.PullFromShopifyEnabled;
            data.PullFromAcumaticaEnabled = input.PullFromAcumaticaEnabled;
            data.SyncOrdersEnabled        = input.SyncOrdersEnabled;
            data.SyncInventoryEnabled     = input.SyncInventoryEnabled;
            data.SyncRefundsEnabled       = input.SyncRefundsEnabled;
            data.SyncFulfillmentsEnabled  = input.SyncShipmentsEnabled;
            _settingsRepository.SaveChanges();

            return(JsonNetResult.Success());
        }
Exemple #2
0
        public ActionResult WarehouseSyncDataUpdate(List <AcumaticaWarehouseModel> input)
        {
            using (var transaction = _syncInventoryRepository.BeginTransaction())
            {
                foreach (var item in input)
                {
                    _syncInventoryRepository.ImprintWarehouseSync(
                        item.AcumaticaWarehouseId, item.ShopifyLocationId);
                }

                _statusService.RefreshWarehouseSyncStatus();

                transaction.Commit();
            }

            return(JsonNetResult.Success());
        }
Exemple #3
0
        public ActionResult SettingsSelections(SettingsSelectionsModel selectionsModel)
        {
            var data = _settingsRepository.RetrieveSettings();

            // Save Settings
            //
            data.AcumaticaTimeZone            = selectionsModel.AcumaticaTimeZone;
            data.AcumaticaDefaultItemClass    = selectionsModel.AcumaticaDefaultItemClass;
            data.AcumaticaDefaultPostingClass = selectionsModel.AcumaticaDefaultPostingClass;
            data.AcumaticaCustomerClass       = selectionsModel.AcumaticaDefaultCustomerClass;

            _settingsRepository.SaveChanges();

            // Save Gateways
            //
            var gatewayRecords =
                selectionsModel.PaymentGateways.Select(x => new PaymentGateway()
            {
                ShopifyGatewayId       = x.ShopifyGatewayId,
                AcumaticaCashAccount   = x.AcumaticaCashAcount,
                AcumaticaPaymentMethod = x.AcumaticaPaymentMethod,
            })
                .ToList();

            _settingsRepository.ImprintPaymentGateways(gatewayRecords);

            // Save Carrier-to-Ship-Via mappings
            //
            var carrierToShipVia =
                selectionsModel.RateToShipVias.Select(x => new RateToShipVia()
            {
                ShopifyRateName    = x.ShopifyRateName,
                AcumaticaShipViaId = x.AcumaticaCarrierId,
            })
                .ToList();

            _settingsRepository.ImprintRateToShipVias(carrierToShipVia);

            // Refresh the Settings Status
            //
            _statusService.RefreshSettingsStatus();

            return(JsonNetResult.Success());
        }
Exemple #4
0
        public ActionResult AcumaticaCredentials(AcumaticaCredentialsModel model)
        {
            var state = _stateRepository.RetrieveSystemStateNoTracking();

            if (state.AcumaticaConnState != StateCode.None)
            {
                _connectionRepository
                .UpdateAcumaticaCredentials(model.UserName, model.Password);
            }
            else
            {
                _connectionRepository
                .UpdateAcumaticaCredentials(
                    model.InstanceUrl, model.Branch, model.Company, model.UserName, model.Password);
            }

            _oneTimeJobService.ConnectToAcumatica();
            return(JsonNetResult.Success());
        }
Exemple #5
0
 public ActionResult Cleanup()
 {
     _jobStatusService.Cleanup();
     return(JsonNetResult.Success());
 }
Exemple #6
0
 public ActionResult StopAll()
 {
     _jobStatusService.SendKillSignal();
     return(JsonNetResult.Success());
 }
Exemple #7
0
 public ActionResult AcumaticaTestConnection()
 {
     _oneTimeJobService.ConnectToAcumatica();
     return(JsonNetResult.Success());
 }
Exemple #8
0
 public ActionResult TriggerConfigDiagnosis()
 {
     _oneTimeJobService.RunDiagnostics();
     return(JsonNetResult.Success());
 }
Exemple #9
0
 public ActionResult SyncWarehouses()
 {
     _oneTimeJobService.SyncWarehouseAndLocation();
     return(JsonNetResult.Success());
 }
Exemple #10
0
 public ActionResult AcumaticaRefDataPull()
 {
     _oneTimeJobService.RefreshAcumaticaReferenceData();
     return(JsonNetResult.Success());
 }
Exemple #11
0
 public ActionResult PauseEndToEndRecurring()
 {
     _recurringJobService.KillEndToEndSync();
     return(JsonNetResult.Success());
 }
Exemple #12
0
        public ActionResult RunSyncWithAcumatica(bool enableInventorySync, List <long> selectedSPIds)
        {
            _oneTimeJobService.SyncAcumaticaStockItems(selectedSPIds, enableInventorySync);

            return(JsonNetResult.Success());
        }
Exemple #13
0
 public ActionResult BulkSyncEnabled(List <long> monsterVariantIds, bool syncEnabled)
 {
     _syncInventoryRepository.UpdateVariantSync(monsterVariantIds, syncEnabled);
     return(JsonNetResult.Success());
 }
Exemple #14
0
 public ActionResult RunInventoryRefresh()
 {
     _oneTimeJobService.RefreshInventory();
     return(JsonNetResult.Success());
 }
Exemple #15
0
 public ActionResult RunEndToEndImmediatelySingleOrder(long shopifyOrderId)
 {
     _oneTimeJobService.EndToEndSyncSingleShopifyOrder(shopifyOrderId);
     return(JsonNetResult.Success());
 }
Exemple #16
0
 public ActionResult RunEndToEndImmediately()
 {
     _oneTimeJobService.EndToEndSync();
     return(JsonNetResult.Success());
 }