payservedb 4.8.7 → 4.8.9

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
@@ -153,6 +153,7 @@ const models = {
153
153
  BookingAnalytics: require('./src/models/bookinganalytics'),
154
154
  RevenueRecord: require('./src/models/bookingrevenuerecord'),
155
155
  GLAccount: require('./src/models/gl_accounts'),
156
+ GLEntries: require('./src/models/gl_entries'),
156
157
  };
157
158
 
158
159
  // 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": "4.8.7",
3
+ "version": "4.8.9",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -0,0 +1,55 @@
1
+ const mongoose = require('mongoose');
2
+
3
+ const glEntriesSchema = new mongoose.Schema({
4
+ entryDate: {
5
+ type: Date,
6
+ required: true,
7
+ default: Date.now,
8
+ },
9
+ accountId: {
10
+ type: mongoose.Schema.Types.ObjectId,
11
+ ref: 'GLAccount',
12
+ required: true,
13
+ },
14
+ amount: {
15
+ type: Number,
16
+ required: true,
17
+ },
18
+ description: {
19
+ type: String,
20
+ trim: true,
21
+ },
22
+ facilityId: {
23
+ type: mongoose.Schema.Types.ObjectId,
24
+ ref: 'Facility',
25
+ required: true,
26
+ },
27
+ createdAt: {
28
+ type: Date,
29
+ default: Date.now,
30
+ },
31
+ updatedAt: {
32
+ type: Date,
33
+ default: Date.now,
34
+ },
35
+ isActive: {
36
+ type: Boolean,
37
+ default: true,
38
+ },
39
+ createdBy: {
40
+ type: mongoose.Schema.Types.ObjectId,
41
+ ref: 'User',
42
+ required: true,
43
+ },
44
+ entryType: {
45
+ type: String,
46
+ enum: ['debit', 'credit'],
47
+ required: true,
48
+ },
49
+ transactionFeeDate: {
50
+ type: Date,
51
+ required: true,
52
+ },
53
+ });
54
+
55
+ module.exports = mongoose.model('GLEntries', glEntriesSchema);
@@ -60,19 +60,21 @@ const rfqDetailsSchema = new mongoose.Schema({
60
60
  type: String,
61
61
  trim: true,
62
62
  },
63
-
64
- // just store the IDs you invited
63
+ status: {
64
+ type: String,
65
+ enum: ['Pending', 'Active', 'Closed'],
66
+ default: 'Pending',
67
+ trim: true,
68
+ },
65
69
  suppliers: [{
66
70
  type: mongoose.Schema.Types.ObjectId,
67
71
  ref: 'Supplier',
68
72
  }],
69
-
70
- // the free‑form items your UI collects
71
73
  items: [{
72
- itemName: { type: String, required: true, trim: true },
73
- description: { type: String, trim: true },
74
- quantity: { type: Number, required: true, min: 1 },
75
- unitOfMeasure: { type: String, trim: true },
74
+ itemName: { type: String, required: true, trim: true },
75
+ description: { type: String, trim: true },
76
+ quantity: { type: Number, required: true, min: 1 },
77
+ unitOfMeasure: { type: String, trim: true },
76
78
  specifications: { type: String, trim: true },
77
79
  }],
78
80