payservedb 10.1.10 → 10.2.1

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
@@ -287,6 +287,7 @@ const models = {
287
287
  QuickBooksCdcSweepState: require("./src/models/quickbooks_cdc_sweep_state"),
288
288
  QuickBooksBackfillState: require("./src/models/quickbooks_backfill_state"),
289
289
  QuickBooksInvoiceRouting: require("./src/models/quickbooks_invoice_routing"),
290
+ DahuaIntegration: require("./src/models/dahuaIntegration"),
290
291
  PrivacyPolicy: require("./src/models/privacy_policy"),
291
292
  TermsAndConditions: require("./src/models/terms_and_conditions"),
292
293
  CommunityGuidelines: require("./src/models/community_guidelines"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payservedb",
3
- "version": "10.1.10",
3
+ "version": "10.2.1",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -0,0 +1,22 @@
1
+ const mongoose = require('mongoose');
2
+
3
+ const DahuaIntegrationSchema = new mongoose.Schema(
4
+ {
5
+ facilityId: { type: String, required: true, unique: true, index: true },
6
+
7
+ baseUrl: { type: String, required: true, trim: true },
8
+
9
+ clientId: { type: String, required: true, trim: true },
10
+
11
+ clientSecret: { type: String, required: true },
12
+
13
+ enabled: { type: Boolean, default: true },
14
+
15
+ updatedBy: { type: String }
16
+ },
17
+ { timestamps: true }
18
+ );
19
+
20
+ const DahuaIntegration = mongoose.model("DahuaIntegration", DahuaIntegrationSchema);
21
+
22
+ module.exports = DahuaIntegration;
@@ -175,7 +175,7 @@ const leaseAgreementSchema = new mongoose.Schema({
175
175
  leaseTemplate: {
176
176
  type: mongoose.Schema.Types.ObjectId,
177
177
  ref: 'LeaseTemplate',
178
- required: true
178
+ required: false
179
179
  },
180
180
  leaseDocuments: [
181
181
  {
@@ -79,7 +79,7 @@ const powerMeterPowerChargeSchema = new mongoose.Schema({
79
79
  timestamps: true
80
80
  });
81
81
 
82
- powerMeterPowerChargeSchema.index({ facilityId: 1, yearMonth: 1, tariff: 1 }, { unique: true });
82
+ powerMeterPowerChargeSchema.index({ facilityId: 1, yearMonth: 1 }, { unique: true });
83
83
 
84
84
  const PowerMeterPowerCharge = mongoose.model('PowerMeterPowerCharge', powerMeterPowerChargeSchema);
85
85
 
@@ -1,10 +1,8 @@
1
- // Lease security deposit <-> its own QuickBooks invoice ("<invoice>-DEP").
1
+ // Lease security deposit <-> QuickBooks invoice line.
2
2
  // Lease deposits have no Deposit document (they are a "Security Deposit" line
3
- // on the tenant's lease invoice), so this collection records each one
4
- // separately from levy deposits (quickbooks_deposit_mapping). The deposit
5
- // invoice posts to the "security_deposit_lease" Item, which must be a Liability.
6
- // qbInvoiceId is the DEPOSIT invoice; the rent invoice stays in
7
- // quickbooks_invoice_mapping.
3
+ // on the tenant's first lease invoice), so this collection records each one
4
+ // separately from levy deposits (quickbooks_deposit_mapping). The line posts
5
+ // to the "security_deposit_lease" Item, which must be a Liability.
8
6
  const mongoose = require("mongoose");
9
7
 
10
8
  const quickBooksLeaseDepositMappingSchema = new mongoose.Schema(
@@ -16,7 +14,6 @@ const quickBooksLeaseDepositMappingSchema = new mongoose.Schema(
16
14
  invoiceNumber: { type: String, default: null },
17
15
  customerId: { type: mongoose.Schema.Types.ObjectId, ref: "Customer", default: null },
18
16
  depositAmount: { type: Number, default: 0 },
19
- // The deposit invoice in QuickBooks (not the rent invoice).
20
17
  qbInvoiceId: { type: String, trim: true, default: null },
21
18
  // Item the deposit line was posted with (security_deposit_lease mapping).
22
19
  qbItemId: { type: String, trim: true, default: null },