Migrate to @orbito/api-lib 2.0.0 for single-company container model.

Remove companyId from handlers, models, cron jobs, and cross-module calls to match the v2 one-module-one-company architecture.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
fatequod
2026-07-08 11:21:35 +02:00
co-authored by Cursor
parent f163100ad4
commit 1a6a978a21
25 changed files with 365 additions and 189 deletions
+3 -3
View File
@@ -311,9 +311,9 @@ function buildTemplate(form) {
};
}
module.exports = async function(companyId, instanceId, body, params) {
module.exports = async function(body, params) {
try {
const config = await ShopConfig.findOne({ companyId, isRemoved: { $ne: true } });
const config = await ShopConfig.findOne({ isRemoved: { $ne: true } });
const form = toFormResponse(config);
return {
@@ -321,7 +321,7 @@ module.exports = async function(companyId, instanceId, body, params) {
template: buildTemplate(form)
};
} catch (err) {
Log.error(companyId, 'pages/config failed', { error: err?.message, stack: err?.stack });
Log.error( 'pages/config failed', { error: err?.message, stack: err?.stack });
return {
type: 'ove',
template: {
+3 -3
View File
@@ -1,17 +1,17 @@
const { Log, Core, Utils, Pages } = require('@orbito/api-lib');
const ShopConfig = require('../src/models/ShopConfig');
module.exports = async function(companyId, instanceId, body, params) {
module.exports = async function(body, params) {
const configId = params.shopId;
const isEdit = !!configId;
let config = null;
if (isEdit) {
config = await ShopConfig.findOne({ _id: configId, companyId, isRemoved: { $ne: true } });
config = await ShopConfig.findOne({ _id: configId, isRemoved: { $ne: true } });
if (!config) throw new Error('Config not found');
}
const res = await Core.callModule(companyId, 'core/orders', 'status.search', {});
const res = await Core.callModule( 'core/orders', 'status.search', {});
const orderStatuses = res.results || [];
return {