payservedb 3.5.8 → 3.6.0

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
@@ -118,7 +118,9 @@ const models = {
118
118
  Budget:require('./src/models/budget'),
119
119
  BudgetCategory:require('./src/models/budgetCategory'),
120
120
  Expense:require('./src/models/expense'),
121
- InvoiceSettings:require('./src/models/levy_invoice_settings')
121
+ InvoiceSettings:require('./src/models/levy_invoice_settings'),
122
+ Account:require('./src/models/account'),
123
+ FacilityPaymentDetails:require('./src/models/facility_payment_details')
122
124
 
123
125
 
124
126
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payservedb",
3
- "version": "3.5.8",
3
+ "version": "3.6.0",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -0,0 +1,34 @@
1
+ import mongoose from "mongoose";
2
+
3
+ const accountSchema = new mongoose.Schema({
4
+ accountNumber: {
5
+ type: String,
6
+ required: true,
7
+ unique: true,
8
+ trim: true,
9
+ },
10
+ facilityId: {
11
+ type: mongoose.Schema.Types.ObjectId,
12
+ default: null,
13
+ },
14
+ customerId: {
15
+ type: mongoose.Schema.Types.ObjectId,
16
+ default: null,
17
+ },
18
+ isActive: {
19
+ type: Boolean,
20
+ default: true,
21
+ },
22
+ accountType: {
23
+ type: String,
24
+ },
25
+ createdAt: {
26
+ type: Date,
27
+ default: Date.now,
28
+ },
29
+ });
30
+
31
+ // [ {accountnumber:1,facilityId:1},{accountnumber:2, facility:2}]
32
+ const Account = mongoose.model('Account', accountSchema);
33
+
34
+ module.exports = Account;
@@ -0,0 +1,20 @@
1
+ import mongoose from "mongoose";
2
+
3
+ const facilityPaymentDetailsSchema = new mongoose.Schema({
4
+ facility: {
5
+ type: mongoose.Schema.Types.ObjectId,
6
+ },
7
+ shortCode: { type: String },
8
+ passkey: { type: String },
9
+ authorizationKey: {
10
+ type: String,
11
+ },
12
+ module: {
13
+ type: String,
14
+ enum: ["All", "Water", "Electricity", "Levy"],
15
+ },
16
+ });
17
+
18
+ const FacilityPaymentDetails = mongoose.model('FacilityPaymentDetails', facilityPaymentDetailsSchema);
19
+
20
+ module.exports = FacilityPaymentDetails;
@@ -8,6 +8,11 @@ const invoiceSchema = new mongoose.Schema(
8
8
  required: true,
9
9
  unique: true,
10
10
  },
11
+ accountNumber: {
12
+ type: String,
13
+ required: true,
14
+ unique: true,
15
+ },
11
16
  client: {
12
17
  type: mongoose.Schema.Types.ObjectId,
13
18
  ref: "Customer",
@@ -54,7 +59,7 @@ const invoiceSchema = new mongoose.Schema(
54
59
  status: {
55
60
  type: String,
56
61
  required: true,
57
- enum: ["Pending", "Paid", "Overdue"],
62
+ enum: ["Unpaid","Pending", "Paid", "Overdue"],
58
63
  },
59
64
  penalty: {
60
65
  type: Number,
@@ -68,7 +73,6 @@ const invoiceSchema = new mongoose.Schema(
68
73
  type: String,
69
74
  default: null,
70
75
  },
71
-
72
76
  lastReminderSent: Date,
73
77
  reminderHistory: [
74
78
  {
@@ -91,4 +95,4 @@ const invoiceSchema = new mongoose.Schema(
91
95
 
92
96
  const Invoice = mongoose.model("Invoice", invoiceSchema);
93
97
 
94
- module.exports = Invoice;
98
+ module.exports = Invoice;
@@ -25,7 +25,7 @@ const levySchema = new mongoose.Schema(
25
25
  min: [0, "Amount must be a positive number"],
26
26
  },
27
27
  dueDate: {
28
- type: Number,
28
+ type: String,
29
29
  required: true,
30
30
  },
31
31
  levyApplicant: {
@@ -39,7 +39,7 @@ const levySchema = new mongoose.Schema(
39
39
  trim: true,
40
40
  },
41
41
  invoiceDay: {
42
- type: Number,
42
+ type: String,
43
43
  required: true,
44
44
  },
45
45
  disabled: {
@@ -60,4 +60,4 @@ const levySchema = new mongoose.Schema(
60
60
  // Compile the model from the schema
61
61
  const Levy = mongoose.model("Levy", levySchema);
62
62
 
63
- module.exports = Levy;
63
+ module.exports = Levy;