28 return !
trimCopy(statementId).empty();
40 std::vector<std::string> unique;
41 unique.reserve(values.size());
42 for (
auto& value : values) {
47 if (std::find(unique.begin(), unique.end(), value) != unique.end()) {
50 unique.push_back(value);
52 values = std::move(unique);
60 return next >= current;
64 return !propertyIds.empty();
Declares private string helpers shared across core implementation files.
Shared transaction transition and normalization helpers.
static bool isValid(const std::string &value)
static bool isValid(double value) noexcept
Checks whether a raw amount is finite.
bool hasStatementAssignment(const std::string &statementId)
Checks whether a statement id is assigned.
bool statusCanAdvance(int current, int next)
Checks whether a transaction status may advance.
void normalizeIds(std::vector< std::string > &values)
Normalizes and deduplicates relation ids.
bool hasValidBookingDate(const std::string &value)
Checks whether a booking date value is valid.
bool canFinalizeFromDraft(const std::string &bookingDate, double amount, const std::string &statementId)
Checks whether a draft transaction can be finalized.
bool hasValidAmount(double value)
Checks whether a transaction amount value is valid.
bool hasPropertyIds(const std::vector< std::string > &propertyIds)
Checks whether a transaction has any property ids.
std::string normalizeId(std::string value)
Normalizes a relation id.
std::string trimCopy(std::string value)
Trims leading and trailing whitespace from text.
std::string normalizeText(std::string value)
Normalizes free-form transaction text.
std::string trim(std::string s)
Removes leading and trailing ASCII whitespace from a string.