KIMA2 ist ein kleines Kassenprogramm für Kindersachenmärkte. https://www.rustysoft.de/?01_kima2
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

50 lines
1.0 KiB

#ifndef MARKETPLACE_H
#define MARKETPLACE_H
#include "article.h"
#include "sale.h"
#include "seller.h"
#include <vector>
namespace
{
using SellersVec = std::vector<std::unique_ptr<Seller>>;
using SalesVec = std::vector<std::unique_ptr<Sale>>;
using BasketVec = std::vector<std::unique_ptr<Article>>;
} // namespace
struct Basket {
};
class Marketplace
{
public:
Marketplace();
void storeToDb(bool onlyDelete = false);
void loadFromDb();
SellersVec& getSellers();
SalesVec& getSales();
int getNextSellerNo();
int getNextArticleNo();
int getNumSellersDelete();
BasketVec& getBasket();
int getBasketSumInCent();
std::string getBasketSumAsString();
void sortSellers();
Seller* findSellerWithSellerNo(int sellerNo);
void addArticleToBasket(std::unique_ptr<Article> article);
size_t basketSize();
void finishCurrentSale();
void removeSale(boost::uuids::uuid uuid);
private:
SellersVec sellers_;
SalesVec sales_;
BasketVec basket_;
};
#endif