from helper import ExtendedEnum


class PosValidationErrorsType(ExtendedEnum):
    # 403 messages (ValidationError)
    PosIdNotFound = "PosId not found"
    OrderIsNotInProgress = "Order is not in progress"
    OrderAlreadyInProgress = "There is already an order registered in that PosId"
    OrderIsNotTotaled = "Order is not totaled"
    OrderIsNotInProgressOrTotaled = "Order is not in progress or totaled"
    OperatorIsNotLogged = "Operator is not logged"
    BusinessDayNotOpened = "Business day is not opened"
    PaymentAlreadyExists = "Impossible release shopping cart due to payment made"
    AlreadyHasTender = "Order already has tender"
    OrderNotFound = "Order not found or already canceled"
    CurrentOrderNotFound = "No current order available"
    PaymentAmountInvalid = "Payment amount is invalid"
    PaymentTypeInvalid = "Payment type is invalid"
    KeyPropertyInvalid = "This key property is invalid"
    DueAmountInvalid = "Invalid due amount"
    SaleTypeInvalid = "Sale type not available or invalid"
    ParamsNotFound = "Params not found"
    ScannerNotFound = "Peripheral scanner not found"
    PrinterNotFound = "Peripheral printer not found"
    InvalidProduct = "Invalid product"
    NoCachedCoupons = "No coupons cached, please reload the cache"
    TimeoutApiCoupon = "Time out api coupon"
    CouponInvalid = "Invalid Coupon"
    ApiCouponInvalid = "Invalid API Coupon"
    ExpiredCoupon = "Expired Coupon"
    CouponWeekDayInvalid = "Invalid Coupon for this weekday"
    PosProductUnavailable = "Product not available in this POS"
    AlreadyUsedCoupon = "Coupon has already been used"
    CannotApplyCoupon = "{}"
    SaleItemsInvalid = "Received items invalid or nonexistent"
    ItemTypeComboInvalid = "Cannot multiply an item with 'combo' type"
    InvalidQuantity = "Invalid quantity received"
    FiscalCertificateError = "Error on fiscal certificate"
    EmptyPrinterContent = "Printert content must not be empty"
    InvalidOrderId = "Invalid orderId"
    LanguagesNotFound = "Languages not found"
    PaymentTypesNotFound = "Payment types not found"
    PaymentTypesToShowNotFound = "Without valid Payment Types to show"
    EmptyStoreConfigurationForPos = "Empty store configuration for current POS"
    InvalidTenderId = "Invalid Tender ID"
    ProductInfoNotFound = "There is no product info for this language"
    PropertyRequiredNotFound = "Property {} is required"
    InvalidWorkingMode = "Invalid pos working mode"


class AuthErrorsType(ExtendedEnum):
    # 401 messages (AuthValidation)
    InvalidApiKey = "Invalid API key"


class OperationErrorsType(ExtendedEnum):
    # 500 messages (OperationErrors)
    OperatorLogoutError = "Unable to logout operator"
    OperatorLoginError = "Unable to login operator"
    BusynessDayCloseError = "Unable to close business period"
    BusynessDayOpenError = "Unable to open business period"
    FiscalModifierError = "Error processing fiscal modifier"
    InvalidPaymentResponse = "Invalid response from service"
    UnexpectedPaymentResponse = "Unexpected payment response"
    InvalidPaymentService = "Has no electronic payment service configured for this POS"


class ExternalServicesErrorsType(ExtendedEnum):

    # 503 messages (ExternalServiceErrors)
    MenuDataNotAvailable = "Can't obtain menu data"
    MenuNavigationNotAvailable = "Can not obtain menu navigation"
    UnableToGetStatus = "Unable to get status"
    UnableToGetMenuId = "Unable to get menu id"
    InsertPaymentUnavailable = "Unable to insert payment"
    FiscalizeUnavailable = "Unable to fiscalize order"
    ServiceUnavailable = "Service Temporary Unavailable"
    ElectronicMessageUnavailable = "Cannot send electronic messages"
    ErrorPrinting = "Error printing text to printer: {}"
    LanguageValuesNotFound = "Text for language '{}' not found"
    CannotGetStoreConfigForPos = "Cannot get store config for POS {}"
    CannotGetNavigationForPos = "Cannot get navigation menu for POS {}"
    StoredOrderError = "Error on stored order"


class BadRequestErrorsType(ExtendedEnum):
    # 400 messages (BadRequestErrors)
    InvalidPosId = "Invalid PosId"


class NotFoundErrorsType(ExtendedEnum):
    # 504 messages (# 503 messages (ExternalServiceErrors))
    CustomerNotFound = "Customer not found"
