Initial commit: core-prestashop module v1.1.1
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
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 },
|
||||
reference: { type: 'string', optional: true, default: '' },
|
||||
syncedAt: { type: 'date', optional: true, default: () => new Date() },
|
||||
paymentSyncedAt: { type: 'date', optional: true },
|
||||
});
|
||||
|
||||
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 });
|
||||
|
||||
module.exports = schema;
|
||||
Reference in New Issue
Block a user