10#include <QVariantList>
75 QObject* parent =
nullptr);
336 const QString& transactionId);
343 Q_INVOKABLE QString
submit();
363 QVariantMap emptyTransaction() const;
370 QVariantMap normalizeTransaction(const QVariantMap& tx) const;
376 QVariantMap transactionData() const;
382 void setTransactionData(const QVariantMap& value);
389 QVariant transactionField(const QString& key) const;
396 void setTransactionField(const QString& key, const QVariant& value);
402 void applyTransactionFormChange(const QVariantMap& changes);
410 int selectedIndexFor(const QVariantList& rows, const QString&
id) const;
416 QVariantMap editTransactionState() const;
423 QVariantMap transactionById(const QString& txId) const;
430 QVariantList statementTransactionRows(const QString& statementId) const;
437 QVariantMap normalizedTransactionState(const QVariantMap& data) const;
442 void captureEditState();
447 void rememberSelectedTransaction();
454 QString transactionIdForStatement(const QString& statementId) const;
460 bool ensureSelectedTransactionForStatement();
465 void syncCurrentCreateTransaction();
470 void syncEditState();
481 QString createStatementName_;
482 QVariantList createTransactionStates_;
483 int createTransactionIndex_ = 0;
484 QString editStatementName_;
485 QVariantMap editTransactionData_;
486 int editTransactionIndex_ = -1;
487 QVariantList editTransactionOrderIds_;
488 QString savedEditStatementName_;
489 QVariantMap savedEditTransactionState_;
490 QVariantMap currentTransactionFormState_;
491 QVariantMap lastTransactionIdByStatementId_;
Q_INVOKABLE void setPropertySelected(const QString &propertyId, bool selected)
Updates whether a property is selected for the current transaction.
QString selectedStatementId
QVariantList selectedPropertyIds
bool transactionAllocatable
void setTransactionAllocatable(bool value)
Updates the current transaction allocatable flag.
QString transactionBookingDate
QString selectedTransactionId
BookingViewModel(WorkspaceStore *store, WorkspaceCommands *commands, WorkspaceSelection *selection, WorkspaceSelectors *selectors, QObject *parent=nullptr)
Creates the booking view model backed by workspace roles.
QVariantList statementRows
Q_INVOKABLE QString submit()
Creates a statement and its transaction form states through workspace.
int selectedContractIndex
Q_INVOKABLE void updateCurrent()
Updates the selected statement and transaction through workspace.
QVariantList actorDisplayRows
Q_INVOKABLE void nextStatement()
Selects the next statement or the create form.
Q_INVOKABLE void addTransactionAfterCurrent()
Adds a transaction after the current transaction.
Q_INVOKABLE void previousTransaction()
Selects the previous transaction in the current statement.
QString transactionAmountText
Q_INVOKABLE void selectActorIndex(int index)
Selects an actor from the actor dropdown.
Q_INVOKABLE void deleteCurrentTransaction()
Deletes the current transaction when at least one remains.
void setTransactionName(const QString &value)
Updates the current transaction name field.
QVariantList propertyRows
QString transactionInfoText
Q_INVOKABLE void selectStatement(const QString &statementId)
Selects a statement from the sidebar.
void setTransactionStatusIndex(int index)
Updates the current transaction status from an option index.
Q_INVOKABLE void resetCreateState()
Clears the create form and creates a single empty transaction state.
QString transactionValuta
Q_INVOKABLE void selectContractIndex(int index)
Selects a contract from the contract dropdown.
void setTransactionAmountText(const QString &value)
Updates the current amount field.
Q_INVOKABLE void previousStatement()
Selects the previous statement or the create form.
void setTransactionBookingDate(const QString &value)
Updates the current transaction booking date field.
QVariantList transactionStatusOptions
bool hasMultipleTransactions
QVariantList contractDisplayRows
int transactionStatusIndex
Q_INVOKABLE void nextTransaction()
Selects the next transaction in the current statement.
Q_INVOKABLE void deleteCurrentStatement()
Deletes the selected statement through workspace.
void setStatementName(const QString &value)
Updates the statement name shown in the form.
void setTransactionValuta(const QString &value)
Updates the current transaction valuta field.
Q_INVOKABLE void selectTransaction(const QString &statementId, const QString &transactionId)
Selects a transaction from the sidebar.
bool canDeleteTransaction
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.