payservedb 10.1.8 → 10.1.9
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
|
@@ -282,6 +282,7 @@ const models = {
|
|
|
282
282
|
QuickBooksPaymentMapping: require("./src/models/quickbooks_payment_mapping"),
|
|
283
283
|
QuickBooksInvoicePaymentMapping: require("./src/models/quickbooks_invoice_payment_mapping"),
|
|
284
284
|
QuickBooksDepositMapping: require("./src/models/quickbooks_deposit_mapping"),
|
|
285
|
+
QuickBooksLeaseDepositMapping: require("./src/models/quickbooks_lease_deposit_mapping"),
|
|
285
286
|
QuickBooksOutboundSyncState: require("./src/models/quickbooks_outbound_sync_state"),
|
|
286
287
|
QuickBooksCdcSweepState: require("./src/models/quickbooks_cdc_sweep_state"),
|
|
287
288
|
QuickBooksBackfillState: require("./src/models/quickbooks_backfill_state"),
|
package/package.json
CHANGED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Lease security deposit <-> QuickBooks invoice line.
|
|
2
|
+
// Lease deposits have no Deposit document (they are a "Security Deposit" line
|
|
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.
|
|
6
|
+
const mongoose = require("mongoose");
|
|
7
|
+
|
|
8
|
+
const quickBooksLeaseDepositMappingSchema = new mongoose.Schema(
|
|
9
|
+
{
|
|
10
|
+
facilityId: { type: mongoose.Schema.Types.ObjectId, ref: "Facility", required: true, index: true },
|
|
11
|
+
qbConfigId: { type: mongoose.Schema.Types.ObjectId, ref: "QuickBooksConfig", required: true, index: true },
|
|
12
|
+
// The PayServe lease invoice carrying the Security Deposit line.
|
|
13
|
+
invoiceId: { type: mongoose.Schema.Types.ObjectId, ref: "Invoice", required: true },
|
|
14
|
+
invoiceNumber: { type: String, default: null },
|
|
15
|
+
customerId: { type: mongoose.Schema.Types.ObjectId, ref: "Customer", default: null },
|
|
16
|
+
depositAmount: { type: Number, default: 0 },
|
|
17
|
+
qbInvoiceId: { type: String, trim: true, default: null },
|
|
18
|
+
// Item the deposit line was posted with (security_deposit_lease mapping).
|
|
19
|
+
qbItemId: { type: String, trim: true, default: null },
|
|
20
|
+
qbItemName: { type: String, trim: true, default: null },
|
|
21
|
+
syncStatus: {
|
|
22
|
+
type: String,
|
|
23
|
+
enum: ["synced", "pending", "error"],
|
|
24
|
+
default: "pending",
|
|
25
|
+
index: true,
|
|
26
|
+
},
|
|
27
|
+
syncError: { type: String, default: null },
|
|
28
|
+
lastSyncedAt: { type: Date, default: null },
|
|
29
|
+
},
|
|
30
|
+
{ timestamps: true },
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
quickBooksLeaseDepositMappingSchema.index({ facilityId: 1, qbConfigId: 1, invoiceId: 1 }, { unique: true });
|
|
34
|
+
|
|
35
|
+
module.exports = { schema: quickBooksLeaseDepositMappingSchema };
|