Skip to content

Commit

Permalink
add code for INVALID_UNITY
Browse files Browse the repository at this point in the history
  • Loading branch information
zuk3975 committed Nov 24, 2020
1 parent 6fd939b commit 4044553
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/Adapter/Product/Validate/ProductValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ private function validatePrices(Product $product): void
}

$this->validateProductProperty($product, 'price', ProductConstraintException::INVALID_PRICE);
$this->validateProductProperty($product, 'unity');
$this->validateProductProperty($product, 'unity', ProductConstraintException::INVALID_UNITY);
$this->validateProductProperty($product, 'ecotax', ProductConstraintException::INVALID_ECOTAX);
$this->validateProductProperty($product, 'wholesale_price', ProductConstraintException::INVALID_WHOLESALE_PRICE);
}
Expand Down
65 changes: 35 additions & 30 deletions src/Core/Domain/Product/Exception/ProductConstraintException.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,153 +66,158 @@ class ProductConstraintException extends ProductException
*/
const INVALID_PRICE = 70;

/**
* When invalid product unity value is supplied
*/
const INVALID_UNITY = 80;

/**
* When invalid product ecotax is supplied
*/
const INVALID_ECOTAX = 80;
const INVALID_ECOTAX = 90;

/**
* When invalid product unit price is supplied
*/
const INVALID_UNIT_PRICE = 90;
const INVALID_UNIT_PRICE = 100;

/**
* When invalid product wholesale_price is supplied
*/
const INVALID_WHOLESALE_PRICE = 100;
const INVALID_WHOLESALE_PRICE = 110;

/**
* When product visibility value is invalid
*/
const INVALID_VISIBILITY = 110;
const INVALID_VISIBILITY = 120;

/**
* When product Ean13 code value is invalid
*/
const INVALID_EAN_13 = 120;
const INVALID_EAN_13 = 130;

/**
* When product ISBN code value is invalid
*/
const INVALID_ISBN = 130;
const INVALID_ISBN = 140;

/**
* When product mpn code value is invalid
*/
const INVALID_MPN = 140;
const INVALID_MPN = 150;

/**
* When product upc code value is invalid
*/
const INVALID_UPC = 150;
const INVALID_UPC = 160;

/**
* When product reference value is invalid
*/
const INVALID_REFERENCE = 160;
const INVALID_REFERENCE = 170;

/**
* When product tag value is invalid
*/
const INVALID_TAG = 170;
const INVALID_TAG = 180;

/**
* When product additional time notes type is invalid
*/
const INVALID_ADDITIONAL_TIME_NOTES_TYPE = 180;
const INVALID_ADDITIONAL_TIME_NOTES_TYPE = 190;

/**
* When product width is invalid
*/
const INVALID_WIDTH = 190;
const INVALID_WIDTH = 200;

/**
* When product height is invalid
*/
const INVALID_HEIGHT = 200;
const INVALID_HEIGHT = 210;

/**
* When product depth is invalid
*/
const INVALID_DEPTH = 210;
const INVALID_DEPTH = 220;

/**
* When product weight is invalid
*/
const INVALID_WEIGHT = 220;
const INVALID_WEIGHT = 230;

/**
* When product additional shipping cost is invalid
*/
const INVALID_ADDITIONAL_SHIPPING_COST = 230;
const INVALID_ADDITIONAL_SHIPPING_COST = 240;

/**
* When product delivery time in stock notes are invalid
*/
const INVALID_DELIVERY_TIME_IN_STOCK_NOTES = 240;
const INVALID_DELIVERY_TIME_IN_STOCK_NOTES = 250;

/**
* When product delivery time out of stock notes are invalid
*/
const INVALID_DELIVERY_TIME_OUT_OF_STOCK_NOTES = 250;
const INVALID_DELIVERY_TIME_OUT_OF_STOCK_NOTES = 260;

/**
* When product redirect type is invalid
*/
const INVALID_REDIRECT_TYPE = 260;
const INVALID_REDIRECT_TYPE = 270;

/**
* When product redirect target
*/
const INVALID_REDIRECT_TARGET = 270;
const INVALID_REDIRECT_TARGET = 280;

/**
* When product meta description is invalid
*/
const INVALID_META_DESCRIPTION = 280;
const INVALID_META_DESCRIPTION = 290;

/**
* When product meta title is invalid
*/
const INVALID_META_TITLE = 290;
const INVALID_META_TITLE = 300;

/**
* When product link rewrite is invalid
*/
const INVALID_LINK_REWRITE = 300;
const INVALID_LINK_REWRITE = 310;

/**
* When product minimal quantity is invalid
*/
const INVALID_MINIMAL_QUANTITY = 310;
const INVALID_MINIMAL_QUANTITY = 320;

/**
* When product location is invalid
*/
const INVALID_LOCATION = 320;
const INVALID_LOCATION = 330;

/**
* When product available later labels are invalid
*/
const INVALID_AVAILABLE_LATER = 330;
const INVALID_AVAILABLE_LATER = 340;

/**
* When product available now labels are is invalid
*/
const INVALID_AVAILABLE_NOW = 340;
const INVALID_AVAILABLE_NOW = 350;

/**
* When product available date is invalid
*/
const INVALID_AVAILABLE_DATE = 350;
const INVALID_AVAILABLE_DATE = 360;

/**
* When product low stock alert is invalid
*/
const INVALID_LOW_STOCK_ALERT = 360;
const INVALID_LOW_STOCK_ALERT = 370;

/**
* When product low stock threshold is invalid
*/
const INVALID_LOW_STOCK_THRESHOLD = 370;
const INVALID_LOW_STOCK_THRESHOLD = 380;
}

0 comments on commit 4044553

Please sign in to comment.