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:
@@ -1,7 +1,6 @@
|
||||
const { DB } = require('@orbito/api-lib');
|
||||
|
||||
const schema = new DB.Schema('ps_orders', {
|
||||
companyId: { type: 'ObjectId' },
|
||||
shopConfigId: { type: 'ObjectId' },
|
||||
psOrderId: { type: 'number' },
|
||||
orbitoOrderId: { type: 'ObjectId', optional: true },
|
||||
@@ -13,8 +12,8 @@ const schema = new DB.Schema('ps_orders', {
|
||||
schema.pre('validate', function (data) {});
|
||||
schema.post('create', function (data) {});
|
||||
|
||||
DB.createIndex('ps_orders', { companyId: 1, psOrderId: 1, shopConfigId: 1 }, { unique: true });
|
||||
DB.createIndex('ps_orders', { companyId: 1, orbitoOrderId: 1 });
|
||||
DB.createIndex('ps_orders', { companyId: 1, syncedAt: -1 });
|
||||
DB.createIndex('ps_orders', { psOrderId: 1, shopConfigId: 1 }, { unique: true });
|
||||
DB.createIndex('ps_orders', { orbitoOrderId: 1 });
|
||||
DB.createIndex('ps_orders', { syncedAt: -1 });
|
||||
|
||||
module.exports = schema;
|
||||
|
||||
Reference in New Issue
Block a user