payservedb 1.5.0 → 1.5.2

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
@@ -74,7 +74,8 @@ const models = {
74
74
  Levy:require('./src/models/levy'),
75
75
  LevyType:require('./src/models/levytype'),
76
76
  Invoice:require('./src/models/invoice'),
77
- Tax:require('./src/models/tax')
77
+ Tax:require('./src/models/tax'),
78
+ InvoiceBillingSetting:require('./src/models/invoiceBillingSetting')
78
79
  };
79
80
 
80
81
  // 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": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -0,0 +1,29 @@
1
+ const mongoose = require('mongoose');
2
+
3
+ // Define the schema for companies
4
+ const InvoiceBillingSettingSchema = new mongoose.Schema({
5
+ dueDays: {
6
+ type: Number,
7
+ required: true,
8
+ min: 1 // Ensures dueDays is at least 1
9
+ },
10
+ note: {
11
+ type: String,
12
+ required: true
13
+ },
14
+ facilityId: {
15
+ type: mongoose.Schema.Types.ObjectId,
16
+ ref: 'Facility',
17
+ required: true // Consider making this required if every setting must be linked to a facility
18
+ }
19
+ }, {
20
+ timestamps: true // Automatically add createdAt and updatedAt fields
21
+ });
22
+
23
+ // Indexes for improved performance
24
+ InvoiceBillingSettingSchema.index({ facilityId: 1 }); // Index on facilityId
25
+
26
+ // Compile the model from the schema
27
+ const InvoiceBillingSetting = mongoose.model('InvoiceBillingSetting', InvoiceBillingSettingSchema);
28
+
29
+ module.exports = InvoiceBillingSetting;
package/src/models/tax.js CHANGED
@@ -23,7 +23,7 @@ const taxSchema = new mongoose.Schema({
23
23
  });
24
24
 
25
25
  // Indexes for improved performance
26
- ;
26
+
27
27
 
28
28
  // Compile the model from the schema
29
29
  const Tax = mongoose.model('Tax', taxSchema);