payservedb 6.9.4 → 6.9.6

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
@@ -211,8 +211,6 @@ const models = {
211
211
  CoreInvoiceSettings: require("./src/models/coreInvoiceSettings"),
212
212
  FacilityInvoice: require("./src/models/facilityInvoice"),
213
213
  CoreBaseSettings: require("./src/models/coreBaseSettings"),
214
- FacilityContractPricing: require("./src/models/facilityContractPricing"),
215
- FacilityContract: require("./src/models/facilityInvoiceContract"),
216
214
  };
217
215
 
218
216
  // Function to get models dynamically from a specific database connection
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payservedb",
3
- "version": "6.9.4",
3
+ "version": "6.9.6",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -1,4 +1,5 @@
1
1
  const mongoose = require("mongoose");
2
+ const {RecipientSchema} = require("./facilityInvoiceRecipeint")
2
3
 
3
4
  const FacilityInvoiceSchema = new mongoose.Schema(
4
5
  {
@@ -12,7 +13,11 @@ const FacilityInvoiceSchema = new mongoose.Schema(
12
13
  ref: "FacilityInvoiceContract",
13
14
  required: true,
14
15
  },
15
- invoiceNumber: {
16
+ recipient: {
17
+ type: RecipientSchema,
18
+ required: true,
19
+ },
20
+ invoiceNumber: {
16
21
  type: String,
17
22
  required: true,
18
23
  trim: true,
@@ -93,10 +98,6 @@ const FacilityInvoiceSchema = new mongoose.Schema(
93
98
  min: [0, "Tax rate cannot be negative"],
94
99
  default: 0,
95
100
  },
96
- prorate: {
97
- type: Boolean,
98
- default: false,
99
- },
100
101
  reminders: [
101
102
  {
102
103
  frequency: {
@@ -0,0 +1,34 @@
1
+ const mongoose = require("mongoose");
2
+
3
+ const RecipientSchema = new mongoose.Schema(
4
+ {
5
+ facilityId: {
6
+ type: mongoose.Schema.Types.ObjectId,
7
+ ref: "Facility",
8
+ required: true,
9
+ },
10
+ phoneNumber: {
11
+ type: String,
12
+ required: true
13
+ },
14
+ email: {
15
+ type: String,
16
+ required: true,
17
+ lowercase: true,
18
+ trim: true,
19
+ match: [/^\S+@\S+\.\S+$/, "Please enter a valid email address"]
20
+ }
21
+ },
22
+ {
23
+ timestamps: true,
24
+ }
25
+ );
26
+
27
+
28
+ const Recipient = mongoose.model("Recipient", RecipientSchema);
29
+
30
+
31
+ module.exports = {
32
+ RecipientSchema,
33
+ Recipient
34
+ };