26std::vector<std::string> stdStrings(
const QStringList& values) {
30std::vector<core::ports::workspace::AliasSnapshot>
31aliasSnapshots(
const QStringList& aliases) {
32 std::vector<core::ports::workspace::AliasSnapshot> out;
33 out.reserve(aliases.size());
34 for (
const auto& alias : aliases) {
36 out.push_back({
text, {},
text, 0, {}, {}, {}});
41core::ports::workspace::ActorCommand
42makeActorCommand(
const QString&
id,
const QString& name,
43 const QStringList& aliases,
const QStringList& contractIds) {
44 core::ports::workspace::ActorCommand command;
47 command.
aliases = aliasSnapshots(aliases);
52core::ports::workspace::PropertyCommand
53makePropertyCommand(
const QString&
id,
const QString& name,
54 const QStringList& aliases,
55 const QStringList& contractIds) {
56 core::ports::workspace::PropertyCommand command;
59 command.
aliases = aliasSnapshots(aliases);
64core::ports::workspace::ContractCommand
65makeContractCommand(
const QString&
id,
const QString& name,
const QString& type,
66 const QString& allocatableMode,
const QStringList& actorIds,
67 const QStringList& propertyIds,
68 const QStringList& aliases) {
69 core::ports::workspace::ContractCommand command;
74 command.
actorIds = stdStrings(actorIds);
76 command.
aliases = aliasSnapshots(aliases);
80core::ports::workspace::TransactionCommand
81makeTransactionCommand(
const QString&
id,
const QString& name,
82 const QString& bookingDate,
const QString& valuta,
83 const QVariant& amount,
const QString& statementId,
84 const QString& insertAfterTransactionId,
int status,
85 const QString& actorId,
const QString& contractId,
86 bool allocatable,
const QStringList& propertyIds) {
87 core::ports::workspace::TransactionCommand command;
104core::ports::workspace::TransactionCommand
105makeTransactionCommand(
const QVariantMap& state,
106 const QString& statementId = {}) {
107 return makeTransactionCommand(
108 state.value(QStringLiteral(
"id")).toString(),
109 state.value(QStringLiteral(
"name")).toString(),
110 state.value(QStringLiteral(
"bookingDate")).toString(),
111 state.value(QStringLiteral(
"valuta")).toString(),
112 state.value(QStringLiteral(
"amount")), statementId, {},
116 state.value(QStringLiteral(
"allocatable")).toBool(),
121core::ports::analysis::AnalysisConfigInput
122analysisConfigInput(
const QString& type,
const QVariantMap&
config) {
123 core::ports::analysis::AnalysisConfigInput input;
128 config.value(QStringLiteral(
"plotMeasure")).toString());
130 config.value(QStringLiteral(
"propertyIds")).toList()));
132 config.value(QStringLiteral(
"contractTypes")).toList()));
137core::ports::analysis::AnalysisFilterSelection
138analysisFilterSelection(
const QVariantMap& filter) {
139 core::ports::analysis::AnalysisFilterSelection selection;
141 filter.value(QStringLiteral(
"dateField")).toString());
151 filter.value(QStringLiteral(
"propertyIds")).toList()));
153 filter.value(QStringLiteral(
"propertyIdsNone")).toBool();
155 filter.value(QStringLiteral(
"contractTypes")).toList()));
157 filter.value(QStringLiteral(
"contractTypesNone")).toBool();
159 filter.value(QStringLiteral(
"allocatableMode")).toString());
163core::ports::workspace::AnalysisCommand
164makeAnalysisCommand(
const QString&
id,
const QString& name,
const QString& type,
165 const QVariantMap&
config,
const QVariantMap& filter,
166 const QString& exportFormat,
bool includeCalcAdjustments,
167 const QVariantList& snapshotTransactions) {
168 core::ports::workspace::AnalysisCommand command;
173 command.
filter = analysisFilterSelection(filter);
177 static_cast<std::size_t
>(snapshotTransactions.size()));
178 for (
const auto& value : snapshotTransactions) {
179 const QVariantMap row = value.toMap();
180 core::ports::workspace::TransactionSnapshot tx;
182 row.value(QStringLiteral(
"id"),
183 row.value(QStringLiteral(
"transactionId")))
186 row.value(QStringLiteral(
"name"),
187 row.value(QStringLiteral(
"transactionName")))
191 row.value(QStringLiteral(
"date")))
195 tx.
amount = row.value(QStringLiteral(
"amount")).toDouble();
196 tx.
status = row.value(QStringLiteral(
"status")).toInt();
198 row.value(QStringLiteral(
"contractId")).toString());
200 row.value(QStringLiteral(
"contractType")).toString());
204 row.value(QStringLiteral(
"statementId")).toString());
205 tx.
allocatable = row.value(QStringLiteral(
"allocatable")).toBool();
207 row.value(QStringLiteral(
"propertyIds")).toList()));
209 row.value(QStringLiteral(
"propertyNames")).toList()));
215std::vector<std::pair<std::string, double>>
216analysisAdjustmentPairs(
const QVariantMap& adjustments) {
217 std::vector<std::pair<std::string, double>> out;
218 out.reserve(
static_cast<std::size_t
>(adjustments.size()));
219 for (
auto it = adjustments.constBegin(); it != adjustments.constEnd(); ++it) {
220 const QString
id = it.key().trimmed();
228core::ports::workspace::AnnualCommand
229makeAnnualCommand(
const QString&
id,
const QString& name,
int year,
230 const QStringList& analysisIds) {
231 core::ports::workspace::AnnualCommand command;
242 : QObject(parent), store_(store) {}
244void WorkspaceCommands::refreshStoreFromReader() {
245 if (store_.reader()) {
250bool WorkspaceCommands::rejectInvalidCommand(
252 const core::ports::workspace::ValidationResult& result)
const {
253 if (result.
valid()) {
257 {
"issueCount", std::to_string(result.
issues.size())}};
258 if (!result.
issues.empty()) {
260 result.
issues.front().message);
261 context.emplace_back(
"field", result.
issues.front().field);
262 context.emplace_back(
"code", result.
issues.front().code);
269void WorkspaceCommands::runStorageOperation(
270 const QString& operation,
const std::function<
void()>& action) {
271 if (!store_.writer()) {
273 "WorkspaceCommands::runStorageOperation",
274 "Storage operation ignored because no workspace writer is bound",
281 }
catch (
const std::exception& ex) {
286std::optional<core::ports::workspace::StatementDraftSnapshot>
288 return store_.reader() ? store_.reader()->statementDraftSnapshot(
295 if (!store_.writer()) {
299 command.
draft = draft;
301 QString::fromStdString(store_.writer()->finalizeStatementDraft(command));
302 refreshStoreFromReader();
308 if (!store_.writer()) {
312 command.
draft = draft;
313 store_.writer()->saveStatementDraft(command);
314 refreshStoreFromReader();
318 if (!store_.writer()) {
322 refreshStoreFromReader();
325void WorkspaceCommands::saveImportLog(
327 if (!store_.writer()) {
333 refreshStoreFromReader();
337 const QString& logId,
const QString& status,
const QString& message,
338 bool draftAttached,
const QString& draftId,
const QString& statementId,
339 const QString& importFile) {
340 if (!store_.writer()) {
344 const QString resolvedLogId =
345 logId.isEmpty() ? QUuid::createUuid().toString(QUuid::WithoutBraces)
347 for (
const auto& existing : store_.snapshot().importLogs) {
348 if (QString::fromStdString(existing.id) == resolvedLogId) {
354 log.
id = resolvedLogId.toStdString();
355 log.
time = QDateTime::currentDateTime()
356 .toString(QStringLiteral(
"dd.MM.yyyy HH:mm:ss"))
358 log.
status = status.toStdString();
359 log.
message = message.toStdString();
362 if (log.
type.empty()) {
363 log.
type =
"statement";
365 if (!importFile.isEmpty()) {
366 log.
file = importFile.toStdString();
368 const QString resolvedDraftId =
369 draftAttached ? (draftId.isEmpty() ? resolvedLogId : draftId) : QString();
370 log.
draftId = resolvedDraftId.toStdString();
372 if (draftAttached && !resolvedDraftId.isEmpty()) {
379 if (store_.writer()) {
381 refreshStoreFromReader();
387 if (!store_.writer()) {
392 store_.writer()->saveExportLog(command);
393 refreshStoreFromReader();
397 if (store_.writer()) {
399 refreshStoreFromReader();
404 runStorageOperation(QStringLiteral(
"newFile"), [&]() {
410 runStorageOperation(QStringLiteral(
"openFile"), [&]() {
416 runStorageOperation(QStringLiteral(
"saveFile"), [&]() {
417 if (beforeStorageSave_) {
418 beforeStorageSave_();
420 store_.writer()->saveFile();
425 runStorageOperation(QStringLiteral(
"saveFileAs"), [&]() {
426 if (beforeStorageSave_) {
427 beforeStorageSave_();
434 std::function<
void()> callback) {
435 beforeStorageSave_ = std::move(callback);
439WorkspaceCommands::validateActor(
const QString&
id,
const QString& name,
440 const QStringList& aliases,
441 const QStringList& contractIds)
const {
444 id, name, aliases, contractIds)))
449 const QStringList& aliases,
450 const QStringList& contractIds) {
451 if (!store_.writer()) {
454 const auto command = makeActorCommand(
id, name, aliases, contractIds);
455 if (rejectInvalidCommand(
"WorkspaceCommands::saveActor",
456 store_.writer()->validateActor(command))) {
459 const QString savedId =
460 id.isEmpty() ? QString::fromStdString(store_.writer()->addActor(command))
461 : (store_.writer()->updateActor(command),
id);
462 refreshStoreFromReader();
467 if (store_.writer()) {
469 refreshStoreFromReader();
474WorkspaceCommands::validateProperty(
const QString&
id,
const QString& name,
475 const QStringList& aliases,
476 const QStringList& contractIds)
const {
477 return store_.writer()
479 store_.writer()->validateProperty(
480 makePropertyCommand(
id, name, aliases, contractIds)))
485 const QStringList& aliases,
486 const QStringList& contractIds) {
487 if (!store_.writer()) {
490 const auto command = makePropertyCommand(
id, name, aliases, contractIds);
491 if (rejectInvalidCommand(
"WorkspaceCommands::saveProperty",
492 store_.writer()->validateProperty(command))) {
495 const QString savedId =
497 ? QString::fromStdString(store_.writer()->addProperty(command))
498 : (store_.writer()->updateProperty(command),
id);
499 refreshStoreFromReader();
504 if (store_.writer()) {
506 refreshStoreFromReader();
510QVariantMap WorkspaceCommands::validateContract(
511 const QString&
id,
const QString& name,
const QString& type,
512 const QStringList& actorIds,
const QStringList& propertyIds,
513 const QStringList& aliases,
const QString& allocatableMode)
const {
514 return store_.writer()
517 makeContractCommand(
id, name, type, allocatableMode,
518 actorIds, propertyIds, aliases)))
524 const QStringList& actorIds,
525 const QStringList& propertyIds,
526 const QStringList& aliases,
527 const QString& allocatableMode) {
528 if (!store_.writer()) {
531 const auto command = makeContractCommand(
id, name, type, allocatableMode,
532 actorIds, propertyIds, aliases);
533 if (rejectInvalidCommand(
"WorkspaceCommands::saveContract",
534 store_.writer()->validateContract(command))) {
537 const QString savedId =
539 ? QString::fromStdString(store_.writer()->addContract(command))
540 : (store_.writer()->updateContract(command),
id);
541 refreshStoreFromReader();
546 if (store_.writer()) {
548 refreshStoreFromReader();
552QVariantMap WorkspaceCommands::validateStatement(
const QString&
id,
553 const QString& name)
const {
558 store_.writer()->validateStatement(command))
563 if (!store_.writer()) {
568 if (rejectInvalidCommand(
"WorkspaceCommands::addStatement",
569 store_.writer()->validateStatement(command))) {
572 const QString savedId =
573 QString::fromStdString(store_.writer()->addStatement(command));
574 refreshStoreFromReader();
579 const QString& name,
const QVariantList& transactionStates) {
580 if (!store_.writer()) {
586 static_cast<std::size_t
>(transactionStates.size()));
587 for (
const auto& stateValue : transactionStates) {
588 command.
transactions.push_back(makeTransactionCommand(stateValue.toMap()));
590 if (rejectInvalidCommand(
591 "WorkspaceCommands::addStatementWithTransactions",
592 store_.writer()->validateStatementWithTransactions(command))) {
595 const QString savedId = QString::fromStdString(
596 store_.writer()->addStatementWithTransactions(command));
597 refreshStoreFromReader();
602 const QString& name) {
603 if (!store_.writer()) {
609 if (!rejectInvalidCommand(
"WorkspaceCommands::updateStatement",
610 store_.writer()->validateStatement(command))) {
611 store_.writer()->updateStatement(command);
612 refreshStoreFromReader();
617 if (store_.writer()) {
619 refreshStoreFromReader();
623QVariantMap WorkspaceCommands::validateTransaction(
624 const QString&
id,
const QString& name,
const QString& bookingDate,
625 const QString& valuta,
const QVariant& amount,
const QString& statementId,
626 int status,
const QString& actorId,
const QString& contractId,
627 bool allocatable,
const QStringList& propertyIds)
const {
628 return store_.writer()
631 id, name, bookingDate, valuta, amount, statementId, {},
632 status, actorId, contractId, allocatable, propertyIds)))
633 : workspace_payloads::validationResult({});
637 const QString& name,
const QString& bookingDate,
const QString& valuta,
638 const QVariant& amount,
const QString& statementId,
int status,
639 const QString& actorId,
const QString& contractId,
bool allocatable,
640 const QStringList& propertyIds) {
641 if (!store_.writer()) {
644 const auto command = makeTransactionCommand(
645 {}, name, bookingDate, valuta, amount, statementId, {}, status, actorId,
646 contractId, allocatable, propertyIds);
647 if (rejectInvalidCommand(
"WorkspaceCommands::addTransaction",
648 store_.writer()->validateTransaction(command))) {
651 const QString savedId =
652 QString::fromStdString(store_.writer()->addTransaction(command));
653 refreshStoreFromReader();
658 const QString& afterTransactionId,
const QString& name,
659 const QString& bookingDate,
const QString& valuta,
const QVariant& amount,
660 const QString& statementId,
int status,
const QString& actorId,
661 const QString& contractId,
bool allocatable,
662 const QStringList& propertyIds) {
663 if (!store_.writer()) {
666 const auto command = makeTransactionCommand(
667 {}, name, bookingDate, valuta, amount, statementId, afterTransactionId,
668 status, actorId, contractId, allocatable, propertyIds);
669 if (rejectInvalidCommand(
"WorkspaceCommands::insertTransactionAfter",
670 store_.writer()->validateTransaction(command))) {
673 const QString savedId =
674 QString::fromStdString(store_.writer()->addTransaction(command));
675 refreshStoreFromReader();
680 const QString&
id,
const QString& name,
const QString& bookingDate,
681 const QString& valuta,
const QVariant& amount,
const QString& statementId,
682 int status,
const QString& actorId,
const QString& contractId,
683 bool allocatable,
const QStringList& propertyIds) {
684 if (!store_.writer()) {
687 const auto command = makeTransactionCommand(
688 id, name, bookingDate, valuta, amount, statementId, {}, status, actorId,
689 contractId, allocatable, propertyIds);
690 if (!rejectInvalidCommand(
"WorkspaceCommands::updateTransaction",
691 store_.writer()->validateTransaction(command))) {
692 store_.writer()->updateTransaction(command);
693 refreshStoreFromReader();
698 if (store_.writer()) {
700 refreshStoreFromReader();
705 const QVariantMap&
config,
706 const QVariantMap& filter,
707 const QString& exportFormat,
708 bool includeCalcAdjustments,
709 const QVariantList& snapshotTransactions,
710 const QVariantMap& adjustments) {
711 if (!store_.writer()) {
715 makeAnalysisCommand({}, name, type,
config, filter, exportFormat,
716 includeCalcAdjustments, snapshotTransactions);
717 command.adjustments = analysisAdjustmentPairs(adjustments);
718 if (rejectInvalidCommand(
"WorkspaceCommands::addAnalysis",
719 store_.writer()->validateAnalysis(command))) {
722 const QString savedId =
723 QString::fromStdString(store_.writer()->addAnalysis(command));
724 refreshStoreFromReader();
729 const QString&
id,
const QString& name,
const QString& type,
730 const QVariantMap&
config,
const QVariantMap& filter,
731 const QString& exportFormat,
bool includeCalcAdjustments,
732 const QVariantList& snapshotTransactions,
const QVariantMap& adjustments) {
733 if (!store_.writer()) {
737 makeAnalysisCommand(
id, name, type,
config, filter, exportFormat,
738 includeCalcAdjustments, snapshotTransactions);
739 command.adjustments = analysisAdjustmentPairs(adjustments);
740 if (!rejectInvalidCommand(
"WorkspaceCommands::updateAnalysis",
741 store_.writer()->validateAnalysis(command))) {
742 store_.writer()->updateAnalysis(command);
743 refreshStoreFromReader();
748 if (store_.writer()) {
750 refreshStoreFromReader();
755 const QString& analysisId,
const QString& exportFormat) {
757 const auto& analyses = store_.snapshot().analyses;
759 std::find_if(analyses.begin(), analyses.end(), [&](
const auto& analysis) {
760 return analysis.id == target;
762 if (it == analyses.end()) {
765 if (!store_.writer()) {
769 analysisId, QString::fromStdString(it->name),
770 QString::fromStdString(it->type),
773 it->includeCalculationAdjustments,
776 if (!rejectInvalidCommand(
"WorkspaceCommands::updateAnalysisExportFormat",
777 store_.writer()->validateAnalysis(command))) {
778 store_.writer()->updateAnalysis(command);
779 refreshStoreFromReader();
784WorkspaceCommands::validateAnnual(
const QString&
id,
const QString& name,
786 const QStringList& analysisIds)
const {
787 return store_.writer()
789 store_.writer()->validateAnnual(
790 makeAnnualCommand(
id, name, year, analysisIds)))
795 const QStringList& analysisIds) {
796 if (!store_.writer()) {
799 const auto command = makeAnnualCommand({}, name, year, analysisIds);
800 if (rejectInvalidCommand(
"WorkspaceCommands::addAnnual",
801 store_.writer()->validateAnnual(command))) {
804 const QString savedId =
805 QString::fromStdString(store_.writer()->addAnnual(command));
806 refreshStoreFromReader();
811 int year,
const QStringList& analysisIds) {
812 if (!store_.writer()) {
815 const auto command = makeAnnualCommand(
id, name, year, analysisIds);
816 if (!rejectInvalidCommand(
"WorkspaceCommands::updateAnnual",
817 store_.writer()->validateAnnual(command))) {
818 store_.writer()->updateAnnual(command);
819 refreshStoreFromReader();
824 if (store_.writer()) {
826 refreshStoreFromReader();
Declarations for the UI PayloadKeys component.
Declarations for the UI payload mapper helpers.
Declares lightweight conversions between common Qt string types and standard strings.
Declarations for the UI Trace component.
Declares workspace-specific QML payload builders.
virtual WorkspaceSnapshot workspaceSnapshot() const =0
Returns the full immutable workspace snapshot.
virtual ValidationResult validateTransaction(const TransactionCommand &command) const =0
Validates a transaction command without mutating workspace state.
virtual void saveImportLog(const ImportLogCommand &command)=0
Saves or updates one import log.
virtual ValidationResult validateContract(const ContractCommand &command) const =0
Validates a contract command without mutating workspace state.
virtual ValidationResult validateActor(const ActorCommand &command) const =0
Validates an actor command without mutating workspace state.
void deleteAnalysis(const QString &id)
Deletes an analysis.
void deleteStatement(const QString &id)
Deletes a statement.
void operationSucceeded(const QString &operation)
Emitted when a storage command completed.
void deleteImportLog(const QString &id)
Deletes an import log.
void updateTransaction(const QString &id, const QString &name, const QString &bookingDate, const QString &valuta, const QVariant &amount, const QString &statementId, int status, const QString &actorId, const QString &contractId, bool allocatable, const QStringList &propertyIds)
Updates a transaction.
WorkspaceCommands(WorkspaceStore &store, QObject *parent=nullptr)
Creates workspace commands for a store.
QString addAnalysis(const QString &name, const QString &type, const QVariantMap &config, const QVariantMap &filter, const QString &exportFormat, bool includeCalcAdjustments, const QVariantList &snapshotTransactions, const QVariantMap &adjustments={})
Creates an analysis.
QString saveProperty(const QString &id, const QString &name, const QStringList &aliases={}, const QStringList &contractIds={})
Creates or updates a property.
void openFile(const QString &path)
Opens an existing workspace file.
void operationFailed(const QString &operation, const QString &error)
Emitted when a storage command failed.
void upsertImportLog(const QString &logId, const QString &status, const QString &message, bool draftAttached, const QString &draftId={}, const QString &statementId={}, const QString &importFile={})
Creates or updates an import log row.
void deleteTransaction(const QString &id)
Deletes a transaction.
void saveFileAs(const QString &path)
Saves the current workspace file to a new path.
void deleteProperty(const QString &id)
Deletes a property.
void updateAnalysisExportFormat(const QString &analysisId, const QString &exportFormat)
Updates only the stored export format of an analysis.
void deleteActor(const QString &id)
Deletes an actor.
QString addTransaction(const QString &name, const QString &bookingDate, const QString &valuta, const QVariant &amount, const QString &statementId, int status=0, const QString &actorId=QString(), const QString &contractId=QString(), bool allocatable=false, const QStringList &propertyIds={})
Creates a transaction.
QString addAnnual(const QString &name, int year, const QStringList &analysisIds={})
Creates an annual.
QString saveActor(const QString &id, const QString &name, const QStringList &aliases={}, const QStringList &contractIds={})
Creates or updates an actor.
void updateStatement(const QString &id, const QString &name)
Updates a statement.
void setBeforeStorageSaveCallback(std::function< void()> callback)
Registers an optional hook executed immediately before storage save.
QString finalizeStatementDraft(const core::ports::workspace::StatementDraftSnapshot &draft)
Finalizes a statement draft through the workspace writer.
QString addStatementWithTransactions(const QString &name, const QVariantList &transactionStates)
Creates a statement and its transactions in one workspace mutation.
void newFile(const QString &path)
Creates a new workspace file.
void clearStatementDraft(const QString &draftId={})
Removes a statement draft from workspace state.
void deleteContract(const QString &id)
Deletes a contract.
void updateAnnual(const QString &id, const QString &name, int year, const QStringList &analysisIds={})
Updates an annual.
void deleteAnnual(const QString &id)
Deletes an annual.
void deleteExportLog(const QString &id)
Deletes an export log.
QString saveContract(const QString &id, const QString &name, const QString &type, const QStringList &actorIds={}, const QStringList &propertyIds={}, const QStringList &aliases={}, const QString &allocatableMode=QStringLiteral("mixed"))
Creates or updates a contract.
void saveStatementDraft(const core::ports::workspace::StatementDraftSnapshot &draft)
Saves a statement draft in workspace state.
void saveExportLog(const core::ports::workspace::ExportLogSnapshot &log)
Saves an export log in workspace state.
void saveFile()
Saves the current workspace file.
void updateAnalysis(const QString &id, const QString &name, const QString &type, const QVariantMap &config, const QVariantMap &filter, const QString &exportFormat, bool includeCalcAdjustments, const QVariantList &snapshotTransactions, const QVariantMap &adjustments={})
Updates an analysis.
QString addStatement(const QString &name)
Creates a statement.
QString insertTransactionAfter(const QString &afterTransactionId, const QString &name, const QString &bookingDate, const QString &valuta, const QVariant &amount, const QString &statementId, int status=0, const QString &actorId=QString(), const QString &contractId=QString(), bool allocatable=false, const QStringList &propertyIds={})
Creates a transaction after another transaction.
std::optional< core::ports::workspace::StatementDraftSnapshot > statementDraftSnapshot(const QString &draftId={}) const
Reads a statement draft snapshot from workspace state.
Owns the current UI-side workspace snapshot and revision lifecycle.
void loadFromState(const core::ports::workspace::WorkspaceSnapshot &snapshot)
Loads a fresh workspace snapshot.
Write-side boundary command models for workspace operations.
std::vector< std::pair< std::string, std::string > > ErrorContext
Key/value context attached to an error event.
constexpr auto kOperation
void traceWorkspace(const char *origin, std::string message, core::errors::ErrorContext context={})
Emits a workspace trace event.
QStringList toQStringList(const std::vector< std::string > &values)
Converts standard strings to a Qt string list.
std::vector< std::string > toStdList(const QStringList &values)
Converts a Qt string list into a standard string vector.
std::string toStdString(const QString &value)
Converts a QString to a UTF-8 encoded std::string.
std::string toEncodedPath(const QString &path)
Converts a filesystem path to the platform-encoded byte representation.
QVariantList transactionRows(const std::vector< core::ports::workspace::TransactionSnapshot > &transactions)
Builds transaction rows.
QVariantMap analysisConfigRow(const core::ports::analysis::AnalysisConfigInput &config)
Builds an analysis config row.
QVariantMap analysisFilterRow(const core::ports::analysis::AnalysisFilterSelection &filter)
Builds an analysis filter row.
QVariantMap validationResult(const core::ports::workspace::ValidationResult &result)
Maps validation results to a QML-friendly payload.
std::vector< std::string > contractTypes
bool propertyIdsUnassigned
std::vector< std::string > propertyIds
std::string allocatableMode
bool contractTypesUnassigned
std::vector< std::string > contractIds
std::vector< AliasSnapshot > aliases
std::vector< TransactionSnapshot > snapshotTransactions
core::ports::analysis::AnalysisFilterSelection filter
bool includeCalculationAdjustments
std::vector< std::pair< std::string, double > > adjustments
core::ports::analysis::AnalysisConfigInput config
std::vector< std::string > assignedAnalysisIds
std::vector< std::string > actorIds
std::string allocatableMode
std::vector< std::string > propertyIds
std::vector< AliasSnapshot > aliases
StatementDraftSnapshot draft
std::vector< std::string > statementDraftIds
std::vector< std::string > contractIds
std::vector< AliasSnapshot > aliases
StatementDraftSnapshot draft
Creates a statement together with its initial transactions.
StatementCommand statement
Statement creation data.
std::vector< TransactionCommand > transactions
Transaction creation data; statement ids are assigned by core.
std::string insertAfterTransactionId
std::vector< std::string > propertyIds
std::vector< std::string > propertyNames
std::vector< std::string > propertyIds
bool valid() const noexcept
Reports whether the validation result has no errors.
std::vector< ValidationIssue > issues
Declares UI-side workspace command submission.