kima2/src/core/article.h

44 lines
883 B
C
Raw Normal View History

2018-07-09 16:06:27 +02:00
#ifndef ARTICLE_H
#define ARTICLE_H
2019-10-04 14:05:19 +02:00
#include "entityuuid.h"
2018-07-09 16:06:27 +02:00
#include <memory>
2018-07-11 13:25:39 +02:00
#include <string>
2018-07-09 16:06:27 +02:00
class Seller;
2018-07-12 13:36:13 +02:00
class Sale;
2018-07-09 16:06:27 +02:00
2019-10-04 14:05:19 +02:00
class Article : public EntityUuid
2018-07-09 16:06:27 +02:00
{
2018-07-11 13:25:39 +02:00
public:
2018-07-20 11:52:26 +02:00
Article() = default;
2018-07-21 19:24:56 +02:00
Article(int price);
2019-10-07 13:58:10 +02:00
Article(const Article&) = delete;
2019-10-07 08:32:37 +02:00
virtual ~Article() = default;
2018-07-20 11:52:26 +02:00
2018-07-09 16:06:27 +02:00
void setArticleNo(int articleNo);
void setPrice(int price);
void setDescription(const std::string& description);
2018-07-11 12:52:57 +02:00
bool isSold();
2018-07-12 14:37:56 +02:00
void setSale(Sale* salePtr);
void setSeller(Seller* sellerPtr);
2018-07-11 13:25:39 +02:00
2018-07-30 14:43:02 +02:00
int getArticleNo() const;
std::string getCompleteArticleNo() const;
2018-07-12 12:06:55 +02:00
std::string getDescription();
Seller* getSeller();
2018-07-25 16:04:45 +02:00
Sale* getSale();
2018-07-20 11:52:26 +02:00
int getPrice() const;
2018-07-23 14:25:18 +02:00
std::string getPriceAsString() const;
2018-07-12 12:06:55 +02:00
2018-07-11 13:25:39 +02:00
private:
2022-07-07 15:03:39 +02:00
Seller* m_sellerPtr{};
Sale* m_salePtr{};
int m_articleNo{};
int m_price{};
std::string m_description{};
2018-07-09 16:06:27 +02:00
};
2019-10-04 14:05:19 +02:00
#endif