shuttlepro-shared 1.2.58 → 1.2.60

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.
@@ -171,15 +171,17 @@ const findUserWorkspaces = async (userId) => {
171
171
  })
172
172
  .lean()
173
173
  .exec();
174
- userRoleWithWorkspaces = userRoleWithWorkspaces.map((ur) => {
175
- return {
176
- ...ur?.workspaceId,
177
- id: ur?.workspaceId?._id?.toString(),
178
- _id: ur?.workspaceId?._id?.toString(),
179
- role: ur?.roleId?.name || "",
180
- permissions: ur?.roleId?.modulePermissions?.modules || [],
181
- };
182
- });
174
+ userRoleWithWorkspaces = userRoleWithWorkspaces
175
+ ?.filter((userRole) => userRole?.workspaceId)
176
+ ?.map((ur) => {
177
+ return {
178
+ ...ur?.workspaceId,
179
+ id: ur?.workspaceId?._id?.toString(),
180
+ _id: ur?.workspaceId?._id?.toString(),
181
+ role: ur?.roleId?.name || "",
182
+ permissions: ur?.roleId?.modulePermissions?.modules || [],
183
+ };
184
+ });
183
185
  if (userRoleWithWorkspaces) {
184
186
  await setRedisData(cacheKey, userRoleWithWorkspaces, null, 0);
185
187
  }
@@ -1,7 +1,4 @@
1
1
  /* eslint-disable no-undef */
2
2
  module.exports = {
3
- url:
4
- process.env.NODE_ENV === "test"
5
- ? process.env.TEST_DB_URL
6
- : process.env.DB_URL,
3
+ url: process.env.DB_URL,
7
4
  };
package/models/Order.js CHANGED
@@ -108,7 +108,11 @@ const OrderSchema = new Schema(
108
108
  ivrGenerated: { type: Boolean, default: false },
109
109
  isActivityGenerated: { type: Boolean, default: false },
110
110
  platformFinancialStatus: { type: String, default: "pending" },
111
- payment: {},
111
+ payment: {
112
+ isPaid: { type: Boolean, default: false },
113
+ paymentDate: { type: String, default: "" },
114
+ paymentDetails: {},
115
+ },
112
116
  credentials: {},
113
117
  sender: { type: String, default: "" },
114
118
  orderName: { type: String, default: "" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shuttlepro-shared",
3
- "version": "1.2.58",
3
+ "version": "1.2.60",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -25,4 +25,4 @@
25
25
  "redis": "^4.6.14",
26
26
  "socket.io": "^4.8.1"
27
27
  }
28
- }
28
+ }