@riocrypto/common-server 1.0.2818 → 1.0.2819
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/models/order.js +0 -6
- package/package.json +1 -1
package/build/models/order.js
CHANGED
|
@@ -386,12 +386,6 @@ const buildOrder = (mongoose) => {
|
|
|
386
386
|
orderSchema.index({ brokerId: 1, "TWAP.sessionId": 1, createdAt: 1 });
|
|
387
387
|
orderSchema.index({ clientReferenceId: 1 }, { sparse: true });
|
|
388
388
|
orderSchema.index({ "paymentsReceived.blockchainTxId": 1 }, { sparse: true });
|
|
389
|
-
// At most one order per real quoteId. Imported orders use quoteId "" and are
|
|
390
|
-
// excluded by the partial filter (which also serves the createOrder lookup).
|
|
391
|
-
orderSchema.index({ quoteId: 1 }, { unique: true, partialFilterExpression: { quoteId: { $gt: "" } } });
|
|
392
|
-
// At most one order per (broker family, clientReferenceId). rootUserId is
|
|
393
|
-
// brokerId || userId; orders without a clientReferenceId are excluded.
|
|
394
|
-
orderSchema.index({ rootUserId: 1, clientReferenceId: 1 }, { unique: true, partialFilterExpression: { clientReferenceId: { $type: "string" } } });
|
|
395
389
|
orderSchema.pre("validate", function (next) {
|
|
396
390
|
this.rootUserId = this.brokerId || this.userId;
|
|
397
391
|
next();
|