36 lines
No EOL
685 B
C++
36 lines
No EOL
685 B
C++
#ifndef SALE_H
|
|
#define SALE_H
|
|
|
|
#include "article.h"
|
|
|
|
#include <vector>
|
|
|
|
#include "boost/date_time/posix_time/posix_time.hpp"
|
|
|
|
// class Article;
|
|
|
|
namespace
|
|
{
|
|
using ArticlesVec = std::vector<Article*>;
|
|
}
|
|
|
|
class Sale : public Entity
|
|
{
|
|
public:
|
|
void addArticle(Article* articlePtr);
|
|
void setTimestamp(const std::string& timestamp);
|
|
|
|
ArticlesVec& getArticles();
|
|
std::string getTimestamp();
|
|
int sumInCents();
|
|
std::string sumAsString();
|
|
|
|
void removeArticle(const Article* articlePtr);
|
|
|
|
private:
|
|
std::string timestamp_{
|
|
boost::posix_time::to_iso_extended_string(boost::posix_time::second_clock::local_time())};
|
|
ArticlesVec articles_{};
|
|
};
|
|
|
|
#endif |