picker-db 5.0.19 → 5.0.21

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/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## v5.0.19
6
+ ### Added
7
+ * DP-15057: Added `searchType` field to Mini Booking schema with enum `ON_DEMAND | EXPRESS | GROUND` (default `ON_DEMAND`, indexed). Backbone for Ground Delivery epic.
8
+ * DP-15057: Added `weight` field to Mini Booking schema (Number, min: 0) for Ground Delivery package weight in pounds (LB).
9
+ * DP-15057: Added `volume` field to Mini Booking schema (String, enum `XSMALL|SMALL|MEDIUM|LARGE|XLARGE`) for Ground Delivery package size category.
10
+ * Added `BOOKING.SEARCH_TYPES` constant.
11
+
5
12
  ## v5.0.18
6
13
  ### Added
7
14
  * DP-14557: Added `externalStoreID` field to Booking and User schemas (String, default `null`) so the store's external identifier can be snapshotted onto bookings.
package/constants.js CHANGED
@@ -241,18 +241,18 @@ module.exports = {
241
241
  },
242
242
  },
243
243
  PROOF_OF_DELIVERY: {
244
- NONE:{
244
+ NONE: {
245
245
  index: 0,
246
246
  text: "NONE",
247
- } ,
247
+ },
248
248
  CODE: {
249
249
  index: 1,
250
250
  text: "CODE",
251
- } ,
251
+ },
252
252
  PHOTO: {
253
253
  index: 2,
254
254
  text: "PHOTO",
255
- }
255
+ },
256
256
  },
257
257
  SOCIAL_ACCOUNTS: {
258
258
  FACEBOOK: "facebook",
@@ -459,7 +459,7 @@ module.exports = {
459
459
  NO_COVERAGE: "NO_COVERAGE",
460
460
  DRIVERS_BUSY: "DRIVERS_BUSY",
461
461
  INVALID_DATA: "INVALID_DATA",
462
- PROVIDER_ERROR: "PROVIDER_ERROR"
462
+ PROVIDER_ERROR: "PROVIDER_ERROR",
463
463
  },
464
464
  BOOKING: {
465
465
  BOOKING_STOP_TYPES: {
@@ -1,4 +1,4 @@
1
- const { PNF_REASON } = require("../../../constants");
1
+ const { PNF_REASON, BOOKING } = require("../../../constants");
2
2
 
3
3
  /** @param {import("mongoose")} connection */
4
4
  module.exports = (connection) => {
@@ -14,14 +14,13 @@ module.exports = (connection) => {
14
14
  deliveryAddress: { type: String },
15
15
  businessName: { type: String },
16
16
  workspaceID: { type: connection.base.Schema.ObjectId, index: true, required: true },
17
- businessID: { type: connection.base.Schema.ObjectId, index: true, required: true },
17
+ businessID: { type: connection.base.Schema.ObjectId, index: true, required: true },
18
18
  externalBookingId: { type: String },
19
19
  elapsedTime: { type: Number },
20
20
  paymentMethod: { type: String },
21
21
  carName: { type: String },
22
22
  requiresProofOfDelivery: { type: Boolean },
23
23
  deliveryCertification: { type: Boolean },
24
- externalBookingId: { type: String },
25
24
  pnfReason: {
26
25
  type: String,
27
26
  enum: [
@@ -56,6 +55,30 @@ module.exports = (connection) => {
56
55
  type: String,
57
56
  required: false,
58
57
  },
58
+ searchType: {
59
+ type: String,
60
+ enum: [
61
+ BOOKING.SEARCH_TYPES.ON_DEMAND,
62
+ BOOKING.SEARCH_TYPES.EXPRESS,
63
+ BOOKING.SEARCH_TYPES.GROUND,
64
+ ],
65
+ default: BOOKING.SEARCH_TYPES.ON_DEMAND,
66
+ index: true,
67
+ },
68
+ weight: {
69
+ type: Number,
70
+ min: 0,
71
+ },
72
+ volume: {
73
+ type: String,
74
+ enum: [
75
+ BOOKING.VOLUMES.XSMALL,
76
+ BOOKING.VOLUMES.SMALL,
77
+ BOOKING.VOLUMES.MEDIUM,
78
+ BOOKING.VOLUMES.LARGE,
79
+ BOOKING.VOLUMES.XLARGE,
80
+ ],
81
+ },
59
82
  }, { timestamps: false });
60
83
 
61
84
  return MiniBookingSchema;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "picker-db",
3
- "version": "5.0.19",
3
+ "version": "5.0.21",
4
4
  "description": "Picker DB services",
5
5
  "main": "index.js",
6
6
  "scripts": {