payservedb 6.1.8 → 6.2.1

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/index.js CHANGED
@@ -197,7 +197,7 @@ const models = {
197
197
  PowerMeterManufacturer: require("./src/models/powerMetersManufacturer"),
198
198
  PowerMeterMonthlyReading: require("./src/models/powerMeterMonthlyReading"),
199
199
  PowerMeterSettings: require("./src/models/powerMeterSettings"),
200
- PrimaryWallet: require("./src/models/primaryWallet"),
200
+ FacilityWalletTransactionsMetadata: require("./src/models/facilityWalletTransactionsMetadata"),
201
201
  };
202
202
 
203
203
  // Function to get models dynamically from a specific database connection
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payservedb",
3
- "version": "6.1.8",
3
+ "version": "6.2.1",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -1,6 +1,6 @@
1
1
  const mongoose = require("mongoose");
2
2
 
3
- const primaryWalletSchema = new mongoose.Schema({
3
+ const faclityWalletTransactionsMetadataSchema = new mongoose.Schema({
4
4
  invoiceId: {
5
5
  type: mongoose.Schema.Types.ObjectId,
6
6
  ref: "Invoice",
@@ -12,6 +12,15 @@ const primaryWalletSchema = new mongoose.Schema({
12
12
  required: true,
13
13
  unique: true,
14
14
  },
15
+ amount: {
16
+ type: Number,
17
+ required: true,
18
+ },
19
+ walletId: {
20
+ type: mongoose.Schema.Types.ObjectId,
21
+ ref: "Wallet",
22
+ required: true,
23
+ },
15
24
  status: {
16
25
  type: String,
17
26
  enum: ["partial", "paid", "cancelled"],
@@ -25,6 +34,14 @@ const primaryWalletSchema = new mongoose.Schema({
25
34
  type: Number,
26
35
  default: 0,
27
36
  },
37
+ paidToLandlord: {
38
+ type: Boolean,
39
+ default: false,
40
+ },
41
+ paidToPropertyManager: {
42
+ type: Boolean,
43
+ default: false,
44
+ },
28
45
  propertyManager: {
29
46
  type: mongoose.Schema.Types.ObjectId,
30
47
  ref: "User",
@@ -35,13 +52,17 @@ const primaryWalletSchema = new mongoose.Schema({
35
52
  ref: "Customer",
36
53
  required: true,
37
54
  },
38
- balance: {
39
- type: Number,
40
- default: 0,
55
+ facility: {
56
+ type: mongoose.Schema.Types.ObjectId,
57
+ ref: "Facility",
58
+ required: true,
41
59
  },
42
60
  });
43
61
 
44
- primaryWalletSchema.index({ invoiceId: 1 });
45
- const PrimaryWallet = mongoose.model("PrimaryWallet", primaryWalletSchema);
62
+ faclityWalletTransactionsMetadataSchema.index({ invoiceId: 1 });
63
+ const FacilityWalletTransactionsMetadata = mongoose.model(
64
+ "FacilityWalletTransactionsMetadata",
65
+ faclityWalletTransactionsMetadataSchema,
66
+ );
46
67
 
47
- module.exports = PrimaryWallet;
68
+ module.exports = FacilityWalletTransactionsMetadata;
@@ -10,7 +10,7 @@ const walletSchema = new mongoose.Schema(
10
10
  ownerType: {
11
11
  type: String,
12
12
  required: true,
13
- enum: ["User", "Customer"],
13
+ enum: ["User", "Customer", "Facility"],
14
14
  },
15
15
  amount: {
16
16
  type: Number,