kima2/src/core/sale.h

30 lines
644 B
C
Raw Normal View History

2018-07-11 12:53:18 +02:00
#ifndef SALE_H
#define SALE_H
2018-07-12 13:34:17 +02:00
#include "article.h"
2018-07-11 12:53:18 +02:00
2018-07-12 13:34:17 +02:00
#include <vector>
2018-07-13 10:51:07 +02:00
#include "boost/date_time/posix_time/posix_time.hpp"
2018-07-12 13:34:17 +02:00
class Article;
class Sale : public Entity
{
public:
2018-07-12 13:42:22 +02:00
void addArticle(std::shared_ptr<Article> articlePtr);
2018-07-13 10:51:07 +02:00
void setTimestamp(const std::string& timestamp);
std::vector<Article*> getArticles();
std::string getTimestamp();
int sumInCents();
2018-07-13 10:12:16 +02:00
void removeArticle(const Article* articlePtr);
2018-07-12 13:34:17 +02:00
private:
2018-07-13 10:51:07 +02:00
std::string timestamp_{
boost::posix_time::to_iso_extended_string(boost::posix_time::second_clock::local_time())};
2018-07-12 13:42:22 +02:00
std::vector<std::shared_ptr<Article>> articles_{};
2018-07-11 12:53:18 +02:00
};
#endif