picker-db 4.7.0 → 4.8.0
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.
|
@@ -24,6 +24,7 @@ const BookingRequestSchema = require("../schemas/bookingRequest");
|
|
|
24
24
|
const BookingLiteSchema = require("../schemas/bookingsLite");
|
|
25
25
|
const MiniBookingSchema = require("../schemas/miniBooking");
|
|
26
26
|
const BookingDriverDetailsSchema = require("../schemas/bookingDriverDetails");
|
|
27
|
+
const ConversationSchema = require("../schemas/conversation");
|
|
27
28
|
|
|
28
29
|
/** @param {import("mongoose")} connection */
|
|
29
30
|
module.exports = (connection) => {
|
|
@@ -54,5 +55,6 @@ module.exports = (connection) => {
|
|
|
54
55
|
Review: connection.model("Review", ReviewSchema(connection)),
|
|
55
56
|
MiniBooking: connection.model("MiniBooking", MiniBookingSchema(connection)),
|
|
56
57
|
BookingDriverDetails: connection.model("BookingDriverDetails", BookingDriverDetailsSchema(connection)),
|
|
58
|
+
Conversation: connection.model("Conversation", ConversationSchema(connection)),
|
|
57
59
|
};
|
|
58
60
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** @param {import("mongoose")} connection */
|
|
2
|
+
module.exports = (connection) => {
|
|
3
|
+
const ConversationSchema = new connection.base.Schema({
|
|
4
|
+
bookingID: {
|
|
5
|
+
type: connection.base.Schema.ObjectId,
|
|
6
|
+
required: true,
|
|
7
|
+
index: true,
|
|
8
|
+
},
|
|
9
|
+
status: {
|
|
10
|
+
type: String,
|
|
11
|
+
enum: ["PENDING", "ACTIVE"],
|
|
12
|
+
default: "PENDING",
|
|
13
|
+
required: true,
|
|
14
|
+
index: true,
|
|
15
|
+
},
|
|
16
|
+
}, { timestamps: true });
|
|
17
|
+
|
|
18
|
+
return ConversationSchema;
|
|
19
|
+
};
|