diff options
author | rtk0c <[email protected]> | 2021-04-08 08:49:10 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2021-04-08 08:49:10 -0700 |
commit | ce8660cc5bfc12e6e3f75d4cce22492783ca9066 (patch) | |
tree | f5c1088def48e60570a1225d6440f304b37b5b5c /core/src/Model/Items.cpp | |
parent | 2f4b9db39239ed5150094a81743beea42a3eedc2 (diff) |
Initial work on table visualizer
Diffstat (limited to 'core/src/Model/Items.cpp')
-rw-r--r-- | core/src/Model/Items.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
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(); } |