add - WarehouseAllocationService
This commit is contained in:
@@ -1,5 +1,22 @@
|
||||
from rest_framework.exceptions import APIException
|
||||
from rest_framework import status
|
||||
from rest_framework.exceptions import APIException
|
||||
|
||||
|
||||
class WareHouseException(APIException):
|
||||
status_code = status.HTTP_400_BAD_REQUEST
|
||||
default_detail = "مقدار ورد شده از انبار بیشتر از موجودی انبار میباشد" # noqa
|
||||
default_code = 'error'
|
||||
|
||||
def __init__(self, message=None, code=None, status_code=None):
|
||||
if status_code is not None:
|
||||
self.status_code = status_code
|
||||
|
||||
detail = {
|
||||
"message": message,
|
||||
"status_code": status_code
|
||||
}
|
||||
|
||||
super().__init__(detail)
|
||||
|
||||
|
||||
class InventoryEntryWeightException(APIException):
|
||||
|
||||
Reference in New Issue
Block a user