payservedb 6.9.5 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payservedb",
3
- "version": "6.9.5",
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
+ };