class LogisticPartnerNotFound(Exception):
    pass


class LogisticSearchError(Exception):
    pass


class LogisticCancelError(Exception):
    pass


class LogisticRequestError(Exception):
    pass


class SaveDeliveryOrderError(Exception):
    pass


class SendLogisticError(Exception):
    pass


class SendOrderToProductionError(Exception):
    pass


class DeliveryCouponPrintError(Exception):
    pass


class NotFoundUserError(Exception):
    pass


class GettingPosVersionException(Exception):
    pass


class BenefitAppliedException(Exception):
    pass


class RemoveBenefitException(Exception):
    pass


class ErrorGettingBenefits(Exception):
    pass


class InvalidTipError(Exception):

    class ErrorCode(object):
        CANNOT_USE_TIP_BY_AMOUNT_AND_PERCENTAGE = 1
        TIP_AMOUNT_MUST_BE_VALID = 2

    def __init__(
        self,       # type: InvalidTipError
        code,       # type: InvalidTipError.ErrorCode
    ):
        # type: (...) -> None
        super(InvalidTipError, self).__init__()

        self.code = code


class UpdateRuptureException(Exception):
    pass


class CleanRuptureException(Exception):
    pass


class ErrorGettingSalesChallenge(Exception):
    pass


class ErrorOnInsertSalesChallenge(Exception):
    pass


class ErrorOnUpdateSalesChallenge(Exception):
    pass


class ErrorOnDeleteSalesChallenge(Exception):
    pass


class DateFormatException(Exception):
    pass


class GettingUserInfoException(Exception):
    pass


class CanceledDialogException(Exception):
    pass


class RequiredDocumentException(Exception):
    pass


class ErrorGettingNFType(Exception):
    pass


class ErrorGettingCertificateExpirationDays(Exception):
    pass


class ErrorApplyingDiscount(Exception):
    def __init__(
        self,        # type: ErrorApplyingDiscount
        error_code,  # type: str
    ):
        # type: (...) -> None

        self.error_code = error_code


class DiscountMinLevelException(Exception):
    def __init__(
        self,
        min_level_required,     # type: int
    ):
        # type: (...) -> None

        self.min_level_required = min_level_required


class GetRuptureItemsException(Exception):
    pass


class MinQuantityException(Exception):
    pass


class MaxQuantityException(Exception):
    pass


class ElectronicPaymentException(Exception):
    pass


class ProductNotExistsException(Exception):
    pass


class MissingTenderParametersException(Exception):
    pass


class RemoteOrderStoreStatusError(Exception):
    pass


class ErrorGettingDevicesData(Exception):
    pass


class ErrorGettingProductData(Exception):
    pass


class ComponentNotFound(Exception):
    def __init__(
        self,
        component,  # type: str
    ):
        # type: (...) -> None

        content = "$COMPONENT_NOT_FOUND|{}".format(component)
        super(ComponentNotFound, self).__init__(content)


class PrinterError(Exception):
    def __init__(self, message):
        super(PrinterError, self).__init__(message)


class ErrorGettingDevice(Exception):
    def __init__(
        self,
        pos_id,             # type: str
        device_type,        # type: str
    ):
        # type: (...) -> None

        self.pos_id = pos_id
        self.device_type = device_type


class CloseOrderByOperatorCloseException(Exception):
    def __init__(
        self,
        service_type,   # type: str
        pos_id,         # type: str
    ):
        # type: (...) -> None

        content = "Operation storing {} order cancelled by operator in POS: {}".format(service_type, pos_id)
        super(CloseOrderByOperatorCloseException, self).__init__(content)


class OrderNotFoundException(Exception):
    def __init__(
        self,           # type: OrderNotFoundException
        error_code,     # type: str
        message,        # type: str
    ):
        # type: (...) -> None

        content = "$ERROR_CODE_INFO|{}|{}".format(
            error_code,
            message,
        )
        super(OrderNotFoundException, self).__init__(content)


class RestartComponentException(Exception):
    def __init__(
        self,
        component,  # type: str
        token,      # type: str
        data,       # type: str
    ):
        # type: (...) -> None

        content = "Error stopping component {0}. {1}: {2}".format(
            component,
            token,
            data,
        )
        super(ComponentNotFound, self).__init__(content)


class SystemUserAccessException(Exception):
    pass
