DuxReiNummariae 1.1.0-alpha.19
Simple and powerful budgeting application
Loading...
Searching...
No Matches
drn::banking::ReconciledBankAccount Class Reference

Represents a bank account that has undergone a reconciliation process to ensure that its transactions are consistent with bank statements. More...

#include <Reconciliation.hpp>

Collaboration diagram for drn::banking::ReconciledBankAccount:

Public Member Functions

 ReconciledBankAccount ()
 Constructs an empty instance of a reconciled bank account, representing a default state for an unreconciled account.
 ReconciledBankAccount (BankAccount bankAccount, const pecunia::Currency &currency)
 Minimum value constructor.
 ReconciledBankAccount (BankAccount bankAccount, pecunia::Money balance, std::optional<::QDate > reconciledOn)
 Full initialisation constructor.
 ReconciledBankAccount (const ReconciledBankAccount &other) noexcept
 Copy constructor.
 ReconciledBankAccount (ReconciledBankAccount &&other) noexcept
 Move constructor, transferring ownership of all state from another instance without duplicating data.
 ~ReconciledBankAccount () noexcept
 Cleans up resources associated with a reconciled bank account instance.
const pecunia::Money & balance () const noexcept
 An accessor to the amount of money in the bank account on the date reconciled.
const BankAccountbankAccount () const noexcept
 An accessor to the bank account that is reconciled.
std::strong_ordering operator<=> (const ReconciledBankAccount &other) const =default
ReconciledBankAccountoperator= (const ReconciledBankAccount &other) noexcept
 Copy assignment operator.
ReconciledBankAccountoperator= (ReconciledBankAccount &&other) noexcept
 Move assignment operator.
void reconcile (const ::QDate &reconciledOn, const pecunia::Money &balance)
 Updates the reconciled information.
const std::optional<::QDate > & reconciledOn () const noexcept
 An accessor to the date the bank account was reconciled on.

Detailed Description

Represents a bank account that has undergone a reconciliation process to ensure that its transactions are consistent with bank statements.

This class is designed to manage and reflect accurate financial records by verifying and reconciling transactions against external bank statements. It is particularly useful for financial reporting, auditing, and ensuring the integrity of account balances.

To use this class, provide the necessary details of the bank account and initiate reconciliation through the provided methods. Once reconciled, you can access the updated account state, balance, and any identified discrepancies.

Constructor & Destructor Documentation

◆ ReconciledBankAccount() [1/5]

drn::banking::ReconciledBankAccount::ReconciledBankAccount ( )

Constructs an empty instance of a reconciled bank account, representing a default state for an unreconciled account.

This constructor initializes the reconciled bank account with default values, ensuring that no unnecessary data is loaded or manipulated. The default-constructed account allows you to safely proceed with further processes without pre-existing account data.

Here is the caller graph for this function:

◆ ReconciledBankAccount() [2/5]

drn::banking::ReconciledBankAccount::ReconciledBankAccount ( BankAccount bankAccount,
const pecunia::Currency & currency )

Minimum value constructor.

Initializes a bank account that is prepared for reconciliation by associating it with a specific currency. This constructor streamlines the setup process necessary to perform reconciliations by creating a baseline using the provided bank account details and a currency framework.

Use this constructor when you need to create a reconciled bank account efficiently with only the essential details like account and currency. Post-instantiation, you can proceed to manage reconciliations and examine the associated financial data.

Parameters
bankAccountThe initial bank account to be reconciled.
currencyThe currency to associate with the bank account, ensuring all balances are denominated consistently.
Here is the call graph for this function:

◆ ReconciledBankAccount() [3/5]

drn::banking::ReconciledBankAccount::ReconciledBankAccount ( BankAccount bankAccount,
pecunia::Money balance,
std::optional<::QDate > reconciledOn )

Full initialisation constructor.

This constructor initializes a bank account with its associated balance and an optional reconciliation date. It is particularly useful when you have precise information about an account's reconciled state and need to immediately create a usable object that reflects these details.

Parameters
bankAccountThe bank account being reconciled.
balanceThe reconciled balance associated with the bank account.
reconciledOnAn optional date representing when the reconciliation occurred.
Here is the call graph for this function:

◆ ReconciledBankAccount() [4/5]

drn::banking::ReconciledBankAccount::ReconciledBankAccount ( const ReconciledBankAccount & other)
noexcept

Copy constructor.

This constructor creates a new instance as an exact copy of an existing one. It ensures that all internal data of the original object is preserved in the copy.

Parameters
otherThe object to copy from.
Here is the call graph for this function:

◆ ReconciledBankAccount() [5/5]

drn::banking::ReconciledBankAccount::ReconciledBankAccount ( ReconciledBankAccount && other)
noexcept

Move constructor, transferring ownership of all state from another instance without duplicating data.

This constructor allows efficient transfer of data from one instance to another, avoiding the overhead of copying. Use this when you need to transfer an already initialized reconciled bank account object into a new context without reinitializing or duplicating its contents.

Parameters
otherThe instance whose state will be transferred. It will leave the source instance in a valid, but unspecified, state after the operation.
Here is the call graph for this function:

◆ ~ReconciledBankAccount()

drn::banking::ReconciledBankAccount::~ReconciledBankAccount ( )
noexcept

Cleans up resources associated with a reconciled bank account instance.

Member Function Documentation

◆ balance()

const pecunia::Money & drn::banking::ReconciledBankAccount::balance ( ) const
nodiscardnoexcept

An accessor to the amount of money in the bank account on the date reconciled.

Returns
When the bank account was reconciled, gives the reconciled balance, zero when the bank account has yet to be reconciled.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ bankAccount()

const BankAccount & drn::banking::ReconciledBankAccount::bankAccount ( ) const
nodiscardnoexcept

An accessor to the bank account that is reconciled.

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

◆ operator<=>()

std::strong_ordering drn::banking::ReconciledBankAccount::operator<=> ( const ReconciledBankAccount & other) const
default
Here is the call graph for this function:

◆ operator=() [1/2]

ReconciledBankAccount & drn::banking::ReconciledBankAccount::operator= ( const ReconciledBankAccount & other)
noexcept

Copy assignment operator.

Parameters
otherThe object instance to copy its data from.
Postcondition
The current instnace's data is all replaced with the data from the supplied object.
Returns
The current instance after modification.
Here is the call graph for this function:

◆ operator=() [2/2]

ReconciledBankAccount & drn::banking::ReconciledBankAccount::operator= ( ReconciledBankAccount && other)
noexcept

Move assignment operator.

Parameters
otherThe instance whose state will be transferred. It will leave the source instance in a valid, but unspecified, state after the operation.
Postcondition
The current instnace's data is all replaced with the data from the supplied object.
Returns
The current instance after modification.
Here is the call graph for this function:

◆ reconcile()

void drn::banking::ReconciledBankAccount::reconcile ( const ::QDate & reconciledOn,
const pecunia::Money & balance )

Updates the reconciled information.

Exceptions
BankErrorWhen the date for reconciliation is in the past of the current reconciliation.
Parameters
reconciledOnThe date for the new balance after a successful reconciliation.
balanceThe new balance after reconciliation.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ reconciledOn()

const std::optional<::QDate > & drn::banking::ReconciledBankAccount::reconciledOn ( ) const
nodiscardnoexcept

An accessor to the date the bank account was reconciled on.

Returns
When the bank account was reconciled, gives the date, null when the bank account has yet to be reconciled.
Here is the call graph for this function:
Here is the caller graph for this function: