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

Classes

struct  AccountNumberBankType
 The representation of the bank account ledger, and the type of account held within a financial institution. More...
class  Bank
 A representation of a financial institution. More...
struct  BankAccount
 Represents a simple bank account with basic operations. More...
struct  BankError
 This represents an issue with a Bank. More...
struct  BankMap
 A representation of financial institutions mapped to their names. More...
class  BankName
 A representation of the name of a financial institution. More...
struct  ReconciledBalance
 Represents a reconciled balance for a bank account. More...
class  ReconciledBankAccount
 Represents a bank account that has undergone a reconciliation process to ensure that its transactions are consistent with bank statements. More...

Functions

DRN_BANKING_EXPORT bool isAssetAccount (const BankAccountTypes type)
 Determines if a supported account type is an asset account type.
DRN_BANKING_EXPORT bool isLiabilityAccount (const BankAccountTypes type)
 Determines if a supported account type is a liability account type.
DRN_BANKING_EXPORT bool operator!= (const Bank &lhs, const Bank &rhs)
 Full inequality comparison operator.
DRN_BANKING_EXPORT bool operator!= (const BankMap &lhs, const BankMap &rhs)
DRN_BANKING_EXPORT::QDebug operator<< (::QDebug out, const Bank &b)
 Full object Qt stream insertion operator.
DRN_BANKING_EXPORT::QDebug operator<< (::QDebug out, const BankAccount &ba)
 Full object Qt stream insertion operator.
DRN_BANKING_EXPORT::QDebug operator<< (::QDebug out, const BankAccountTypes &data)
 Full object Qt stream insertion operator.
DRN_BANKING_EXPORT::QDebug operator<< (::QDebug out, const BankName &bn)
 Full object Qt stream insertion operator.
DRN_BANKING_EXPORT::QDebug operator<< (::QDebug out, const ReconciledBalance &lr)
 Full object Qt stream insertion operator.
DRN_BANKING_EXPORT::QDebug operator<< (::QDebug out, const ReconciledBankAccount &rba)
 Full object Qt stream insertion operator.
DRN_BANKING_EXPORT std::ostream & operator<< (std::ostream &o, const BankMap &bm)
DRN_BANKING_EXPORT std::ostream & operator<< (std::ostream &out, const AccountNumberBankType &bat)
 Full object stream insertion operator.
DRN_BANKING_EXPORT std::ostream & operator<< (std::ostream &out, const Bank &b)
 Full object stream insertion operator.
DRN_BANKING_EXPORT std::ostream & operator<< (std::ostream &out, const BankAccount &ba)
 Full object stream insertion operator.
DRN_BANKING_EXPORT std::ostream & operator<< (std::ostream &out, const BankAccountTypes &sat)
 Full object stream insertion operator.
DRN_BANKING_EXPORT std::ostream & operator<< (std::ostream &out, const BankName &bn)
 Full object stream insertion operator.
DRN_BANKING_EXPORT std::ostream & operator<< (std::ostream &out, const ReconciledBankAccount &rba)
 Full object stream insertion operator.
DRN_BANKING_EXPORT bool operator== (const Bank &lhs, const Bank &rhs)
 Full equality comparison operator.
DRN_BANKING_EXPORT bool operator== (const BankMap &lhs, const BankMap &rhs)
DRN_BANKING_EXPORT::QString presentationText (const AccountNumberBankType &bat, const foundation::LocaleAware isLocaleAware=foundation::LocaleAware{true})
 Generates a user-friendly presentation text for a bank account type.
DRN_BANKING_EXPORT::QString presentationText (const BankAccount &ba, const foundation::LocaleAware isLocaleAware=foundation::LocaleAware{true})
 Generates a localized presentation text for a bank account.
DRN_BANKING_EXPORT::QString presentationText (const BankAccountTypes &sat)
 Generates a user-friendly localised presentation text for a given supported account type.
DRN_BANKING_EXPORT::QString presentationText (const BankName &bn)
 Generates a user-friendly presentation text for a financial institution's name.
DRN_BANKING_EXPORT accounting::AccountTypes toAccountTypes (const BankAccountTypes &sat)
 Converts a supported bank account type to a corresponding ledger account type.
DRN_BANKING_EXPORT BankAccountTypes toBankAccountTypes (const ::QString &accountType)
 Maps a bank account type string to its corresponding supported account type enumeration. This method processes a provided bank account type string and converts it into a supported account type enumeration value, which can be used for further classification or logic in financial account management.
DRN_BANKING_EXPORT::QString toNonLocalisedText (const BankAccountTypes &sat)
 Converts the given account type into its non-localized textual representation.

Variables

constexpr std::array allBankAccountTypes
 A collection of all supported financial account types.

Function Documentation

◆ isAssetAccount()

DRN_BANKING_EXPORT bool drn::banking::isAssetAccount ( const BankAccountTypes type)
nodiscard

Determines if a supported account type is an asset account type.

Parameters
typeThe supported type to check.
Returns
Gives true when the supported type is of a known asset type, false otherwise.

◆ isLiabilityAccount()

DRN_BANKING_EXPORT bool drn::banking::isLiabilityAccount ( const BankAccountTypes type)
nodiscard

Determines if a supported account type is a liability account type.

Parameters
typeThe supported type to check.
Returns
Gives true when the supported type is of a known liability type, false otherwise.

◆ operator!=() [1/2]

DRN_BANKING_EXPORT bool drn::banking::operator!= ( const Bank & lhs,
const Bank & rhs )

Full inequality comparison operator.

Parameters
lhsThe left-hand-side to compare against
rhsThe right-hand-side to compare with
Returns
Gives true when any value is /not/ the same, false otherwise.

◆ operator!=() [2/2]

DRN_BANKING_EXPORT bool drn::banking::operator!= ( const BankMap & lhs,
const BankMap & rhs )

◆ operator<<() [1/13]

DRN_BANKING_EXPORT::QDebug drn::banking::operator<< ( ::QDebug out,
const Bank & b )

Full object Qt stream insertion operator.

Parameters
outThe stream to place the data into.
bThe data to place into the stream.
Returns
The modified stream after insertion.

◆ operator<<() [2/13]

DRN_BANKING_EXPORT::QDebug drn::banking::operator<< ( ::QDebug out,
const BankAccount & ba )

Full object Qt stream insertion operator.

Parameters
outThe stream to place the data into.
baThe data to place into the stream.
Returns
The modified stream after insertion.

◆ operator<<() [3/13]

DRN_BANKING_EXPORT::QDebug drn::banking::operator<< ( ::QDebug out,
const BankAccountTypes & data )

Full object Qt stream insertion operator.

Parameters
outThe stream to place the data into.
dataThe data to place into the stream.
Returns
The modified stream after insertion.

◆ operator<<() [4/13]

DRN_BANKING_EXPORT::QDebug drn::banking::operator<< ( ::QDebug out,
const BankName & bn )

Full object Qt stream insertion operator.

Parameters
outThe stream to place the data into.
bnThe data to place into the stream.
Returns
The modified stream after insertion.

◆ operator<<() [5/13]

DRN_BANKING_EXPORT::QDebug drn::banking::operator<< ( ::QDebug out,
const ReconciledBalance & lr )

Full object Qt stream insertion operator.

Parameters
outThe stream to place the data into.
lrThe data to place into the stream.
Returns
The modified stream after insertion.

◆ operator<<() [6/13]

DRN_BANKING_EXPORT::QDebug drn::banking::operator<< ( ::QDebug out,
const ReconciledBankAccount & rba )

Full object Qt stream insertion operator.

Parameters
outThe stream to place the data into.
rbaThe data to place into the stream.
Returns
The modified stream after insertion.

◆ operator<<() [7/13]

DRN_BANKING_EXPORT std::ostream & drn::banking::operator<< ( std::ostream & o,
const BankMap & bm )

◆ operator<<() [8/13]

DRN_BANKING_EXPORT std::ostream & drn::banking::operator<< ( std::ostream & out,
const AccountNumberBankType & bat )

Full object stream insertion operator.

Parameters
outThe stream to place the data into.
batThe data to place into the stream.
Returns
The modified stream after insertion.

◆ operator<<() [9/13]

DRN_BANKING_EXPORT std::ostream & drn::banking::operator<< ( std::ostream & out,
const Bank & b )

Full object stream insertion operator.

Parameters
outThe stream to place the data into.
bThe data to place into the stream.
Returns
The modified stream after insertion.

◆ operator<<() [10/13]

DRN_BANKING_EXPORT std::ostream & drn::banking::operator<< ( std::ostream & out,
const BankAccount & ba )

Full object stream insertion operator.

Parameters
outThe stream to place the data into.
baThe data to place into the stream.
Returns
The modified stream after insertion.

◆ operator<<() [11/13]

DRN_BANKING_EXPORT std::ostream & drn::banking::operator<< ( std::ostream & out,
const BankAccountTypes & sat )

Full object stream insertion operator.

Parameters
outThe stream to place the data into.
satThe data to place into the stream.
Returns
The modified stream after insertion.

◆ operator<<() [12/13]

DRN_BANKING_EXPORT std::ostream & drn::banking::operator<< ( std::ostream & out,
const BankName & bn )

Full object stream insertion operator.

Parameters
outThe stream to place the data into.
bnThe data to place into the stream.
Returns
The modified stream after insertion.

◆ operator<<() [13/13]

DRN_BANKING_EXPORT std::ostream & drn::banking::operator<< ( std::ostream & out,
const ReconciledBankAccount & rba )

Full object stream insertion operator.

Parameters
outThe stream to place the data into.
rbaThe data to place into the stream.
Returns
The modified stream after insertion.

◆ operator==() [1/2]

DRN_BANKING_EXPORT bool drn::banking::operator== ( const Bank & lhs,
const Bank & rhs )

Full equality comparison operator.

Parameters
lhsThe left-hand-side to compare against
rhsThe right-hand-side to compare with
Returns
Gives true when all values are the same, false otherwise.

◆ operator==() [2/2]

DRN_BANKING_EXPORT bool drn::banking::operator== ( const BankMap & lhs,
const BankMap & rhs )

◆ presentationText() [1/4]

DRN_BANKING_EXPORT::QString drn::banking::presentationText ( const AccountNumberBankType & bat,
const foundation::LocaleAware isLocaleAware = foundation::LocaleAware{true} )

Generates a user-friendly presentation text for a bank account type.

This method creates a textual representation of the bank account type, including account number and type. It is useful in GUI applications or any user-facing component to display a descriptive representation of an account. Localization is applied to the presentation when specified.

Exceptions
std::logic_errorIf the provided bank account type is invalid or unrecognized.
Parameters
batThe bank account type for which the presentation text is generated.
isLocaleAwareA flag indicating whether to localize the presentation text or not.
Returns
A localized or non-localized descriptive string representing the bank account type and number.

◆ presentationText() [2/4]

DRN_BANKING_EXPORT::QString drn::banking::presentationText ( const BankAccount & ba,
const foundation::LocaleAware isLocaleAware = foundation::LocaleAware{true} )

Generates a localized presentation text for a bank account.

This function creates a formatted string to display information about a bank account, including its name and type. It supports localization to adapt the presentation depending on the specified locale preferences. The output is designed for display in GUI elements or logs where an account summary is needed.

Use this method to generate a readable and context-appropriate representation of a bank account.

Parameters
baThe bank account object for which the presentation text is generated.
isLocaleAwareIndicates whether the output should adhere to locale-aware formatting rules.
Returns
A formatted string representing the bank account, localized if specified.
Here is the caller graph for this function:

◆ presentationText() [3/4]

DRN_BANKING_EXPORT::QString drn::banking::presentationText ( const BankAccountTypes & sat)

Generates a user-friendly localised presentation text for a given supported account type.

This method emits a human-readable string corresponding to the financial account type, such as "Chequeing", "Savings", or "Credit Card". It is useful in GUI applications or other user-facing components that need a descriptive label for account types.

Exceptions
std::logic_errorIf the provided account type is not recognized.
Parameters
satThe account type for which a descriptive string is required.
Returns
A descriptive label for the specified account type.

◆ presentationText() [4/4]

DRN_BANKING_EXPORT::QString drn::banking::presentationText ( const BankName & bn)

Generates a user-friendly presentation text for a financial institution's name.

This method retrieves the name of the financial institution and formats it for presentation through a graphical or textual user interface.

Parameters
bnThe object representing the financial institution whose name is to be presented.
Returns
A formatted string representation of the financial institution's name, suitable for presentation.
Here is the call graph for this function:

◆ toAccountTypes()

DRN_BANKING_EXPORT accounting::AccountTypes drn::banking::toAccountTypes ( const BankAccountTypes & sat)

Converts a supported bank account type to a corresponding ledger account type.

This method maps a given supported bank account type to its equivalent ledger account type based on pre-defined mappings. It is useful when translating account types between two different systems or domains, ensuring compatibility and proper categorization of account data.

Exceptions
std::invalid_argumentThrows this exception if the provided supported account type is invalid or unrecognized.
Parameters
satThe supported bank account type to be converted.
Returns
The converted bank account type corresponding to the provided supported ledger account type.

◆ toBankAccountTypes()

DRN_BANKING_EXPORT BankAccountTypes drn::banking::toBankAccountTypes ( const ::QString & accountType)

Maps a bank account type string to its corresponding supported account type enumeration. This method processes a provided bank account type string and converts it into a supported account type enumeration value, which can be used for further classification or logic in financial account management.

Exceptions
std::invalid_argumentThrown if the provided bank account type string cannot be mapped to a valid supported account type enumeration.
Parameters
accountTypeA textual representation of a bank account type. This can be a localized string matching predefined values for different account types such as "Chequeing", "Savings", or "Loan".
Returns
The enumeration value corresponding to the provided bank account type string.

◆ toNonLocalisedText()

DRN_BANKING_EXPORT::QString drn::banking::toNonLocalisedText ( const BankAccountTypes & sat)

Converts the given account type into its non-localized textual representation.

This function maps the supported account types to their corresponding non-localized string representations. It is useful when a consistent textual representation of account types is required, irrespective of localization or display formatting preferences.

Exceptions
Throwsa runtime exception if the provided account type is invalid or unhandled.
Parameters
satThe supported account type that is to be converted to a non-localized text.
Returns
A non-localized string representing the given account type. If the account typ is Unknown, the string representation will also state "Unknown".

Variable Documentation

◆ allBankAccountTypes

std::array drn::banking::allBankAccountTypes
inlineconstexpr
Initial value:
{
BankAccountTypes::Unknown,
BankAccountTypes::Chequeing,
BankAccountTypes::Goal,
BankAccountTypes::CreditCard,
BankAccountTypes::Loan,
BankAccountTypes::Savings
}

A collection of all supported financial account types.

This array contains all the predefined account types supported by the system. It provides a centralized list that can be used for validations, comparisons, or any functionality that requires iterating over the supported account types. It is especially useful to avoid redundancy and ensure consistency when handling account types in business logic or graphical interfaces.

Use this array when you need to check or iterate over all types of accounts supported in the system.

Example usage:

for (const auto& accountType : allBankAccountTypes) {
// Perform operations based on the accountType
}
constexpr std::array allBankAccountTypes
A collection of all supported financial account types.
Definition BankAccountType.hpp:221