payservedb 4.9.2 → 4.9.3

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": "4.9.2",
3
+ "version": "4.9.3",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -36,6 +36,10 @@ const glAccountsSchema = new mongoose.Schema({
36
36
  required: true,
37
37
  default: 0,
38
38
  },
39
+ isFinal: {
40
+ type: Boolean,
41
+ default: false,
42
+ },
39
43
  isActive: {
40
44
  type: Boolean,
41
45
  default: true,
@@ -102,7 +102,7 @@ const invoiceSchema = new mongoose.Schema(
102
102
  status: {
103
103
  type: String,
104
104
  required: true,
105
- enum: ["Unpaid", "Pending", "Paid", "Overdue", "Cancelled", "Partially Paid"],
105
+ enum: ["Unpaid", "Pending", "Paid", "Overdue", "Cancelled", "Partially Paid", "Void"],
106
106
  },
107
107
  penalty: {
108
108
  type: Number,
@@ -116,13 +116,28 @@ const invoiceSchema = new mongoose.Schema(
116
116
  type: String,
117
117
  default: null,
118
118
  },
119
- // Enhanced balanceBroughtForward field
120
- // Positive values = customer owes money
121
- // Negative values = credit (previously tracked in overpay field)
122
119
  balanceBroughtForward: {
123
120
  type: Number,
124
121
  default: 0,
125
122
  },
123
+ voidMetadata: {
124
+ voidedBy: {
125
+ userId: { type: mongoose.Schema.Types.ObjectId, ref: "User" },
126
+ name: { type: String },
127
+ role: { type: String }
128
+ },
129
+ voidedAt: { type: Date },
130
+ reason: { type: String }
131
+ },
132
+ cancelMetadata: {
133
+ cancelledBy: {
134
+ userId: { type: mongoose.Schema.Types.ObjectId, ref: "User" },
135
+ name: { type: String },
136
+ role: { type: String }
137
+ },
138
+ cancelledAt: { type: Date },
139
+ reason: { type: String }
140
+ },
126
141
  lastReminderSent: Date,
127
142
  reminderHistory: [
128
143
  {