20#ifndef ORES_QT_BUSINESS_UNIT_DETAIL_DIALOG_HPP
21#define ORES_QT_BUSINESS_UNIT_DETAIL_DIALOG_HPP
25#include <boost/uuid/uuid.hpp>
26#include "ores.qt/ClientManager.hpp"
27#include "ores.qt/DetailDialogBase.hpp"
28#include "ores.qt/ImageCache.hpp"
29#include "ores.logging/make_logger.hpp"
30#include "ores.refdata.api/domain/business_unit.hpp"
33class BusinessUnitDetailDialog;
43 boost::uuids::uuid id;
59 inline static std::string_view logger_name =
60 "ores.qt.business_unit_detail_dialog";
62 [[nodiscard]]
static auto& lg() {
64 static auto instance = make_logger(logger_name);
74 void setUsername(
const std::string& username);
76 void setCreateMode(
bool createMode);
77 void setReadOnly(
bool readOnly);
80 void business_unitSaved(
const QString& code);
81 void business_unitDeleted(
const QString& code);
85 void onDeleteClicked();
86 void onCodeChanged(
const QString& text);
87 void onFieldChanged();
97 void setupConnections();
98 void updateUiFromUnit();
99 void updateUnitFromUi();
100 void updateSaveButtonState();
101 void populateBusinessCentres();
102 void populateUnitTypes();
103 bool validateInput();
105 Ui::BusinessUnitDetailDialog* ui_;
108 std::string username_;
110 std::vector<unit_type_entry> unit_type_entries_;
111 bool createMode_{
true};
112 bool readOnly_{
false};
113 bool hasChanges_{
false};
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Qt-based graphical user interface for ORE Studio.
Definition AboutDialog.hpp:29
Lightweight entry for a business unit type, used to populate the unit type combo box.
Definition BusinessUnitDetailDialog.hpp:42
Detail dialog for viewing and editing business unit records.
Definition BusinessUnitDetailDialog.hpp:55
ProvenanceWidget * provenanceWidget() const override
Returns the promoted ProvenanceWidget (named "provenanceWidget" in .ui).
Definition BusinessUnitDetailDialog.cpp:59
bool hasUnsavedChanges() const override
Definition BusinessUnitDetailDialog.hpp:93
QTabWidget * tabWidget() const override
Returns the dialog's QTabWidget (named "tabWidget" in .ui).
Definition BusinessUnitDetailDialog.cpp:57
QWidget * provenanceTab() const override
Returns the Provenance tab widget (named "provenanceTab" in .ui).
Definition BusinessUnitDetailDialog.cpp:58
Manages the lifecycle of the NATS client and login state.
Definition ClientManager.hpp:109
Base class for all detail dialogs.
Definition DetailDialogBase.hpp:74
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
Internal organizational unit within a party.
Definition business_unit.hpp:37