@riocrypto/common-server 1.0.2913 → 1.0.2915

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.
@@ -84,6 +84,14 @@ const buildBankAccount = (mongoose) => {
84
84
  },
85
85
  },
86
86
  });
87
+ // Duplicate check on create. The CLABE suffix also covers the CCI and
88
+ // accountNumber variants, which fall back to the userId/country/fiat prefix.
89
+ BankAccountSchema.index({ userId: 1, country: 1, fiat: 1, CLABE: 1 });
90
+ // Listing a single user's accounts, newest first.
91
+ BankAccountSchema.index({ userId: 1, createdAt: -1, _id: -1 });
92
+ // Admin and cluster listing, which filters on nothing and sorts the whole
93
+ // collection before paginating.
94
+ BankAccountSchema.index({ createdAt: -1, _id: -1 });
87
95
  BankAccountSchema.statics.build = (attrs) => {
88
96
  return new BankAccount(attrs);
89
97
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.2913",
3
+ "version": "1.0.2915",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",