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.
 
 
 
 

52 lines
1.4 KiB

#ifndef SELLER_H
#define SELLER_H
#include "article.h"
#include "entityint.h"
#include <memory>
#include <string>
#include <vector>
// class Article;
class Seller : public EntityInt
{
public:
Seller() = default;
// virtual ~Seller() = default;
Seller(const std::string& firstName, const std::string& lastName, int sellerNo = 0,
int numArticlesOffered = 0);
void setSellerNo(int sellerNo);
void setFirstName(const std::string& firstName);
void setLastName(const std::string& lastName);
void setNumArticlesOffered(int number);
void addArticle(std::unique_ptr<Article> article);
void cleanupArticles();
std::string getFirstName() const;
std::string getLastName() const;
int getSellerNo() const;
std::string getSellerNoAsString() const;
int numArticlesOffered() const;
int numArticlesSold() const;
// int numArticlesTotal() const;
std::vector<Article*> getArticles(bool onlySold = true) const;
Article* getArticleByUuid(const std::string& uuidString);
int getMaxArticleNo() const;
int sumInCents();
std::string sumAsString();
friend bool operator<(const Seller& li, const Seller& re);
friend bool operator<(const std::unique_ptr<Seller>& li, const std::unique_ptr<Seller>& re);
private:
int sellerNo_{-1};
int numArticlesOffered_{};
std::string firstName_{};
std::string lastName_{};
std::vector<std::unique_ptr<Article>> articles_{};
};
#endif