FOSSredder 0.5.0
Loading...
Searching...
No Matches
ui::AnalysisWorkflow Class Reference

Coordinates analysis preview and computation use cases for UI state. More...

#include <AnalysisWorkflow.h>

Inheritance diagram for ui::AnalysisWorkflow:
Collaboration diagram for ui::AnalysisWorkflow:

Public Types

using StateSnapshotProvider

Public Member Functions

 AnalysisWorkflow (StateSnapshotProvider stateSnapshotProvider, std::shared_ptr< ui::adapters::AnalysisAdapter > analysisAdapter, std::shared_ptr< core::ports::diagnostics::IErrorReporter > errorReporter, QObject *parent=nullptr)
 Creates an analysis workflow.
QString analysisFilterSpec (const QString &dateField, const QString &dateMode, const QString &year, const QString &dateFrom, const QString &dateTo, const QStringList &propertyIds, const QStringList &contractTypes, const QString &allocatableMode) const
 Builds a serialized filter specification from UI fields.
QVariantMap analysisAdjustmentAmountsFromPercentText (const QVariantList &transactions, const QStringList &selectedTransactionIds, const QString &percentText) const
 Builds adjustment amounts from selected transactions and percent text.
QVariantMap computeAnalysisPreview (const QString &analysisId, const QString &filterSpec, bool includeAdjustments, const QVariantMap &adjustmentAmounts) const
 Computes the current analysis preview.
QVariantMap previewTransactions (const QString &filterSpec) const
 Builds a transaction preview for the current filter.
QStringList contractTypes () const
 Returns contract types available in the current workspace snapshot.

Detailed Description

Coordinates analysis preview and computation use cases for UI state.

Definition at line 29 of file AnalysisWorkflow.h.

Member Typedef Documentation

◆ StateSnapshotProvider

Constructor & Destructor Documentation

◆ AnalysisWorkflow()

ui::AnalysisWorkflow::AnalysisWorkflow ( StateSnapshotProvider stateSnapshotProvider,
std::shared_ptr< ui::adapters::AnalysisAdapter > analysisAdapter,
std::shared_ptr< core::ports::diagnostics::IErrorReporter > errorReporter,
QObject * parent = nullptr )
explicit

Creates an analysis workflow.

Parameters
stateSnapshotProviderProvider for the current workspace snapshot.
analysisAdapterAdapter used to invoke the core analysis runner.
errorReporterError reporter used for workflow diagnostics.
parentOptional Qt parent.

Definition at line 22 of file AnalysisWorkflow.cpp.

Member Function Documentation

◆ analysisAdjustmentAmountsFromPercentText()

QVariantMap ui::AnalysisWorkflow::analysisAdjustmentAmountsFromPercentText ( const QVariantList & transactions,
const QStringList & selectedTransactionIds,
const QString & percentText ) const

Builds adjustment amounts from selected transactions and percent text.

Parameters
transactionsPreview transaction rows containing id and amount.
selectedTransactionIdsTransaction ids selected for adjustment.
percentTextUser-entered percent text.
Returns
Adjustment amount map keyed by transaction id.

Definition at line 47 of file AnalysisWorkflow.cpp.

◆ analysisFilterSpec()

QString ui::AnalysisWorkflow::analysisFilterSpec ( const QString & dateField,
const QString & dateMode,
const QString & year,
const QString & dateFrom,
const QString & dateTo,
const QStringList & propertyIds,
const QStringList & contractTypes,
const QString & allocatableMode ) const

Builds a serialized filter specification from UI fields.

Parameters
dateFieldSelected date field.
dateModeSelected date mode.
yearSelected year text.
dateFromStart date text.
dateToEnd date text.
propertyIdsSelected property ids.
contractTypesSelected contract types.
allocatableModeSelected allocatable mode.
Returns
Serialized filter specification.

Definition at line 35 of file AnalysisWorkflow.cpp.

Here is the call graph for this function:

◆ computeAnalysisPreview()

QVariantMap ui::AnalysisWorkflow::computeAnalysisPreview ( const QString & analysisId,
const QString & filterSpec,
bool includeAdjustments,
const QVariantMap & adjustmentAmounts ) const

Computes the current analysis preview.

Parameters
analysisIdAnalysis id.
filterSpecSerialized filter specification.
includeAdjustmentsWhether calculation adjustments are included.
adjustmentAmountsAdjustment amount map keyed by transaction id.
Returns
QML analysis result payload.

Definition at line 62 of file AnalysisWorkflow.cpp.

Here is the call graph for this function:

◆ contractTypes()

QStringList ui::AnalysisWorkflow::contractTypes ( ) const

Returns contract types available in the current workspace snapshot.

Returns
Contract type labels.

Definition at line 132 of file AnalysisWorkflow.cpp.

Here is the caller graph for this function:

◆ previewTransactions()

QVariantMap ui::AnalysisWorkflow::previewTransactions ( const QString & filterSpec) const

Builds a transaction preview for the current filter.

Parameters
filterSpecSerialized filter specification.
Returns
QML preview payload.

Definition at line 120 of file AnalysisWorkflow.cpp.

Here is the call graph for this function:

The documentation for this class was generated from the following files: