From ce8660cc5bfc12e6e3f75d4cce22492783ca9066 Mon Sep 17 00:00:00 2001 From: rtk0c Date: Thu, 8 Apr 2021 08:49:10 -0700 Subject: Initial work on table visualizer --- core/src/Model/Items.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'core/src/Model/Items.cpp') diff --git a/core/src/Model/Items.cpp b/core/src/Model/Items.cpp index 2951666..02a4516 100644 --- a/core/src/Model/Items.cpp +++ b/core/src/Model/Items.cpp @@ -8,6 +8,13 @@ void ProductItem::SetDescription(std::string description) { mDescription = std::move(description); } +int ProductItem::GetPrice() const { + return mPrice; +} +void ProductItem::SetPrice(int price) { + mPrice = price; +} + int ProductItem::GetStock() const { return mStock; } @@ -19,12 +26,14 @@ void ProductItem::SetStock(int stock) { Json::Value ProductItem::Serialize() const { Json::Value elm; elm["Description"] = mDescription; + elm["Price"] = mPrice; elm["Stock"] = mStock; return elm; } void ProductItem::Deserialize(const Json::Value& elm) { mDescription = elm["Description"].asString(); + mPrice = elm["Price"].asInt(); mStock = elm["Stock"].asInt(); } -- cgit v1.2.3-70-g09d2