payservedb 7.0.3 → 7.0.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 CHANGED
@@ -211,7 +211,7 @@ const models = {
211
211
  CoreInvoiceSettings: require("./src/models/coreInvoiceSettings"),
212
212
  FacilityInvoice: require("./src/models/facilityInvoice"),
213
213
  CoreBaseSettings: require("./src/models/coreBaseSettings"),
214
- RecipientSchema: require("./src/models/facilityInvoicerecipientMD")
214
+ Recipient: require("./src/models/facilityInvoiceRecipient")
215
215
  };
216
216
 
217
217
  // 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": "7.0.3",
3
+ "version": "7.0.4",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -1,5 +1,5 @@
1
1
  const mongoose = require("mongoose");
2
- const {Recipient} = require("./facilityInvoiceRecipient")
2
+ const {RecipientSchema} = require("./facilityInvoiceRecipient")
3
3
 
4
4
  const FacilityInvoiceSchema = new mongoose.Schema(
5
5
  {
@@ -14,7 +14,7 @@ const FacilityInvoiceSchema = new mongoose.Schema(
14
14
  required: true,
15
15
  },
16
16
  recipient: {
17
- type: Recipient,
17
+ type: RecipientSchema,
18
18
  required: true,
19
19
  },
20
20
  invoiceNumber: {
@@ -1,6 +1,6 @@
1
1
  const mongoose = require("mongoose");
2
2
 
3
- const Recipient = new mongoose.Schema(
3
+ const RecipientSchema = new mongoose.Schema(
4
4
  {
5
5
  facilityId: {
6
6
  type: mongoose.Schema.Types.ObjectId,
@@ -25,7 +25,12 @@ const Recipient = new mongoose.Schema(
25
25
  );
26
26
 
27
27
 
28
+ const Recipient = mongoose.model("Recipient", RecipientSchema);
29
+
30
+
31
+ module.exports = Recipient
32
+
28
33
 
29
34
  module.exports = {
30
- Recipient
31
- };
35
+ RecipientSchema
36
+ }
@@ -1,33 +0,0 @@
1
- const mongoose = require("mongoose");
2
-
3
- const Recipient = 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 RecipientSchema = mongoose.model("RecipientSchema", Recipient);
29
-
30
-
31
- module.exports = {
32
- RecipientSchema,
33
- };