payservedb 8.3.2 → 8.3.4

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": "8.3.2",
3
+ "version": "8.3.4",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -193,17 +193,15 @@ const waterMeterSettingsSchema = new mongoose.Schema({
193
193
  billerAddress: {
194
194
  name: {
195
195
  type: String,
196
- required: [true, "Biller name is required"],
197
196
  trim: true,
198
- minlength: [1, "Biller name must be at least 1 character long"],
199
197
  },
200
198
  email: {
201
199
  type: String,
202
- required: [true, "Biller email is required"],
203
200
  trim: true,
204
201
  lowercase: true,
205
202
  validate: {
206
203
  validator: function (v) {
204
+ if (!v) return true; // allow empty
207
205
  return /^\w+([\.-]?\w+)@\w+([\.-]?\w+)(\.\w{2,3})+$/.test(v);
208
206
  },
209
207
  message: "Please enter a valid email address"
@@ -211,21 +209,30 @@ const waterMeterSettingsSchema = new mongoose.Schema({
211
209
  },
212
210
  phone: {
213
211
  type: String,
214
- required: [true, "Biller phone is required"],
215
212
  trim: true,
216
213
  },
217
214
  address: {
218
215
  type: String,
219
- required: [true, "Biller address is required"],
220
216
  trim: true,
221
217
  },
222
218
  city: {
223
219
  type: String,
224
- required: [true, "Biller city is required"],
225
220
  trim: true,
221
+ },
222
+ country: {
223
+ type: String,
224
+ trim: true,
225
+ default: "Kenya"
226
+ },
227
+ logo: {
228
+ type: String,
229
+ required: false,
230
+ },
231
+ digitalSignature: {
232
+ type: String,
233
+ required: false,
226
234
  }
227
235
  },
228
-
229
236
  // GL accounts for accounting entries
230
237
  glAccounts: {
231
238
  invoice: {
@@ -255,7 +262,7 @@ const waterMeterSettingsSchema = new mongoose.Schema({
255
262
  },
256
263
 
257
264
  //GL ACCOUNT DOUBLE ENTRIES
258
-
265
+
259
266
  invocieCreationDe: {
260
267
  type: mongoose.Schema.Types.ObjectId,
261
268
  ref: 'GLAccountDoubleEntries',