payservedb 10.1.4 → 10.1.5

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
@@ -270,6 +270,7 @@ const models = {
270
270
  ZohoIntegration: require("./src/models/zohoIntegration"),
271
271
  ZohoItem: require("./src/models/zohoItem"),
272
272
  ZohoAccount: require("./src/models/zohoAccount"),
273
+ ZohoItemMapping: require("./src/models/zoho_item_mapping"),
273
274
  QuickBooksConfig: require("./src/models/quickbooks_config"),
274
275
  QuickBooksOAuthState: require("./src/models/quickbooks_oauth_state"),
275
276
  QuickBooksAccountMapping: require("./src/models/quickbooks_account_mapping"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payservedb",
3
- "version": "10.1.4",
3
+ "version": "10.1.5",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -0,0 +1,72 @@
1
+ // Which Zoho Books item each PayServe invoice category posts to (per facility).
2
+ // Mirrors quickbooks_item_mapping: invoice lines reference Items, and the Item
3
+ // carries the income account.
4
+ const mongoose = require("mongoose");
5
+
6
+ const zohoItemMappingSchema = new mongoose.Schema(
7
+ {
8
+ facilityId: {
9
+ type: mongoose.Schema.Types.ObjectId,
10
+ ref: "Facility",
11
+ required: true,
12
+ index: true,
13
+ },
14
+ // e.g. utility_power, utility_water, rent_lease, levy_contract, service_charge,
15
+ // property_management, security_deposit
16
+ category: {
17
+ type: String,
18
+ required: true,
19
+ trim: true,
20
+ },
21
+ categoryLabel: {
22
+ type: String,
23
+ trim: true,
24
+ default: null,
25
+ },
26
+ zohoItemId: {
27
+ type: String,
28
+ trim: true,
29
+ default: null,
30
+ },
31
+ zohoItemName: {
32
+ type: String,
33
+ trim: true,
34
+ default: null,
35
+ },
36
+ zohoAccountId: {
37
+ type: String,
38
+ trim: true,
39
+ default: null,
40
+ },
41
+ zohoAccountName: {
42
+ type: String,
43
+ trim: true,
44
+ default: null,
45
+ },
46
+ zohoTaxId: {
47
+ type: String,
48
+ trim: true,
49
+ default: null,
50
+ },
51
+ // auto: accepted suggestion, manual: picked by an admin,
52
+ // created: item created in Zoho from PayServe.
53
+ matchType: {
54
+ type: String,
55
+ enum: ["auto", "manual", "created"],
56
+ default: "manual",
57
+ },
58
+ isActive: {
59
+ type: Boolean,
60
+ default: true,
61
+ },
62
+ mappedBy: {
63
+ type: mongoose.Schema.Types.ObjectId,
64
+ default: null,
65
+ },
66
+ },
67
+ { timestamps: true },
68
+ );
69
+
70
+ zohoItemMappingSchema.index({ facilityId: 1, category: 1 }, { unique: true });
71
+
72
+ module.exports = { schema: zohoItemMappingSchema };