11#include <QVariantList>
13#include <qqmlintegration.h>
101 void setName(
const QString& value);
128 return availableAnalysisRows_;
136 return assignedAnalysisRows_;
144 return contentIndex_;
152 return annualTransactions_;
222 Q_INVOKABLE
void navigate(
int delta);
239 Q_INVOKABLE
void stepYear(
int delta);
259 const QString& exportFormat);
276 QStringList normalizedAnalysisIds(
const QVariant& values)
const;
282 QString analysisIdFromVariant(
const QVariant& value)
const;
288 QVariantMap annualRowById(
const QString&
id)
const;
294 QVariantMap analysisRowById(
const QString&
id)
const;
300 QVariantMap normalizeAnalysisRow(
const QVariant& value)
const;
305 QVariantList normalizedAnalysisRows()
const;
310 QVariantList buildAssignedAnalysisRows()
const;
315 QVariantList buildAvailableAnalysisRows()
const;
321 QVariantMap augmentAnalysisRow(
const QVariantMap& row)
const;
327 QVariantList exportOptionsForType(
const QString& type)
const;
334 int exportFormatIndex(
const QVariantList& options,
335 const QString& exportFormat)
const;
342 QString normalizedExportFormat(
const QString& value,
343 const QString& type)
const;
348 int defaultYear()
const;
352 void loadCreateState();
356 void loadSelectedAnnual();
360 void refreshAnalysisSelectionRows();
364 void rebuildAnnualResultState();
369 void applyAnnualResult(
const QVariantMap& result);
373 void captureSavedState();
378 void setAnalysisIds(
const QStringList& ids);
383 QVariantMap emptyIssues()
const;
388 QVariantMap emptyStatusMetrics()
const;
394 QVariantList rowsFromResultBucket(
const QVariantList& rows)
const;
400 QVariantMap transactionRow(
const QVariantMap& source)
const;
408 QVariantMap transactionSection(
const QString& key,
const QString& title,
409 const QVariantList& rows)
const;
415 bool isTransactionSectionExpanded(
const QString& key)
const;
420 int workspaceRevision()
const;
439 QStringList analysisIds_;
440 QVariantList availableAnalysisRows_;
441 QVariantList assignedAnalysisRows_;
442 int contentIndex_ = 0;
443 QVariantMap verificationIssues_;
444 QVariantMap statusMetrics_;
445 QVariantList annualTransactions_;
446 QVariantMap annualTransactionGroups_;
447 QVariantMap sectionExpanded_;
450 QStringList savedAnalysisIds_;
451 QString lastPreviewAnnualId_;
452 int lastPreviewYear_ = 0;
453 QStringList lastPreviewAnalysisIds_;
454 int lastPreviewRevision_ = -1;
455 bool analysisMetadataDirty_ =
false;
void setYear(int value)
Updates the selected annual year.
void setAnnualWorkflow(AnnualWorkflow *value)
Sets the workflow used for annual computation.
Q_INVOKABLE void submitCreate()
Creates an annual through workspace.
Q_INVOKABLE void submitUpdate()
Updates the selected annual through workspace.
Q_INVOKABLE void setAnalysisExportFormat(const QString &id, const QString &exportFormat)
Updates export format for an assigned analysis.
QVariantList assignedAnalysisRows
QVariantList availableAnalysisRows
Q_INVOKABLE void navigate(int delta)
Navigates between annual rows.
Q_INVOKABLE void stepYear(int delta)
Steps the selected year by a relative delta.
bool canSubmit() const noexcept
Returns whether the current annual can be submitted.
QVariantList analysisIds() const
Returns ids of analyses assigned to the annual.
Q_INVOKABLE void selectAnnual(const QString &id)
Selects an annual row.
int contentIndex() const noexcept
Returns the active annual content stack index.
QVariantList assignedAnalysisRows() const
Returns analyses assigned to the annual.
QVariantList verificationRows
Q_INVOKABLE void addAvailableAnalysisAtIndex(int index)
Adds an available analysis by row index.
Q_INVOKABLE void removeAnalysis(const QString &id)
Removes an analysis from the annual.
Q_INVOKABLE void toggleTransactionSection(const QString &key)
Toggles expansion state for a transaction section.
AnnualViewModel(QObject *parent=nullptr)
Creates the annual view model.
QVariantList availableAnalysisRows() const
Returns analyses available for assignment.
int year() const noexcept
Returns the selected annual year.
void setName(const QString &value)
Updates the annual name field.
QVariantList annualTransactions() const
Returns annual transaction preview rows.
Q_INVOKABLE void refreshFromSelection()
Reloads create or edit state from the workspace selection.
Q_INVOKABLE void toggleContent()
Toggles between annual analysis assignment and transaction preview.
QVariantList transactionSections
void setWorkspaceRoles(WorkspaceStore *store, WorkspaceCommands *commands, WorkspaceSelection *selection, WorkspaceSelectors *selectors)
Sets workspace roles used for annual rows, selection and mutations.
QVariantList annualTransactions
Q_INVOKABLE void deleteCurrent()
Deletes the selected annual through workspace.
Q_INVOKABLE void resetCreateState()
Resets the create form to defaults.
QString statusSummaryText
Coordinates annual computation for UI states.
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.