11#include <QVariantList>
13#include <qqmlintegration.h>
137 void setName(
const QString& value);
144 return mainTypeIndex_;
158 return plotSubtypeIndex_;
196 return includeAdjustments_;
210 return filterEditMode_;
224 return filterContentIndex_;
232 return dateFieldIndex_;
246 return dateModeIndex_;
274 return dateFromValue_;
302 return propertyFilterRows_;
310 return contractTypeRows_;
318 return selectedPropertyIds_;
332 return selectedContractTypes_;
346 return allocatableMode_;
384 return selectedAdjustmentTxIds_;
398 return adjustmentName_;
412 return adjustmentPercentText_;
432 return renderedPreviewSource_;
440 return tableContractTypes_;
448 return tablePropertyRows_;
456 return tableGrandTotal_;
558 Q_INVOKABLE
void navigate(
int delta);
585 QVariantMap analysisRowById(
const QString&
id)
const;
590 QString uiType()
const;
595 QString strategyType()
const;
600 QString currentDateField()
const;
605 QString currentDateMode()
const;
610 QString defaultAnalysisDateMode()
const;
615 QString defaultAnalysisYear()
const;
621 QStringList stringList(
const QVariantList& values)
const;
626 QVariantList allPropertyIds()
const;
631 QVariantList allContractTypes()
const;
639 QVariantList pruneSelection(
const QVariantList& values,
640 const QVariantList& availableRows,
641 const QString& idField = {})
const;
649 bool isAllSelected(
const QVariantList& selectedIds,
650 const QVariantList& availableRows,
651 const QString& idField = {})
const;
656 QStringList effectiveSelectedPropertyIds()
const;
662 QStringList effectiveSelectedContractTypes()
const;
667 QString currentFilterSpec()
const;
672 QVariantMap currentAnalysisConfig()
const;
677 QVariantMap currentAnalysisFilter()
const;
684 QString normalizedExportFormat(
const QString& value,
685 const QString& uiType)
const;
690 void setExportFormat(
const QString& value);
695 QString currentResultType()
const;
702 renderedPreviewSourceFromResult(
const QVariantMap& analysisResult)
const;
706 void refreshFilterRows();
710 void resetAdjustments();
714 void refreshAdjustmentAmountsFromSelection();
718 void refreshAnalysisResult();
722 void refreshPreview();
726 void requestPreviewRefresh();
730 void loadSelectedAnalysis();
734 void loadCreateState();
738 void updateResultState();
746 void bindWorkspaceRoles(WorkspaceStore* store, WorkspaceCommands* commands,
747 WorkspaceSelection* selection,
748 WorkspaceSelectors* selectors);
750 WorkspaceStore* store_ =
nullptr;
751 WorkspaceCommands* commands_ =
nullptr;
752 WorkspaceSelection* selection_ =
nullptr;
753 WorkspaceSelectors* selectors_ =
nullptr;
754 AnalysisWorkflow* analysisWorkflow_ =
nullptr;
755 Settings* settings_ =
nullptr;
756 QTimer previewDebounce_;
759 int mainTypeIndex_ = 0;
760 int plotSubtypeIndex_ = 0;
761 QString exportFormat_;
762 bool includeAdjustments_ =
true;
763 QVariantList snapshotTransactions_;
764 bool filterEditMode_ =
true;
765 int filterContentIndex_ = 0;
766 int dateFieldIndex_ = 0;
767 int dateModeIndex_ = 0;
769 QString dateFromValue_;
770 QString dateToValue_;
771 QVariantList propertyFilterRows_;
772 QVariantList contractTypeRows_;
773 QVariantList selectedPropertyIds_;
774 QVariantList selectedContractTypes_;
775 QString allocatableMode_ = QStringLiteral(
"all");
776 QVariantList previewTransactions_;
777 QVariantMap previewMetrics_;
778 QVariantList selectedAdjustmentTxIds_;
779 QVariantMap adjustmentAmountsById_;
780 QString adjustmentName_;
781 QString adjustmentPercentText_;
782 QString activeResultType_ = QStringLiteral(
"plot");
783 QVariantMap currentAnalysisResult_;
784 QString renderedPreviewSource_;
785 int renderedPreviewRevision_ = 0;
786 QVariantList tableContractTypes_;
787 QVariantList tablePropertyRows_;
788 double tableGrandTotal_ = 0.0;
void setYearValue(const QString &value)
Updates the year filter field.
QString adjustmentPercentText() const
Returns the adjustment percent field.
Q_INVOKABLE void selectAnalysis(const QString &id)
Selects an analysis row.
QVariantList selectedContractTypes() const
Returns selected contract type keys for filtering.
void setAdjustmentName(const QString &value)
Updates the adjustment name field.
QVariantList exportFormatOptions
QString previewStatementCountText
QVariantList plotTypeOptions
void setDateFromValue(const QString &value)
Updates the start date filter field.
Q_INVOKABLE void selectAllContractTypes()
Selects all available contract types.
void setIncludeAdjustments(bool value)
Updates whether adjustment amounts are included.
int dateModeIndex() const noexcept
Returns the selected date mode index.
QString previewAmountSumText
bool currentResultIsTable
void setDateModeIndex(int value)
Updates the selected date mode index.
void setAdjustmentPercentText(const QString &value)
Updates the adjustment percent field.
void setSelectedPropertyIds(const QVariantList &value)
Updates selected property ids for filtering.
void setSelectedContractTypes(const QVariantList &value)
Updates selected contract type keys for filtering.
QVariantList tablePropertyRows
int filterContentIndex() const noexcept
Returns the active filter content stack index.
Q_INVOKABLE void selectAllProperties()
Selects all available properties.
void setAllocatableMode(const QString &value)
Updates the selected allocatable filter mode.
QVariantList contractTypeRows() const
Returns contract type rows for the contract type filter.
QString adjustmentPercentText
QString dateToValue() const
Returns the end date filter field.
Q_INVOKABLE void selectNoProperties()
Clears the property selection.
QVariantList selectedPropertyIds
Q_INVOKABLE void navigate(int delta)
Navigates between analyses.
QString renderedPreviewSource
void setFilterEditMode(bool value)
Updates whether filter editing is shown in create mode.
bool includeAdjustments() const noexcept
Returns whether adjustment amounts are included.
QVariantList tableContractTypes
int plotSubtypeIndex() const noexcept
Returns the selected plot subtype index.
void setName(const QString &value)
Updates the analysis name field.
QVariantList contractTypeRows
Q_INVOKABLE void submitCreate()
Creates an analysis through workspace.
QVariantList selectedContractTypes
Q_INVOKABLE void setAllocatableModeIndex(int index)
Updates allocatable mode from a segmented control index.
QVariantList selectedAdjustmentTxIds
QVariantList propertyFilterRows
QVariantList analysisRows
QString allocatableMode() const
Returns the selected allocatable filter mode.
QVariantList selectedAdjustmentTxIds() const
Returns transaction ids selected for adjustment.
QString selectedAnalysisId
void setSelectedAdjustmentTxIds(const QVariantList &value)
Updates transaction ids selected for adjustment.
void setPlotSubtypeIndex(int value)
Updates the selected plot subtype index.
void setDateFieldIndex(int value)
Updates the selected date field index.
void setSettings(Settings *value)
Sets the settings source used for analysis defaults.
Q_INVOKABLE void applySelectedAdjustment()
Applies the entered adjustment to selected preview transactions.
Q_INVOKABLE void setAdjustmentTransactionSelected(const QString &id, bool selected)
Updates whether a preview transaction is selected for adjustment.
QVariantList propertyFilterRows() const
Returns property rows for the analysis property filter.
void setExportFormatIndex(int value)
Updates the selected export format index.
bool filterEditMode() const noexcept
Returns whether filter editing is shown in create mode.
double tableGrandTotal() const noexcept
Returns the table grand total.
int dateFieldIndex() const noexcept
Returns the selected date field index.
QString previewTransactionCountText READ previewTransactionCountText
Q_INVOKABLE void setPropertySelected(const QString &id, bool selected)
Updates whether a property is selected for filtering.
AnalysisViewModel(QObject *parent=nullptr)
Creates the analysis view model.
QString adjustmentName() const
Returns the adjustment name field.
QString renderedPreviewSource() const
Returns the rendered plot preview image source.
void setAnalysisWorkflow(AnalysisWorkflow *value)
Sets the workflow used for analysis computation and rendering.
void setDateToValue(const QString &value)
Updates the end date filter field.
QVariantList tablePropertyRows() const
Returns table property rows.
Q_INVOKABLE void submitUpdate()
Updates the selected analysis through workspace.
QVariantList previewTransactionRows
Q_INVOKABLE void clearFilters()
Resets all filter fields and refreshes the preview.
Q_INVOKABLE void setContractTypeSelected(const QString &type, bool selected)
Updates whether a contract type is selected for filtering.
QVariantList selectedPropertyIds() const
Returns selected property ids for filtering.
Q_INVOKABLE void selectNoContractTypes()
Clears the contract type selection.
QVariantList tableContractTypes() const
Returns table column contract types.
int mainTypeIndex() const noexcept
Returns the selected main analysis type index.
Q_INVOKABLE void deleteCurrent()
Deletes the selected analysis through workspace.
QString dateFromValue() const
Returns the start date filter field.
Q_INVOKABLE void refreshFromSelection()
Reloads create or edit state from the workspace selection.
void setMainTypeIndex(int value)
Updates the selected main analysis type index.
QString yearValue() const
Returns the year filter field.
void setWorkspaceRoles(WorkspaceStore *store, WorkspaceCommands *commands, WorkspaceSelection *selection, WorkspaceSelectors *selectors)
Sets workspace roles used for analysis CRUD, rows and selection.
Q_INVOKABLE void toggleFilterContent()
Toggles between filter fields and transaction preview.
Coordinates analysis preview and computation use cases for UI state.
Stores and exposes globally persisted UI settings for settings-related views.
Maps UI intent to core workspace writer commands.
Tracks the currently selected workspace entities.
Projects workspace store data into QML-facing read models.
Owns the current UI-side workspace snapshot and revision lifecycle.