|
Player12
An open source football management simulator
|
Persists club ledgers (table FinanceLedger, keyed by team and sequence number, append-only). More...
#include <finance_repository.h>
Public Member Functions | |
| FinanceRepository (std::shared_ptr< DatabaseConnection > db_conn) | |
| std::unordered_map< TeamID, std::vector< FinanceTransaction > > | loadAll () const |
| void | insertPending (const std::vector< std::reference_wrapper< const Team > > &teams) const |
Private Attributes | |
| std::shared_ptr< DatabaseConnection > | db_conn |
Persists club ledgers (table FinanceLedger, keyed by team and sequence number, append-only).
|
explicit |
| void FinanceRepository::insertPending | ( | const std::vector< std::reference_wrapper< const Team > > & | teams | ) | const |
Inserts the teams' not yet persisted transactions. Rows that already exist are ignored, so flushing twice before markPersisted() is safe.
| std::unordered_map< TeamID, std::vector< FinanceTransaction > > FinanceRepository::loadAll | ( | ) | const |
Loads every ledger, oldest transaction first.
|
private |