@dynamatix/gb-schemas 0.21.4 → 0.21.6

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.
@@ -1,5 +1,5 @@
1
1
  import mongoose from "mongoose";
2
- import mongooseEncryption from "../utils/encryption.middleware";
2
+ import mongooseEncryption from "../utils/encryption.middleware.js";
3
3
 
4
4
  const illustrationSchema = new mongoose.Schema({
5
5
  date: { type: Date } // e.g., the date of illustration
@@ -1,5 +1,5 @@
1
1
  import mongoose from "mongoose";
2
- import mongooseEncryption from "../utils/encryption.middleware";
2
+ import mongooseEncryption from "../utils/encryption.middleware.js";
3
3
 
4
4
  const legalSchema = new mongoose.Schema({
5
5
  assignedSolicitor: { type: String, default: "" },
@@ -1,5 +1,5 @@
1
1
  import mongoose from "mongoose";
2
- import mongooseEncryption from "../utils/encryption.middleware";
2
+ import mongooseEncryption from "../utils/encryption.middleware.js";
3
3
 
4
4
  const offerSchema = new mongoose.Schema({
5
5
  date: { type: Date } // The date associated with the offer
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamatix/gb-schemas",
3
- "version": "0.21.4",
3
+ "version": "0.21.6",
4
4
  "description": "All the schemas for gatehouse bank back-end.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,5 +1,5 @@
1
1
  import mongoose from "mongoose";
2
- import mongooseEncryption from "../utils/encryption.middleware";
2
+ import mongooseEncryption from "../utils/encryption.middleware.js";
3
3
 
4
4
  const permissionSchema = new mongoose.Schema({
5
5
  name: { type: String, required: true },
@@ -1,5 +1,5 @@
1
1
  import mongoose from "mongoose";
2
- import mongooseEncryption from "../utils/encryption.middleware";
2
+ import mongooseEncryption from "../utils/encryption.middleware.js";
3
3
 
4
4
  const RoleGroupSchema = new mongoose.Schema({
5
5
  groupId: { type: Number, required: true },
@@ -1,5 +1,5 @@
1
1
  import mongoose from "mongoose";
2
- import mongooseEncryption from "../utils/encryption.middleware";
2
+ import mongooseEncryption from "../utils/encryption.middleware.js";
3
3
 
4
4
  const RoleSchema = new mongoose.Schema({
5
5
  roleId: { type: Number, required: true },
@@ -24,7 +24,7 @@ export default function mongooseEncryption(schema, options) {
24
24
  });
25
25
 
26
26
  // Encrypt before bulkWrite operations
27
- schema.pre("bulkWrite", function (operations, next) {
27
+ schema.pre("bulkWrite", function (next, operations) {
28
28
  operations.forEach(operation => {
29
29
  if (operation.insertOne && operation.insertOne.document) {
30
30
  operation.insertOne.document = encryptObject(operation.insertOne.document, collectionName);