fix: harden PrestaShop automation jobs
This commit is contained in:
@@ -8,6 +8,10 @@ const schema = new DB.Schema('ps_orders', {
|
||||
reference: { type: 'string', optional: true, default: '' },
|
||||
syncedAt: { type: 'date', optional: true, default: () => new Date() },
|
||||
paymentSyncedAt: { type: 'date', optional: true },
|
||||
// Ostatnia kumulatywna kwota total_paid_real potwierdzona w core/orders.
|
||||
paymentTotalSynced: { type: 'number', optional: true },
|
||||
paymentCheckedAt: { type: 'date', optional: true },
|
||||
nextPaymentCheckAt: { type: 'date', optional: true },
|
||||
});
|
||||
|
||||
schema.pre('validate', function (data) {});
|
||||
@@ -16,5 +20,6 @@ schema.post('create', function (data) {});
|
||||
DB.createIndex('ps_orders', { psOrderId: 1, shopConfigId: 1 }, { unique: true });
|
||||
DB.createIndex('ps_orders', { orbitoOrderId: 1 });
|
||||
DB.createIndex('ps_orders', { syncedAt: -1 });
|
||||
DB.createIndex('ps_orders', { shopConfigId: 1, nextPaymentCheckAt: 1, syncedAt: 1 });
|
||||
|
||||
module.exports = schema;
|
||||
|
||||
Reference in New Issue
Block a user