data-validation-proximity 1.4.1 → 1.4.3

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.
Files changed (2) hide show
  1. package/index.js +22 -8
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -77,7 +77,24 @@ const policySchema = joi
77
77
  delivery: joi
78
78
  .object({
79
79
  enabled: joi.boolean().allow(null),
80
- delivery: joi.boolean().required().allow(null),
80
+ delivery: joi.boolean().allow(null),
81
+ zone: joi
82
+ .object({
83
+ centerPoint: joi
84
+ .object({
85
+ latitude: joi.number().allow(null),
86
+ longitude: joi.number().allow(null),
87
+ })
88
+ .allow(null),
89
+ radius: joi.number().allow(null),
90
+ })
91
+ .allow(null),
92
+ pricing: joi
93
+ .object({
94
+ fixe: joi.number().allow(null),
95
+ km: joi.number().allow(null),
96
+ })
97
+ .allow(null),
81
98
  })
82
99
  .allow(null),
83
100
  reservation: joi
@@ -114,6 +131,7 @@ const policySchema = joi
114
131
  returnMethod: joi.string().allow('').allow(null).required(),
115
132
  refund: joi
116
133
  .object({
134
+ enabled: joi.boolean().allow(null),
117
135
  order: joi
118
136
  .object({
119
137
  fixe: joi.number().allow(null).required(),
@@ -132,12 +150,8 @@ const policySchema = joi
132
150
  .allow(null),
133
151
  order: joi
134
152
  .object({
135
- validation: joi
136
- .object({
137
- auto: joi.boolean().allow(null).required(),
138
- manual: joi.boolean().allow(null).required(),
139
- })
140
- .allow(null),
153
+ enabled: joi.boolean().allow(null),
154
+ autoValidateOrder: joi.boolean().allow(null),
141
155
  notification: joi
142
156
  .object({
143
157
  realtime: joi.boolean().allow(null).required(),
@@ -355,7 +369,7 @@ const updateSchema = joi.object({
355
369
  proximityRange: joi.number().min(0).max(1000),
356
370
  preferredLanguage: joi.string().valid('en', 'fr', 'ar').optional(),
357
371
  currency: joi.string().optional(),
358
- mobilePaymentManager: joi.boolean(),
372
+ mobilePaymentManager: joi.boolean().allow(null).optional(),
359
373
  });
360
374
 
361
375
  exports.updateSchemaValidation = createValidationMiddleware(updateSchema, (req) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "data-validation-proximity",
3
- "version": "1.4.1",
3
+ "version": "1.4.3",
4
4
  "description": "A library of Joi-based validation middlewares for Express.js",
5
5
  "main": "index.js",
6
6
  "license": "MIT",