domain.enums.snapshot_source¶
src.domain.enums.snapshot_source
¶
Snapshot source enumeration.
Defines the source/trigger of a balance snapshot capture.
Architecture
- Domain layer enum (no infrastructure dependencies)
- Used in BalanceSnapshot entity to track origin
- Enables analytics by source type
Reference
- docs/architecture/balance-tracking-architecture.md
Usage
from src.domain.enums import SnapshotSource
snapshot = BalanceSnapshot( source=SnapshotSource.MANUAL_SYNC, ... )
Classes¶
SnapshotSource
¶
Bases: StrEnum
Source/trigger of a balance snapshot.
Tracks how/why a balance snapshot was captured. Enables filtering and analytics by capture method.
Values
ACCOUNT_SYNC: Captured during account data sync. HOLDINGS_SYNC: Captured during holdings sync operation. MANUAL_SYNC: User-initiated sync request. SCHEDULED_SYNC: Automated background sync job. INITIAL_CONNECTION: First sync after provider connection.
Example
snapshot.source == SnapshotSource.MANUAL_SYNC True
Source code in src/domain/enums/snapshot_source.py
Attributes¶
ACCOUNT_SYNC
class-attribute
instance-attribute
¶
Captured during account data sync.
HOLDINGS_SYNC
class-attribute
instance-attribute
¶
Captured during holdings sync operation.
MANUAL_SYNC
class-attribute
instance-attribute
¶
User-initiated sync request.
SCHEDULED_SYNC
class-attribute
instance-attribute
¶
Automated background sync job.
INITIAL_CONNECTION
class-attribute
instance-attribute
¶
First sync after provider connection.
Functions¶
is_automated
¶
Check if snapshot was captured automatically.
Returns:
| Type | Description |
|---|---|
bool
|
True if source is automated (scheduled or sync operations). |
Source code in src/domain/enums/snapshot_source.py
is_user_initiated
¶
Check if snapshot was triggered by user action.
Returns:
| Type | Description |
|---|---|
bool
|
True if source is user-initiated. |