#ifndef SALE_H #define SALE_H #include "article.h" #include #include "boost/date_time/posix_time/posix_time.hpp" // class Article; namespace { using ArticlesVec = std::vector; } class Sale : public EntityUuid { public: Sale() = default; Sale(const Sale&) = delete; virtual ~Sale() = default; void addArticle(Article* articlePtr); void setTimestamp(const std::string& timestamp); ArticlesVec& getArticles(); std::string getTimestamp() const; std::string getTimestampFormatted() const; 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())}; mutable ArticlesVec articles_{}; }; #endif