diff options
author | rtk0c <[email protected]> | 2021-04-01 22:18:46 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2021-04-01 22:18:46 -0700 |
commit | 2f4b9db39239ed5150094a81743beea42a3eedc2 (patch) | |
tree | 7d5795f7c23eb4f92ccffe2476da019db9977f2b /core/src/Model/Items.cpp | |
parent | 44f5fa5c8f258e8fc1f7d7e2e45e0485bd6cc490 (diff) |
Initial work on SQLite database
Diffstat (limited to 'core/src/Model/Items.cpp')
-rw-r--r-- | core/src/Model/Items.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/core/src/Model/Items.cpp b/core/src/Model/Items.cpp index 7679eb9..2951666 100644 --- a/core/src/Model/Items.cpp +++ b/core/src/Model/Items.cpp @@ -8,14 +8,24 @@ void ProductItem::SetDescription(std::string description) { mDescription = std::move(description); } +int ProductItem::GetStock() const { + return mStock; +} + +void ProductItem::SetStock(int stock) { + mStock = stock; +} + Json::Value ProductItem::Serialize() const { Json::Value elm; elm["Description"] = mDescription; + elm["Stock"] = mStock; return elm; } void ProductItem::Deserialize(const Json::Value& elm) { mDescription = elm["Description"].asString(); + mStock = elm["Stock"].asInt(); } const std::string& FactoryItem::GetDescription() const { |