FOSSredder 0.5.0
Loading...
Searching...
No Matches
core::domain::policies::transaction Namespace Reference

Functions

std::string trimCopy (std::string value)
 Trims leading and trailing whitespace from text.
bool hasValidBookingDate (const std::string &value)
 Checks whether a booking date value is valid.
bool hasValidAmount (double value)
 Checks whether a transaction amount value is valid.
bool hasStatementAssignment (const std::string &statementId)
 Checks whether a statement id is assigned.
std::string normalizeText (std::string value)
 Normalizes free-form transaction text.
std::string normalizeId (std::string value)
 Normalizes a relation id.
void normalizeIds (std::vector< std::string > &values)
 Normalizes and deduplicates relation ids.
bool canFinalizeFromDraft (const std::string &bookingDate, double amount, const std::string &statementId)
 Checks whether a draft transaction can be finalized.
bool statusCanAdvance (int current, int next)
 Checks whether a transaction status may advance.
bool hasPropertyIds (const std::vector< std::string > &propertyIds)
 Checks whether a transaction has any property ids.

Function Documentation

◆ canFinalizeFromDraft()

bool core::domain::policies::transaction::canFinalizeFromDraft ( const std::string & bookingDate,
double amount,
const std::string & statementId )

Checks whether a draft transaction can be finalized.

Parameters
bookingDateRaw booking date.
amountRaw amount.
statementIdRaw statement id.
Returns
true when all finalization prerequisites are met.

Definition at line 55 of file TransactionPolicy.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hasPropertyIds()

bool core::domain::policies::transaction::hasPropertyIds ( const std::vector< std::string > & propertyIds)

Checks whether a transaction has any property ids.

Parameters
propertyIdsProperty id list to inspect.
Returns
true when the list is not empty.

Definition at line 63 of file TransactionPolicy.cpp.

◆ hasStatementAssignment()

bool core::domain::policies::transaction::hasStatementAssignment ( const std::string & statementId)

Checks whether a statement id is assigned.

Parameters
statementIdRaw statement id.
Returns
true when the normalized statement id is non-empty.

Definition at line 27 of file TransactionPolicy.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hasValidAmount()

bool core::domain::policies::transaction::hasValidAmount ( double value)

Checks whether a transaction amount value is valid.

Parameters
valueRaw amount.
Returns
true when the amount is finite.

Definition at line 23 of file TransactionPolicy.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hasValidBookingDate()

bool core::domain::policies::transaction::hasValidBookingDate ( const std::string & value)

Checks whether a booking date value is valid.

Parameters
valueRaw booking date.
Returns
true when the booking date passes value-object validation.

Definition at line 19 of file TransactionPolicy.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ normalizeId()

std::string core::domain::policies::transaction::normalizeId ( std::string value)

Normalizes a relation id.

Parameters
valueRaw id text.
Returns
Normalized id.

Definition at line 35 of file TransactionPolicy.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ normalizeIds()

void core::domain::policies::transaction::normalizeIds ( std::vector< std::string > & values)

Normalizes and deduplicates relation ids.

Parameters
valuesRelation id list to mutate.

Definition at line 39 of file TransactionPolicy.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ normalizeText()

std::string core::domain::policies::transaction::normalizeText ( std::string value)

Normalizes free-form transaction text.

Parameters
valueRaw transaction text.
Returns
Normalized text.

Definition at line 31 of file TransactionPolicy.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ statusCanAdvance()

bool core::domain::policies::transaction::statusCanAdvance ( int current,
int next )

Checks whether a transaction status may advance.

Parameters
currentCurrent numeric status.
nextRequested numeric status.
Returns
true when the requested status is not a regression.

Definition at line 59 of file TransactionPolicy.cpp.

Here is the caller graph for this function:

◆ trimCopy()

std::string core::domain::policies::transaction::trimCopy ( std::string value)

Trims leading and trailing whitespace from text.

Parameters
valueRaw text.
Returns
Trimmed text or an empty string.

Definition at line 15 of file TransactionPolicy.cpp.

Here is the call graph for this function:
Here is the caller graph for this function: