payservedb 1.5.3 → 1.5.4

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
@@ -75,7 +75,8 @@ const models = {
75
75
  LevyType:require('./src/models/levytype'),
76
76
  Invoice:require('./src/models/invoice'),
77
77
  Tax:require('./src/models/tax'),
78
- InvoiceBillingSetting:require('./src/models/invoiceBillingSetting')
78
+ InvoiceBillingSetting:require('./src/models/invoiceBillingSetting'),
79
+ Penalty:require('./src/models/penalty')
79
80
  };
80
81
 
81
82
  // 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.3",
3
+ "version": "1.5.4",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -0,0 +1,43 @@
1
+ const mongoose = require('mongoose');
2
+
3
+ // Define the schema for companies
4
+ const penaltySchema = new mongoose.Schema({
5
+ title: {
6
+ type: String,
7
+ required: true
8
+ },
9
+ type: {
10
+ type: String,
11
+ required: true
12
+ },
13
+ effectDays: {
14
+ type: Number,
15
+ required: true
16
+ },
17
+ percentage: {
18
+ type: Boolean,
19
+ required: true
20
+ },
21
+ amount: {
22
+ type: Number,
23
+ required: true
24
+ },
25
+ isActive: {
26
+ type: Boolean,
27
+ required: true
28
+ },
29
+ facilityId: {
30
+ type: mongoose.Schema.Types.ObjectId,
31
+ ref: 'Facility',
32
+ }
33
+ }, {
34
+ timestamps: true // Automatically add createdAt and updatedAt fields
35
+ });
36
+
37
+ // Indexes for improved performance
38
+
39
+
40
+ // Compile the model from the schema
41
+ const Penalty = mongoose.model('Penalty', penaltySchema);
42
+
43
+ module.exports = Penalty;