payservedb 1.5.3 → 1.5.5

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.5",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -0,0 +1,47 @@
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
+ module: {
10
+ type: String,
11
+ required: true
12
+ },
13
+ type: {
14
+ type: String,
15
+ required: true
16
+ },
17
+ effectDays: {
18
+ type: Number,
19
+ required: true
20
+ },
21
+ percentage: {
22
+ type: Boolean,
23
+ required: true
24
+ },
25
+ amount: {
26
+ type: Number,
27
+ required: true
28
+ },
29
+ isActive: {
30
+ type: Boolean,
31
+ required: true
32
+ },
33
+ facilityId: {
34
+ type: mongoose.Schema.Types.ObjectId,
35
+ ref: 'Facility',
36
+ }
37
+ }, {
38
+ timestamps: true // Automatically add createdAt and updatedAt fields
39
+ });
40
+
41
+ // Indexes for improved performance
42
+
43
+
44
+ // Compile the model from the schema
45
+ const Penalty = mongoose.model('Penalty', penaltySchema);
46
+
47
+ module.exports = Penalty;