The representation of an amount of money that set aside each period for a particular usage. More...
#include <Goal.h>
Public Member Functions | |
Goal ()=default | |
Goal (const BudgetSource &source) | |
Minimum initialisation constructor. | |
Goal (const BudgetSource &source, const pecunia::Money &amount, const EventFrequency &period, const ::QDate &nextOccurOn, const pecunia::Money &final) | |
Fully initialises all member variables to their supplied values. | |
const pecunia::Money & | final () const |
The final amount of money the goal is completed at. | |
std::strong_ordering | operator<=> (const Goal &other) const noexcept |
bool | operator== (const Goal &other) const noexcept=default |
![]() | |
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 &)=default | |
virtual | ~BudgetedMoney ()=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 &) const noexcept=default |
BudgetedMoney & | operator= (BudgetedMoney &&) noexcept=default |
BudgetedMoney & | operator= (const BudgetedMoney &)=default |
bool | operator== (const BudgetedMoney &other) const |
Equality operator compares all members. | |
const EventFrequency & | period () const noexcept |
The frequency at which the money event occurs. | |
void | rename (BudgetSource source) |
Changes the source of the money. | |
const BudgetSource & | source () const noexcept |
The identifier of the source for the money. | |
void | updateNextOccurOn () |
Updates the next occur on date by the event frequency period. | |
The representation of an amount of money that set aside each period for a particular usage.
|
default |
|
explicit |
Minimum initialisation constructor.
It initializes the internal data to represent a specific goal that aligns with the properties of the provided budget source. This should be used to create an instance representing a focused financial target derived from a specific source. The associated source allows for tracking and manipulation based on the user's budgeting decisions.
source | The budget source from which the goal is derived. |
drn::budgeting::Goal::Goal | ( | const BudgetSource & | source, |
const pecunia::Money & | amount, | ||
const EventFrequency & | period, | ||
const ::QDate & | nextOccurOn, | ||
const pecunia::Money & | final ) |
Fully initialises all member variables to their supplied values.
BudgetItemError | When the source is empty. |
BudgetItemError | When the amount is less then zero. |
BudgetItemError | When the amount is not issued in a known currency. |
BudgetItemError | When the period is not known. |
BudgetItemError | When the next occur date is invalid. |
source | The source of the money budget item. |
amount | The amount the money is for every period. |
period | The frequency period of the event for the money. |
nextOccurOn | The date the money budget item last occurred on. |
final | The final amount of money the goal is completed at. |
const pecunia::Money & drn::budgeting::Goal::final | ( | ) | const |
The final amount of money the goal is completed at.
|
nodiscardnoexcept |
|
nodiscarddefaultnoexcept |