payservedb 1.4.9 → 1.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payservedb",
3
- "version": "1.4.9",
3
+ "version": "1.5.1",
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
@@ -6,6 +6,10 @@ const taxSchema = new mongoose.Schema({
6
6
  type: String,
7
7
  required: true
8
8
  },
9
+ percentage: {
10
+ type: Boolean,
11
+ required: true
12
+ },
9
13
  amount: {
10
14
  type: Number,
11
15
  required: true
@@ -19,7 +23,7 @@ const taxSchema = new mongoose.Schema({
19
23
  });
20
24
 
21
25
  // Indexes for improved performance
22
- ;
26
+
23
27
 
24
28
  // Compile the model from the schema
25
29
  const Tax = mongoose.model('Tax', taxSchema);