application.commands.sync_commands¶
src.application.commands.sync_commands
¶
Sync commands for account and transaction synchronization.
Commands that trigger data synchronization from external providers. These are blocking operations (sync execution, not background job).
Architecture
- Commands are immutable value objects representing user intent
- Handlers execute the sync operation and return results
- Domain events published for audit/observability
Reference
- docs/architecture/cqrs-pattern.md
- docs/architecture/api-design-patterns.md
Classes¶
SyncAccounts
dataclass
¶
Command to sync accounts from a provider connection.
Triggers account data synchronization for all accounts associated with the specified provider connection.
Attributes:
| Name | Type | Description |
|---|---|---|
connection_id |
UUID
|
Provider connection to sync. |
user_id |
UUID
|
Requesting user (for authorization). |
force |
bool
|
Force sync even if recently synced. |
Source code in src/application/commands/sync_commands.py
SyncTransactions
dataclass
¶
Command to sync transactions from a provider connection.
Triggers transaction data synchronization for all accounts associated with the specified provider connection.
Attributes:
| Name | Type | Description |
|---|---|---|
connection_id |
UUID
|
Provider connection to sync. |
user_id |
UUID
|
Requesting user (for authorization). |
start_date |
date | None
|
Sync transactions from this date (default: 30 days ago). |
end_date |
date | None
|
Sync transactions until this date (default: today). |
account_id |
UUID | None
|
Optionally sync only for specific account. |
force |
bool
|
Force sync even if recently synced. |
Source code in src/application/commands/sync_commands.py
SyncHoldings
dataclass
¶
Command to sync holdings (positions) from a provider connection.
Triggers holdings data synchronization for a specific account associated with the specified provider connection.
Attributes:
| Name | Type | Description |
|---|---|---|
account_id |
UUID
|
Account to sync holdings for. |
user_id |
UUID
|
Requesting user (for authorization). |
force |
bool
|
Force sync even if recently synced. |