|
FOSSredder 0.5.0
|
Runs PDF imports and holds the active in-memory statement draft session. More...
#include <ImportWorkflow.h>


Public Types | |
| using | StateSnapshotProvider |
Signals | |
| void | stateChanged () |
| Emitted when import workflow state changed. | |
| void | importFinished () |
| Emitted when an import reached a finished state. | |
| void | importCanceled () |
| Emitted when an import was canceled. | |
| void | importFailed (const QString &error) |
| Emitted when an import failed. | |
Public Member Functions | |
| ImportWorkflow (std::shared_ptr< ui::adapters::ImportAdapter > importAdapter, std::shared_ptr< core::ports::diagnostics::IErrorReporter > errorReporter, StateSnapshotProvider stateSnapshotProvider={}, WorkspaceCommands *commands=nullptr, WorkspaceSelectors *selectors=nullptr, QObject *parent=nullptr) | |
| Creates an import workflow. | |
| ~ImportWorkflow () override | |
| Destroys the workflow and its internal state. | |
| void | setWorkspaceRoles (WorkspaceCommands *commands, WorkspaceSelectors *selectors) |
| Rebinds workspace roles used by the workflow. | |
| bool | isRunning () const noexcept |
| Reports whether an import is running. | |
| bool | isPaused () const noexcept |
| Reports whether the running import is paused. | |
| double | progress () const noexcept |
| Returns import progress. | |
| QString | phase () const |
| Returns the current import phase text. | |
| QString | error () const |
| Returns the current import error text. | |
| QString | selectedFile () const |
| Returns the selected import file. | |
| void | setSelectedFile (const QString &path) |
| Sets the selected import file. | |
| int | queuedCount () const noexcept |
| Returns queued import file count. | |
| QStringList | queuedFiles () const |
| Returns queued import files. | |
| bool | hasDraft () const noexcept |
| Reports whether an active statement draft exists. | |
| QString | currentDraftId () const |
| Returns the active draft id. | |
| int | currentTransactionIndex () const noexcept |
| Returns the selected transaction draft index. | |
| void | setCurrentTransactionIndex (int index) |
| Selects the current transaction draft by index. | |
| int | transactionCount () const noexcept |
| Returns transaction count in the active draft. | |
| QString | currentStatementName () const |
| Returns the editable name of the active statement draft. | |
| void | flushActiveDraftToWorkspace () |
| Saves the active in-memory draft into workspace draft state. | |
| bool | renameCurrentStatementDraft (const QString &name) |
| Renames the active statement draft. | |
| int | insertTransactionAfterCurrent () |
| Inserts a transaction draft after the current one. | |
| int | removeCurrentTransaction () |
| Removes the current transaction draft. | |
| bool | commitCurrentTransactionName (const QString &name) |
| Updates the current transaction draft name. | |
| bool | commitCurrentTransactionBookingDate (const QString &bookingDate) |
| Updates the current transaction draft booking date. | |
| bool | commitCurrentTransactionValuta (const QString &valuta) |
| Updates the current transaction draft valuta date. | |
| bool | setCurrentTransactionStatus (int status) |
| Updates the current transaction draft status. | |
| bool | setCurrentTransactionAllocatable (bool allocatable) |
| Updates the current transaction draft allocatable flag. | |
| bool | applyCurrentTransactionAmountText (const QString &amountText) |
| Applies user-entered amount text to the current transaction draft. | |
| bool | selectCurrentTransactionActor (const QString &actorId) |
| Selects an actor for the current transaction draft. | |
| bool | clearCurrentTransactionActor () |
| Clears the actor selection for the current transaction draft. | |
| bool | setCurrentTransactionPropertySelected (const QString &propertyId, bool selected) |
| Selects or deselects a property for the current transaction draft. | |
| bool | selectCurrentTransactionContract (const QString &contractId) |
| Selects a contract for the current transaction draft. | |
| bool | clearCurrentTransactionContract () |
| Clears the contract selection for the current transaction draft. | |
| bool | createActorForCurrentTransaction (const QString &actorName) |
| Creates or reuses an actor and selects it for the current draft. | |
| bool | createPropertyForCurrentTransaction (const QString &propertyName) |
| Creates or reuses a property and selects it for the current draft. | |
| bool | createOrSelectContractForCurrentTransaction (const QString &contractName, const QString &contractType, const QString &allocatableMode) |
| Creates or reuses a contract and selects it for the current draft. | |
| TransactionDraftView | currentTransactionView () const |
| Builds the QML-facing view of the current transaction draft. | |
| void | pauseActiveDraft () |
| Saves the active draft and returns to the import overview. | |
| void | discardActiveDraft () |
| Discards the active draft and removes its workspace draft state. | |
| void | finalizeActiveDraft () |
| Finalizes the active draft into workspace statement data. | |
| void | removeAttachedImportLog (const QString &logId, bool draftAttached, const QString &draftId) |
| Removes an import log and optionally its attached draft. | |
| void | startStatementImport () |
| Starts importing the selected or next queued statement file. | |
| void | addFiles (const QStringList &paths) |
| Adds files to the import selection or queue. | |
| void | resetStatus () |
| Resets import status fields when no import is running. | |
| void | clearDraft () |
| Clears the active draft and may continue queued imports. | |
| bool | openStoredDraft (const QString &draftId={}) |
| Opens a statement draft stored in workspace state. | |
| void | cancelImport () |
| Cancels the current running import. | |
| void | cancelQueuedImports () |
| Cancels the running import and clears queued imports. | |
| void | pauseImport () |
| Pauses the current running import. | |
| void | resumeImport () |
| Resumes the current paused import. | |
Runs PDF imports and holds the active in-memory statement draft session.
Definition at line 64 of file ImportWorkflow.h.
Definition at line 68 of file ImportWorkflow.h.
|
explicit |
Creates an import workflow.
| importAdapter | Adapter used to invoke the core import runner. |
| errorReporter | Error reporter used for workflow exceptions. |
| stateSnapshotProvider | Provider for the current workspace snapshot. |
| commands | Workspace commands used for draft/log mutations. |
| selectors | Workspace selectors used for log/draft lookups. |
| parent | Optional Qt parent. |
Definition at line 395 of file ImportWorkflow.cpp.
|
overridedefault |
Destroys the workflow and its internal state.

| void ui::ImportWorkflow::addFiles | ( | const QStringList & | paths | ) |
Adds files to the import selection or queue.
| paths | File paths. |
Definition at line 564 of file ImportWorkflow.cpp.


| bool ui::ImportWorkflow::applyCurrentTransactionAmountText | ( | const QString & | amountText | ) |
Applies user-entered amount text to the current transaction draft.
| amountText | Amount text. |
Definition at line 1210 of file ImportWorkflow.cpp.


| void ui::ImportWorkflow::cancelImport | ( | ) |
Cancels the current running import.
Definition at line 731 of file ImportWorkflow.cpp.


| void ui::ImportWorkflow::cancelQueuedImports | ( | ) |
Cancels the running import and clears queued imports.
Definition at line 737 of file ImportWorkflow.cpp.


| bool ui::ImportWorkflow::clearCurrentTransactionActor | ( | ) |
Clears the actor selection for the current transaction draft.
Definition at line 1244 of file ImportWorkflow.cpp.


| bool ui::ImportWorkflow::clearCurrentTransactionContract | ( | ) |
Clears the contract selection for the current transaction draft.
Definition at line 1297 of file ImportWorkflow.cpp.


| void ui::ImportWorkflow::clearDraft | ( | ) |
Clears the active draft and may continue queued imports.
Definition at line 582 of file ImportWorkflow.cpp.


| bool ui::ImportWorkflow::commitCurrentTransactionBookingDate | ( | const QString & | bookingDate | ) |
Updates the current transaction draft booking date.
| bookingDate | Booking date text. |
Definition at line 1180 of file ImportWorkflow.cpp.


| bool ui::ImportWorkflow::commitCurrentTransactionName | ( | const QString & | name | ) |
Updates the current transaction draft name.
| name | Transaction name. |
Definition at line 1173 of file ImportWorkflow.cpp.


| bool ui::ImportWorkflow::commitCurrentTransactionValuta | ( | const QString & | valuta | ) |
Updates the current transaction draft valuta date.
| valuta | Valuta date text. |
Definition at line 1188 of file ImportWorkflow.cpp.


| bool ui::ImportWorkflow::createActorForCurrentTransaction | ( | const QString & | actorName | ) |
Creates or reuses an actor and selects it for the current draft.
| actorName | Actor name. |
Definition at line 1313 of file ImportWorkflow.cpp.


| bool ui::ImportWorkflow::createOrSelectContractForCurrentTransaction | ( | const QString & | contractName, |
| const QString & | contractType, | ||
| const QString & | allocatableMode ) |
Creates or reuses a contract and selects it for the current draft.
Definition at line 1346 of file ImportWorkflow.cpp.


| bool ui::ImportWorkflow::createPropertyForCurrentTransaction | ( | const QString & | propertyName | ) |
Creates or reuses a property and selects it for the current draft.
| propertyName | Property name. |
Definition at line 1329 of file ImportWorkflow.cpp.


| QString ui::ImportWorkflow::currentDraftId | ( | ) | const |
Returns the active draft id.
Definition at line 1073 of file ImportWorkflow.cpp.


| QString ui::ImportWorkflow::currentStatementName | ( | ) | const |
Returns the editable name of the active statement draft.
Definition at line 1078 of file ImportWorkflow.cpp.


|
noexcept |
Returns the selected transaction draft index.
Definition at line 456 of file ImportWorkflow.cpp.

| TransactionDraftView ui::ImportWorkflow::currentTransactionView | ( | ) | const |
Builds the QML-facing view of the current transaction draft.
Definition at line 1385 of file ImportWorkflow.cpp.


| void ui::ImportWorkflow::discardActiveDraft | ( | ) |
Discards the active draft and removes its workspace draft state.
Definition at line 509 of file ImportWorkflow.cpp.


| QString ui::ImportWorkflow::error | ( | ) | const |
Returns the current import error text.
Definition at line 436 of file ImportWorkflow.cpp.

| void ui::ImportWorkflow::finalizeActiveDraft | ( | ) |
Finalizes the active draft into workspace statement data.
Definition at line 522 of file ImportWorkflow.cpp.


| void ui::ImportWorkflow::flushActiveDraftToWorkspace | ( | ) |
Saves the active in-memory draft into workspace draft state.
Definition at line 1422 of file ImportWorkflow.cpp.


|
noexcept |
Reports whether an active statement draft exists.
Definition at line 452 of file ImportWorkflow.cpp.

|
signal |
Emitted when an import was canceled.
|
signal |
Emitted when an import failed.
| error | Error message. |

|
signal |
Emitted when an import reached a finished state.
| int ui::ImportWorkflow::insertTransactionAfterCurrent | ( | ) |
Inserts a transaction draft after the current one.
Definition at line 1123 of file ImportWorkflow.cpp.


|
noexcept |
Reports whether the running import is paused.
Definition at line 424 of file ImportWorkflow.cpp.

|
noexcept |
Reports whether an import is running.
Definition at line 420 of file ImportWorkflow.cpp.
| bool ui::ImportWorkflow::openStoredDraft | ( | const QString & | draftId = {} | ) |
Opens a statement draft stored in workspace state.
| draftId | Draft id; empty selects the remembered or first attached draft. |
Definition at line 982 of file ImportWorkflow.cpp.


| void ui::ImportWorkflow::pauseActiveDraft | ( | ) |
Saves the active draft and returns to the import overview.
Definition at line 498 of file ImportWorkflow.cpp.


| void ui::ImportWorkflow::pauseImport | ( | ) |
Pauses the current running import.
Definition at line 777 of file ImportWorkflow.cpp.


| QString ui::ImportWorkflow::phase | ( | ) | const |
Returns the current import phase text.
Definition at line 432 of file ImportWorkflow.cpp.

|
noexcept |
Returns import progress.
Definition at line 428 of file ImportWorkflow.cpp.

|
noexcept |
Returns queued import file count.
Definition at line 444 of file ImportWorkflow.cpp.

| QStringList ui::ImportWorkflow::queuedFiles | ( | ) | const |
Returns queued import files.
Definition at line 448 of file ImportWorkflow.cpp.

| void ui::ImportWorkflow::removeAttachedImportLog | ( | const QString & | logId, |
| bool | draftAttached, | ||
| const QString & | draftId ) |
Removes an import log and optionally its attached draft.
| logId | Import log id. |
| draftAttached | Whether the log points to a draft. |
| draftId | Attached draft id. |
Definition at line 552 of file ImportWorkflow.cpp.


| int ui::ImportWorkflow::removeCurrentTransaction | ( | ) |
Removes the current transaction draft.
Definition at line 1140 of file ImportWorkflow.cpp.


| bool ui::ImportWorkflow::renameCurrentStatementDraft | ( | const QString & | name | ) |
Renames the active statement draft.
| name | New statement draft name. |
Definition at line 1108 of file ImportWorkflow.cpp.


| void ui::ImportWorkflow::resetStatus | ( | ) |
Resets import status fields when no import is running.
Definition at line 576 of file ImportWorkflow.cpp.


| void ui::ImportWorkflow::resumeImport | ( | ) |
Resumes the current paused import.
Definition at line 781 of file ImportWorkflow.cpp.


| bool ui::ImportWorkflow::selectCurrentTransactionActor | ( | const QString & | actorId | ) |
Selects an actor for the current transaction draft.
| actorId | Actor id. |
Definition at line 1227 of file ImportWorkflow.cpp.


| bool ui::ImportWorkflow::selectCurrentTransactionContract | ( | const QString & | contractId | ) |
Selects a contract for the current transaction draft.
| contractId | Contract id. |
Definition at line 1279 of file ImportWorkflow.cpp.


| QString ui::ImportWorkflow::selectedFile | ( | ) | const |
Returns the selected import file.
Definition at line 440 of file ImportWorkflow.cpp.

| bool ui::ImportWorkflow::setCurrentTransactionAllocatable | ( | bool | allocatable | ) |
Updates the current transaction draft allocatable flag.
| allocatable | Allocatable flag. |
Definition at line 1202 of file ImportWorkflow.cpp.


| void ui::ImportWorkflow::setCurrentTransactionIndex | ( | int | index | ) |
Selects the current transaction draft by index.
| index | Zero-based transaction index. |
Definition at line 1093 of file ImportWorkflow.cpp.


| bool ui::ImportWorkflow::setCurrentTransactionPropertySelected | ( | const QString & | propertyId, |
| bool | selected ) |
Selects or deselects a property for the current transaction draft.
| propertyId | Property id. |
| selected | Whether the property should be selected. |
Definition at line 1260 of file ImportWorkflow.cpp.


| bool ui::ImportWorkflow::setCurrentTransactionStatus | ( | int | status | ) |
Updates the current transaction draft status.
| status | Transaction status. |
Definition at line 1195 of file ImportWorkflow.cpp.


| void ui::ImportWorkflow::setSelectedFile | ( | const QString & | path | ) |
Sets the selected import file.
| path | Import file path. |
Definition at line 570 of file ImportWorkflow.cpp.


| void ui::ImportWorkflow::setWorkspaceRoles | ( | WorkspaceCommands * | commands, |
| WorkspaceSelectors * | selectors ) |
Rebinds workspace roles used by the workflow.
| commands | Workspace commands. |
| selectors | Workspace selectors. |
Definition at line 413 of file ImportWorkflow.cpp.

| void ui::ImportWorkflow::startStatementImport | ( | ) |
Starts importing the selected or next queued statement file.
Definition at line 613 of file ImportWorkflow.cpp.


|
signal |
Emitted when import workflow state changed.

|
noexcept |
Returns transaction count in the active draft.
Definition at line 1062 of file ImportWorkflow.cpp.

