FOSSredder 0.5.0
Loading...
Searching...
No Matches
DraftMatcher.h
Go to the documentation of this file.
1
5
6#pragma once
7
8#include <string>
9#include <vector>
10
14
16
21 std::string entityId;
22 std::string label;
23 std::string entityType;
24 std::string sourceText;
25 std::string rationale;
26 std::string lastUsedAt;
27 std::vector<std::string> matchedAliases;
28 double confidence = 0.0;
29 double score = 0.0;
30 double aliasWeight = 0.0;
31 double recencyWeight = 0.0;
32 int hitCount = 0;
33};
34
39 std::string sourceText;
40 std::vector<DraftSuggestionCandidate> candidates;
41};
42
51
56 std::string sharedText;
57 std::string actorText;
58 std::string propertyText;
59 std::string contractText;
60 std::string typeText;
61};
62
67 std::string name;
68 std::string metadata;
69 std::string actorText;
70 std::string propertyText;
71 std::string actorId;
72 bool actorSelected = false;
73 std::string contractId;
74 bool contractSelected = false;
75 std::string type;
76 bool allocatable = false;
77 bool allocatableSelected = false;
78 std::vector<std::string> propertyIds;
82};
83
88 std::string id;
89 std::string name;
90 std::string display;
91 std::string type;
92 std::string allocatableMode;
93 std::vector<std::string> aliases;
94 std::vector<std::string> actorIds;
95 std::vector<std::string> propertyIds;
96 bool synthetic = false;
97 double confidence = 0.0;
98 std::string sourceText;
99};
100
132
134
136 bool hasName = false;
137 std::string name;
138 bool hasBookingDate = false;
139 std::string bookingDate;
140 bool hasValuta = false;
141 std::string valuta;
142 bool hasAmount = false;
143 double amount = 0.0;
144 bool hasStatus = false;
145 int status = 0;
146 bool hasAllocatable = false;
147 bool allocatable = false;
149};
150
156std::string normalizeDraftText(const std::string& text);
163bool matchesDraftText(const std::string& left, const std::string& right);
169std::vector<std::string> referenceAliasesFromMetadata(const std::string& metadata);
192std::string resolveActorId(const core::domain::catalog::WorkspaceCatalog& state, const std::string& text);
199std::string resolveContractId(const core::domain::catalog::WorkspaceCatalog& state, const std::string& text);
206bool contractIsFullyAllocatable(const core::domain::catalog::WorkspaceCatalog& state, const std::string& contractId);
222 const DraftLinkSelection& selection);
223
225 const DraftDerivedState& derived,
227
228bool applyActorSelection(TransactionDraft& draft, const std::string& actorId);
231 const std::string& propertyId);
233 const std::string& propertyId,
234 bool selected);
236 const DraftChoiceRow& contract);
239 const std::string& contractId);
242 const TransactionDraftPatch& patch);
243int insertTransactionAfter(StatementDraft& draft, int currentIndex);
245bool renameStatementDraft(StatementDraft& draft, const std::string& name);
246
247}
Draft statement model used by import finalization and core application flow.
Draft transaction model used by import finalization and core application flow.
Domain aggregate that stores catalog entities for one workspace.
bool setPropertySelected(TransactionDraft &draft, const std::string &propertyId, bool selected)
core::domain::catalog::WorkspaceCatalog mergeCatalogState(core::domain::catalog::WorkspaceCatalog primary, const core::domain::catalog::WorkspaceCatalog &secondary)
Merges two catalog states by keeping populated primary collections and filling gaps from a secondary ...
bool contractIsFullyAllocatable(const core::domain::catalog::WorkspaceCatalog &state, const std::string &contractId)
Checks whether all transactions assigned to a contract are allocatable.
bool applyDerivedSelections(TransactionDraft &draft, const DraftDerivedState &derived, DraftAutoSelectionMode mode)
bool matchesDraftText(const std::string &left, const std::string &right)
Compares two draft text fragments after normalization.
int insertTransactionAfter(StatementDraft &draft, int currentIndex)
DraftDerivedState buildDraftDerivedState(const core::domain::catalog::WorkspaceCatalog &state, const DraftLinkSelection &selection)
Derives UI-agnostic matching state for the currently edited draft link.
bool applyContractSelection(TransactionDraft &draft, const DraftChoiceRow &contract)
bool clearContractSelection(TransactionDraft &draft)
DraftTextSignals buildDraftTextSignals(const core::domain::catalog::WorkspaceCatalog &state, const TransactionDraft &transaction)
Derives text signals from a workspace transaction draft.
std::string resolveContractId(const core::domain::catalog::WorkspaceCatalog &state, const std::string &text)
Resolves the best matching contract identifier for the provided text.
std::vector< std::string > referenceAliasesFromMetadata(const std::string &metadata)
Extracts alias-like reference strings from draft metadata.
bool applyActorSelection(TransactionDraft &draft, const std::string &actorId)
bool renameStatementDraft(StatementDraft &draft, const std::string &name)
int removeTransactionAt(StatementDraft &draft, int index)
DraftImportSuggestions buildImportSuggestions(const core::domain::catalog::WorkspaceCatalog &state, const TransactionDraft &transaction)
Builds ranked import suggestions for the given workspace and transaction draft.
std::string resolveActorId(const core::domain::catalog::WorkspaceCatalog &state, const std::string &text)
Resolves the best matching actor identifier for the provided text.
std::string normalizeDraftText(const std::string &text)
Normalizes free-form draft text for fuzzy matching.
bool applyPropertySelection(TransactionDraft &draft, const std::string &propertyId)
bool clearActorSelection(TransactionDraft &draft)
bool applyTransactionPatch(TransactionDraft &draft, const TransactionDraftPatch &patch)
Represents a selectable catalog row for import-draft assignment UIs.
Contains all derived matching state needed to render the current transaction draft.
Holds core-native ranked suggestions for the import draft.
Groups ranked candidates for one draft link target.
std::vector< DraftSuggestionCandidate > candidates
Carries the subset of suggestion data needed for current-draft matching decisions.
Carries the shared text signals extracted from one imported transaction.