domain.enums.account_type¶
src.domain.enums.account_type
¶
Financial account type classification.
Defines account types across four categories: investment, banking, credit, and other. Used to classify accounts from financial providers and determine appropriate handling for each type.
Categories
Investment: Brokerage, IRA, 401k, HSA - accounts that hold securities Banking: Checking, savings, CD - traditional deposit accounts Credit: Credit cards, lines of credit - revolving credit accounts Other: Loans, mortgages, uncategorized
Reference
- docs/architecture/account-domain-model.md
Usage
from src.domain.enums import AccountType
if account_type in AccountType.investment_types(): # Handle investment account
Classes¶
AccountType
¶
Bases: str, Enum
Financial account type classification.
Inherits from str for easy serialization and database storage. Values are lowercase for consistency across the system.
Categories
Investment: Securities, trading, retirement accounts Banking: Checking, savings, money market accounts Credit: Credit cards, lines of credit Other: Loans, mortgages, specialized accounts
Example
account_type = AccountType.BROKERAGE account_type.value 'brokerage' account_type in AccountType.investment_types() True
Source code in src/domain/enums/account_type.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 | |
Attributes¶
BROKERAGE
class-attribute
instance-attribute
¶
General brokerage/trading account.
Standard taxable investment account for buying and selling securities. No special tax treatment.
IRA
class-attribute
instance-attribute
¶
Traditional Individual Retirement Account.
Tax-deferred retirement account. Contributions may be tax-deductible, withdrawals taxed as ordinary income.
ROTH_IRA
class-attribute
instance-attribute
¶
Roth Individual Retirement Account.
After-tax contributions, tax-free qualified withdrawals. Subject to income limits and contribution limits.
RETIREMENT_401K
class-attribute
instance-attribute
¶
Employer-sponsored 401(k) retirement account.
Tax-deferred contributions from payroll. May include employer match. Early withdrawal penalties apply before age 59½.
RETIREMENT_403B
class-attribute
instance-attribute
¶
403(b) retirement account for nonprofits.
Similar to 401(k) but for employees of public schools, tax-exempt organizations, and certain ministers.
HSA
class-attribute
instance-attribute
¶
Health Savings Account.
Triple tax-advantaged account for qualified medical expenses. Requires enrollment in high-deductible health plan. Can be invested and used for retirement after age 65.
CHECKING
class-attribute
instance-attribute
¶
Checking/current account.
Transactional account for everyday banking. Typically offers unlimited deposits and withdrawals.
SAVINGS
class-attribute
instance-attribute
¶
Savings account.
Deposit account for saving money with interest. May have withdrawal limits under Regulation D.
MONEY_MARKET
class-attribute
instance-attribute
¶
Money market account.
Higher interest savings account with check-writing capabilities. Often requires higher minimum balance.
CD
class-attribute
instance-attribute
¶
Certificate of Deposit.
Time deposit with fixed term and fixed interest rate. Early withdrawal penalties typically apply.
CREDIT_CARD
class-attribute
instance-attribute
¶
Credit card account.
Revolving credit with monthly billing cycle. Has credit limit and may incur interest on balances.
LINE_OF_CREDIT
class-attribute
instance-attribute
¶
Line of credit account.
Revolving credit facility with draw period. Interest charged only on amount borrowed.
LOAN
class-attribute
instance-attribute
¶
Loan account.
Installment loan with fixed repayment schedule. Examples: personal loan, auto loan, student loan.
MORTGAGE
class-attribute
instance-attribute
¶
Mortgage account.
Real estate loan secured by property. Long-term installment loan (15-30 years typical).
OTHER
class-attribute
instance-attribute
¶
Uncategorized account type.
Fallback for account types not fitting other categories. Used when provider returns unknown account type.
category
property
¶
Get the category for this account type.
Returns:
| Type | Description |
|---|---|
str
|
Category string: "investment", "banking", "credit", or "other". |
Example
AccountType.BROKERAGE.category 'investment' AccountType.CHECKING.category 'banking'
Functions¶
values
classmethod
¶
Get all account type values as strings.
Returns:
| Type | Description |
|---|---|
list[str]
|
List of account type string values. |
Example
AccountType.values() ['brokerage', 'ira', 'roth_ira', ...]
Source code in src/domain/enums/account_type.py
is_valid
classmethod
¶
Check if a string is a valid account type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
str
|
String to check. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if value is a valid account type. |
Example
AccountType.is_valid("brokerage") True AccountType.is_valid("invalid") False
Source code in src/domain/enums/account_type.py
investment_types
classmethod
¶
Get account types that hold securities.
Investment accounts can hold stocks, bonds, mutual funds, ETFs, and other securities. These accounts may have special tax treatment.
Returns:
| Type | Description |
|---|---|
list[AccountType]
|
List of investment account types. |
Example
AccountType.BROKERAGE in AccountType.investment_types() True
Source code in src/domain/enums/account_type.py
bank_types
classmethod
¶
Get traditional banking account types.
Bank accounts are deposit accounts held at financial institutions. They are FDIC insured up to limits.
Returns:
| Type | Description |
|---|---|
list[AccountType]
|
List of banking account types. |
Example
AccountType.CHECKING in AccountType.bank_types() True
Source code in src/domain/enums/account_type.py
retirement_types
classmethod
¶
Get retirement/tax-advantaged account types.
These accounts have special tax treatment and are designed for long-term retirement savings.
Returns:
| Type | Description |
|---|---|
list[AccountType]
|
List of retirement account types. |
Example
AccountType.IRA in AccountType.retirement_types() True
Source code in src/domain/enums/account_type.py
credit_types
classmethod
¶
Get credit and loan account types.
Credit accounts represent money owed. Balance is typically shown as negative or as amount owed.
Returns:
| Type | Description |
|---|---|
list[AccountType]
|
List of credit account types. |
Example
AccountType.CREDIT_CARD in AccountType.credit_types() True
Source code in src/domain/enums/account_type.py
is_investment
¶
Check if this account type is an investment account.
Returns:
| Type | Description |
|---|---|
bool
|
True if this is an investment account type. |
Example
AccountType.BROKERAGE.is_investment() True AccountType.CHECKING.is_investment() False
Source code in src/domain/enums/account_type.py
is_bank
¶
Check if this account type is a banking account.
Returns:
| Type | Description |
|---|---|
bool
|
True if this is a banking account type. |
Example
AccountType.CHECKING.is_bank() True AccountType.BROKERAGE.is_bank() False
Source code in src/domain/enums/account_type.py
is_retirement
¶
Check if this account type is a retirement account.
Returns:
| Type | Description |
|---|---|
bool
|
True if this is a retirement account type. |
Example
AccountType.IRA.is_retirement() True AccountType.BROKERAGE.is_retirement() False
Source code in src/domain/enums/account_type.py
is_credit
¶
Check if this account type is a credit account.
Returns:
| Type | Description |
|---|---|
bool
|
True if this is a credit account type. |
Example
AccountType.CREDIT_CARD.is_credit() True AccountType.CHECKING.is_credit() False