DuxReiNummariae 1.1.0-alpha.19
Simple and powerful budgeting application
Loading...
Searching...
No Matches
drn::budgeting::Debt Class Referencefinal

The representation of an amount of money that is borrowed and how often it occurs. More...

#include <Debt.hpp>

Inheritance diagram for drn::budgeting::Debt:
Collaboration diagram for drn::budgeting::Debt:

Public Member Functions

 Debt ()
 Constructs all member variables to their empty state.
 Debt (const BudgetSource &source)
 Partially initialises the debt to be based upon a source and defaulting the rest.
 Debt (const BudgetSource &source, const pecunia::Money &minimum, const EventFrequency &period, const ::QDate &nextOccurOn, const pecunia::Money &borrowed, const foundation::Percentage &interest)
 Fully initialises all member variables to their supplied values.
 Debt (const Debt &other)
 Complete copy constructor.
const pecunia::Money & borrowed () const
 The total amount of money borrowed.
std::unique_ptr< BudgetedMoneyclone () const override
 Creates a unique copy of the current instance.
const foundation::Percentageinterest () const
 The current interest rate for the debt.
std::strong_ordering operator<=> (const Debt &other) const noexcept
 Determines the ordering relationship between two debt budget items.
Debtoperator= (const Debt &other)
 Complete copy assignment operator.
bool operator== (const Debt &other) const noexcept
 Full equality operator.
Public Member Functions inherited from drn::budgeting::BudgetedMoney
 BudgetedMoney ()
 Constructs all member variables to their empty state.
 BudgetedMoney (BudgetedMoney &&) noexcept=default
 BudgetedMoney (BudgetSource source)
 Constructs all member variables to their empty state apart from the source.
 BudgetedMoney (BudgetSource source, pecunia::Money amount, const EventFrequency &period, const ::QDate &nextOccurOn)
 Fully initialises all member variables to their supplied values.
 BudgetedMoney (const BudgetedMoney &)=delete
 ~BudgetedMoney () override=default
const pecunia::Money & amount () const noexcept
 The amount expected per period for the money.
const ::QDate & nextOccurOn () const noexcept
 The date the budgeted money item occurs on next.
bool operator!= (const BudgetedMoney &other) const
 Inequality operator compares all members.
std::strong_ordering operator<=> (const BudgetedMoney &other) const noexcept
 Compares the current instance with another instance.
BudgetedMoneyoperator= (BudgetedMoney &&) noexcept=default
BudgetedMoneyoperator= (const BudgetedMoney &)=delete
bool operator== (const BudgetedMoney &other) const
 Equality operator compares all members.
const EventFrequencyperiod () const noexcept
 The frequency at which the money event occurs.
void rename (BudgetSource source)
 Changes the source of the money.
const BudgetSourcesource () const noexcept
 The identifier of the source for the money.
void updateNextOccurOn ()
 Updates the next occur on date by the event frequency period.
Public Member Functions inherited from drn::foundation::RequireClonable< BudgetedMoney >
virtual ~RequireClonable ()=default

Additional Inherited Members

Protected Member Functions inherited from drn::budgeting::BudgetedMoney
void assign (const BudgetedMoney &other)
 Assigns the values from another BudgetedMoney instance to the current instance.

Detailed Description

The representation of an amount of money that is borrowed and how often it occurs.

Constructor & Destructor Documentation

◆ Debt() [1/4]

drn::budgeting::Debt::Debt ( )

Constructs all member variables to their empty state.

Here is the caller graph for this function:

◆ Debt() [2/4]

drn::budgeting::Debt::Debt ( const BudgetSource & source)
explicit

Partially initialises the debt to be based upon a source and defaulting the rest.

Here is the call graph for this function:

◆ Debt() [3/4]

drn::budgeting::Debt::Debt ( const BudgetSource & source,
const pecunia::Money & minimum,
const EventFrequency & period,
const ::QDate & nextOccurOn,
const pecunia::Money & borrowed,
const foundation::Percentage & interest )

Fully initialises all member variables to their supplied values.

Exceptions
BudgetItemErrorWhen the source is empty.
BudgetItemErrorWhen the borrowed is less then zero.
BudgetItemErrorWhen the borrowed is not issued in a known currency.
BudgetItemErrorWhen the borrowed is less then the minimum payment.
BudgetItemErrorWhen the period is not known.
BudgetItemErrorWhen the minimum is less than zero.
BudgetItemErrorWhen the minimum is not issued in a known currency.
BudgetItemErrorWhen the interest rate is less than zero.
BudgetItemErrorWhen the next occur date is invalid.
Parameters
sourceThe source of the debt.
minimumThe minimum payment required per payment period.
periodThe frequency period of payment for the debt source.
nextOccurOnThe date the money budget item last occurred on.
interestThe interest rate applied to the borrowed amount.
borrowedThe total amount of money borrowed from the debt source.
Here is the call graph for this function:

◆ Debt() [4/4]

drn::budgeting::Debt::Debt ( const Debt & other)

Complete copy constructor.

Parameters
otherThe instance to copy.
Postcondition
The current instance is a deep copy of the other instance.
Here is the call graph for this function:

Member Function Documentation

◆ borrowed()

const pecunia::Money & drn::budgeting::Debt::borrowed ( ) const
nodiscard

The total amount of money borrowed.

Here is the caller graph for this function:

◆ clone()

std::unique_ptr< BudgetedMoney > drn::budgeting::Debt::clone ( ) const
nodiscardoverridevirtual

Creates a unique copy of the current instance.

Returns
The cloned instance of the object.

Implements drn::foundation::RequireClonable< BudgetedMoney >.

◆ interest()

const foundation::Percentage & drn::budgeting::Debt::interest ( ) const
nodiscard

The current interest rate for the debt.

Here is the caller graph for this function:

◆ operator<=>()

std::strong_ordering drn::budgeting::Debt::operator<=> ( const Debt & other) const
nodiscardnoexcept

Determines the ordering relationship between two debt budget items.

Parameters
otherThe other debt budget item to compare against.
Returns
The result of comparing the two debt budget items in the order basic budget items, amount borrowed, and finally the interest rate.
Here is the call graph for this function:

◆ operator=()

Debt & drn::budgeting::Debt::operator= ( const Debt & other)

Complete copy assignment operator.

Parameters
otherThe instance to copy
Postcondition
The current instance is a deep copy of the other instance.
Returns
The modified instance.
Here is the call graph for this function:

◆ operator==()

bool drn::budgeting::Debt::operator== ( const Debt & other) const
nodiscardnoexcept

Full equality operator.

Parameters
otherThe other instance to compare for equality.
Returns
Gives true if all member variables are equivalent.
Here is the call graph for this function: