ORE Studio 0.0.4
Loading...
Searching...
No Matches
LookupFetcher.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 *
3 * Copyright (C) 2026 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_QT_LOOKUP_FETCHER_HPP
21#define ORES_QT_LOOKUP_FETCHER_HPP
22
23#include <string>
24#include <string_view>
25#include <unordered_map>
26#include <vector>
27#include "ores.qt/export.hpp"
28
29namespace ores::qt {
30
31class ClientManager;
32
41inline constexpr int lookup_fetch_limit = 1000;
42
46namespace party_categories {
47inline constexpr std::string_view operational = "Operational";
48inline constexpr std::string_view system = "System";
49inline constexpr std::string_view internal = "Internal";
50}
51
59 std::vector<std::string> type_codes;
60 std::vector<std::string> status_codes;
61 std::vector<std::string> business_centre_codes;
62};
63
71
79
87ORES_QT_API std::vector<std::string> fetch_currency_codes(ClientManager* cm);
88
96ORES_QT_API std::unordered_map<std::string, std::string>
98
103 std::string id; // UUID as string
104 std::string name;
105};
106
113ORES_QT_API std::vector<portfolio_entry> fetch_portfolio_entries(ClientManager* cm);
114
119 std::string id; // UUID as string
120 std::string name;
121};
122
129ORES_QT_API std::vector<business_unit_entry> fetch_business_unit_entries(ClientManager* cm);
130
131}
132
133#endif
Qt-based graphical user interface for ORE Studio.
Definition AccountController.hpp:32
ORES_QT_API std::unordered_map< std::string, std::string > fetch_business_centre_image_map(ClientManager *cm)
Fetches business centre code to image ID mapping from the server.
Definition LookupFetcher.cpp:115
ORES_QT_API std::vector< business_unit_entry > fetch_business_unit_entries(ClientManager *cm)
Fetches all business unit name/id pairs from the server.
Definition LookupFetcher.cpp:148
ORES_QT_API std::vector< std::string > fetch_currency_codes(ClientManager *cm)
Fetches currency ISO codes from the server.
Definition LookupFetcher.cpp:99
ORES_QT_API lookup_result fetch_party_lookups(ClientManager *cm)
Fetches party type and status codes from the server.
Definition LookupFetcher.cpp:34
constexpr int lookup_fetch_limit
Maximum number of items fetched by each synchronous lookup call.
Definition LookupFetcher.hpp:41
ORES_QT_API std::vector< portfolio_entry > fetch_portfolio_entries(ClientManager *cm)
Fetches all portfolio name/id pairs from the server.
Definition LookupFetcher.cpp:133
ORES_QT_API lookup_result fetch_tenant_lookups(ClientManager *cm)
Fetches tenant type and status codes from the server.
Definition LookupFetcher.cpp:72
Manages the lifecycle of the NATS client and login state.
Definition ClientManager.hpp:123
Result of fetching type and status lookup codes from the server.
Definition LookupFetcher.hpp:58
A name/id pair for a portfolio, used to populate parent combos.
Definition LookupFetcher.hpp:102
A name/id pair for a business unit, used to populate owner-unit combos.
Definition LookupFetcher.hpp:118