Browse Source

marketplace added

allow_new_sellers
Martin Brodbeck 4 years ago
parent
commit
e04a24f7a1
  1. 1
      src/core/CMakeLists.txt
  2. 9
      src/core/marketplace.cpp
  3. 21
      src/core/marketplace.h

1
src/core/CMakeLists.txt

@ -14,6 +14,7 @@ set(CORE_SOURCES
seller.cpp
article.cpp
sale.cpp
marketplace.cpp
)
add_library(core STATIC ${CORE_SOURCES})

9
src/core/marketplace.cpp

@ -0,0 +1,9 @@
#include "marketplace.h"
#include "database.h"
void Marketplace::storeToDb() {
const std::string DB_PATH{"/tmp/kima2.db"};
Database db(DB_PATH);
db.storeSellers(sellers_);
}

21
src/core/marketplace.h

@ -0,0 +1,21 @@
#ifndef MARKETPLACE_H
#define MARKETPLACE_H
#include "article.h"
#include "sale.h"
#include "seller.h"
#include <vector>
class Marketplace
{
public:
void storeToDb();
void loadFromDb();
private:
std::vector<std::shared_ptr<Seller>> sellers_;
//std::vector<std::shared_ptr<Article>> articles_;
std::vector<std::shared_ptr<Sale>> sales_;
};
#endif
Loading…
Cancel
Save