Browse Source

Renamed declarations to adatabasetypes moved DEFAULT_X_POSITIONS to Opl

George 4 years ago
parent
commit
cca550e7f8

+ 1 - 1
openPilotLog.pro

@@ -63,7 +63,7 @@ HEADERS += \
     src/classes/atailentry.h \
     src/database/adatabase.h \
     src/database/adatabasesetup.h \
-    src/database/declarations.h \
+    src/database/adatabasetypes.h \
     src/functions/acalc.h \
     src/functions/adatetime.h \
     src/functions/areadcsv.h \

+ 4 - 4
src/classes/aaircraftentry.cpp

@@ -19,13 +19,13 @@
 #include "src/oplconstants.h"
 
 AAircraftEntry::AAircraftEntry()
-    : AEntry::AEntry(DEFAULT_AIRCRAFT_POSITION)
+    : AEntry::AEntry(Opl::Db::DEFAULT_AIRCRAFT_POSITION)
 {}
 
-AAircraftEntry::AAircraftEntry(RowId row_id)
+AAircraftEntry::AAircraftEntry(RowId_t row_id)
     : AEntry::AEntry(DataPosition(Opl::Db::TABLE_AIRCRAFT, row_id))
 {}
 
-AAircraftEntry::AAircraftEntry(RowData table_data)
-    : AEntry::AEntry(DEFAULT_AIRCRAFT_POSITION, table_data)
+AAircraftEntry::AAircraftEntry(RowData_t table_data)
+    : AEntry::AEntry(Opl::Db::DEFAULT_AIRCRAFT_POSITION, table_data)
 {}

+ 3 - 3
src/classes/aaircraftentry.h

@@ -19,13 +19,13 @@
 #define AAIRCRAFTENTRY_H
 
 #include "src/classes/aentry.h"
-#include "src/database/declarations.h"
+#include "src/database/adatabasetypes.h"
 
 struct AAircraftEntry : public AEntry {
 public:
     AAircraftEntry();
-    AAircraftEntry(RowId row_id);
-    AAircraftEntry(RowData table_data);
+    AAircraftEntry(RowId_t row_id);
+    AAircraftEntry(RowData_t table_data);
 
     AAircraftEntry(const AAircraftEntry& te) = default;
     AAircraftEntry& operator=(const AAircraftEntry& te) = default;

+ 4 - 4
src/classes/aentry.cpp

@@ -21,15 +21,15 @@ AEntry::AEntry(DataPosition position_)
     : position(position_)
 {}
 
-AEntry::AEntry(RowData table_data)
+AEntry::AEntry(RowData_t table_data)
     : tableData(table_data)
 {}
 
-AEntry::AEntry(DataPosition position_, RowData table_data)
+AEntry::AEntry(DataPosition position_, RowData_t table_data)
     : position(position_), tableData(table_data)
 {}
 
-void AEntry::setData(RowData table_data)
+void AEntry::setData(RowData_t table_data)
 {
     tableData = table_data;
 }
@@ -39,7 +39,7 @@ const DataPosition& AEntry::getPosition()
     return position;
 }
 
-const RowData& AEntry::getData()
+const RowData_t& AEntry::getData()
 {
     return tableData;
 }

+ 6 - 6
src/classes/aentry.h

@@ -24,7 +24,7 @@
 #include <QPair>
 #include <QVariant>
 
-#include "src/database/declarations.h"
+#include "src/database/adatabasetypes.h"
 
 // [G]: Define what data is public and what not. For objects such as
 // DataPosition which are consumable its no biggy. Are entries the same?
@@ -41,20 +41,20 @@ class AEntry {
 protected:
     DataPosition position;
 public:
-    RowData tableData;
+    RowData_t tableData;
 public:
     AEntry() = delete; // Demand specificity from default constructor
     AEntry(const AEntry&) = default;
     AEntry& operator=(const AEntry&) = default;
     AEntry(DataPosition position_);
-    AEntry(RowData table_data);
-    AEntry(DataPosition position_, RowData table_data);
+    AEntry(RowData_t table_data);
+    AEntry(DataPosition position_, RowData_t table_data);
 
-    void setData(RowData table_data);
+    void setData(RowData_t table_data);
     void setPosition(DataPosition position_);
 
     const DataPosition& getPosition();
-    const RowData& getData();
+    const RowData_t& getData();
 
 };
 

+ 4 - 4
src/classes/aflightentry.cpp

@@ -22,15 +22,15 @@
 #include "src/classes/asettings.h"
 
 AFlightEntry::AFlightEntry()
-    : AEntry::AEntry(DEFAULT_FLIGHT_POSITION)
+    : AEntry::AEntry(Opl::Db::DEFAULT_FLIGHT_POSITION)
 {}
 
-AFlightEntry::AFlightEntry(RowId row_id)
+AFlightEntry::AFlightEntry(RowId_t row_id)
     : AEntry::AEntry(DataPosition(Opl::Db::TABLE_FLIGHTS, row_id))
 {}
 
-AFlightEntry::AFlightEntry(RowData table_data)
-    : AEntry::AEntry(DEFAULT_FLIGHT_POSITION, table_data)
+AFlightEntry::AFlightEntry(RowData_t table_data)
+    : AEntry::AEntry(Opl::Db::DEFAULT_FLIGHT_POSITION, table_data)
 {}
 
 const QString AFlightEntry::summary()

+ 2 - 2
src/classes/aflightentry.h

@@ -23,8 +23,8 @@
 class AFlightEntry : public AEntry {
 public:
     AFlightEntry();
-    AFlightEntry(RowId row_id);
-    AFlightEntry(RowData table_data);
+    AFlightEntry(RowId_t row_id);
+    AFlightEntry(RowData_t table_data);
 
     AFlightEntry(const AFlightEntry& pe) = default;
     AFlightEntry& operator=(const AFlightEntry& pe) = default;

+ 4 - 4
src/classes/apilotentry.cpp

@@ -19,15 +19,15 @@
 #include "src/oplconstants.h"
 
 APilotEntry::APilotEntry()
-    : AEntry::AEntry(DEFAULT_PILOT_POSITION)
+    : AEntry::AEntry(Opl::Db::DEFAULT_PILOT_POSITION)
 {}
 
-APilotEntry::APilotEntry(RowId row_id)
+APilotEntry::APilotEntry(RowId_t row_id)
     : AEntry::AEntry(DataPosition(Opl::Db::TABLE_PILOTS, row_id))
 {}
 
-APilotEntry::APilotEntry(RowData table_data)
-    : AEntry::AEntry(DEFAULT_PILOT_POSITION, table_data)
+APilotEntry::APilotEntry(RowData_t table_data)
+    : AEntry::AEntry(Opl::Db::DEFAULT_PILOT_POSITION, table_data)
 {}
 
 const QString APilotEntry::name()

+ 3 - 3
src/classes/apilotentry.h

@@ -19,13 +19,13 @@
 #define APILOTENTRY_H
 
 #include "src/classes/aentry.h"
-#include "src/database/declarations.h"
+#include "src/database/adatabasetypes.h"
 
 struct APilotEntry : public AEntry {
 public:
     APilotEntry();
-    APilotEntry(RowId row_id);
-    APilotEntry(RowData table_data);
+    APilotEntry(RowId_t row_id);
+    APilotEntry(RowData_t table_data);
 
     APilotEntry(const APilotEntry& pe) = default;
     APilotEntry& operator=(const APilotEntry& pe) = default;

+ 4 - 4
src/classes/atailentry.cpp

@@ -19,15 +19,15 @@
 #include "src/oplconstants.h"
 
 ATailEntry::ATailEntry()
-    : AEntry::AEntry(DEFAULT_TAIL_POSITION)
+    : AEntry::AEntry(Opl::Db::DEFAULT_TAIL_POSITION)
 {}
 
-ATailEntry::ATailEntry(RowId row_id)
+ATailEntry::ATailEntry(RowId_t row_id)
     : AEntry::AEntry(DataPosition(Opl::Db::TABLE_TAILS, row_id))
 {}
 
-ATailEntry::ATailEntry(RowData table_data)
-    : AEntry::AEntry(DEFAULT_TAIL_POSITION, table_data)
+ATailEntry::ATailEntry(RowData_t table_data)
+    : AEntry::AEntry(Opl::Db::DEFAULT_TAIL_POSITION, table_data)
 {}
 
 const QString ATailEntry::registration()

+ 3 - 3
src/classes/atailentry.h

@@ -19,15 +19,15 @@
 #define ATAILENTRY_H
 
 #include "src/classes/aentry.h"
-#include "src/database/declarations.h"
+#include "src/database/adatabasetypes.h"
 
 struct ATailEntry : public AEntry {
 public:
     ATailEntry();
     ATailEntry(const ATailEntry& te) = default;
     ATailEntry& operator=(const ATailEntry& te) = default;
-    ATailEntry(RowId row_id);
-    ATailEntry(RowData table_data);
+    ATailEntry(RowId_t row_id);
+    ATailEntry(RowData_t table_data);
 
     const QString registration();
 

+ 17 - 17
src/database/adatabase.cpp

@@ -35,7 +35,7 @@ ADatabase* ADatabase::self = nullptr;
 /*!
  * \brief Return the names of a given table in the database.
  */
-ColumnNames ADatabase::getTableColumns(TableName table_name) const
+ColumnNames_t ADatabase::getTableColumns(TableName_t table_name) const
 {
     return tableColumns.value(table_name);
 }
@@ -43,7 +43,7 @@ ColumnNames ADatabase::getTableColumns(TableName table_name) const
 /*!
  * \brief Return the names of all tables in the database
  */
-TableNames ADatabase::getTableNames() const
+TableNames_t ADatabase::getTableNames() const
 {
     return tableNames;
 }
@@ -59,7 +59,7 @@ void ADatabase::updateLayout()
 
     tableColumns.clear();
     for (const auto &table_name : tableNames) {
-        ColumnNames table_columns;
+        ColumnNames_t table_columns;
         QSqlRecord fields = db.record(table_name);
         for (int i = 0; i < fields.count(); i++) {
             table_columns.append(fields.field(i).name());
@@ -356,12 +356,12 @@ bool ADatabase::insert(AEntry new_entry)
 
 }
 
-RowData ADatabase::getEntryData(DataPosition data_position)
+RowData_t ADatabase::getEntryData(DataPosition data_position)
 {
     // check table exists
     if (!getTableNames().contains(data_position.tableName)) {
         DEB << data_position.tableName << " not a table in the database. Unable to retreive Entry data.";
-        return RowData();
+        return RowData_t();
     }
 
     //Check Database for rowId
@@ -377,14 +377,14 @@ RowData ADatabase::getEntryData(DataPosition data_position)
         DEB << "SQL error: " << check_query.lastError().text();
         DEB << "Statement: " << statement;
         lastError = check_query.lastError().text();
-        return RowData();
+        return RowData_t();
     }
 
     check_query.next();
     if (check_query.value(0).toInt() == 0) {
         DEB << "No Entry found for row id: " << data_position.rowId;
         lastError = ADatabaseError("Database entry not found.");
-        return RowData();
+        return RowData_t();
     }
 
     // Retreive TableData
@@ -401,11 +401,11 @@ RowData ADatabase::getEntryData(DataPosition data_position)
         DEB << "SQL error: " << select_query.lastError().text();
         DEB << "Statement: " << statement;
         lastError = select_query.lastError().text();
-        return RowData();
+        return RowData_t();
     }
 
     select_query.next();
-    RowData entry_data;
+    RowData_t entry_data;
 
     for (const auto &column : getTableColumns(data_position.tableName)) {
         entry_data.insert(column, select_query.value(column));
@@ -420,28 +420,28 @@ AEntry ADatabase::getEntry(DataPosition data_position)
     return entry;
 }
 
-APilotEntry ADatabase::getPilotEntry(RowId row_id)
+APilotEntry ADatabase::getPilotEntry(RowId_t row_id)
 {
     APilotEntry pilot_entry(row_id);
     pilot_entry.setData(getEntryData(pilot_entry.getPosition()));
     return pilot_entry;
 }
 
-ATailEntry ADatabase::getTailEntry(RowId row_id)
+ATailEntry ADatabase::getTailEntry(RowId_t row_id)
 {
     ATailEntry tail_entry(row_id);
     tail_entry.setData(getEntryData(tail_entry.getPosition()));
     return tail_entry;
 }
 
-AAircraftEntry ADatabase::getAircraftEntry(RowId row_id)
+AAircraftEntry ADatabase::getAircraftEntry(RowId_t row_id)
 {
     AAircraftEntry aircraft_entry(row_id);
     aircraft_entry.setData(getEntryData(aircraft_entry.getPosition()));
     return aircraft_entry;
 }
 
-AFlightEntry ADatabase::getFlightEntry(RowId row_id)
+AFlightEntry ADatabase::getFlightEntry(RowId_t row_id)
 {
     AFlightEntry flight_entry(row_id);
     flight_entry.setData(getEntryData(flight_entry.getPosition()));
@@ -497,7 +497,7 @@ const QStringList ADatabase::getCompletionList(ADatabaseTarget target)
 }
 
 const
-QMap<ADatabase::QString, ADatabase::RowId_t> ADatabase::getIdMap(ADatabaseTarget target)
+QMap<QString, RowId_t> ADatabase::getIdMap(ADatabaseTarget target)
 {
     QString statement;
 
@@ -573,7 +573,7 @@ int ADatabase::getLastEntry(ADatabaseTarget target)
     }
 }
 
-QList<int> ADatabase::getForeignKeyConstraints(int foreign_row_id, ADatabaseTarget target)
+QList<RowId_t> ADatabase::getForeignKeyConstraints(RowId_t foreign_row_id, ADatabaseTarget target)
 {
     QString statement = "SELECT ROWID FROM flights WHERE ";
 
@@ -610,12 +610,12 @@ QList<int> ADatabase::getForeignKeyConstraints(int foreign_row_id, ADatabaseTarg
     return row_ids;
 }
 
-APilotEntry ADatabase::resolveForeignPilot(int foreign_key)
+APilotEntry ADatabase::resolveForeignPilot(ForeignKey_t foreign_key)
 {
     return aDB->getPilotEntry(foreign_key);
 }
 
-ATailEntry ADatabase::resolveForeignTail(int foreign_key)
+ATailEntry ADatabase::resolveForeignTail(ForeignKey_t foreign_key)
 {
     return aDB->getTailEntry(foreign_key);
 }

+ 14 - 27
src/database/adatabase.h

@@ -31,7 +31,7 @@
 #include <QSqlRecord>
 #include <QSqlField>
 
-#include "src/database/declarations.h"
+#include "src/database/adatabasetypes.h"
 #include "src/classes/aentry.h"
 #include "src/classes/apilotentry.h"
 #include "src/classes/atailentry.h"
@@ -89,33 +89,20 @@ public:
 class ADatabase : public QObject {
     Q_OBJECT
 public:
-    using RowId_t = int;
-
-    using PilotName_t = QString;
-    using PilotRowId_t = RowId_t;
-
-    using TailRgstr_t = QString;
-    using TailId_t = RowId_t;
-
-    using ArprtICAO_t = QString;
-    using ArprtIATA_t = QString;
-    using ArprtName_t = QString;
-    using ArprtId_t = RowId_t;
-
 
 private:
     ADatabase();
 
     static ADatabase* self;
-    TableNames tableNames;
-    TableColumns tableColumns;
+    TableNames_t tableNames;
+    TableColumns_t tableColumns;
 public:
     // Ensure DB is not copiable or assignable
     ADatabase(const ADatabase&) = delete;
     void operator=(const ADatabase&) = delete;
     static ADatabase* instance();
-    TableNames getTableNames() const;
-    ColumnNames getTableColumns(TableName table_name) const;
+    TableNames_t getTableNames() const;
+    ColumnNames_t getTableColumns(TableName_t table_name) const;
     void updateLayout();
     const QString sqliteVersion();
 
@@ -183,7 +170,7 @@ public:
     /*!
      * \brief retreive entry data from the database to create an entry object
      */
-    RowData getEntryData(DataPosition data_position);
+    RowData_t getEntryData(DataPosition data_position);
 
     /*!
      * \brief retreive an Entry from the database.
@@ -198,7 +185,7 @@ public:
      * instead of an Entry. It allows for easy access to a pilot entry
      * with only the RowId required as input.
      */
-    APilotEntry getPilotEntry(RowId row_id);
+    APilotEntry getPilotEntry(RowId_t row_id);
 
     /*!
      * \brief retreives a TailEntry from the database.
@@ -208,7 +195,7 @@ public:
      * instead of an Entry. It allows for easy access to a tail entry
      * with only the RowId required as input.
      */
-    ATailEntry getTailEntry(RowId row_id);
+    ATailEntry getTailEntry(RowId_t row_id);
 
     /*!
      * \brief retreives a TailEntry from the database.
@@ -218,7 +205,7 @@ public:
      * instead of an AEntry. It allows for easy access to an aircraft entry
      * with only the RowId required as input.
      */
-    AAircraftEntry getAircraftEntry(RowId row_id);
+    AAircraftEntry getAircraftEntry(RowId_t row_id);
 
     /*!
      * \brief retreives a flight entry from the database.
@@ -228,7 +215,7 @@ public:
      * instead of an AEntry. It allows for easy access to a flight entry
      * with only the RowId required as input.
      */
-    AFlightEntry getFlightEntry(RowId row_id);
+    AFlightEntry getFlightEntry(RowId_t row_id);
 
     /*!
      * \brief getCompletionList returns a QStringList of values for a
@@ -237,7 +224,7 @@ public:
     const QStringList getCompletionList(ADatabaseTarget target);
 
     /*!
-     * \brief returns a QMap<QueryResult_qstr, QueryResult_i> of a human-readable database value and
+     * \brief returns a QMap<QString, RowId_t> of a human-readable database value and
      * its row id. Used in the Dialogs to map user input to unique database entries.
      */
     const QMap<QString, RowId_t> getIdMap(ADatabaseTarget target);
@@ -251,19 +238,19 @@ public:
      * \brief returns a list of ROWID's in the flights table for which foreign key constraints
      * exist.
      */
-    QList<int> getForeignKeyConstraints(int foreign_row_id, ADatabaseTarget target);
+    QList<RowId_t> getForeignKeyConstraints(RowId_t foreign_row_id, ADatabaseTarget target);
 
     /*!
      * \brief Resolves the foreign key in a flight entry
      * \return The Pilot Entry referencted by the foreign key.
      */
-    APilotEntry resolveForeignPilot(int foreign_key);
+    APilotEntry resolveForeignPilot(ForeignKey_t foreign_key);
 
     /*!
      * \brief Resolves the foreign key in a flight entry
      * \return The Tail Entry referencted by the foreign key.
      */
-    ATailEntry resolveForeignTail(int foreign_key);
+    ATailEntry resolveForeignTail(ForeignKey_t foreign_key);
 
 
 

+ 27 - 30
src/database/declarations.h → src/database/adatabasetypes.h

@@ -19,38 +19,41 @@
 #define DECLARATIONS_H
 
 #include <QtCore>
-#include "src/oplconstants.h"
 #include "src/testing/adebug.h"
 
-/// \todo Break apart these aliases to their
-/// corresponding sub section of the program
-/// eg DB related to ADatabase.h and so on
+// [G]: TODO. Break apart these aliases to their
+// corresponding sub section of the program
+// eg DB related to ADatabase.h and so on
 
-/*!
- * \brief An alias for QString
- *
- * Very long description *with* **markdown?**
- * - - -
- * # Header
- */
-using ColName = QString;
-using ColData = QVariant;
-using TableName = QString;
-using RowId = int;
+using RowId_t = int;
+using PilotName_t = QString;
+using PilotRowId_t = RowId_t;
+using TailRgstr_t = QString;
+using TailId_t = RowId_t;
+using ArprtICAO_t = QString;
+using ArprtIATA_t = QString;
+using ArprtName_t = QString;
+using ArprtId_t = RowId_t;
+using ColName_t = QString;
+using ColData_t = QVariant;
+using TableName_t = QString;
+using RowId_t = int;
 
-using TableNames = QStringList;
-using RowData = QMap<ColName, ColData>;
-using ColumnData = QPair<ColName, ColData>;
-using ColumnNames = QStringList;
-using TableColumns = QMap<TableName, ColumnNames>;
+using TableNames_t = QStringList;
+using RowData_t = QMap<ColName_t, ColData_t>;
+using ColumnData_t = QPair<ColName_t, ColData_t>;
+using ColumnNames_t = QStringList;
+using TableColumns_t = QMap<TableName_t, ColumnNames_t>;
+
+using ForeignKey_t = int;
 
 struct DataPosition {
-    TableName tableName;
-    RowId rowId;
+    TableName_t tableName;
+    RowId_t rowId;
     DataPosition()
-        : tableName(TableName())
+        : tableName(TableName_t())
     {};
-    DataPosition(TableName table_name, RowId row_id)
+    DataPosition(TableName_t table_name, RowId_t row_id)
         : tableName(table_name), rowId(row_id)
     {};
 
@@ -63,10 +66,4 @@ struct DataPosition {
          )
 };
 
-// Default Positions
-static auto const DEFAULT_FLIGHT_POSITION   = DataPosition(Opl::Db::TABLE_FLIGHTS, 0);
-static auto const DEFAULT_PILOT_POSITION    = DataPosition(Opl::Db::TABLE_PILOTS, 0);
-static auto const DEFAULT_TAIL_POSITION     = DataPosition(Opl::Db::TABLE_TAILS, 0);
-static auto const DEFAULT_AIRCRAFT_POSITION = DataPosition(Opl::Db::TABLE_AIRCRAFT, 0);
-
 #endif // DECLARATIONS_H

+ 2 - 2
src/gui/dialogues/newflightdialog.cpp

@@ -525,9 +525,9 @@ void NewFlightDialog::fillDeductibleData()
  * no input validation is done in this step and input data is assumed to be valid.
  * \return
  */
-RowData NewFlightDialog::collectInput()
+RowData_t NewFlightDialog::collectInput()
 {
-    RowData newData;
+    RowData_t newData;
     DEB << "Collecting Input...";
     //Block Time
     const auto tofb = ATime::fromString(ui->tofbTimeLineEdit->text());

+ 2 - 10
src/gui/dialogues/newflightdialog.h

@@ -44,14 +44,6 @@ class NewFlight;
 class NewFlightDialog : public QDialog
 {
     Q_OBJECT
-    using PilotName_t = ADatabase::PilotName_t;
-    using PilotRowId_t = ADatabase::PilotRowId_t;
-    using TailRgstr_t = ADatabase::TailRgstr_t;
-    using TailId_t = ADatabase::TailId_t;
-    using ArprtICAO_t = ADatabase::ArprtICAO_t;
-    using ArprtIATA_t = ADatabase::ArprtIATA_t;
-    using ArprtName_t = ADatabase::ArprtName_t;
-    using ArprtId_t = ADatabase::ArprtId_t;
 public:
     /*!
      * \brief NewFlightDialog create a new flight and add it to the logbook.
@@ -129,7 +121,7 @@ private:
     /*!
      * To be used by the QCompleters
      */
-    QStringList pilotList;QVariant
+    QStringList pilotList;
     QStringList tailsList;
     QStringList airportList;
 
@@ -169,7 +161,7 @@ private:
     void addNewTail(QLineEdit*);
     void addNewPilot(QLineEdit *);
 
-    RowData collectInput();
+    RowData_t collectInput();
 
     /*!
      * \brief converts a time string as used in the UI to an integer of minutes for

+ 1 - 1
src/gui/dialogues/newpilotdialog.cpp

@@ -141,7 +141,7 @@ void NewPilotDialog::submitForm()
 {
     DEB << "Collecting User Input...";
 
-    RowData new_data;
+    RowData_t new_data;
     auto line_edits = this->findChildren<QLineEdit *>();
     for(auto& le : line_edits) {
         auto key = le->objectName().remove(QStringLiteral("LineEdit"));

+ 1 - 1
src/gui/dialogues/newtaildialog.cpp

@@ -187,7 +187,7 @@ bool NewTailDialog::verify()
 void NewTailDialog::submitForm()
 {
     DEB << "Creating Database Object...";
-    RowData new_data;
+    RowData_t new_data;
     //retreive Line Edits
     auto line_edits = this->findChildren<QLineEdit *>();
     line_edits.removeOne(this->findChild<QLineEdit *>(QStringLiteral("searchLineEdit")));

+ 1 - 1
src/gui/widgets/settingswidget.cpp

@@ -135,7 +135,7 @@ void SettingsWidget::setupValidators()
 
 void SettingsWidget::updatePersonalDetails()
 {
-    RowData user_data;
+    RowData_t user_data;
     switch (ui->aliasComboBox->currentIndex()) {
     case 0:
         user_data.insert(Opl::Db::PILOTS_ALIAS, QStringLiteral("self"));

+ 6 - 0
src/oplconstants.h

@@ -19,6 +19,7 @@
 #define OPLCONSTANTS_H
 
 #include <QtCore>
+#include "src/database/adatabasetypes.h"
 
 /*!
  *  \brief A namespace to collect constants and enums used throughout the application.
@@ -164,6 +165,11 @@ static const auto ROWID                  = QStringLiteral("ROWID");
 static const auto EMPTY_STRING           = QStringLiteral("");
 static const auto NULL_TIME_hhmm         = QStringLiteral("00:00");
 
+static const auto DEFAULT_FLIGHT_POSITION   = DataPosition(TABLE_FLIGHTS, 0);
+static const auto DEFAULT_PILOT_POSITION    = DataPosition(TABLE_PILOTS, 0);
+static const auto DEFAULT_TAIL_POSITION     = DataPosition(TABLE_TAILS, 0);
+static const auto DEFAULT_AIRCRAFT_POSITION = DataPosition(TABLE_AIRCRAFT, 0);
+
 } // namespace opl::db
 
 } // namespace opl