Add import customers functionality to XL Vask module

This commit is contained in:
Jeppe Bundgaard
2025-07-15 14:25:40 +02:00
parent 1551d37f19
commit 026942f772
4 changed files with 208 additions and 2 deletions
@@ -8,6 +8,7 @@ use classes\router;
use classes\xlvask;
use objects\orders_o;
use objects\users_o;
use objects\xlvask_customers_o;
use traits\route_t;
class moduleXLVaskRoute
@@ -215,5 +216,21 @@ class moduleXLVaskRoute
'modules_xlvask_sync_usage' => 'Synchronize usage with the xlvask module'
]
);
$this->get('/modules/xlvask/tasks/import-customers', function () {
global $response;
self::requirePermission('modules_xlvask_import_customers');
// Create the xlvask_customers_o object
$xlvask_customers_o = new xlvask_customers_o();
$xlvask_customers_o->importCustomers();
$response->success(
'Customers imported',
200
);
},
[
'modules_xlvask_import_customers' => 'Import customers from the xlvask module'
]
);
}
}