ORE Studio 0.0.4
Loading...
Searching...
No Matches
currency.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 *
3 * Copyright (C) 2025 Marco Craveiro <marco.craveiro@gmail.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License as published by the Free Software
7 * Foundation; either version 3 of the License, or (at your option) any later
8 * version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 * details.
14 *
15 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc., 51
17 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 *
19 */
20#ifndef ORES_REFDATA_DOMAIN_CURRENCY_HPP
21#define ORES_REFDATA_DOMAIN_CURRENCY_HPP
22
23#include <chrono>
24#include <string>
25#include <optional>
26#include <boost/uuid/uuid.hpp>
27
28namespace ores::refdata::domain {
29
33struct currency final {
37 int version = 0;
38
42 std::string iso_code;
43
47 std::string name;
48
52 std::string numeric_code;
56 std::string symbol;
60 std::string fraction_symbol;
61
66
70 std::string rounding_type;
71
76
80 std::string format;
81
85 std::string currency_type;
86
90 std::optional<boost::uuids::uuid> image_id;
91
95 std::string recorded_by;
96
103
107 std::string change_commentary;
108
112 std::chrono::system_clock::time_point recorded_at;
113};
114
115}
116
117#endif
Domain types for risk management.
Definition country.hpp:28
Represents a currency with its metadata and formatting rules.
Definition currency.hpp:33
std::string iso_code
ISO 4217 alphabetic code (e.g., "USD").
Definition currency.hpp:42
std::string change_commentary
Free-text commentary explaining the change.
Definition currency.hpp:107
std::string fraction_symbol
Symbol for fractional unit (e.g., "cent").
Definition currency.hpp:60
int rounding_precision
Decimal places to round to during formatting.
Definition currency.hpp:75
int fractions_per_unit
Number of fractional units per whole unit (e.g., 100 for cents).
Definition currency.hpp:65
std::string symbol
Currency symbol (e.g., "$").
Definition currency.hpp:56
std::string numeric_code
ISO 4217 numeric code (e.g., "840").
Definition currency.hpp:52
std::optional< boost::uuids::uuid > image_id
Optional reference to a flag image in the images table.
Definition currency.hpp:90
std::chrono::system_clock::time_point recorded_at
Timestamp when this version of the record was recorded in the system.
Definition currency.hpp:112
std::string name
Full name of the currency (e.g., "United States Dollar").
Definition currency.hpp:47
std::string recorded_by
Username of the person who recorded this version in the system.
Definition currency.hpp:95
int version
Version number for optimistic locking and change tracking.
Definition currency.hpp:37
std::string rounding_type
Rounding method for fractional amounts.
Definition currency.hpp:70
std::string format
Format string for display.
Definition currency.hpp:80
std::string currency_type
Type classification (e.g., fiat, crypto, major, minor, etc.).
Definition currency.hpp:85
std::string change_reason_code
Code identifying the reason for the change.
Definition currency.hpp:102