Player12
An open source football management simulator
Loading...
Searching...
No Matches
finance_repository.h
Go to the documentation of this file.
1// -----------------------------------------------------------------------------
2// Football Management Project
3// Copyright (c) 2025 - 2026 Flavio Milinanni. All Rights Reserved.
4//
5// This file is part of the Football Management Project.
6// See the LICENSE file in the project root.
7// -----------------------------------------------------------------------------
8
9#pragma once
10
11#include <functional>
12#include <memory>
13#include <unordered_map>
14#include <vector>
15
17#include "global/types.h"
18#include "model/finances.h"
19
20class Team;
21
28{
29 public:
30 explicit FinanceRepository(std::shared_ptr<DatabaseConnection> db_conn);
31
33 std::unordered_map<TeamID, std::vector<FinanceTransaction>> loadAll() const;
34
39 void insertPending(
40 const std::vector<std::reference_wrapper<const Team>>& teams) const;
41
42 private:
43 std::shared_ptr<DatabaseConnection> db_conn;
44};
Persists club ledgers (table FinanceLedger, keyed by team and sequence number, append-only).
Definition finance_repository.h:28
std::shared_ptr< DatabaseConnection > db_conn
Definition finance_repository.h:43
std::unordered_map< TeamID, std::vector< FinanceTransaction > > loadAll() const
Definition finance_repository.cpp:24
void insertPending(const std::vector< std::reference_wrapper< const Team > > &teams) const
Definition finance_repository.cpp:42
Represents a football team.
Definition team.h:47