Using enum class instead of string in more places

ReportingType and ReportUpdates are now used as enum class in more
places than before. Changed how this two fields are stored in
persistent configuration. Increased Report::Version to break backward
compatibility. Updated unit tests to verify changed functionality.

Tested:
- All existing tests are passing

Change-Id: I55db205aefbe2b5a69fb7a31ccf11885aaecaaf2
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
diff --git a/src/types/report_action.hpp b/src/types/report_action.hpp
new file mode 100644
index 0000000..44348f2
--- /dev/null
+++ b/src/types/report_action.hpp
@@ -0,0 +1,43 @@
+#pragma once
+
+#include "utils/conversion.hpp"
+
+#include <array>
+#include <cstdint>
+#include <string_view>
+#include <type_traits>
+
+enum class ReportAction : uint32_t
+{
+    emitsReadingsUpdate,
+    logToMetricReportsCollection
+};
+
+namespace utils
+{
+
+constexpr std::array<std::pair<std::string_view, ReportAction>, 2>
+    convDataReportAction = {
+        {std::make_pair<std::string_view, ReportAction>(
+             "EmitsReadingsUpdate", ReportAction::emitsReadingsUpdate),
+         std::make_pair<std::string_view, ReportAction>(
+             "LogToMetricReportsCollection",
+             ReportAction::logToMetricReportsCollection)}};
+
+inline ReportAction toReportAction(std::underlying_type_t<ReportAction> value)
+{
+    return toEnum<ReportAction, minEnumValue(convDataReportAction),
+                  maxEnumValue(convDataReportAction)>(value);
+}
+
+inline ReportAction toReportAction(const std::string& value)
+{
+    return toEnum(convDataReportAction, value);
+}
+
+inline std::string enumToString(ReportAction value)
+{
+    return std::string(enumToString(convDataReportAction, value));
+}
+
+} // namespace utils
\ No newline at end of file