payservedb 10.2.3 → 10.2.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 +2 -1
- package/package.json +1 -1
- package/src/models/quickbooks_log.js +40 -0
package/index.js
CHANGED
|
@@ -288,6 +288,7 @@ const models = {
|
|
|
288
288
|
QuickBooksCdcSweepState: require("./src/models/quickbooks_cdc_sweep_state"),
|
|
289
289
|
QuickBooksBackfillState: require("./src/models/quickbooks_backfill_state"),
|
|
290
290
|
QuickBooksInvoiceRouting: require("./src/models/quickbooks_invoice_routing"),
|
|
291
|
+
QuickBooksLog: require("./src/models/quickbooks_log"),
|
|
291
292
|
DahuaIntegration: require("./src/models/dahuaIntegration"),
|
|
292
293
|
PrivacyPolicy: require("./src/models/privacy_policy"),
|
|
293
294
|
TermsAndConditions: require("./src/models/terms_and_conditions"),
|
|
@@ -467,4 +468,4 @@ module.exports = {
|
|
|
467
468
|
initializeService,
|
|
468
469
|
...models,
|
|
469
470
|
moveIn: moveInModels,
|
|
470
|
-
};
|
|
471
|
+
};
|
package/package.json
CHANGED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const mongoose = require("mongoose");
|
|
2
|
+
|
|
3
|
+
// Per-call QuickBooks API request/response log for a facility/realm.
|
|
4
|
+
const quickBooksLogSchema = new mongoose.Schema(
|
|
5
|
+
{
|
|
6
|
+
facilityId: {
|
|
7
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
8
|
+
ref: "Facility",
|
|
9
|
+
required: true,
|
|
10
|
+
index: true,
|
|
11
|
+
},
|
|
12
|
+
qbConfigId: {
|
|
13
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
14
|
+
ref: "QuickBooksConfig",
|
|
15
|
+
required: true,
|
|
16
|
+
index: true,
|
|
17
|
+
},
|
|
18
|
+
realmId: { type: String, index: true },
|
|
19
|
+
environment: { type: String },
|
|
20
|
+
direction: { type: String, enum: ["outbound", "inbound"], default: "outbound" },
|
|
21
|
+
method: { type: String, default: "GET" },
|
|
22
|
+
path: { type: String, required: true },
|
|
23
|
+
params: { type: mongoose.Schema.Types.Mixed },
|
|
24
|
+
requestBody: { type: mongoose.Schema.Types.Mixed },
|
|
25
|
+
responseBody: { type: mongoose.Schema.Types.Mixed },
|
|
26
|
+
statusCode: { type: Number },
|
|
27
|
+
errorMessage: { type: String },
|
|
28
|
+
faultCode: { type: String },
|
|
29
|
+
startedAt: { type: Date, default: Date.now, index: true },
|
|
30
|
+
endedAt: { type: Date },
|
|
31
|
+
durationMs: { type: Number },
|
|
32
|
+
correlationId: { type: String, index: true },
|
|
33
|
+
qbRequestId: { type: String },
|
|
34
|
+
},
|
|
35
|
+
{ timestamps: true },
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
quickBooksLogSchema.index({ facilityId: 1, qbConfigId: 1, startedAt: -1 });
|
|
39
|
+
|
|
40
|
+
module.exports = { schema: quickBooksLogSchema };
|