data-validation-proximity 1.2.8 → 1.3.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.
Files changed (2) hide show
  1. package/index.js +8 -12
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -443,11 +443,9 @@ const variantSchema = joi.object({
443
443
  img: joi.string().min(3),
444
444
  price: joi.number().min(1).max(1000000),
445
445
  quantity: joi.number().min(1).max(1000000),
446
- characterstics: joi.array().items(
447
- joi.object({
448
- name: joi.string().min(3),
449
- value: joi.string(),
450
- })
446
+ characterstics: joi.object().pattern(
447
+ joi.string(),
448
+ joi.string()
451
449
  ),
452
450
  });
453
451
 
@@ -455,11 +453,9 @@ const createVariantSchema = joi.object({
455
453
  price: joi.number().min(1).required(),
456
454
  quantity: joi.number().min(1).required(),
457
455
  img: joi.string().min(3),
458
- characterstics: joi.array().items(
459
- joi.object({
460
- name: joi.string().min(3).required(),
461
- value: joi.string().required(),
462
- })
456
+ characterstics: joi.object().pattern(
457
+ joi.string(),
458
+ joi.string()
463
459
  ),
464
460
  });
465
461
 
@@ -469,7 +465,7 @@ const updateProductSchema = joi.object({
469
465
  price: joi.number().min(1).max(1000000),
470
466
  description: joi.string().min(3).max(800),
471
467
  tags: joi.array().items(joi.string().min(3)),
472
- discount: joi.number().min(0).max(100),
468
+ discount: joi.number().min(0),
473
469
  image: joi.string().min(3),
474
470
  images: joi.array().items(joi.string().min(3)),
475
471
  storeId: joi.string().required(),
@@ -496,7 +492,7 @@ const createProductSchema = joi.object({
496
492
  images: joi.array().items(joi.string().min(3)),
497
493
  tags: joi.array().items(joi.string().min(2)),
498
494
  sellerId: joi.string(),
499
- discount: joi.number().min(1).max(100),
495
+ discount: joi.number().min(0),
500
496
  discountType: joi.string(),
501
497
  discountExpiration: joi.string(),
502
498
  image: joi.string().min(3),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "data-validation-proximity",
3
- "version": "1.2.8",
3
+ "version": "1.3.0",
4
4
  "description": "A library of Joi-based validation middlewares for Express.js",
5
5
  "main": "index.js",
6
6
  "license": "MIT",