feat(prestashop): sync mapped statuses from Orbito in 1.1.11
This commit is contained in:
@@ -4,12 +4,13 @@ const PsOrder = require('./src/models/PsOrder');
|
||||
const PrestashopApi = require('./src/PrestaApi');
|
||||
const { importFromPSOrder } = require('./src/OrderImporter');
|
||||
const { isLegacyApi } = require('./src/utils');
|
||||
const { loadEnabledConfigs, setLastOrderId } = require('./src/module-config');
|
||||
const { loadConfig, loadEnabledConfigs, setLastOrderId } = require('./src/module-config');
|
||||
const { registerPrestashopConfigBlocks } = require('./src/register-config');
|
||||
const { registerPrestashopPermissions } = require('./src/register-permissions');
|
||||
const { importOrdersForShop, syncPaymentsForShop } = require('./src/automation-jobs');
|
||||
const { createJobRuntime } = require('./src/job-runtime');
|
||||
const { ensureShopIcon } = require('./src/shop-icon');
|
||||
const { registerStatusSyncHook } = require('./src/status-sync');
|
||||
|
||||
const NEW_ORDERS_WINDOW_MS = 20 * 60 * 1000;
|
||||
// TTL locków cronowych w sekundach (jednostka oczekiwana przez Core.getLock/Core.extendLockTime).
|
||||
@@ -29,6 +30,10 @@ function apiFor(config) {
|
||||
return new PrestashopApi(config.apiUrl, config.apiKey, isLegacyApi(config.versionCode));
|
||||
}
|
||||
|
||||
registerStatusSyncHook({ Core, Log, PsOrder, loadConfig, apiFor }).catch(error => {
|
||||
Log.error('PrestaShop: nie udało się zarejestrować synchronizacji statusów', { error: error?.message });
|
||||
});
|
||||
|
||||
async function runOrdersPuller(isLockValid) {
|
||||
const configs = await loadEnabledConfigs();
|
||||
for (const config of configs) {
|
||||
|
||||
Reference in New Issue
Block a user