payservedb 1.4.7 → 1.4.8

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/models/tax.js +27 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payservedb",
3
- "version": "1.4.7",
3
+ "version": "1.4.8",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -0,0 +1,27 @@
1
+ const mongoose = require('mongoose');
2
+
3
+ // Define the schema for companies
4
+ const taxSchema = new mongoose.Schema({
5
+ type: {
6
+ type: String,
7
+ required: true
8
+ },
9
+ amount: {
10
+ type: Number,
11
+ required: true
12
+ },
13
+ facilityId: {
14
+ type: mongoose.Schema.Types.ObjectId,
15
+ ref: 'Facility',
16
+ }
17
+ }, {
18
+ timestamps: true // Automatically add createdAt and updatedAt fields
19
+ });
20
+
21
+ // Indexes for improved performance
22
+ ;
23
+
24
+ // Compile the model from the schema
25
+ const Tax = mongoose.model('Tax', taxSchema);
26
+
27
+ module.exports = Tax;