28 lines
794 B
C++
28 lines
794 B
C++
//SPDX-License-Identifier: LGPL-3.0-only
|
|
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
|
|
|
export module Nostro:Account;
|
|
|
|
import std;
|
|
import :Currency;
|
|
import :Transaction;
|
|
|
|
namespace Nostro {
|
|
export struct Account {
|
|
std::string name;
|
|
std::string bic;
|
|
std::string iban;
|
|
Currency currency;
|
|
std::int64_t balance;
|
|
|
|
std::vector<Transaction> transactions;
|
|
};
|
|
}
|
|
|
|
template<std::derived_from<Nostro::Account> T>
|
|
struct std::formatter<T> : std::formatter<std::string> {
|
|
auto format(const Nostro::Account& obj, std::format_context& ctx) const {
|
|
return std::formatter<std::string>::format(std::format("{}\t{} {}\t{}{}", obj.name, obj.bic, obj.iban, obj.currency, Nostro::FormatAmount(obj.balance, obj.currency)), ctx);
|
|
}
|
|
};
|
|
|