picker-db 4.3.4 → 4.3.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/constants.js +6 -0
- package/modules/picker/schemas/bookings.js +25 -22
- package/package.json +1 -1
package/constants.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const { VEHICLE_TYPES, PAYMENT_METHODS, BOOKING_TYPES, BOOKING_STATUS, DELIVERY_CHARGE_TYPE, PROOF_OF_DELIVERY } = require("../../../constants");
|
|
1
|
+
const { VEHICLE_TYPES, PAYMENT_METHODS, BOOKING_TYPES, BOOKING_STATUS, DELIVERY_CHARGE_TYPE, PROOF_OF_DELIVERY, PNF_REASON } = require("../../../constants");
|
|
2
2
|
const { DEVICE_TYPES } = require("../../../constants").USER;
|
|
3
3
|
|
|
4
4
|
const PricingDetailsSchema = require("./pricingDetails");
|
|
@@ -120,12 +120,12 @@ module.exports = (connection) => {
|
|
|
120
120
|
},
|
|
121
121
|
driverLocation: {
|
|
122
122
|
lat: {
|
|
123
|
-
type: Number
|
|
123
|
+
type: Number,
|
|
124
124
|
},
|
|
125
125
|
lng: {
|
|
126
|
-
type: Number
|
|
127
|
-
}
|
|
128
|
-
}
|
|
126
|
+
type: Number,
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
129
|
}, { _id: false });
|
|
130
130
|
// #endregion Internal Schemas
|
|
131
131
|
|
|
@@ -565,7 +565,6 @@ module.exports = (connection) => {
|
|
|
565
565
|
min: 0,
|
|
566
566
|
default: 0,
|
|
567
567
|
},
|
|
568
|
-
providerFeeNoMarkup: { type: Number, min: 0 },
|
|
569
568
|
restartPenaltyFee: { type: Number, default: 0 },
|
|
570
569
|
productValue: { type: Number, default: 0 },
|
|
571
570
|
},
|
|
@@ -742,6 +741,7 @@ module.exports = (connection) => {
|
|
|
742
741
|
min: 0,
|
|
743
742
|
}, // In milliseconds
|
|
744
743
|
isActive: {
|
|
744
|
+
index: true,
|
|
745
745
|
type: Boolean,
|
|
746
746
|
default: true,
|
|
747
747
|
},
|
|
@@ -760,11 +760,11 @@ module.exports = (connection) => {
|
|
|
760
760
|
},
|
|
761
761
|
usedGoogleAddress: {
|
|
762
762
|
type: String,
|
|
763
|
-
default: false
|
|
763
|
+
default: false,
|
|
764
764
|
},
|
|
765
|
-
currency: {
|
|
766
|
-
type: String,
|
|
767
|
-
default: "USD"
|
|
765
|
+
currency: {
|
|
766
|
+
type: String,
|
|
767
|
+
default: "USD",
|
|
768
768
|
},
|
|
769
769
|
lastResponsableAction: {
|
|
770
770
|
type: String,
|
|
@@ -820,24 +820,18 @@ module.exports = (connection) => {
|
|
|
820
820
|
notDeliveredReason: {
|
|
821
821
|
type: String,
|
|
822
822
|
},
|
|
823
|
-
cancelReasonByBusiness: {
|
|
824
|
-
type: String
|
|
825
|
-
},
|
|
826
|
-
cancelReasonByAdmin: {
|
|
827
|
-
type: String
|
|
828
|
-
},
|
|
829
823
|
tipBusiness: {
|
|
830
|
-
type: Number
|
|
824
|
+
type: Number,
|
|
831
825
|
},
|
|
832
826
|
onlyMyFleet: {
|
|
833
827
|
type: Boolean,
|
|
834
828
|
default: false,
|
|
835
829
|
},
|
|
836
830
|
review: {
|
|
837
|
-
type: String
|
|
831
|
+
type: String,
|
|
838
832
|
},
|
|
839
833
|
rating: {
|
|
840
|
-
type: Number
|
|
834
|
+
type: Number,
|
|
841
835
|
},
|
|
842
836
|
isWithHack: { type: Boolean, index: true, sparse: true },
|
|
843
837
|
// REASIGNMENT COUNTERS
|
|
@@ -885,7 +879,7 @@ module.exports = (connection) => {
|
|
|
885
879
|
type: String,
|
|
886
880
|
},
|
|
887
881
|
scrapperFail: {
|
|
888
|
-
type: Boolean
|
|
882
|
+
type: Boolean,
|
|
889
883
|
},
|
|
890
884
|
usesCustomerSupportLink: {
|
|
891
885
|
type: Boolean,
|
|
@@ -896,7 +890,16 @@ module.exports = (connection) => {
|
|
|
896
890
|
publicBookingToken: { type: String, sparse: true, unique: true, index: true },
|
|
897
891
|
certificateDriverPhone: {
|
|
898
892
|
type: Boolean,
|
|
899
|
-
default: false
|
|
893
|
+
default: false,
|
|
894
|
+
},
|
|
895
|
+
pnfReason: {
|
|
896
|
+
type: String,
|
|
897
|
+
enum: [
|
|
898
|
+
PNF_REASON.NO_COVERAGE,
|
|
899
|
+
PNF_REASON.DRIVERS_BUSY,
|
|
900
|
+
PNF_REASON.INVALID_DATA,
|
|
901
|
+
PNF_REASON.PROVIDER_ERROR,
|
|
902
|
+
],
|
|
900
903
|
},
|
|
901
904
|
}, { timestamps: true });
|
|
902
905
|
|
|
@@ -905,7 +908,7 @@ module.exports = (connection) => {
|
|
|
905
908
|
return next();
|
|
906
909
|
}
|
|
907
910
|
const doc = this;
|
|
908
|
-
|
|
911
|
+
|
|
909
912
|
if (!doc.bookingNumericId) {
|
|
910
913
|
try {
|
|
911
914
|
const query = { model: "Bookings" };
|