Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 3rdParty/TargomanDBM
Submodule TargomanDBM updated 0 files
4 changes: 2 additions & 2 deletions App/Server/appTargomanAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ void appTargomanAPI::slotExecute() {
try {
// ServerCommonConfigs::InstanceID.setFromVariant(QString("TAPI-%1").arg(Helpers::SecurityHelper::UUIDtoMD5()));
ServerCommonConfigs::InstanceID.setFromVariant(QString("TAPI-%1").arg(QSysInfo::machineHostName()));
TargomanDebug(0) << "Instance-ID: " << ServerCommonConfigs::InstanceID.value();
TargomanDebug(5) << "Instance-ID: " << ServerCommonConfigs::InstanceID.value();

QMap<QString, stuModuleDBInfo> RequiredDBs;

auto RegisterModule = [&RequiredDBs](intfPureModule *_module) {
_module->setInstancePointer();

TargomanDebug(0) << "Registering module <" << _module->moduleFullName() << ">";
TargomanDebug(5) << "Registering module <" << _module->moduleFullName() << ">";

foreach (auto ModuleMethod, _module->listOfMethods())
RESTAPIRegistry::registerRESTAPI(ModuleMethod.Module, ModuleMethod.Method);
Expand Down
64 changes: 41 additions & 23 deletions Interfaces/AAA/Accounting_Interfaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ namespace Targoman::API::AAA {
/******************************************************************/
/******************************************************************/
//key: schema
QMap<QString, intfAccountUnitsI18N*> intfAccountUnitsI18N::myInstance;
QMap<QString, intfAccountUnitsI18N*> intfAccountUnitsI18N::MyInstance;

intfAccountUnitsI18N::intfAccountUnitsI18N(
// bool _isTokenBase,
Expand All @@ -115,7 +115,7 @@ intfAccountUnitsI18N::intfAccountUnitsI18N(
)
// intfAccountORMBase(_isTokenBase)
{
intfAccountUnitsI18N::myInstance[_schema] = this;
intfAccountUnitsI18N::MyInstance[_schema] = this;
}

/******************************************************************/
Expand All @@ -138,7 +138,7 @@ intfAccountUnits::intfAccountUnits(

ORMSelectQuery intfAccountUnits::makeSelectQuery(INTFAPICALLBOOM_IMPL &APICALLBOOM_PARAM, const QString &_alias, Q_DECL_UNUSED bool _translate, Q_DECL_UNUSED bool _isRoot) {

intfAccountUnitsI18N::myInstance[this->Schema]->prepareFiltersList();
intfAccountUnitsI18N::MyInstance[this->Schema]->prepareFiltersList();

ORMSelectQuery Query = intfSQLBasedModule::makeSelectQuery(APICALLBOOM_PARAM, _alias, _translate)
.addCols(this->selectableColumnNames())
Expand All @@ -149,7 +149,7 @@ ORMSelectQuery intfAccountUnits::makeSelectQuery(INTFAPICALLBOOM_IMPL &APICALLBO
.removeCols({
tblAccountUnitsBase::Fields::untName
})
.nestedLeftJoin(intfAccountUnitsI18N::myInstance[this->Schema]->makeSelectQuery(APICALLBOOM_PARAM)
.nestedLeftJoin(intfAccountUnitsI18N::MyInstance[this->Schema]->makeSelectQuery(APICALLBOOM_PARAM)
.where({ tblAccountUnitsI18NBase::Fields::language, enuConditionOperator::Equal, APICALLBOOM_PARAM.language() })
, "lng_tblAccountUnits"
, { "lng_tblAccountUnits", tblAccountUnitsI18NBase::Fields::pid,
Expand All @@ -166,7 +166,7 @@ ORMSelectQuery intfAccountUnits::makeSelectQuery(INTFAPICALLBOOM_IMPL &APICALLBO
;
} else {
Query
.nestedLeftJoin(intfAccountUnitsI18N::myInstance[this->Schema]->makeSelectQuery(APICALLBOOM_PARAM)
.nestedLeftJoin(intfAccountUnitsI18N::MyInstance[this->Schema]->makeSelectQuery(APICALLBOOM_PARAM)
.addCol(tblAccountUnitsI18NBase::Fields::pid)
.addCol(DBExpression::VALUE(QString("CONCAT('[', GROUP_CONCAT(JSON_OBJECT(`language`, %1)), ']')")
.arg(tblAccountUnitsI18NBase::Fields::untNameI18N)),
Expand Down Expand Up @@ -212,7 +212,7 @@ bool IMPL_ORMDELETE_USER(intfAccountUnits) {
/******************************************************************/
/******************************************************************/
//key: schema
QMap<QString, intfAccountProductsI18N*> intfAccountProductsI18N::myInstance;
QMap<QString, intfAccountProductsI18N*> intfAccountProductsI18N::MyInstance;

intfAccountProductsI18N::intfAccountProductsI18N(
// bool _isTokenBase,
Expand All @@ -230,7 +230,7 @@ intfAccountProductsI18N::intfAccountProductsI18N(
)
// intfAccountORMBase(_isTokenBase)
{
intfAccountProductsI18N::myInstance[_schema] = this;
intfAccountProductsI18N::MyInstance[_schema] = this;
}

/******************************************************************/
Expand All @@ -252,7 +252,7 @@ intfAccountProducts::intfAccountProducts(
{ ; }

ORMSelectQuery intfAccountProducts::makeSelectQuery(INTFAPICALLBOOM_IMPL &APICALLBOOM_PARAM, const QString &_alias, Q_DECL_UNUSED bool _translate, Q_DECL_UNUSED bool _isRoot) {
intfAccountProductsI18N::myInstance[this->Schema]->prepareFiltersList();
intfAccountProductsI18N::MyInstance[this->Schema]->prepareFiltersList();

ORMSelectQuery Query = intfSQLBasedModule::makeSelectQuery(APICALLBOOM_PARAM, _alias, _translate)
.addCols(this->selectableColumnNames())
Expand All @@ -273,7 +273,7 @@ ORMSelectQuery intfAccountProducts::makeSelectQuery(INTFAPICALLBOOM_IMPL &APICAL
tblAccountProductsBase::Fields::prdName,
tblAccountProductsBase::Fields::prdDesc,
})
.nestedLeftJoin(intfAccountProductsI18N::myInstance[this->Schema]->makeSelectQuery(APICALLBOOM_PARAM)
.nestedLeftJoin(intfAccountProductsI18N::MyInstance[this->Schema]->makeSelectQuery(APICALLBOOM_PARAM)
.where({ tblAccountProductsI18NBase::Fields::language, enuConditionOperator::Equal, APICALLBOOM_PARAM.language() })
, "lng_tblAccountProducts"
, { "lng_tblAccountProducts", tblAccountProductsI18NBase::Fields::pid,
Expand All @@ -296,7 +296,7 @@ ORMSelectQuery intfAccountProducts::makeSelectQuery(INTFAPICALLBOOM_IMPL &APICAL
;
} else {
Query
.nestedLeftJoin(intfAccountProductsI18N::myInstance[this->Schema]->makeSelectQuery(APICALLBOOM_PARAM)
.nestedLeftJoin(intfAccountProductsI18N::MyInstance[this->Schema]->makeSelectQuery(APICALLBOOM_PARAM)
.addCol(tblAccountProductsI18NBase::Fields::pid)
.addCol(DBExpression::VALUE(QString("CONCAT('[', GROUP_CONCAT(JSON_OBJECT(`language`, %1)), ']')")
.arg(tblAccountProductsI18NBase::Fields::prdNameI18N)),
Expand Down Expand Up @@ -349,7 +349,7 @@ bool IMPL_ORMDELETE_USER(intfAccountProducts) {
/******************************************************************/
/******************************************************************/
//key: schema
QMap<QString, intfAccountSaleablesI18N*> intfAccountSaleablesI18N::myInstance;
QMap<QString, intfAccountSaleablesI18N*> intfAccountSaleablesI18N::MyInstance;

intfAccountSaleablesI18N::intfAccountSaleablesI18N(
// bool _isTokenBase,
Expand All @@ -367,10 +367,13 @@ intfAccountSaleablesI18N::intfAccountSaleablesI18N(
)
// intfAccountORMBase(_isTokenBase)
{
intfAccountSaleablesI18N::myInstance[_schema] = this;
intfAccountSaleablesI18N::MyInstance[_schema] = this;
}

/******************************************************************/
//key: schema
QMap<QString, intfAccountSaleables*> intfAccountSaleables::MyInstance;

intfAccountSaleables::intfAccountSaleables(
// bool _isTokenBase,
const QString& _schema,
Expand All @@ -386,10 +389,12 @@ intfAccountSaleables::intfAccountSaleables(
tblAccountSaleablesBase::Private::Indexes + _exclusiveIndexes
)
// intfAccountORMBase(_isTokenBase)
{ ; }
{
intfAccountSaleables::MyInstance[_schema] = this;
}

ORMSelectQuery intfAccountSaleables::makeSelectQuery(INTFAPICALLBOOM_IMPL &APICALLBOOM_PARAM, const QString &_alias, Q_DECL_UNUSED bool _translate, Q_DECL_UNUSED bool _isRoot) {
intfAccountSaleablesI18N::myInstance[this->Schema]->prepareFiltersList();
intfAccountSaleablesI18N::MyInstance[this->Schema]->prepareFiltersList();

ORMSelectQuery Query = intfSQLBasedModule::makeSelectQuery(APICALLBOOM_PARAM, _alias, _translate)
.addCols(this->selectableColumnNames())
Expand All @@ -401,7 +406,7 @@ ORMSelectQuery intfAccountSaleables::makeSelectQuery(INTFAPICALLBOOM_IMPL &APICA
tblAccountSaleablesBase::Fields::slbName,
tblAccountSaleablesBase::Fields::slbDesc,
})
.nestedLeftJoin(intfAccountSaleablesI18N::myInstance[this->Schema]->makeSelectQuery(APICALLBOOM_PARAM)
.nestedLeftJoin(intfAccountSaleablesI18N::MyInstance[this->Schema]->makeSelectQuery(APICALLBOOM_PARAM)
.where({ tblAccountSaleablesI18NBase::Fields::language, enuConditionOperator::Equal, APICALLBOOM_PARAM.language() })
, "lng_tblAccountSaleables"
, { "lng_tblAccountSaleables", tblAccountSaleablesI18NBase::Fields::pid,
Expand All @@ -424,7 +429,7 @@ ORMSelectQuery intfAccountSaleables::makeSelectQuery(INTFAPICALLBOOM_IMPL &APICA
;
} else {
Query
.nestedLeftJoin(intfAccountSaleablesI18N::myInstance[this->Schema]->makeSelectQuery(APICALLBOOM_PARAM)
.nestedLeftJoin(intfAccountSaleablesI18N::MyInstance[this->Schema]->makeSelectQuery(APICALLBOOM_PARAM)
.addCol(tblAccountSaleablesI18NBase::Fields::pid)
.addCol(DBExpression::VALUE(QString("CONCAT('[', GROUP_CONCAT(JSON_OBJECT(`language`, %1)), ']')")
.arg(tblAccountSaleablesI18NBase::Fields::slbNameI18N)),
Expand Down Expand Up @@ -508,7 +513,7 @@ bool IMPL_ORMDELETE_USER(intfAccountSaleables) {

/******************************************************************/
//key: schema
QMap<QString, intfAccountSaleablesFiles*> intfAccountSaleablesFiles::myInstance;
QMap<QString, intfAccountSaleablesFiles*> intfAccountSaleablesFiles::MyInstance;

intfAccountSaleablesFiles::intfAccountSaleablesFiles(
// bool _isTokenBase,
Expand All @@ -526,7 +531,7 @@ intfAccountSaleablesFiles::intfAccountSaleablesFiles(
)
// intfAccountORMBase(_isTokenBase)
{
intfAccountSaleablesFiles::myInstance[_schema] = this;
intfAccountSaleablesFiles::MyInstance[_schema] = this;
}

QVariant IMPL_ORMGET_ANONYMOUSE(intfAccountSaleablesFiles) {
Expand Down Expand Up @@ -628,7 +633,7 @@ ORMSelectQuery intfAccountUserAssets::makeSelectQuery(INTFAPICALLBOOM_IMPL &APIC
// ) tmpNeededFiles
// ON tmpNeededFiles.slf_slbID = tblAccountUserAssets.uas_slbID

.nestedLeftJoin(intfAccountSaleablesFiles::myInstance[this->Schema]->makeSelectQuery(APICALLBOOM_PARAM, "", true, false)
.nestedLeftJoin(intfAccountSaleablesFiles::MyInstance[this->Schema]->makeSelectQuery(APICALLBOOM_PARAM, "", true, false)
.addCol(tblAccountSaleablesFilesBase::Fields::slf_slbID, tblAccountSaleablesFilesBase::Fields::slf_slbID)
.addCol(enuAggregation::SUM, tblAccountSaleablesFilesBase::Fields::slfMinCount, "MandatoryFilesCount")
.where({ tblAccountSaleablesFilesBase::Fields::slfMinCount, enuConditionOperator::Greater, 0 })
Expand Down Expand Up @@ -663,7 +668,7 @@ ORMSelectQuery intfAccountUserAssets::makeSelectQuery(INTFAPICALLBOOM_IMPL &APIC
// ON tmpProvidedFiles.uasufl_uasID = tblAccountUserAssets.uasID

.nestedLeftJoin(ORMSelectQuery(APICALLBOOM_PARAM,
intfAccountUserAssetsFiles::myInstance[this->Schema]->makeSelectQuery(APICALLBOOM_PARAM, "", true, false)
intfAccountUserAssetsFiles::MyInstance[this->Schema]->makeSelectQuery(APICALLBOOM_PARAM, "", true, false)
.addCol(tblAccountUserAssetsFilesBase::Fields::uasufl_uasID)
.addCol(tblAccountUserAssetsFilesBase::Fields::uasufl_slfID)
.addCol(tblAccountSaleablesFilesBase::Fields::slfMinCount)
Expand Down Expand Up @@ -697,7 +702,20 @@ QVariant IMPL_ORMGET_USER(intfAccountUserAssets) {
if (Authorization::hasPriv(APICALLBOOM_PARAM, this->privOn(EHTTP_GET, this->moduleBaseName())) == false)
this->setSelfFilters({{tblAccountUserAssetsBase::Fields::uas_actorID, APICALLBOOM_PARAM.getActorID() }}, _filters);

return this->Select(GET_METHOD_ARGS_CALL_VALUES);
auto fnTouchQuery = [this, &_cols](ORMSelectQuery &_query) {
if (_cols.isEmpty())
_query.addCols(this->selectableColumnNames());
else {
_query.addCSVCols(_cols);
_cols = {};
}

_query.innerJoinWith(tblAccountUserAssetsBase::Relation::Saleable)
.addCols(intfAccountSaleables::MyInstance[this->Schema]->selectableColumnNames())
;
};

return this->Select(GET_METHOD_ARGS_CALL_VALUES, {}, 0, fnTouchQuery);
}

bool IMPL_REST_UPDATE(intfAccountUserAssets, setAsPrefered, (
Expand Down Expand Up @@ -738,7 +756,7 @@ bool IMPL_REST_UPDATE(intfAccountUserAssets, disablePackage, (

/******************************************************************/
//key: schema
QMap<QString, intfAccountUserAssetsFiles*> intfAccountUserAssetsFiles::myInstance;
QMap<QString, intfAccountUserAssetsFiles*> intfAccountUserAssetsFiles::MyInstance;

intfAccountUserAssetsFiles::intfAccountUserAssetsFiles(
// bool _isTokenBase,
Expand All @@ -756,7 +774,7 @@ intfAccountUserAssetsFiles::intfAccountUserAssetsFiles(
)
// intfAccountORMBase(_isTokenBase)
{
intfAccountUserAssetsFiles::myInstance[_schema] = this;
intfAccountUserAssetsFiles::MyInstance[_schema] = this;
}

QVariant IMPL_ORMGET_USER(intfAccountUserAssetsFiles) {
Expand Down
14 changes: 9 additions & 5 deletions Interfaces/AAA/Accounting_Interfaces.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class intfAccountUnitsI18N : public intfSQLBasedModule//, public intfAccountORMB

public:
//key: schema
static QMap<QString, intfAccountUnitsI18N*> myInstance;
static QMap<QString, intfAccountUnitsI18N*> MyInstance;
// friend class intfAccountUnits;
};

Expand Down Expand Up @@ -102,7 +102,7 @@ class intfAccountProductsI18N : public intfSQLBasedModule//, public intfAccountO

public:
//key: schema
static QMap<QString, intfAccountProductsI18N*> myInstance;
static QMap<QString, intfAccountProductsI18N*> MyInstance;
// friend class intfAccountProducts;
};

Expand Down Expand Up @@ -144,7 +144,7 @@ class intfAccountSaleablesI18N : public intfSQLBasedModule//, public intfAccount

public:
//key: schema
static QMap<QString, intfAccountSaleablesI18N*> myInstance;
static QMap<QString, intfAccountSaleablesI18N*> MyInstance;
// friend class intfAccountSaleables;
};

Expand All @@ -160,6 +160,10 @@ class intfAccountSaleables : public intfSQLBasedModule//, public intfAccountORMB
const QList<DBM::stuRelation>& _exclusiveRelations = {},
const QList<DBM::stuDBIndex>& _exclusiveIndexes = {});

public:
//key: schema
static QMap<QString, intfAccountSaleables*> MyInstance;

public:
virtual ORMSelectQuery makeSelectQuery(INTFAPICALLBOOM_DECL &APICALLBOOM_PARAM, const QString &_alias = {}, bool _translate = true, bool _isRoot = true);

Expand Down Expand Up @@ -187,7 +191,7 @@ class intfAccountSaleablesFiles : public intfSQLBasedModule//, public intfAccoun

public:
//key: schema
static QMap<QString, intfAccountSaleablesFiles*> myInstance;
static QMap<QString, intfAccountSaleablesFiles*> MyInstance;
// friend class intfAccountUserAssets;

private slots:
Expand Down Expand Up @@ -250,7 +254,7 @@ class intfAccountUserAssetsFiles : public intfSQLBasedModule//, public intfAccou

public:
//key: schema
static QMap<QString, intfAccountUserAssetsFiles*> myInstance;
static QMap<QString, intfAccountUserAssetsFiles*> MyInstance;
// friend class intfAccountUserAssets;

private slots:
Expand Down
Loading