serialize: Add version purpose

Add store/restore of the version purpose. Only need to store it if the
activation was successful, since those are the only versions that are
restored after BMC reboot.

Tested: Verified a code update with an image of purpose System got its
        value restored instead of being set to BMC by default.

Change-Id: I6414e9f3b992a8c29046b4d3a3d581c20a166cee
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/item_updater.hpp b/item_updater.hpp
index 4a4d1b4..52607bc 100644
--- a/item_updater.hpp
+++ b/item_updater.hpp
@@ -148,6 +148,10 @@
      */
     void freeSpace(Activation& caller);
 
+    /** @brief Persistent map of Version D-Bus objects and their
+     * version id */
+    std::map<std::string, std::unique_ptr<VersionClass>> versions;
+
   private:
     /** @brief Callback function for Software.Version match.
      *  @details Creates an Activation D-Bus object.
@@ -208,10 +212,6 @@
      * version id */
     std::map<std::string, std::unique_ptr<Activation>> activations;
 
-    /** @brief Persistent map of Version D-Bus objects and their
-     * version id */
-    std::map<std::string, std::unique_ptr<VersionClass>> versions;
-
     /** @brief sdbusplus signal match for Software.Version */
     sdbusplus::bus::match_t versionMatch;