Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
lib-py-b2b / financial_status.py
Size: Mime:
from enum import Enum


class FinancialStatus(Enum):
    NONE = ('none', -1)
    PENDING = ('pending', 1)
    AUTHORIZED = ('authorized', 2)
    VOIDED = ('voided', 3)
    PARTIALLY_PAID = ('partially_paid', 4)
    PAID = ('paid', 4)
    PARTIALLY_REFUNDED = ('partially_refunded', 5)
    REFUNDED = ('refunded', 6)

    def __new__(cls, value, rank: int = -1):
        obj = object.__new__(cls)
        obj._value_ = value
        obj.rank = rank
        return obj

    def __ge__(self, other):
        if self.__class__ is other.__class__:
            return self.rank >= other.rank
        return NotImplemented

    def __gt__(self, other):
        if self.__class__ is other.__class__:
            return self.rank > other.rank
        return NotImplemented

    def __le__(self, other):
        if self.__class__ is other.__class__:
            return self.rank <= other.rank
        return NotImplemented

    def __lt__(self, other):
        if self.__class__ is other.__class__:
            return self.rank < other.rank
        return NotImplemented