aboutsummaryrefslogtreecommitdiff
path: root/core/src/Model/Project.hpp
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2021-05-25 23:56:02 -0700
committerrtk0c <[email protected]>2021-05-25 23:56:02 -0700
commita611b22650d1e40593db4fb1bce29d925e49e932 (patch)
tree1103179b6344c368e214852f16742129642c338b /core/src/Model/Project.hpp
parentbb2ab4bc5b2c9cc25ef1858ac538f2dc48af2d2c (diff)
More work on workflow management UI
Diffstat (limited to 'core/src/Model/Project.hpp')
-rw-r--r--core/src/Model/Project.hpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/core/src/Model/Project.hpp b/core/src/Model/Project.hpp
index 998befb..5f26532 100644
--- a/core/src/Model/Project.hpp
+++ b/core/src/Model/Project.hpp
@@ -4,8 +4,10 @@
#include "Model/TransactionsModel.hpp"
#include <json/forwards.h>
+#include <tsl/array_map.h>
#include <filesystem>
#include <string>
+#include <string_view>
class Project
{
@@ -13,12 +15,13 @@ public:
ItemList<ProductItem> Products;
ItemList<FactoryItem> Factories;
ItemList<CustomerItem> Customers;
+ TransactionModel Database;
private:
+ tsl::array_map<char, WorkflowInfo> mWorkflows;
std::filesystem::path mRootPath;
std::string mRootPathString;
std::string mName;
- TransactionModel mDb;
public:
/// Load the project from a directory containing the cplt_project.json file.
@@ -32,11 +35,19 @@ public:
const std::filesystem::path& GetPath() const;
const std::string& GetPathString() const;
+ std::filesystem::path GetDatabasesDirectory() const;
+ std::filesystem::path GetItemsDirectory() const;
+ std::filesystem::path GetWorkflowsDirectory() const;
+ std::filesystem::path GetWorkflowPath(std::string_view name) const;
+
const std::string& GetName() const;
void SetName(std::string name);
- const TransactionModel& GetTransactionsModel() const;
- TransactionModel& GetTransactionsModel();
+ const decltype(mWorkflows)& GetWorkflows() const;
+ std::unique_ptr<Workflow> LoadWorkflow(std::string_view name);
+ std::unique_ptr<Workflow> CreateWorkflow(std::string_view name);
+ bool RemoveWorkflow(std::string_view name);
+ bool RenameWorkflow(std::string_view name, std::string_view newName);
Json::Value Serialize();
void WriteToDisk();