Skip to content

domain.enums.provider_category

src.domain.enums.provider_category

Provider category classification.

Defines the type of financial provider (brokerage, bank, credit card, etc.). Used to determine applicable features and entities for each provider.

Reference
  • docs/architecture/provider-domain-model.md

Classes

ProviderCategory

Bases: str, Enum

Financial provider category classification.

Determines the type of financial institution. Different categories have different features - brokerages have holdings, banks have pending transactions, etc.

Examples:

>>> category = ProviderCategory.BROKERAGE
>>> category.value
'brokerage'
Source code in src/domain/enums/provider_category.py
class ProviderCategory(str, Enum):
    """Financial provider category classification.

    Determines the type of financial institution. Different categories
    have different features - brokerages have holdings, banks have
    pending transactions, etc.

    Examples:
        >>> category = ProviderCategory.BROKERAGE
        >>> category.value
        'brokerage'
    """

    BROKERAGE = "brokerage"
    """Brokerage/investment provider (Schwab, Fidelity, TD Ameritrade)."""

    BANK = "bank"
    """Traditional banking provider (Chase, Bank of America, Wells Fargo)."""

    CREDIT_CARD = "credit_card"
    """Credit card provider (American Express, Discover, Capital One)."""

    LOAN = "loan"
    """Loan provider (mortgages, auto loans, personal loans)."""

    CRYPTO = "crypto"
    """Cryptocurrency exchange (Coinbase, Kraken, Binance)."""

    AGGREGATOR = "aggregator"
    """Data aggregator connecting multiple institutions (Plaid, MX, Yodlee)."""

    OTHER = "other"
    """Uncategorized provider type."""

    @classmethod
    def values(cls) -> list[str]:
        """Get all category values as strings.

        Returns:
            List of category string values.
        """
        return [category.value for category in cls]

    @classmethod
    def is_valid(cls, value: str) -> bool:
        """Check if a string is a valid provider category.

        Args:
            value: String to check.

        Returns:
            True if value is a valid category.
        """
        return value in cls.values()

    def supports_holdings(self) -> bool:
        """Check if this category typically supports holdings/positions.

        Returns:
            True if providers of this category have holdings.
        """
        return self in (ProviderCategory.BROKERAGE, ProviderCategory.CRYPTO)
Attributes
BROKERAGE class-attribute instance-attribute
BROKERAGE = 'brokerage'

Brokerage/investment provider (Schwab, Fidelity, TD Ameritrade).

BANK class-attribute instance-attribute
BANK = 'bank'

Traditional banking provider (Chase, Bank of America, Wells Fargo).

CREDIT_CARD class-attribute instance-attribute
CREDIT_CARD = 'credit_card'

Credit card provider (American Express, Discover, Capital One).

LOAN class-attribute instance-attribute
LOAN = 'loan'

Loan provider (mortgages, auto loans, personal loans).

CRYPTO class-attribute instance-attribute
CRYPTO = 'crypto'

Cryptocurrency exchange (Coinbase, Kraken, Binance).

AGGREGATOR class-attribute instance-attribute
AGGREGATOR = 'aggregator'

Data aggregator connecting multiple institutions (Plaid, MX, Yodlee).

OTHER class-attribute instance-attribute
OTHER = 'other'

Uncategorized provider type.

Functions
values classmethod
values() -> list[str]

Get all category values as strings.

Returns:

Type Description
list[str]

List of category string values.

Source code in src/domain/enums/provider_category.py
@classmethod
def values(cls) -> list[str]:
    """Get all category values as strings.

    Returns:
        List of category string values.
    """
    return [category.value for category in cls]
is_valid classmethod
is_valid(value: str) -> bool

Check if a string is a valid provider category.

Parameters:

Name Type Description Default
value str

String to check.

required

Returns:

Type Description
bool

True if value is a valid category.

Source code in src/domain/enums/provider_category.py
@classmethod
def is_valid(cls, value: str) -> bool:
    """Check if a string is a valid provider category.

    Args:
        value: String to check.

    Returns:
        True if value is a valid category.
    """
    return value in cls.values()
supports_holdings
supports_holdings() -> bool

Check if this category typically supports holdings/positions.

Returns:

Type Description
bool

True if providers of this category have holdings.

Source code in src/domain/enums/provider_category.py
def supports_holdings(self) -> bool:
    """Check if this category typically supports holdings/positions.

    Returns:
        True if providers of this category have holdings.
    """
    return self in (ProviderCategory.BROKERAGE, ProviderCategory.CRYPTO)