picker-db 3.7.0 → 3.7.2

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 CHANGED
@@ -228,6 +228,20 @@ module.exports = {
228
228
  TEXT: "RETURNED_TO_PICKUP",
229
229
  },
230
230
  },
231
+ PROOF_OF_DELIVERY: {
232
+ NONE:{
233
+ index: 0,
234
+ text: "NONE",
235
+ } ,
236
+ CODE: {
237
+ index: 1,
238
+ text: "CODE",
239
+ } ,
240
+ PHOTO: {
241
+ index: 2,
242
+ text: "PHOTO",
243
+ }
244
+ },
231
245
  SOCIAL_ACCOUNTS: {
232
246
  FACEBOOK: "facebook",
233
247
  GOOGLE: "google",
@@ -422,5 +436,11 @@ module.exports = {
422
436
  RECOMMENDED_VALUE: "RECOMMENDED_VALUE",
423
437
  CUSTOM_VALUE: "CUSTOM_VALUE",
424
438
  NONE: "NONE",
425
- }
439
+ },
440
+ BOOKING_REQUEST: {
441
+ STATUS: {
442
+ CREATED: "CREATED",
443
+ FAILED: "FAILED",
444
+ },
445
+ },
426
446
  };
@@ -1,3 +1,5 @@
1
+ const { BOOKING_REQUEST } = require("../../../constants");
2
+
1
3
  /** @param {import("mongoose")} connection */
2
4
  module.exports = (connection) => {
3
5
  const BookingRequestSchema = new connection.base.Schema({
@@ -26,6 +28,13 @@ module.exports = (connection) => {
26
28
  type: String,
27
29
  index: true,
28
30
  },
31
+ status: {
32
+ type: String,
33
+ enum: [BOOKING_REQUEST.STATUS.CREATED, BOOKING_REQUEST.STATUS.FAILED],
34
+ },
35
+ errorMessage: {
36
+ type: String,
37
+ },
29
38
  }, { timestamps: true, strict: false });
30
39
 
31
40
  return BookingRequestSchema;
@@ -1,4 +1,4 @@
1
- const { VEHICLE_TYPES, PAYMENT_METHODS, BOOKING_TYPES, BOOKING_STATUS, DELIVERY_CHARGE_TYPE } = require("../../../constants");
1
+ const { VEHICLE_TYPES, PAYMENT_METHODS, BOOKING_TYPES, BOOKING_STATUS, DELIVERY_CHARGE_TYPE, PROOF_OF_DELIVERY } = require("../../../constants");
2
2
  const { DEVICE_TYPES } = require("../../../constants").USER;
3
3
 
4
4
  const PricingDetailsSchema = require("./pricingDetails");
@@ -699,7 +699,67 @@ module.exports = (connection) => {
699
699
  usedGoogleAddress: {
700
700
  type: String,
701
701
  default: false
702
- }
702
+ },
703
+ currency: {
704
+ type: String,
705
+ default: "USD"
706
+ },
707
+ lastResponsableAction: {
708
+ type: String,
709
+ },
710
+ timeOnBatch: {
711
+ type: Number,
712
+ },
713
+ externalBookingId: {
714
+ type: String,
715
+ index: true,
716
+ },
717
+ userBookingCreator: {
718
+ type: String,
719
+ },
720
+ isActiveOnBatch: {
721
+ type: Boolean,
722
+ default: true,
723
+ },
724
+ isProofOfDeliveryApproved: {
725
+ type: Boolean,
726
+ default: false,
727
+ },
728
+ proofValidationCode: {
729
+ type: String,
730
+ },
731
+ proofOfDeliveryType: {
732
+ type: String,
733
+ enum: [
734
+ PROOF_OF_DELIVERY.CODE.text,
735
+ PROOF_OF_DELIVERY.NONE.text,
736
+ PROOF_OF_DELIVERY.PHOTO.text,
737
+ ],
738
+ default: PROOF_OF_DELIVERY.NONE.text,
739
+ },
740
+ wasManuallyRequested: {
741
+ type: Boolean,
742
+ default: false,
743
+ },
744
+ manualRequestReason: {
745
+ type: String,
746
+ },
747
+ wasManuallyAssigned: {
748
+ type: Boolean,
749
+ default: false,
750
+ },
751
+ manualAssignReason: {
752
+ type: String,
753
+ },
754
+ notDeliveredReason: {
755
+ type: String,
756
+ },
757
+ cancelReasonByBusiness: {
758
+ type: String
759
+ },
760
+ cancelReasonByAdmin: {
761
+ type: String
762
+ },
703
763
  }, { timestamps: true });
704
764
 
705
765
  BookingSchema.pre("save", function (next) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "picker-db",
3
- "version": "3.7.0",
3
+ "version": "3.7.2",
4
4
  "description": "Picker DB services",
5
5
  "main": "index.js",
6
6
  "scripts": {