From a611b22650d1e40593db4fb1bce29d925e49e932 Mon Sep 17 00:00:00 2001 From: rtk0c Date: Tue, 25 May 2021 23:56:02 -0700 Subject: More work on workflow management UI --- core/src/Model/Project.hpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'core/src/Model/Project.hpp') 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 +#include #include #include +#include class Project { @@ -13,12 +15,13 @@ public: ItemList Products; ItemList Factories; ItemList Customers; + TransactionModel Database; private: + tsl::array_map 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 LoadWorkflow(std::string_view name); + std::unique_ptr 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(); -- cgit v1.2.3-70-g09d2