20#ifndef ORES_QT_ENTITY_DETAIL_DIALOG_HPP
21#define ORES_QT_ENTITY_DETAIL_DIALOG_HPP
23#include <QTableWidget>
27#include <unordered_map>
28#include "ores.qt/ClientManager.hpp"
29#include "ores.qt/DetailDialogBase.hpp"
30#include "ores.qt/ImageCache.hpp"
31#include "ores.qt/EntityDetailOperations.hpp"
32#include "ores.logging/make_logger.hpp"
33#include "ores.refdata.api/domain/party_id_scheme.hpp"
36class EntityDetailDialog;
53 inline static std::string_view logger_name =
54 "ores.qt.entity_detail_dialog";
56 [[nodiscard]]
static auto& lg() {
58 static auto instance = make_logger(logger_name);
64 std::shared_ptr<entity_detail_operations> ops,
65 QWidget* parent =
nullptr);
70 void setUsername(
const std::string& username);
72 void setCreateMode(
bool createMode);
73 void setReadOnly(
bool readOnly);
76 void entitySaved(
const QString& code);
77 void entityDeleted(
const QString& code);
81 void onDeleteClicked();
82 void onCodeChanged(
const QString& text);
83 void onFieldChanged();
84 void onAddIdentifier();
85 void onDeleteIdentifier();
87 void onDeleteContact();
88 void onContactDoubleClicked(
int row,
int column);
99 void setupConnections();
100 void setupIdentifierTable();
101 void setupContactTable();
102 void setupHierarchyTree();
103 void populateLookups();
104 void loadIdentifiers();
106 void loadAllEntities();
107 void loadIdSchemes();
108 void loadCountryImageMap();
109 void populateParentCombo();
110 void populateIdentifierTable();
111 void populateContactTable();
112 void buildHierarchyTree();
113 void updateUiFromEntity();
114 void updateEntityFromUi();
115 void updateSaveButtonState();
116 bool validateInput();
118 std::shared_ptr<entity_detail_operations> ops_;
119 Ui::EntityDetailDialog* ui_;
122 std::string username_;
124 bool createMode_{
true};
125 bool readOnly_{
false};
126 bool hasChanges_{
false};
129 std::vector<parent_entity_entry> allEntities_;
132 QTableWidget* identifierTable_;
133 QToolBar* identifierToolbar_;
134 std::vector<identifier_entry> identifiers_;
137 QTableWidget* contactTable_;
138 QToolBar* contactToolbar_;
139 std::vector<contact_entry> contacts_;
142 std::vector<refdata::domain::party_id_scheme> idSchemes_;
145 std::unordered_map<std::string, std::string> countryImageMap_;
148 QTreeWidget* hierarchyTree_;
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Qt-based graphical user interface for ORE Studio.
Definition AboutDialog.hpp:29
Manages the lifecycle of the NATS client and login state.
Definition ClientManager.hpp:109
Base class for all detail dialogs.
Definition DetailDialogBase.hpp:74
Shared detail dialog for viewing and editing party and counterparty records.
Definition EntityDetailDialog.hpp:49
ProvenanceWidget * provenanceWidget() const override
Returns the promoted ProvenanceWidget (named "provenanceWidget" in .ui).
Definition EntityDetailDialog.cpp:82
bool hasUnsavedChanges() const override
Definition EntityDetailDialog.hpp:95
QTabWidget * tabWidget() const override
Returns the dialog's QTabWidget (named "tabWidget" in .ui).
Definition EntityDetailDialog.cpp:80
QWidget * provenanceTab() const override
Returns the Provenance tab widget (named "provenanceTab" in .ui).
Definition EntityDetailDialog.cpp:81
Common entity data extracted from party or counterparty types.
Definition EntityDetailOperations.hpp:90
Cache for dynamically loaded images (flags, icons) from the server.
Definition ImageCache.hpp:53
Widget displaying the 6 standard record provenance fields.
Definition ProvenanceWidget.hpp:39