payservedb 6.7.2 → 6.7.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/index.js CHANGED
@@ -207,6 +207,7 @@ const models = {
207
207
  DutyRosterChecklist: require("./src/models/dutyRosterChecklist"),
208
208
  AuditTrail: require("./src/models/auditTrail"),
209
209
  DailyChecklist: require("./src/models/dailyChecklist"),
210
+ CoreInvoiceSettings: require("./src/models/coreInvoiceSettings"),
210
211
  };
211
212
 
212
213
  // 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": "6.7.2",
3
+ "version": "6.7.4",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -0,0 +1,100 @@
1
+ const mongoose = require("mongoose");
2
+
3
+ const CoreInvoiceSettingsSchema = new mongoose.Schema(
4
+ {
5
+ header: {
6
+ companyName: {
7
+ type: String,
8
+ required: true,
9
+ trim: true,
10
+ },
11
+ companyAddress: {
12
+ type: String,
13
+ required: true,
14
+ trim: true,
15
+ },
16
+ companyPhone: {
17
+ type: String,
18
+ trim: true,
19
+ },
20
+ companyEmail: {
21
+ type: String,
22
+ trim: true,
23
+ lowercase: true,
24
+ match: [/^\S+@\S+\.\S+$/, "Please enter a valid email address"],
25
+ },
26
+ companyWebsite: {
27
+ type: String,
28
+ trim: true,
29
+ match: [/^https?:\/\/[^\s$.?#].[^\s]*$/, "Please enter a valid URL"],
30
+ },
31
+ taxNumber: {
32
+ type: String,
33
+ trim: true,
34
+ },
35
+ logo: {
36
+ type: String, // Store as base64 string or URL to the logo
37
+ default: null,
38
+ },
39
+ },
40
+ footer: {
41
+ bankName: {
42
+ type: String,
43
+ trim: true,
44
+ },
45
+ accountName: {
46
+ type: String,
47
+ trim: true,
48
+ },
49
+ accountNumber: {
50
+ type: String,
51
+ trim: true,
52
+ },
53
+ swiftCode: {
54
+ type: String,
55
+ trim: true,
56
+ },
57
+ paymentTerms: {
58
+ type: String,
59
+ trim: true,
60
+ default: "Net 30 days",
61
+ },
62
+ latePaymentFee: {
63
+ type: String,
64
+ trim: true,
65
+ },
66
+ taxRate: {
67
+ type: String,
68
+ trim: true,
69
+ },
70
+ additionalNotes: {
71
+ type: String,
72
+ trim: true,
73
+ },
74
+ supportEmail: {
75
+ type: String,
76
+ trim: true,
77
+ lowercase: true,
78
+ match: [/^\S+@\S+\.\S+$/, "Please enter a valid email address"],
79
+ },
80
+ supportPhone: {
81
+ type: String,
82
+ trim: true,
83
+ },
84
+ termsAndConditions: {
85
+ type: String,
86
+ trim: true,
87
+ },
88
+ },
89
+ },
90
+ {
91
+ timestamps: true, // Adds createdAt and updatedAt fields
92
+ },
93
+ );
94
+
95
+ const CoreInvoiceSettings = mongoose.model(
96
+ "CoreInvoiceSettings",
97
+ CoreInvoiceSettingsSchema,
98
+ );
99
+
100
+ module.exports = CoreInvoiceSettings;
@@ -81,8 +81,8 @@ const powerMeterSchema = new mongoose.Schema({
81
81
  },
82
82
  liveStatus: {
83
83
  type: String,
84
- enum: ['ON', 'OFF'],
85
- default: 'OFF'
84
+ enum: ['on', 'off', 'maintenance', 'faulty'],
85
+ default: 'on'
86
86
  },
87
87
  gatewayLiveStatus: {
88
88
  type: String,
@@ -94,12 +94,6 @@ const powerMeterSchema = new mongoose.Schema({
94
94
  required: true,
95
95
  enum: ['installed', 'not installed'],
96
96
  default: 'installed',
97
- },
98
- status: {
99
- type: String,
100
- required: true,
101
- enum: ['on', 'off', 'maintenance', 'faulty'],
102
- default: 'on',
103
97
  }
104
98
  }, {
105
99
  timestamps: true