payservedb 5.1.6 → 5.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payservedb",
3
- "version": "5.1.6",
3
+ "version": "5.1.7",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -26,10 +26,37 @@ const leaseAgreementSchema = new mongoose.Schema({
26
26
  ref: 'Customer',
27
27
  required: true
28
28
  },
29
- doubleEntryAccount: {
29
+ // GL Account configurations
30
+ invoiceDoubleEntryAccount: {
30
31
  type: mongoose.Schema.Types.ObjectId,
31
- ref: 'GLAccountDoubleEntries',
32
- required: true
32
+ ref: 'GLAccountDoubleEntries'
33
+ },
34
+ paymentDoubleEntryAccount: {
35
+ type: mongoose.Schema.Types.ObjectId,
36
+ ref: 'GLAccountDoubleEntries'
37
+ },
38
+ // GL Account direct configurations (used when creating double entry records)
39
+ glAccounts: {
40
+ invoice: {
41
+ debit: {
42
+ type: mongoose.Schema.Types.ObjectId,
43
+ ref: 'GLAccount'
44
+ },
45
+ credit: {
46
+ type: mongoose.Schema.Types.ObjectId,
47
+ ref: 'GLAccount'
48
+ }
49
+ },
50
+ payment: {
51
+ debit: {
52
+ type: mongoose.Schema.Types.ObjectId,
53
+ ref: 'GLAccount'
54
+ },
55
+ credit: {
56
+ type: mongoose.Schema.Types.ObjectId,
57
+ ref: 'GLAccount'
58
+ }
59
+ }
33
60
  },
34
61
  leaseTerms: {
35
62
  startDate: { type: Date, required: true },
@@ -73,7 +100,21 @@ const leaseAgreementSchema = new mongoose.Schema({
73
100
  businessNumber: String,
74
101
  accountNumber: String,
75
102
  phoneNumber: String
76
- }
103
+ },
104
+ escalations: [{
105
+ effectiveDate: { type: Date, required: true },
106
+ type: {
107
+ type: String,
108
+ enum: ['percentage', 'fixed'],
109
+ required: true
110
+ },
111
+ value: { type: Number, required: true },
112
+ status: {
113
+ type: String,
114
+ enum: ['scheduled', 'applied', 'cancelled'],
115
+ default: 'scheduled'
116
+ }
117
+ }]
77
118
  },
78
119
  billingCycle: {
79
120
  frequency: {
@@ -82,7 +123,8 @@ const leaseAgreementSchema = new mongoose.Schema({
82
123
  required: true
83
124
  },
84
125
  nextInvoiceDate: { type: Date },
85
- autoSend: { type: Boolean, default: false }
126
+ autoSend: { type: Boolean, default: false },
127
+ lastInvoiceDate: { type: Date }
86
128
  },
87
129
  invoices: [
88
130
  { type: mongoose.Schema.Types.ObjectId, ref: 'Invoice' }
@@ -117,6 +159,10 @@ const leaseAgreementSchema = new mongoose.Schema({
117
159
  enum: ['Active', 'Pending', 'Expired', 'Terminated'],
118
160
  default: 'Active'
119
161
  },
162
+ requireLandlordApproval: {
163
+ type: Boolean,
164
+ default: false
165
+ },
120
166
  payments: [
121
167
  {
122
168
  invoiceId: {
@@ -65,8 +65,8 @@ const waterMeterSchema = new mongoose.Schema({
65
65
  status: {
66
66
  type: String,
67
67
  required: true,
68
- enum: ['open', 'closed', 'maintenance', 'faulty'],
69
- default: 'open',
68
+ enum: ['opened', 'closed', 'maintenance', 'faulty'],
69
+ default: 'opened',
70
70
  },
71
71
  customerType: {
72
72
  type: String,