Add Serialization Support for Dump Entry Attributes

Implemented serialization of dump entry attributes using the
nlohmann::json library. Added serialization support in the Dump Entry
class, serializing attributes including originatorId, originatorType,
and startTime. These attributes are not part of the dump filename and
thus require serialization to ensure their state is preserved.

Deserialization will occur only if the serialization version matches
and the dump ID in the dump object matches the ID in the
serialized file.

Tests:
- Created BMC dumps and restarted service
- Created BMC dumps and restarted BMC
- Created 200 BMC dumps and restarted service and BMC multiple times

File:
```
{"dumpId":2,"originatorId":"","originatorType":1,"startTime":1718199238942411,"version":1}
```

Change-Id: I16ecb058bddd464c8771bd8d08a50ea1877747ed
Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
diff --git a/bmc_dump_entry.cpp b/bmc_dump_entry.cpp
index a75606d..05d1f10 100644
--- a/bmc_dump_entry.cpp
+++ b/bmc_dump_entry.cpp
@@ -2,6 +2,7 @@
 
 #include "dump_manager.hpp"
 #include "dump_offload.hpp"
+#include "dump_utils.hpp"
 
 #include <phosphor-logging/lg2.hpp>
 
@@ -35,6 +36,35 @@
     offloaded(true);
 }
 
+void Entry::updateFromFile(const std::filesystem::path& dumpPath)
+{
+    // Extract dump details from the file name
+    auto dumpDetails = phosphor::dump::extractDumpDetails(dumpPath);
+    if (!dumpDetails)
+    {
+        lg2::error("Failed to extract dump details from file name: {PATH}",
+                   "PATH", dumpPath);
+        throw std::logic_error("Invalid dump file name format");
+    }
+
+    auto [extractedId, extractedTimestamp, extractedSize] = *dumpDetails;
+
+    if (id != extractedId)
+    {
+        lg2::error("Id({ID}) is not matching with id on filename"
+                   "({ID_FILENAME})",
+                   "ID", id, "ID_FILENAME", extractedId);
+        throw std::logic_error("Invalid dump id in filename");
+    }
+
+    // Update the entry with extracted details
+    startTime(extractedTimestamp);
+    elapsed(extractedTimestamp);
+    completedTime(extractedTimestamp);
+    size(extractedSize);
+    status(OperationStatus::Completed);
+}
+
 } // namespace bmc
 } // namespace dump
 } // namespace phosphor