allow to clear database
This commit is contained in:
parent
95a89e568c
commit
badd1595e1
4 changed files with 49 additions and 1 deletions
|
@ -248,4 +248,20 @@ std::string escapeCsvValue(const std::string& value, const char delimiter)
|
|||
}
|
||||
|
||||
return output.str();
|
||||
}
|
||||
|
||||
void Marketplace::clear()
|
||||
{
|
||||
std::for_each(sellers_.begin(), sellers_.end(), [](auto& seller) {
|
||||
if (seller->getUuidAsString() == "11111111-1111-1111-1111-111111111111") {
|
||||
for (auto& article : seller->getArticles()) {
|
||||
article->setState(Article::State::DELETE);
|
||||
}
|
||||
} else {
|
||||
seller->setState(Seller::State::DELETE);
|
||||
}
|
||||
});
|
||||
std::for_each(sales_.begin(), sales_.end(),
|
||||
[](auto& sale) { sale->setState(Sale::State::DELETE); });
|
||||
storeToDb();
|
||||
}
|
|
@ -48,6 +48,8 @@ class Marketplace
|
|||
std::string getOverallPaymentAsString(int percent, int maxFee);
|
||||
std::string getOverallRevenueAsString(int percent, int maxFee);
|
||||
|
||||
void clear();
|
||||
|
||||
void exportReportToCSV(const std::string& filename, int feeInPercent, int maxFeeInEuro);
|
||||
|
||||
friend class ExcelReader;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue