kima2/src/core/seller.h

42 lines
1.0 KiB
C++

#ifndef SELLER_H
#define SELLER_H
#include "article.h"
#include "entity.h"
#include <memory>
#include <string>
#include <vector>
class Article;
class Seller : public Entity
{
public:
Seller();
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::shared_ptr<Article> article);
std::string getFirstName() const;
std::string getLastName() const;
int getSellerNo() const;
int numArticlesOffered() const;
int numArticlesSold() const;
//int numArticlesTotal() const;
std::vector<Article*> getArticles(bool onlySold = true) const;
private:
int sellerNo_{-1};
int numArticlesOffered_{};
std::string firstName_{};
std::string lastName_{};
std::vector<std::shared_ptr<Article>> articles_{};
};
#endif