Skip to content

FinceptTerminal is a modern finance application offering advanced market analytics, investment research, and economic data tools, designed for interactive exploration and data-driven decision-making in a user-friendly environment.

fix(dbnomics): add default member initializers and nodiscard to models

jaimin-ptl07438c1a52e875
diff --git a/fincept-qt/src/services/dbnomics/DBnomicsModels.h b/fincept-qt/src/services/dbnomics/DBnomicsModels.h
index 23f823388..a2be7590f 100644
--- a/fincept-qt/src/services/dbnomics/DBnomicsModels.h
+++ b/fincept-qt/src/services/dbnomics/DBnomicsModels.h
@@ -24,9 +24,9 @@ struct DbnSeriesInfo {
};
struct DbnObservation {
- QString period; // "2024-01", "2024-01-01"
- double value; // 3.5
- bool valid; // false if the API returned NA/null
+ QString period; // "2024-01", "2024-01-01"
+ double value = 0.0; // 3.5
+ bool valid = true; // false if the API returned NA/null
};
// A fully loaded series ready to plot
@@ -34,7 +34,7 @@ struct DbnDataPoint {
QString series_id; // "BLS/ln/LNS14000000"
QString series_name;
QVector<DbnObservation> observations;
- QColor color;
+ QColor color = QColor("#ea580c"); // default: orange; caller should override with chart_color(index)
};
// ── Search ───────────────────────────────────────────────────────────────────
@@ -53,7 +53,7 @@ struct DbnPagination {
int offset = 0;
int limit = 50;
int total = 0;
- bool has_more() const { return offset + limit < total; }
+ [[nodiscard]] bool has_more() const { return offset + limit < total; }
};
// ── UI enumerations ──────────────────────────────────────────────────────────