|
DuxReiNummariae 1.1.0-alpha.19
Simple and powerful budgeting application
|
Represents a completed survey of a reconciled bank account, including distributions and associated data. It is primarily designed to allow tracking and managing a bank account’s reconciled state with respect to budgeting and distribution of account balance amount. More...
#include <CompletedSurvey.hpp>
Public Member Functions | |
| CompletedSurvey ()=default | |
| CompletedSurvey (banking::BankAccount ba, const pecunia::Currency ¤cy) | |
| Partial initialisation constructor for creating a new survey. | |
| CompletedSurvey (banking::ReconciledBankAccount reconciled, std::map< budgeting::BudgetItemIdentifier, pecunia::Money > distribution, pecunia::Money nonDistributed, std::optional<::QString > checksum) | |
| Full initialisation constructor. It is designed to ensure consistency and validity of the survey’s data. | |
| CompletedSurvey (CompletedSurvey &&other) noexcept=default | |
| CompletedSurvey (const CompletedSurvey &other) noexcept=default | |
| ~CompletedSurvey () noexcept=default | |
| const std::optional<::QString > & | checksum () const noexcept |
| Retrieves the stored checksum value associated with the survey’s finalised state. This provides a mechanism to verify the integrity and consistency of the survey data after it has been reconciled. | |
| void | completed (const ::QDate &completedOn, const pecunia::Money &reconciledBalance, const std::map< budgeting::BudgetItemIdentifier, DistributedAmount > &distribution, const pecunia::Money &nonDistributed, const foundation::Percentage &balanceWindow) |
| Finalises and records the completion of a survey of a reconciled bank account, including its reconciled balance, distribution, and related details. | |
| const std::map< budgeting::BudgetItemIdentifier, pecunia::Money > & | distribution () const noexcept |
| Provides access to the distribution of allocated amounts from the reconciled balance in the completed survey, enabling consumers to review the allocation results. | |
| const pecunia::Money & | nonDistributed () const noexcept |
| Retrieves the part of the total reconciled amount that has not been distributed. | |
| bool | operator!= (const CompletedSurvey &) const noexcept=default |
| std::strong_ordering | operator<=> (const CompletedSurvey &other) const noexcept |
| Compares this completed survey with another to determine their relative order. The comparison considers reconciliation state, non-distributed amounts, distribution data, and a checksum in that order. | |
| CompletedSurvey & | operator= (CompletedSurvey &&other) noexcept |
| Moves the contents of another instance into this instance, effectively transferring ownership of all data. | |
| CompletedSurvey & | operator= (const CompletedSurvey &other) noexcept |
| Assigns the contents of another instance to the current instance. | |
| bool | operator== (const CompletedSurvey &) const noexcept=default |
| const banking::ReconciledBankAccount & | reconciled () const noexcept |
| Retrieves the reconciled bank account associated with the completed survey. This information is intended to facilitate the examination and tracking of the reconciled state within a budgeting or financial context. | |
| void | renamed (const accounting::AccountNumber &original, const accounting::AccountNumber &changed) |
| Updates the reconciled bank account with a new account number. | |
| void | renamed (const banking::BankName &original, const banking::BankName &newName) |
| Updates the surveyed bank account’s name. | |
| void | renamed (const budgeting::BudgetItemIdentifier &id, const budgeting::BudgetSource &newName) |
| Renames a specific budget distribution item identified by its identifier. | |
Represents a completed survey of a reconciled bank account, including distributions and associated data. It is primarily designed to allow tracking and managing a bank account’s reconciled state with respect to budgeting and distribution of account balance amount.
|
default |
| drn::surveying::CompletedSurvey::CompletedSurvey | ( | banking::BankAccount | ba, |
| const pecunia::Currency & | currency ) |
Partial initialisation constructor for creating a new survey.
| ba | The bank account that is reconciled. |
| currency | The currency held within the bank account. |
| drn::surveying::CompletedSurvey::CompletedSurvey | ( | banking::ReconciledBankAccount | reconciled, |
| std::map< budgeting::BudgetItemIdentifier, pecunia::Money > | distribution, | ||
| pecunia::Money | nonDistributed, | ||
| std::optional<::QString > | checksum ) |
Full initialisation constructor. It is designed to ensure consistency and validity of the survey’s data.
| SurveyError | When the currency of the non-distributed amount does not match the reconciled bank account’s currency. |
| SurveyError | When a checksum is provided, but does not match the calculated value based on the values supplied. |
| SurveyError | When a zero-amount is distributed in a budget item. |
| reconciled | The reconciled bank account that reflects the current state of the account. |
| distribution | A mapping of budget items to monetary allocations that distributes the account’s reconciled balance. |
| nonDistributed | The amount of funds that remain after allocation to budget items. |
| checksum | A checksum to validate the integrity of the survey content. No validation occurs when null. |
|
defaultnoexcept |
|
defaultnoexcept |
|
defaultnoexcept |
|
nodiscardnoexcept |
Retrieves the stored checksum value associated with the survey’s finalised state. This provides a mechanism to verify the integrity and consistency of the survey data after it has been reconciled.
| void drn::surveying::CompletedSurvey::completed | ( | const ::QDate & | completedOn, |
| const pecunia::Money & | reconciledBalance, | ||
| const std::map< budgeting::BudgetItemIdentifier, DistributedAmount > & | distribution, | ||
| const pecunia::Money & | nonDistributed, | ||
| const foundation::Percentage & | balanceWindow ) |
Finalises and records the completion of a survey of a reconciled bank account, including its reconciled balance, distribution, and related details.
| SurveyError | When the non-distributed balance currency is not the same as the reconciled account’s currency. |
| SurveyError | When the combined total distribution balance and non-distributed balance is not within the specified percentage window of the reconciled balance. |
| SurveyError | When a zero-amount is distributed in a budget item. |
| completedOn | The date when the survey was finalised. |
| reconciledBalance | The reconciled balance of the bank account associated with the survey. |
| distribution | A map of budget item identifiers to distributed amounts, representing how the reconciled balance is distributed amongst budget items. |
| nonDistributed | The portion of the reconciled balance that has not been distributed to any budget item. |
| balanceWindow | The allowed percentage deviation within which the distribution balance must align with the reconciled balance. |
|
nodiscardnoexcept |
Provides access to the distribution of allocated amounts from the reconciled balance in the completed survey, enabling consumers to review the allocation results.
|
nodiscardnoexcept |
Retrieves the part of the total reconciled amount that has not been distributed.
|
nodiscarddefaultnoexcept |
|
nodiscardnoexcept |
Compares this completed survey with another to determine their relative order. The comparison considers reconciliation state, non-distributed amounts, distribution data, and a checksum in that order.
| other | The other completed survey to compare against. |
|
noexcept |
Moves the contents of another instance into this instance, effectively transferring ownership of all data.
This ensures efficient transfer of resources without the need for duplicating data, and it is used to handle ownership transfer scenarios where copying data would negatively impact performance or where the original instance’s data is no longer needed.
| other | The instance whose data will be transferred to this instance. |
|
noexcept |
Assigns the contents of another instance to the current instance.
| other | An instance whose data will be duplicated into the current instance. |
|
nodiscarddefaultnoexcept |
|
nodiscardnoexcept |
Retrieves the reconciled bank account associated with the completed survey. This information is intended to facilitate the examination and tracking of the reconciled state within a budgeting or financial context.
| void drn::surveying::CompletedSurvey::renamed | ( | const accounting::AccountNumber & | original, |
| const accounting::AccountNumber & | changed ) |
Updates the reconciled bank account with a new account number.
| SurveyError | If the provided original account number does not match the account number of the reconciled bank account. |
| original | The account number of the bank account being renamed. |
| changed | The new account number to replace the original number for the reconciled bank account. |
| void drn::surveying::CompletedSurvey::renamed | ( | const banking::BankName & | original, |
| const banking::BankName & | newName ) |
Updates the surveyed bank account’s name.
| SurveyError | When the original bank name does not match the currently surveyed bank account. |
| original | The current name of the surveyed bank account. |
| newName | The new name to assign to the surveyed bank account. |
| void drn::surveying::CompletedSurvey::renamed | ( | const budgeting::BudgetItemIdentifier & | id, |
| const budgeting::BudgetSource & | newName ) |
Renames a specific budget distribution item identified by its identifier.
| BudgetItemError | Thrown when the specified identifier does not correspond to any existing budget item in the distribution. |
| id | The identifier of the budget item to be renamed. |
| newName | The new name to be assigned to the identified budget item. |