Compare commits
2 commits
5b02f7dabe
...
e494762c3a
Author | SHA1 | Date | |
---|---|---|---|
e494762c3a | |||
d0311e4333 |
3 changed files with 46 additions and 3 deletions
|
@ -56,9 +56,9 @@ class Marketplace
|
||||||
friend class ExcelReader;
|
friend class ExcelReader;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SellersVec sellers_;
|
SellersVec sellers_{500};
|
||||||
SalesVec sales_;
|
SalesVec sales_{50000};
|
||||||
BasketVec basket_;
|
BasketVec basket_{50};
|
||||||
};
|
};
|
||||||
|
|
||||||
double marketFee(int sumInCent, int percent, int maxFeeInCent);
|
double marketFee(int sumInCent, int percent, int maxFeeInCent);
|
||||||
|
|
1
test/compile_make_sales.sh
Normal file
1
test/compile_make_sales.sh
Normal file
|
@ -0,0 +1 @@
|
||||||
|
g++ -I ../src/core make_sales.cpp -L /home/brodbemn/Entwicklung/kima2/build/lib -l core -L /usr/lib -l sqlite3 -l stdc++fs -l boost_date_time -o make_sales
|
42
test/make_sales.cpp
Normal file
42
test/make_sales.cpp
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
#include "../src/core/database.h"
|
||||||
|
#include "../src/core/seller.h"
|
||||||
|
#include "../src/core/sale.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
std::vector<std::unique_ptr<Seller>> sellers;
|
||||||
|
std::vector<std::unique_ptr<Sale>> sales;
|
||||||
|
|
||||||
|
Database db("test.db");
|
||||||
|
|
||||||
|
int count = 0;
|
||||||
|
|
||||||
|
for (int i = 0; i < 300; ++i) {
|
||||||
|
auto seller = std::make_unique<Seller>();
|
||||||
|
seller->createUuid();
|
||||||
|
seller->setSellerNo(i + 1);
|
||||||
|
for (int j = 0; j < 100; ++j) {
|
||||||
|
++count;
|
||||||
|
auto article = std::make_unique<Article>();
|
||||||
|
article->createUuid();
|
||||||
|
article->setSourceNo(3);
|
||||||
|
article->setArticleNo(count);
|
||||||
|
article->setPrice(500);
|
||||||
|
auto sale = std::make_unique<Sale>();
|
||||||
|
sale->createUuid();
|
||||||
|
sale->setSourceNo(3);
|
||||||
|
sale->addArticle(article.get());
|
||||||
|
sales.push_back(std::move(sale));
|
||||||
|
seller->addArticle(std::move(article));
|
||||||
|
}
|
||||||
|
sellers.push_back(std::move(seller));
|
||||||
|
}
|
||||||
|
|
||||||
|
db.storeSellers(sellers);
|
||||||
|
db.storeSales(sales);
|
||||||
|
|
||||||
|
for (int i = 0; i < 30000; ++i) {
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue