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
28namespace ores::qt {
29
30class ClientManager;
31
40inline constexpr int lookup_fetch_limit = 1000;
41
45namespace party_categories {
46inline constexpr std::string_view operational = "Operational";
47inline constexpr std::string_view system = "System";
48inline constexpr std::string_view internal = "Internal";
49}
50
58 std::vector<std::string> type_codes;
59 std::vector<std::string> status_codes;
60 std::vector<std::string> business_centre_codes;
61};
62
70
78
86std::vector<std::string> fetch_currency_codes(ClientManager* cm);
87
95std::unordered_map<std::string, std::string>
97
102 std::string id; // UUID as string
103 std::string name;
104};
105
112std::vector<portfolio_entry> fetch_portfolio_entries(ClientManager* cm);
113
118 std::string id; // UUID as string
119 std::string name;
120};
121
128std::vector<business_unit_entry> fetch_business_unit_entries(ClientManager* cm);
129
130}
131
132#endif
Qt-based graphical user interface for ORE Studio.
Definition AboutDialog.hpp:29
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
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
std::vector< std::string > fetch_currency_codes(ClientManager *cm)
Fetches currency ISO codes from the server.
Definition LookupFetcher.cpp:99
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:40
std::vector< portfolio_entry > fetch_portfolio_entries(ClientManager *cm)
Fetches all portfolio name/id pairs from the server.
Definition LookupFetcher.cpp:133
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:109
Result of fetching type and status lookup codes from the server.
Definition LookupFetcher.hpp:57
A name/id pair for a portfolio, used to populate parent combos.
Definition LookupFetcher.hpp:101
A name/id pair for a business unit, used to populate owner-unit combos.
Definition LookupFetcher.hpp:117