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"
34#include "ores.qt/export.hpp"
37class EntityDetailDialog;
54 inline static std::string_view logger_name =
55 "ores.qt.entity_detail_dialog";
57 [[nodiscard]]
static auto& lg() {
59 static auto instance = make_logger(logger_name);
65 std::shared_ptr<entity_detail_operations> ops,
66 QWidget* parent =
nullptr);
71 void setUsername(
const std::string& username);
73 void setCreateMode(
bool createMode);
74 void setReadOnly(
bool readOnly);
77 void entitySaved(
const QString& code);
78 void entityDeleted(
const QString& code);
82 void onDeleteClicked();
83 void onCodeChanged(
const QString& text);
84 void onFieldChanged();
85 void onAddIdentifier();
86 void onDeleteIdentifier();
88 void onDeleteContact();
89 void onContactDoubleClicked(
int row,
int column);
92 QTabWidget* tabWidget()
const override;
93 QWidget* provenanceTab()
const override;
100 void setupConnections();
101 void setupIdentifierTable();
102 void setupContactTable();
103 void setupHierarchyTree();
104 void populateLookups();
105 void loadIdentifiers();
107 void loadAllEntities();
108 void loadIdSchemes();
109 void loadCountryImageMap();
110 void populateParentCombo();
111 void populateIdentifierTable();
112 void populateContactTable();
113 void buildHierarchyTree();
114 void updateUiFromEntity();
115 void updateEntityFromUi();
116 void updateSaveButtonState();
117 bool validateInput();
119 std::shared_ptr<entity_detail_operations> ops_;
120 Ui::EntityDetailDialog* ui_;
123 std::string username_;
125 bool createMode_{
true};
126 bool readOnly_{
false};
127 bool hasChanges_{
false};
130 std::vector<parent_entity_entry> allEntities_;
133 QTableWidget* identifierTable_;
134 QToolBar* identifierToolbar_;
135 std::vector<identifier_entry> identifiers_;
138 QTableWidget* contactTable_;
139 QToolBar* contactToolbar_;
140 std::vector<contact_entry> contacts_;
143 std::vector<refdata::domain::party_id_scheme> idSchemes_;
146 std::unordered_map<std::string, std::string> countryImageMap_;
149 QTreeWidget* hierarchyTree_;
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Qt-based graphical user interface for ORE Studio.
Definition AccountController.hpp:32
Manages the lifecycle of the NATS client and login state.
Definition ClientManager.hpp:123
Base class for all detail dialogs.
Definition DetailDialogBase.hpp:75
Shared detail dialog for viewing and editing party and counterparty records.
Definition EntityDetailDialog.hpp:50
bool hasUnsavedChanges() const override
Definition EntityDetailDialog.hpp:96
Common entity data extracted from party or counterparty types.
Definition EntityDetailOperations.hpp:91
Cache for dynamically loaded images (flags, icons) from the server.
Definition ImageCache.hpp:54
Widget displaying the 6 standard record provenance fields.
Definition ProvenanceWidget.hpp:40