application.commands.import_commands¶
src.application.commands.import_commands
¶
Import commands for file-based data imports.
Commands for importing financial data from downloaded files (QFX, OFX, CSV). Unlike sync commands which pull from live APIs, these import from local files.
Architecture
- Commands are immutable value objects representing user intent
- Handlers execute the import and return results
- Creates provider connection + accounts + transactions in one operation
Reference
- docs/architecture/cqrs-pattern.md
Classes¶
ImportFromFile
dataclass
¶
Command to import financial data from a file.
Creates a provider connection (if needed) and imports accounts/transactions from the uploaded file. Used for file-based providers like Chase QFX.
Attributes:
| Name | Type | Description |
|---|---|---|
user_id |
UUID
|
User importing the file. |
provider_slug |
str
|
Provider identifier (e.g., "chase_file"). |
file_content |
bytes
|
Raw file bytes. |
file_format |
str
|
File format ("qfx", "ofx", "csv"). |
file_name |
str
|
Original filename (for logging). |
Example
command = ImportFromFile( ... user_id=user.id, ... provider_slug="chase_file", ... file_content=uploaded_file.read(), ... file_format="qfx", ... file_name="Chase_Activity.QFX", ... )