jp-shared 1.1.5 → 1.1.7
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.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const mongoose = require("mongoose");
|
|
2
2
|
const { getDatabaseName } = require("../../constants");
|
|
3
|
+
const { isIntegerValidator } = require("../../utils");
|
|
3
4
|
|
|
4
5
|
const { ObjectId } = mongoose.Types;
|
|
5
6
|
|
|
@@ -125,6 +126,18 @@ const paymentHistorySchema = new mongoose.Schema(
|
|
|
125
126
|
message: "Discount percentage is required when isJobOffer is true",
|
|
126
127
|
},
|
|
127
128
|
},
|
|
129
|
+
gstPercentage: {
|
|
130
|
+
type: Number,
|
|
131
|
+
required: [true, "GST percentage is required"],
|
|
132
|
+
min: [0, "GST percentage must be a positive number"],
|
|
133
|
+
max: [100, "GST percentage cannot exceed 100%"],
|
|
134
|
+
validate: isIntegerValidator,
|
|
135
|
+
},
|
|
136
|
+
totalAmount: {
|
|
137
|
+
type: Number,
|
|
138
|
+
required: true,
|
|
139
|
+
min: 0, // Ensure total amount is non-negative
|
|
140
|
+
},
|
|
128
141
|
},
|
|
129
142
|
{
|
|
130
143
|
timestamps: true, // Automatically manage createdAt and updatedAt
|
|
@@ -142,7 +142,12 @@ const planSchema = new mongoose.Schema({
|
|
|
142
142
|
min: [0, "GST percentage must be a positive number"],
|
|
143
143
|
max: [100, "GST percentage cannot exceed 100%"],
|
|
144
144
|
validate: isIntegerValidator,
|
|
145
|
-
}
|
|
145
|
+
},
|
|
146
|
+
totalAmount: {
|
|
147
|
+
type: Number,
|
|
148
|
+
required: true,
|
|
149
|
+
min: 0, // Ensure total amount is non-negative
|
|
150
|
+
},
|
|
146
151
|
|
|
147
152
|
});
|
|
148
153
|
|