kima2/src/core/seller.h

40 lines
996 B
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 numberOfArticles = 0);
void setSellerNo(int sellerNo);
void setFirstName(const std::string& firstName);
void setLastName(const std::string& lastName);
void setNumberOfOfferedArticles(int number);
void addArticle(std::shared_ptr<Article> article);
std::string getFirstName() const;
std::string getLastName() const;
int getSellerNo() const;
int getNumberOfOfferedArticles() const;
std::vector<std::shared_ptr<Article>> getArticles(bool onlySold = false);
private:
int sellerNo_{-1};
int numberOfOfferedArticles_{};
std::string firstName_{};
std::string lastName_{};
std::vector<std::shared_ptr<Article>> articles_{};
};
#endif