FOSSredder 0.5.0
Loading...
Searching...
No Matches
core::application::analysis::Transaction Class Reference

#include <Transaction.h>

Public Types

enum class  Status : int { Neutral = 0 , Unverified = 1 , Verified = 2 , Completed = 3 }

Public Member Functions

 Transaction () noexcept
 Transaction (std::string nameValue, std::string bookingDateValue, std::string valutaValue, double amountValue, bool allocatableValue=false)
 Creates a transaction from raw inputs.
 Transaction (const Transaction &)=delete
 Transaction (Transaction &&)=delete
Transaction & operator= (const Transaction &)=delete
Transaction & operator= (Transaction &&)=delete
void setName (EntityName value)
 Sets the transaction name from a value object.
void setName (std::string value)
 Sets the transaction name from raw text.
void setBookingDate (BookingDate value)
 Sets the booking date from a value object.
void setBookingDate (std::string value)
 Sets the booking date from raw text.
void setValuta (std::string value)
 Sets the valuta text.
void setAmount (MoneyAmount value)
 Sets the amount from a value object.
void setAmount (double value)
 Sets the amount from raw numeric input.
void setStatus (Status value)
 Sets the transaction status.
void setContractId (std::string value)
 Sets the contract id.
void setActorId (std::string value)
 Sets the actor id.
void setStatementId (std::string value)
 Sets the statement id.
void setAllocatable (bool value)
 Sets the allocatable flag.
void clearContract ()
 Clears the linked contract id.
void clearActor ()
 Clears the linked actor id.
void clearStatement ()
 Clears the linked statement id.
void clearProperties ()
 Clears linked property ids.
bool hasStatus (Status value) const noexcept
 Checks whether the transaction has a given status.
bool hasStatement () const noexcept
 Checks whether the transaction is linked to a statement.
bool hasContract () const noexcept
 Checks whether the transaction is linked to a contract.
bool hasActor () const noexcept
 Checks whether the transaction is linked to an actor.
bool hasProperties () const noexcept
 Checks whether the transaction is linked to properties.
std::size_t propertyCount () const noexcept
 Returns the number of linked properties.
bool belongsToStatement (const std::string &value) const
 Checks whether the transaction belongs to a statement.
bool isAllocatable () const noexcept
 Checks whether the transaction can be allocated.
void markUnverified ()
 Advances the transaction to unverified status when allowed.
void markVerified ()
 Advances the transaction to verified status when allowed.
void markCompleted ()
 Advances the transaction to completed status when allowed.
bool hasRelations () const noexcept
 Checks whether the transaction has any relations.
bool isStandalone () const noexcept
 Checks whether the transaction is standalone.
void setPropertyIds (std::vector< std::string > value)
 Replaces the property id list with normalized values.
void addPropertyId (std::string value)
 Adds a property id when it is not already present.
void removePropertyId (const std::string &value)
 Removes a property id from the transaction.
bool containsPropertyId (const std::string &value) const
 Checks whether a property id exists.
const std::string & id () const noexcept
const std::string & name () const noexcept
const std::string & bookingDate () const noexcept
const std::string & valuta () const noexcept
const double & amount () const noexcept
const Status & status () const noexcept
const std::string & contractId () const noexcept
const std::string & actorId () const noexcept
const std::string & statementId () const noexcept
const std::vector< std::string > & propertyIds () const noexcept
const std::string & createdAt () const noexcept
const std::string & updatedAt () const noexcept
void setId (std::string value)
void setCreatedAt (std::string value)
void setUpdatedAt (std::string value)

Detailed Description

Definition at line 20 of file Transaction.h.

Member Enumeration Documentation

◆ Status

enum class core::domain::Transaction::Status : int
strong
Enumerator
Neutral 
Unverified 
Verified 
Completed 

Definition at line 22 of file Transaction.h.

Constructor & Destructor Documentation

◆ Transaction() [1/4]

core::domain::Transaction::Transaction ( )
defaultnoexcept

◆ Transaction() [2/4]

core::domain::Transaction::Transaction ( std::string nameValue,
std::string bookingDateValue,
std::string valutaValue,
double amountValue,
bool allocatableValue = false )

Creates a transaction from raw inputs.

Parameters
nameValueRaw transaction name.
bookingDateValueRaw booking date.
valutaValueRaw valuta text.
amountValueRaw amount.
allocatableValueWhether the transaction can be allocated.

Definition at line 15 of file Transaction.cpp.

◆ Transaction() [3/4]

core::domain::Transaction::Transaction ( const Transaction & )
delete

◆ Transaction() [4/4]

core::domain::Transaction::Transaction ( Transaction && )
delete

Member Function Documentation

◆ actorId()

const std::string & core::domain::Transaction::actorId ( ) const
nodiscardnoexcept

Definition at line 179 of file Transaction.cpp.

◆ addPropertyId()

void core::domain::Transaction::addPropertyId ( std::string value)

Adds a property id when it is not already present.

Parameters
valueProperty id to add.

Definition at line 154 of file Transaction.cpp.

◆ amount()

const double & core::domain::Transaction::amount ( ) const
nodiscardnoexcept

Definition at line 176 of file Transaction.cpp.

◆ belongsToStatement()

bool core::domain::Transaction::belongsToStatement ( const std::string & value) const
nodiscard

Checks whether the transaction belongs to a statement.

Parameters
valueStatement id to compare.
Returns
true when the transaction is linked to the given statement.

Definition at line 115 of file Transaction.cpp.

◆ bookingDate()

const std::string & core::domain::Transaction::bookingDate ( ) const
nodiscardnoexcept

Definition at line 174 of file Transaction.cpp.

◆ clearActor()

void core::domain::Transaction::clearActor ( )

Clears the linked actor id.

Definition at line 79 of file Transaction.cpp.

◆ clearContract()

void core::domain::Transaction::clearContract ( )

Clears the linked contract id.

Definition at line 75 of file Transaction.cpp.

◆ clearProperties()

void core::domain::Transaction::clearProperties ( )

Clears linked property ids.

Definition at line 87 of file Transaction.cpp.

◆ clearStatement()

void core::domain::Transaction::clearStatement ( )

Clears the linked statement id.

Definition at line 83 of file Transaction.cpp.

◆ containsPropertyId()

bool core::domain::Transaction::containsPropertyId ( const std::string & value) const
nodiscard

Checks whether a property id exists.

Parameters
valueProperty id to search for.
Returns
true when the property id exists.

Definition at line 167 of file Transaction.cpp.

◆ contractId()

const std::string & core::domain::Transaction::contractId ( ) const
nodiscardnoexcept

Definition at line 178 of file Transaction.cpp.

◆ createdAt()

const std::string & core::domain::Transaction::createdAt ( ) const
nodiscardnoexcept

Definition at line 182 of file Transaction.cpp.

◆ hasActor()

bool core::domain::Transaction::hasActor ( ) const
nodiscardnoexcept

Checks whether the transaction is linked to an actor.

Returns
true when an actor id is set.

Definition at line 103 of file Transaction.cpp.

◆ hasContract()

bool core::domain::Transaction::hasContract ( ) const
nodiscardnoexcept

Checks whether the transaction is linked to a contract.

Returns
true when a contract id is set.

Definition at line 99 of file Transaction.cpp.

◆ hasProperties()

bool core::domain::Transaction::hasProperties ( ) const
nodiscardnoexcept

Checks whether the transaction is linked to properties.

Returns
true when at least one property id is set.

Definition at line 107 of file Transaction.cpp.

◆ hasRelations()

bool core::domain::Transaction::hasRelations ( ) const
nodiscardnoexcept

Checks whether the transaction has any relations.

Returns
true when statement, contract, actor or properties exist.

Definition at line 141 of file Transaction.cpp.

◆ hasStatement()

bool core::domain::Transaction::hasStatement ( ) const
nodiscardnoexcept

Checks whether the transaction is linked to a statement.

Returns
true when a statement id is set.

Definition at line 95 of file Transaction.cpp.

◆ hasStatus()

bool core::domain::Transaction::hasStatus ( Status value) const
nodiscardnoexcept

Checks whether the transaction has a given status.

Parameters
valueStatus value to compare.
Returns
true when the current status matches.

Definition at line 91 of file Transaction.cpp.

◆ id()

const std::string & core::domain::Transaction::id ( ) const
nodiscardnoexcept

Definition at line 172 of file Transaction.cpp.

◆ isAllocatable()

bool core::domain::Transaction::isAllocatable ( ) const
nodiscardnoexcept

Checks whether the transaction can be allocated.

Returns
true when the allocatable flag is set.

Definition at line 119 of file Transaction.cpp.

◆ isStandalone()

bool core::domain::Transaction::isStandalone ( ) const
nodiscardnoexcept

Checks whether the transaction is standalone.

Returns
true when no relations are assigned.

Definition at line 145 of file Transaction.cpp.

◆ markCompleted()

void core::domain::Transaction::markCompleted ( )

Advances the transaction to completed status when allowed.

Definition at line 135 of file Transaction.cpp.

◆ markUnverified()

void core::domain::Transaction::markUnverified ( )

Advances the transaction to unverified status when allowed.

Definition at line 123 of file Transaction.cpp.

◆ markVerified()

void core::domain::Transaction::markVerified ( )

Advances the transaction to verified status when allowed.

Definition at line 129 of file Transaction.cpp.

◆ name()

const std::string & core::domain::Transaction::name ( ) const
nodiscardnoexcept

Definition at line 173 of file Transaction.cpp.

◆ operator=() [1/2]

Transaction & core::domain::Transaction::operator= ( const Transaction & )
delete

◆ operator=() [2/2]

Transaction & core::domain::Transaction::operator= ( Transaction && )
delete

◆ propertyCount()

std::size_t core::domain::Transaction::propertyCount ( ) const
nodiscardnoexcept

Returns the number of linked properties.

Returns
Property relation count.

Definition at line 111 of file Transaction.cpp.

◆ propertyIds()

const std::vector< std::string > & core::domain::Transaction::propertyIds ( ) const
nodiscardnoexcept

Definition at line 181 of file Transaction.cpp.

◆ removePropertyId()

void core::domain::Transaction::removePropertyId ( const std::string & value)

Removes a property id from the transaction.

Parameters
valueProperty id to remove.

Definition at line 162 of file Transaction.cpp.

◆ setActorId()

void core::domain::Transaction::setActorId ( std::string value)

Sets the actor id.

Parameters
valueRaw actor id text.

Definition at line 63 of file Transaction.cpp.

◆ setAllocatable()

void core::domain::Transaction::setAllocatable ( bool value)

Sets the allocatable flag.

Parameters
valueAllocatable flag.

Definition at line 71 of file Transaction.cpp.

◆ setAmount() [1/2]

void core::domain::Transaction::setAmount ( double value)

Sets the amount from raw numeric input.

Parameters
valueRaw amount.

Definition at line 51 of file Transaction.cpp.

◆ setAmount() [2/2]

void core::domain::Transaction::setAmount ( MoneyAmount value)

Sets the amount from a value object.

Parameters
valueNormalized money amount wrapper.

Definition at line 47 of file Transaction.cpp.

◆ setBookingDate() [1/2]

void core::domain::Transaction::setBookingDate ( BookingDate value)

Sets the booking date from a value object.

Parameters
valueNormalized booking date wrapper.

Definition at line 35 of file Transaction.cpp.

◆ setBookingDate() [2/2]

void core::domain::Transaction::setBookingDate ( std::string value)

Sets the booking date from raw text.

Parameters
valueRaw booking date text.

Definition at line 39 of file Transaction.cpp.

◆ setContractId()

void core::domain::Transaction::setContractId ( std::string value)

Sets the contract id.

Parameters
valueRaw contract id text.

Definition at line 59 of file Transaction.cpp.

◆ setCreatedAt()

void core::domain::Transaction::setCreatedAt ( std::string value)

Definition at line 185 of file Transaction.cpp.

◆ setId()

void core::domain::Transaction::setId ( std::string value)

Definition at line 184 of file Transaction.cpp.

◆ setName() [1/2]

void core::domain::Transaction::setName ( EntityName value)

Sets the transaction name from a value object.

Parameters
valueNormalized entity name wrapper.

Definition at line 27 of file Transaction.cpp.

◆ setName() [2/2]

void core::domain::Transaction::setName ( std::string value)

Sets the transaction name from raw text.

Parameters
valueRaw transaction name text.

Definition at line 31 of file Transaction.cpp.

◆ setPropertyIds()

void core::domain::Transaction::setPropertyIds ( std::vector< std::string > value)

Replaces the property id list with normalized values.

Parameters
valueProperty id list to store.

Definition at line 149 of file Transaction.cpp.

◆ setStatementId()

void core::domain::Transaction::setStatementId ( std::string value)

Sets the statement id.

Parameters
valueRaw statement id text.

Definition at line 67 of file Transaction.cpp.

◆ setStatus()

void core::domain::Transaction::setStatus ( Status value)

Sets the transaction status.

Parameters
valueTransaction status value.

Definition at line 55 of file Transaction.cpp.

◆ setUpdatedAt()

void core::domain::Transaction::setUpdatedAt ( std::string value)

Definition at line 186 of file Transaction.cpp.

◆ setValuta()

void core::domain::Transaction::setValuta ( std::string value)

Sets the valuta text.

Parameters
valueRaw valuta text.

Definition at line 43 of file Transaction.cpp.

◆ statementId()

const std::string & core::domain::Transaction::statementId ( ) const
nodiscardnoexcept

Definition at line 180 of file Transaction.cpp.

◆ status()

const Transaction::Status & core::domain::Transaction::status ( ) const
nodiscardnoexcept

Definition at line 177 of file Transaction.cpp.

◆ updatedAt()

const std::string & core::domain::Transaction::updatedAt ( ) const
nodiscardnoexcept

Definition at line 183 of file Transaction.cpp.

◆ valuta()

const std::string & core::domain::Transaction::valuta ( ) const
nodiscardnoexcept

Definition at line 175 of file Transaction.cpp.


The documentation for this class was generated from the following files: